forked from ton-blockchain/ton
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP jenkins pipeline: include mac nix build
- Loading branch information
Showing
4 changed files
with
74 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz | ||
|
||
{ pkgs ? import <nixpkgs> { system = builtins.currentSystem; } | ||
, lib ? pkgs.lib | ||
, stdenv ? pkgs.stdenv | ||
}: | ||
|
||
pkgs.stdenv.mkDerivation { # clang default | ||
pname = "ton"; | ||
version = "dev-bin"; | ||
|
||
src = ./.; | ||
|
||
nativeBuildInputs = with pkgs; | ||
[ cmake ninja git pkg-config ]; | ||
|
||
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 | ||
] | ||
(x: x.overrideAttrs(oldAttrs: rec { configureFlags = (oldAttrs.configureFlags or []) ++ [ "--enable-static" "--disable-shared" "--disable-tests" ]; dontDisableStatic = true; })) | ||
++ [ | ||
darwin.apple_sdk.frameworks.CoreFoundation | ||
(openssl.override { static = true; }).dev | ||
(zlib.override { shared = false; }).dev | ||
(libiconv.override { enableStatic = true; enableShared = false; }) | ||
]; | ||
|
||
|
||
dontAddStaticConfigureFlags = true; | ||
doCheck = false; | ||
makeStatic = true; | ||
|
||
|
||
configureFlags = []; | ||
|
||
cmakeFlags = [ | ||
"-DTON_USE_ABSEIL=OFF" | ||
"-DNIX=ON" | ||
"-DCMAKE_CROSSCOMPILING=OFF" | ||
"-DCMAKE_LINK_SEARCH_START_STATIC=ON" | ||
"-DCMAKE_LINK_SEARCH_END_STATIC=ON" | ||
"-DBUILD_SHARED_LIBS=OFF" | ||
"-DCMAKE_CXX_FLAGS=-stdlib=libc++" | ||
"-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=11.3" | ||
]; | ||
|
||
LDFLAGS = [ | ||
"-static-libstdc++" | ||
"-framework CoreFoundation" | ||
]; | ||
|
||
postInstall = '' | ||
moveToOutput bin "$bin" | ||
''; | ||
|
||
preFixup = '' | ||
for fn in "$bin"/bin/* "$out"/lib/*.dylib; do | ||
echo Fixing libc++ in "$fn" | ||
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 | ||
''; | ||
outputs = [ "bin" "out" ]; | ||
} |