1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Use jemalloc in portable artifacts (#1003)

* use jemalloc in portable builds;
also avoid mixing musl with glibc artifacts in nix builds;

* minor fix for ubuntu arm nix build
This commit is contained in:
neodix42 2024-06-07 17:52:11 +02:00 committed by GitHub
parent 5186c4755c
commit 0a0a92c6b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 122 additions and 112 deletions

View file

@ -7,20 +7,35 @@
, stdenv ? pkgs.stdenv
}:
let
system = builtins.currentSystem;
system = builtins.currentSystem;
nixos1909 = (import (builtins.fetchTarball {
url = "https://channels.nixos.org/nixos-19.09/nixexprs.tar.xz";
sha256 = "1vp1h2gkkrckp8dzkqnpcc6xx5lph5d2z46sg2cwzccpr8ay58zy";
}) { inherit system; });
glibc227 = nixos1909.glibc // { pname = "glibc"; };
stdenv227 = let
cc = pkgs.wrapCCWith {
cc = nixos1909.buildPackages.gcc-unwrapped;
libc = glibc227;
bintools = pkgs.binutils.override { libc = glibc227; };
};
in (pkgs.overrideCC pkgs.stdenv cc);
staticOptions = pkg: pkg.overrideAttrs(oldAttrs: {
dontDisableStatic = true;
enableSharedExecutables = false;
configureFlags = (oldAttrs.configureFlags or []) ++ [ "--without-shared" "--disable-shared" "--disable-tests" ];
});
secp256k1Static = (staticOptions pkgs.secp256k1);
libsodiumStatic = (staticOptions pkgs.libsodium);
microhttpdStatic = pkgs.libmicrohttpd.overrideAttrs(oldAttrs: {
dontDisableStatic = true;
enableSharedExecutables = false;
configureFlags = (oldAttrs.configureFlags or []) ++ [ "--enable-static" "--disable-tests" "--disable-benchmark" "--disable-shared" "--disable-https" "--with-pic" ];
});
nixos1909 = (import (builtins.fetchTarball {
url = "https://channels.nixos.org/nixos-19.09/nixexprs.tar.xz";
sha256 = "1vp1h2gkkrckp8dzkqnpcc6xx5lph5d2z46sg2cwzccpr8ay58zy";
}) { inherit system; });
glibc227 = nixos1909.glibc // { pname = "glibc"; };
stdenv227 = let
cc = pkgs.wrapCCWith {
cc = nixos1909.buildPackages.gcc-unwrapped;
libc = glibc227;
bintools = pkgs.binutils.override { libc = glibc227; };
};
in (pkgs.overrideCC pkgs.stdenv cc);
in
stdenv227.mkDerivation {
@ -34,7 +49,12 @@ stdenv227.mkDerivation {
buildInputs = with pkgs;
[
pkgsStatic.openssl pkgsStatic.zlib pkgsStatic.libmicrohttpd.dev pkgsStatic.libsodium.dev pkgsStatic.secp256k1 pkgsStatic.lz4
(openssl.override { static = true; }).dev
microhttpdStatic.dev
(zlib.override { shared = false; }).dev
(lz4.override { enableStatic = true; enableShared = false; }).dev
secp256k1Static
libsodiumStatic.dev
];
dontAddStaticConfigureFlags = false;