Skip to content

Commit

Permalink
Fix boost
Browse files Browse the repository at this point in the history
  • Loading branch information
tvorogme committed Jun 11, 2024
1 parent 9e557c4 commit b18c83e
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
3 changes: 2 additions & 1 deletion assembly/nix/linux-arm64-static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
}:
let
microhttpdmy = (import ./microhttpd.nix) { inherit pkgs; };
staticBoost = import ./static-boost.nix { inherit pkgs; };
in
with import microhttpdmy;
stdenv.mkDerivation {
Expand All @@ -23,7 +24,7 @@ stdenv.mkDerivation {

buildInputs = with pkgs;
[
pkgsStatic.openssl microhttpdmy pkgsStatic.zlib pkgsStatic.libsodium.dev pkgsStatic.secp256k1 glibc.static boost
pkgsStatic.openssl microhttpdmy pkgsStatic.zlib pkgsStatic.libsodium.dev pkgsStatic.secp256k1 glibc.static staticBoost
];

makeStatic = true;
Expand Down
5 changes: 3 additions & 2 deletions assembly/nix/linux-arm64-tonlib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
, src ? ./.
}:
let
microhttpdmy = (import ./microhttpd.nix) { inherit pkgs; };
microhttpdmy = (import ./microhttpd.nix) { inherit pkgs; };
staticBoost = import ./static-boost.nix { inherit pkgs; };
in
with import microhttpdmy;
pkgs.llvmPackages_16.stdenv.mkDerivation {
Expand All @@ -23,7 +24,7 @@ pkgs.llvmPackages_16.stdenv.mkDerivation {

buildInputs = with pkgs;
[
pkgsStatic.openssl microhttpdmy pkgsStatic.zlib pkgsStatic.secp256k1 boost
pkgsStatic.openssl microhttpdmy pkgsStatic.zlib pkgsStatic.secp256k1 staticBoost
(pkgsStatic.libsodium.overrideAttrs (oldAttrs: {
# https://github.com/jedisct1/libsodium/issues/292#issuecomment-137135369
configureFlags = oldAttrs.configureFlags ++ [ " --disable-pie" ];
Expand Down
3 changes: 2 additions & 1 deletion assembly/nix/linux-x86-64-static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
}:
let
microhttpdmy = (import ./microhttpd.nix) { inherit pkgs; };
staticBoost = import ./static-boost.nix { inherit pkgs; };
in
with import microhttpdmy;
stdenv.mkDerivation {
Expand All @@ -23,7 +24,7 @@ stdenv.mkDerivation {

buildInputs = with pkgs;
[
pkgsStatic.openssl microhttpdmy pkgsStatic.zlib pkgsStatic.libsodium.dev pkgsStatic.secp256k1 glibc.static boost
pkgsStatic.openssl microhttpdmy pkgsStatic.zlib pkgsStatic.libsodium.dev pkgsStatic.secp256k1 glibc.static staticBoost
];

makeStatic = true;
Expand Down
1 change: 1 addition & 0 deletions assembly/nix/linux-x86-64-tonlib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ let
bintools = pkgs.binutils.override { libc = glibc227; };
};
in (pkgs.overrideCC pkgs.stdenv cc);
staticBoost = import ./static-boost.nix { inherit pkgs; };

in
stdenv227.mkDerivation {
Expand Down
5 changes: 4 additions & 1 deletion assembly/nix/macos-static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
, system ? builtins.currentSystem
, src ? ./.
}:
let
staticBoost = import ./static-boost.nix { inherit pkgs; };
in
pkgs.llvmPackages_14.stdenv.mkDerivation {
pname = "ton";
version = "dev-bin";
Expand All @@ -17,7 +20,7 @@ pkgs.llvmPackages_14.stdenv.mkDerivation {

buildInputs = with pkgs;
lib.forEach [
secp256k1 libsodium.dev libmicrohttpd.dev gmp.dev nettle.dev libtasn1.dev libidn2.dev libunistring.dev gettext (gnutls.override { withP11-kit = false; }).dev boost
secp256k1 libsodium.dev libmicrohttpd.dev gmp.dev nettle.dev libtasn1.dev libidn2.dev libunistring.dev gettext (gnutls.override { withP11-kit = false; }).dev staticBoost
]
(x: x.overrideAttrs(oldAttrs: rec { configureFlags = (oldAttrs.configureFlags or []) ++ [ "--enable-static" "--disable-shared" "--disable-tests" ]; dontDisableStatic = true; }))
++ [
Expand Down
5 changes: 4 additions & 1 deletion assembly/nix/macos-tonlib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
, system ? builtins.currentSystem
, src ? ./.
}:
let
staticBoost = import ./static-boost.nix { inherit pkgs; };
in
pkgs.llvmPackages_14.stdenv.mkDerivation {
pname = "ton";
version = "dev-lib";
Expand All @@ -17,7 +20,7 @@ pkgs.llvmPackages_14.stdenv.mkDerivation {

buildInputs = with pkgs;
lib.forEach [
secp256k1 libsodium.dev libmicrohttpd.dev gmp.dev nettle.dev libtasn1.dev libidn2.dev libunistring.dev gettext (gnutls.override { withP11-kit = false; }).dev boost
secp256k1 libsodium.dev libmicrohttpd.dev gmp.dev nettle.dev libtasn1.dev libidn2.dev libunistring.dev gettext (gnutls.override { withP11-kit = false; }).dev staticBoost
] (x: x.overrideAttrs(oldAttrs: rec { configureFlags = (oldAttrs.configureFlags or []) ++ [ "--enable-static" "--disable-shared" "--disable-tests" ]; dontDisableStatic = true; }))
++ [
darwin.apple_sdk.frameworks.CoreFoundation
Expand Down
9 changes: 9 additions & 0 deletions assembly/nix/static-boost.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ pkgs }:

pkgs.boost.overrideAttrs (oldAttrs: {
buildInputs = (oldAttrs.buildInputs or []) ++ [ pkgs.stdenv ];
doCheck = false;
postConfigure = ''
./b2 install --prefix=$out --build-dir=build --layout=system link=static threading=multi runtime-link=static
'';
})

0 comments on commit b18c83e

Please sign in to comment.