Commit 18b81736 authored by Pol Dellaiera's avatar Pol Dellaiera
Browse files

crun: use commit ID

parent 5392c7e2
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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}
  '';