fix: make venmic reproducible

refactor: venmic -> venmic-server
This commit is contained in:
2025-06-26 17:19:33 -06:00
parent 296c97ce00
commit 5507ea916d

View File

@@ -24,7 +24,7 @@ let
hash = "sha256-0UP8a2bfhWGsB2Lg/GeIBu4zw1zHnXbitT8vU+DLeEY="; hash = "sha256-0UP8a2bfhWGsB2Lg/GeIBu4zw1zHnXbitT8vU+DLeEY=";
}; };
venmic-deps = stdenv.mkDerivation { venmicDeps = stdenv.mkDerivation {
name = "venmic-deps-${version}.tar.gz"; name = "venmic-deps-${version}.tar.gz";
inherit src; inherit src;
@@ -52,6 +52,10 @@ let
]; ];
installPhase = '' installPhase = ''
# Remove .git directories. For reasons unknown to me, they are a source
# of indeterminism.
find "${depsDir}" -type d -name '.git' -exec rm -rf {} +
# Build a reproducible tarball, per # Build a reproducible tarball, per
# https://reproducible-builds.org/docs/archives. # https://reproducible-builds.org/docs/archives.
tar --owner=0 --group=0 --numeric-owner --format=gnu \ tar --owner=0 --group=0 --numeric-owner --format=gnu \
@@ -61,17 +65,17 @@ let
''; '';
outputHashAlgo = "sha256"; outputHashAlgo = "sha256";
outputHash = "sha256-J/uctyoqC2j58TYemjRBtOMMXz70e8uv/VeA+vq8WVY="; outputHash = "sha256-cnkqZbSnxFFwDy0zNo4QuQQCaT0dav3V8TDjzZ4mMFA=";
}; };
venmic = stdenv.mkDerivation { venmic-server = stdenv.mkDerivation {
pname = "venmic"; pname = "venmic-server";
inherit version src; inherit version src venmicDeps;
postUnpack = '' postUnpack = ''
# Bring in the cached CPM deps. # Bring in the cached CPM deps.
mkdir -p $sourceRoot/build mkdir -p $sourceRoot/build
tar xzf ${venmic-deps} -C $sourceRoot/build tar xzf "$venmicDeps" -C $sourceRoot/build
# Bring in CPM itself — Venmic tries to download it itself. # Bring in CPM itself — Venmic tries to download it itself.
rm $sourceRoot/cmake/cpm.cmake rm $sourceRoot/cmake/cpm.cmake
@@ -102,4 +106,4 @@ let
mv server/venmic-server $out/bin mv server/venmic-server $out/bin
''; '';
}; };
in venmic in venmic-server