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 3233261 commit 80f9839
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 2 deletions.
7 changes: 7 additions & 0 deletions assembly/nix/linux-arm64-static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
let
microhttpdmy = (import ./microhttpd.nix) { inherit pkgs; };
in
let
# Define pkgsStatic with a custom overlay
pkgsStatic = import <nixpkgs> {
inherit system;
overlays = [ (import ./static-overlay.nix) ];
};
in
with import microhttpdmy;
stdenv.mkDerivation {
pname = "ton";
Expand Down
7 changes: 7 additions & 0 deletions assembly/nix/linux-arm64-tonlib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
let
microhttpdmy = (import ./microhttpd.nix) { inherit pkgs; };
in
let
# Define pkgsStatic with a custom overlay
pkgsStatic = import <nixpkgs> {
inherit system;
overlays = [ (import ./static-overlay.nix) ];
};
in
with import microhttpdmy;
pkgs.llvmPackages_16.stdenv.mkDerivation {
pname = "ton";
Expand Down
7 changes: 7 additions & 0 deletions assembly/nix/linux-x86-64-static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
let
microhttpdmy = (import ./microhttpd.nix) { inherit pkgs; };
in
let
# Define pkgsStatic with a custom overlay
pkgsStatic = import <nixpkgs> {
inherit system;
overlays = [ (import ./static-overlay.nix) ];
};
in
with import microhttpdmy;
stdenv.mkDerivation {
pname = "ton";
Expand Down
7 changes: 7 additions & 0 deletions assembly/nix/linux-x86-64-tonlib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ let
in (pkgs.overrideCC pkgs.stdenv cc);

in
let
# Define pkgsStatic with a custom overlay
pkgsStatic = import <nixpkgs> {
inherit system;
overlays = [ (import ./static-overlay.nix) ];
};
in
stdenv227.mkDerivation {
pname = "ton";
version = "dev-lib";
Expand Down
6 changes: 4 additions & 2 deletions assembly/nix/macos-static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
, src ? ./.
}:
let
# Define pkgsStatic with a custom overlay
pkgsStatic = import <nixpkgs> {
inherit system;
overlays = [ (self: super: { inherit (pkgs) stdenv; }) ];
overlays = [ (import ./static-overlay.nix) ];
};
in
pkgs.llvmPackages_14.stdenv.mkDerivation {
Expand All @@ -35,6 +36,7 @@ pkgs.llvmPackages_14.stdenv.mkDerivation {
pkgsStatic.librdkafka
];


dontAddStaticConfigureFlags = true;
makeStatic = true;
doCheck = true;
Expand Down Expand Up @@ -77,7 +79,7 @@ pkgs.llvmPackages_14.stdenv.mkDerivation {
install_name_tool -change "$(otool -L "$fn" | grep libc++.1 | cut -d' ' -f1 | xargs)" libc++.1.dylib "$fn"
install_name_tool -change "$(otool -L "$fn" | grep libc++abi.1 | cut -d' ' -f1 | xargs)" libc++abi.dylib "$fn"
done
fi
fi
'';
outputs = [ "bin" "out" ];
}
15 changes: 15 additions & 0 deletions assembly/nix/static-overlay.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
self: super: {
boost = super.boost.overrideAttrs (oldAttrs: {
buildInputs = (oldAttrs.buildInputs or []) ++ [ super.stdenv ];
doCheck = false;
configurePhase = '' ''; # No configure phase
buildPhase = ''
./bootstrap.sh --prefix=$out --with-toolset=clang
./b2 install --prefix=$out --build-dir=build --layout=system link=static threading=multi runtime-link=static
'';
});

librdkafka = super.librdkafka.overrideAttrs (oldAttrs: {
configureFlags = (oldAttrs.configureFlags or []) ++ [ "--enable-static", "--disable-shared" ];
});
}

0 comments on commit 80f9839

Please sign in to comment.