From 0b10c8a954db879e5144bf7dde79aa3768c3be6f Mon Sep 17 00:00:00 2001 From: neodiX Date: Fri, 22 Dec 2023 20:16:29 +0100 Subject: [PATCH] WIP jenkins pipeline: include mac nix build --- assembly/cicd/jenkins/test-builds.groovy | 13 ++++++----- assembly/nix/macos-arm64-static.nix | 9 ++++---- assembly/nix/macos-arm64-tonlib.nix | 2 +- assembly/nix/macos-x86-64-static.nix | 28 ++++++++++-------------- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/assembly/cicd/jenkins/test-builds.groovy b/assembly/cicd/jenkins/test-builds.groovy index b891bbb79..a3cf79c99 100644 --- a/assembly/cicd/jenkins/test-builds.groovy +++ b/assembly/cicd/jenkins/test-builds.groovy @@ -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/ ''' @@ -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/ @@ -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/ diff --git a/assembly/nix/macos-arm64-static.nix b/assembly/nix/macos-arm64-static.nix index 9aff71a93..95e88e97f 100644 --- a/assembly/nix/macos-arm64-static.nix +++ b/assembly/nix/macos-arm64-static.nix @@ -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 = []; diff --git a/assembly/nix/macos-arm64-tonlib.nix b/assembly/nix/macos-arm64-tonlib.nix index 70528da5c..2be6480b8 100644 --- a/assembly/nix/macos-arm64-tonlib.nix +++ b/assembly/nix/macos-arm64-tonlib.nix @@ -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; }) ]; diff --git a/assembly/nix/macos-x86-64-static.nix b/assembly/nix/macos-x86-64-static.nix index 890c4ba81..aab81d6e7 100644 --- a/assembly/nix/macos-x86-64-static.nix +++ b/assembly/nix/macos-x86-64-static.nix @@ -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"; @@ -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 = []; @@ -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" ];