Skip to content

Commit

Permalink
WIP jenkins pipeline: include mac nix build
Browse files Browse the repository at this point in the history
  • Loading branch information
neodix42 committed Dec 22, 2023
1 parent 86736be commit 0b10c8a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 28 deletions.
13 changes: 7 additions & 6 deletions assembly/cicd/jenkins/test-builds.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ pipeline {
timeout(time: 90, unit: 'MINUTES') {
sh '''
cp assembly/nix/linux-x86-64* .
export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.11.tar.gz
cp assembly/nix/linux-arm64* .
export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz
nix-build linux-x86-64-static.nix
mkdir tmp
cp ./result/bin/* tmp/
rm -rf result
nix-build linux-x86-64-tonlib.nix
nix-build linux-arm64-tonlib.nix
cp ./result/lib/libtonlibjson.so.0.5 tmp/
cp ./result/lib/libemulator.so tmp/
'''
Expand Down Expand Up @@ -110,7 +111,7 @@ pipeline {
timeout(time: 90, unit: 'MINUTES') {
sh '''
cp assembly/nix/macos-x86-64-* .
export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.11.tar.gz
export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz
nix-build macos-x86-64-static.nix
mkdir tmp
cp ./result/bin/* tmp/
Expand Down Expand Up @@ -148,11 +149,11 @@ pipeline {
timeout(time: 90, unit: 'MINUTES') {
sh '''
cp assembly/nix/macos-arm64-* .
export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.11.tar.gz
export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz
nix-build macos-arm64-static.nix
mkdir tmp
cp ./result/bin/* tmp/
rm -rf result
cp ./result-bin/bin/* tmp/
rm -rf result-bin
nix-build macos-arm64-tonlib.nix
cp ./result/lib/libtonlibjson.dylib tmp/
cp ./result/lib/libemulator.dylib tmp/
Expand Down
9 changes: 4 additions & 5 deletions assembly/nix/macos-arm64-static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ pkgs.stdenv.mkDerivation { # clang default
(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
(openssl_3.override { static = true; }).dev
(zlib.override { shared = false; }).dev
(libiconv.override { enableStatic = true; enableShared = false; })
];


dontAddStaticConfigureFlags = true;
doCheck = false;
makeStatic = true;

dontAddStaticConfigureFlags = true;
doCheck = false;
makeStatic = true;

configureFlags = [];

Expand Down
2 changes: 1 addition & 1 deletion assembly/nix/macos-arm64-tonlib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pkgs.stdenv.mkDerivation { # clang default
] (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
(openssl_3.override { static = true; }).dev
(zlib.override { shared = false; }).dev
(libiconv.override { enableStatic = true; enableShared = false; })
];
Expand Down
28 changes: 12 additions & 16 deletions assembly/nix/macos-x86-64-static.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@
, stdenv ? pkgs.stdenv
}:

let
# secp256k1 = (import ./secp256k1.nix) {};
# sodium = (import ./sodium.nix) {};
in
#with import secp256k1;

pkgs.llvmPackages_14.stdenv.mkDerivation { # clang
pkgs.gcc11Stdenv.mkDerivation { # gcc
pname = "ton";
version = "x86_64-darwin";

Expand All @@ -22,21 +16,24 @@ pkgs.llvmPackages_14.stdenv.mkDerivation { # clang

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
secp256k1 libsodium.dev libmicrohttpd.dev gmp.dev nettle.dev libtasn1.dev libidn2.dev libunistring.dev gettext
]
(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
(openssl_3.override { static = true; }).dev
(zlib.override { shared = false; }).dev
(libiconv.override { enableStatic = true; enableShared = false; })
((gnutls.override { withP11-kit = false; }).overrideAttrs(oldAttrs: rec {
cmakeFlags = (oldAttrs.cmakeFlags or []) ++ [ "-fpermissive" "-Wno-error=implicit-int" ];
configureFlags = (oldAttrs.configureFlags or []) ++ [ "--enable-static" "--disable-shared" "--disable-tests" ]; dontDisableStatic = true;
})).dev
];


dontAddStaticConfigureFlags = true;
doCheck = false;
makeStatic = true;

dontAddStaticConfigureFlags = true;
doCheck = false;
makeStatic = true;

configureFlags = [];

Expand All @@ -47,13 +44,12 @@ pkgs.llvmPackages_14.stdenv.mkDerivation { # clang
"-DCMAKE_LINK_SEARCH_START_STATIC=ON"
"-DCMAKE_LINK_SEARCH_END_STATIC=ON"
"-DBUILD_SHARED_LIBS=OFF"
"-DCMAKE_CXX_FLAGS=-stdlib=libc++"
"-DCMAKE_CXX_FLAGS=-fpermissive -Wno-error=implicit-int"
"-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=11.3"
];

LDFLAGS = [
# "-static-libgcc"
"-static-libstdc++"
"-static-libgcc"
"-framework CoreFoundation"
];

Expand Down

0 comments on commit 0b10c8a

Please sign in to comment.