mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-21 21:01:04 -05:00
bff8bce88f
* ci: test reproducability with different dependency installation methods * nix: mitigate nix store optimisiation * docs: reproducible builds Co-authored-by: Daniel Weiße <66256922+daniel-weisse@users.noreply.github.com> Co-authored-by: Thomas Tendyck <51411342+thomasten@users.noreply.github.com> * ci: upgrade ubuntu runners for reproducible builds --------- Co-authored-by: Thomas Tendyck <51411342+thomasten@users.noreply.github.com>
20 lines
835 B
Nix
20 lines
835 B
Nix
{ pkgs, pkgsLinux, buildEnv, closureInfo }:
|
|
let
|
|
lib = pkgs.lib;
|
|
cc = pkgsLinux.stdenv.cc;
|
|
packages = [ pkgsLinux.libvirt ];
|
|
closure = builtins.toString (lib.strings.splitString "\n" (builtins.readFile "${closureInfo {rootPaths = packages;}}/store-paths"));
|
|
rpath = pkgs.lib.makeLibraryPath [ pkgsLinux.libvirt pkgsLinux.glib pkgsLinux.libxml2 pkgsLinux.readline pkgsLinux.glibc pkgsLinux.libgcc.lib ];
|
|
in
|
|
pkgs.symlinkJoin {
|
|
name = "libvirt";
|
|
paths = packages;
|
|
buildInputs = packages;
|
|
postBuild = ''
|
|
tar -cf $out/closure.tar --mtime="@$SOURCE_DATE_EPOCH" --sort=name --hard-dereference ${closure}
|
|
tar --transform 's+^./+bin/+' -cf $out/bin-linktree.tar --mtime="@$SOURCE_DATE_EPOCH" --sort=name -C $out/bin .
|
|
echo "${rpath}" > $out/rpath
|
|
cp ${cc}/nix-support/dynamic-linker $out/dynamic-linker
|
|
'';
|
|
}
|