mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-13 09:46:16 +02:00
Setup static building of nix
This commit is contained in:
parent
88cf6ffce3
commit
07dae2ff77
2 changed files with 85 additions and 69 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs }:
|
{ pkgs, enableStatic }:
|
||||||
|
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
|
||||||
|
@ -30,35 +30,42 @@ rec {
|
||||||
});
|
});
|
||||||
|
|
||||||
configureFlags =
|
configureFlags =
|
||||||
lib.optionals stdenv.isLinux [
|
lib.optionals (!enableStatic && stdenv.isLinux) [
|
||||||
"--with-sandbox-shell=${sh}/bin/busybox"
|
"--with-sandbox-shell=${sh}/bin/busybox"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nativeBuildDeps =
|
||||||
|
[
|
||||||
|
buildPackages.bison
|
||||||
|
buildPackages.flex
|
||||||
|
buildPackages.libxml2
|
||||||
|
buildPackages.libxslt
|
||||||
|
buildPackages.docbook5
|
||||||
|
buildPackages.docbook_xsl_ns
|
||||||
|
buildPackages.autoreconfHook
|
||||||
|
buildPackages.pkgconfig
|
||||||
|
|
||||||
|
# Tests
|
||||||
|
buildPackages.git
|
||||||
|
buildPackages.mercurial
|
||||||
|
buildPackages.ipfs
|
||||||
|
];
|
||||||
|
|
||||||
buildDeps =
|
buildDeps =
|
||||||
[ bison
|
[ autoreconfHook
|
||||||
flex
|
|
||||||
libxml2
|
|
||||||
libxslt
|
|
||||||
docbook5
|
|
||||||
docbook_xsl_ns
|
|
||||||
autoconf-archive
|
autoconf-archive
|
||||||
autoreconfHook
|
|
||||||
|
|
||||||
curl
|
curl
|
||||||
bzip2 xz brotli zlib editline
|
bzip2 xz brotli zlib editline
|
||||||
openssl pkgconfig sqlite
|
openssl sqlite
|
||||||
libarchive
|
libarchive
|
||||||
boost
|
boost
|
||||||
nlohmann_json
|
nlohmann_json
|
||||||
|
|
||||||
# Tests
|
|
||||||
git
|
|
||||||
mercurial
|
|
||||||
gmock
|
gmock
|
||||||
]
|
]
|
||||||
++ lib.optionals stdenv.isLinux [libseccomp utillinuxMinimal]
|
++ lib.optionals stdenv.isLinux [libseccomp utillinuxMinimal]
|
||||||
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
|
++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
|
||||||
++ lib.optional (stdenv.isLinux || stdenv.isDarwin)
|
++ lib.optional (!enableStatic && (stdenv.isLinux || stdenv.isDarwin))
|
||||||
((aws-sdk-cpp.override {
|
((aws-sdk-cpp.override {
|
||||||
apis = ["s3" "transfer"];
|
apis = ["s3" "transfer"];
|
||||||
customMemoryManagement = false;
|
customMemoryManagement = false;
|
||||||
|
|
37
release.nix
37
release.nix
|
@ -12,16 +12,8 @@ let
|
||||||
builtins.readFile ./.version
|
builtins.readFile ./.version
|
||||||
+ (if officialRelease then "" else "pre${toString nix.revCount}_${nix.shortRev}");
|
+ (if officialRelease then "" else "pre${toString nix.revCount}_${nix.shortRev}");
|
||||||
|
|
||||||
jobs = rec {
|
buildFun = pkgs: enableStatic:
|
||||||
|
with pkgs; with import ./release-common.nix { inherit pkgs enableStatic; };
|
||||||
build = pkgs.lib.genAttrs systems (system:
|
|
||||||
|
|
||||||
let pkgs = import nixpkgs { inherit system; }; in
|
|
||||||
|
|
||||||
with pkgs;
|
|
||||||
|
|
||||||
with import ./release-common.nix { inherit pkgs; };
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "nix-${version}";
|
name = "nix-${version}";
|
||||||
|
|
||||||
|
@ -31,10 +23,12 @@ let
|
||||||
|
|
||||||
buildInputs = buildDeps;
|
buildInputs = buildDeps;
|
||||||
|
|
||||||
|
nativeBuildInputs = nativeBuildDeps;
|
||||||
|
|
||||||
propagatedBuildInputs = propagatedDeps;
|
propagatedBuildInputs = propagatedDeps;
|
||||||
|
|
||||||
preConfigure =
|
preConfigure =
|
||||||
''
|
lib.optionalString (!enableStatic) ''
|
||||||
# Copy libboost_context so we don't get all of Boost in our closure.
|
# Copy libboost_context so we don't get all of Boost in our closure.
|
||||||
# https://github.com/NixOS/nixpkgs/issues/45462
|
# https://github.com/NixOS/nixpkgs/issues/45462
|
||||||
mkdir -p $out/lib
|
mkdir -p $out/lib
|
||||||
|
@ -51,9 +45,11 @@ let
|
||||||
configureFlags = configureFlags ++
|
configureFlags = configureFlags ++
|
||||||
[ "--sysconfdir=/etc" ];
|
[ "--sysconfdir=/etc" ];
|
||||||
|
|
||||||
|
dontUpdateAutotoolsGnuConfigScripts = true;
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
makeFlags = "profiledir=$(out)/etc/profile.d";
|
makeFlags = [ "profiledir=$(out)/etc/profile.d" "PRECOMPILE_HEADERS=0" ];
|
||||||
|
|
||||||
installFlags = "sysconfdir=$(out)/etc";
|
installFlags = "sysconfdir=$(out)/etc";
|
||||||
|
|
||||||
|
@ -67,8 +63,21 @@ let
|
||||||
doInstallCheck = true;
|
doInstallCheck = true;
|
||||||
installCheckFlags = "sysconfdir=$(out)/etc";
|
installCheckFlags = "sysconfdir=$(out)/etc";
|
||||||
|
|
||||||
separateDebugInfo = true;
|
separateDebugInfo = !enableStatic;
|
||||||
});
|
|
||||||
|
stripAllList = ["bin"];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
jobs = rec {
|
||||||
|
|
||||||
|
|
||||||
|
build-static = pkgs.lib.genAttrs systems (system:
|
||||||
|
buildFun (import nixpkgs { inherit system; }).pkgsStatic true);
|
||||||
|
|
||||||
|
|
||||||
|
build = pkgs.lib.genAttrs systems (system:
|
||||||
|
buildFun (import nixpkgs { inherit system; }) false);
|
||||||
|
|
||||||
|
|
||||||
perlBindings = pkgs.lib.genAttrs systems (system:
|
perlBindings = pkgs.lib.genAttrs systems (system:
|
||||||
|
|
Loading…
Reference in a new issue