crun: use commit ID

This commit is contained in:
Pol Dellaiera
2025-12-01 09:20:37 +01:00
parent 5392c7e2d0
commit 18b81736bb
+8 -2
View File
@@ -49,6 +49,12 @@ stdenv.mkDerivation (finalAttrs: {
tag = finalAttrs.version;
hash = "sha256-WBAwyDODMrUDlgonRbxaNQ+aN8K6YicY2JVArXDJem8=";
fetchSubmodules = true;
leaveDotGit = true;
postFetch = ''
cd $out
git rev-parse HEAD > COMMIT
rm -rf .git
'';
};
nativeBuildInputs = [
@@ -77,10 +83,10 @@ stdenv.mkDerivation (finalAttrs: {
# config.h with the correct values
postPatch = ''
echo ${finalAttrs.version} > .tarball-version
echo '#define GIT_VERSION "${finalAttrs.src.tag}"' > git-version.h
echo "#define GIT_VERSION \"$(cat COMMIT)\"" > git-version.h
${lib.concatMapStringsSep "\n" (
e: "substituteInPlace Makefile.am --replace 'tests/${e}' ''"
e: "substituteInPlace Makefile.am --replace-fail 'tests/${e}' ''"
) disabledTests}
'';