Skip to content

Commit 010cdf5

Browse files
committed
WIP jenkins pipeline: include mac nix build
1 parent ef500dd commit 010cdf5

File tree

3 files changed

+65
-8
lines changed

3 files changed

+65
-8
lines changed

assembly/cicd/jenkins/test-builds.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pipeline {
7777
mkdir tmp
7878
cp ./result/bin/* tmp/
7979
rm -rf result
80-
nix-build linux-x86-64-tonlib.nix
80+
nix-build linux-arm64-tonlib.nix
8181
cp ./result/lib/libtonlibjson.so.0.5 tmp/
8282
cp ./result/lib/libemulator.so tmp/
8383
'''
@@ -145,7 +145,7 @@ pipeline {
145145
export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.11.tar.gz
146146
nix-build macos-arm64-static.nix
147147
'''
148-
sh 'zip -r ton-arm64-m1-macos-portable ./result/*'
148+
sh 'zip -r ton-arm64-m1-macos-portable ./result/bin/*'
149149
archiveArtifacts artifacts: 'ton-arm64-m1-macos-portable.zip'
150150
}
151151
}
@@ -173,11 +173,11 @@ pipeline {
173173
steps {
174174
timeout(time: 90, unit: 'MINUTES') {
175175
sh '''
176-
cp assembly/native/build-macos-portable.sh .
177-
chmod +x build-macos-portable.sh
178-
./build-macos-portable.sh -t -a -o 13.2
176+
cp assembly/nix/macos-arm64-* .
177+
export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.11.tar.gz
178+
nix-build macos-arm64-static.nix
179179
'''
180-
sh 'zip -r ton-arm64-m2-macos-portable ./artifacts/*'
180+
sh 'zip -r ton-arm64-m2-macos-portable ./result/bin/*'
181181
archiveArtifacts artifacts: 'ton-arm64-m2-macos-portable.zip'
182182
}
183183
}

assembly/nix/linux-arm64-tonlib.nix

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz
2+
{
3+
pkgs ? import <nixpkgs> { system = builtins.currentSystem; }
4+
, lib ? pkgs.lib
5+
, stdenv ? pkgs.stdenv
6+
}:
7+
let
8+
system = "x86_64-linux";
9+
10+
nixos1909 = (import (builtins.fetchTarball {
11+
url = "https://channels.nixos.org/nixos-19.09/nixexprs.tar.xz";
12+
sha256 = "1vp1h2gkkrckp8dzkqnpcc6xx5lph5d2z46sg2cwzccpr8ay58zy";
13+
}) { inherit system; });
14+
glibc227 = nixos1909.glibc // { pname = "glibc"; };
15+
stdenv227 = let
16+
cc = pkgs.wrapCCWith {
17+
cc = nixos1909.buildPackages.gcc-unwrapped;
18+
libc = glibc227;
19+
bintools = pkgs.binutils.override { libc = glibc227; };
20+
};
21+
in (pkgs.overrideCC pkgs.stdenv cc);
22+
23+
in
24+
stdenv227.mkDerivation {
25+
pname = "ton";
26+
version = "dev-lib";
27+
28+
src = ./.;
29+
30+
nativeBuildInputs = with pkgs;
31+
[ cmake ninja git pkg-config ];
32+
33+
buildInputs = with pkgs;
34+
[
35+
pkgsStatic.openssl pkgsStatic.zlib pkgsStatic.libmicrohttpd.dev pkgsStatic.libsodium.dev pkgsStatic.secp256k1
36+
];
37+
38+
dontAddStaticConfigureFlags = false;
39+
40+
configureFlags = [
41+
42+
];
43+
44+
45+
cmakeFlags = [
46+
"-DTON_USE_ABSEIL=OFF"
47+
"-DNIX=ON"
48+
];
49+
50+
LDFLAGS = [
51+
"-static-libgcc" "-static-libstdc++" "-fPIC"
52+
];
53+
54+
ninjaFlags = [
55+
"tonlibjson" "emulator"
56+
];
57+
58+
}

assembly/nix/linux-x86-64-static.nix

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,5 @@ pkgs.stdenv.mkDerivation { # gcc
3838

3939
LDFLAGS = [
4040
"-static-libgcc" "-static-libstdc++" "-fPIC" "--enable-static-pie" "-static"
41-
];
42-
41+
];
4342
}

0 commit comments

Comments
 (0)