crystal: replace hasEpochFile with file existence check

Co-authored-by: Peter H. Hoeg <peter@hoeg.com>
This commit is contained in:
Kenichi Kamiya 2025-05-21 22:48:58 +09:00 committed by Peter Hoeg
parent 554e92840b
commit b72ff2f539

View File

@ -96,7 +96,6 @@ let
"docs"
"release=1"
],
hasEpochFile ? true, # Available since 1.13.0 https://github.com/crystal-lang/crystal/pull/14574
}:
stdenv.mkDerivation (finalAttrs: {
pname = "crystal";
@ -165,16 +164,17 @@ let
'';
# Defaults are 4
preBuild =
''
export CRYSTAL_WORKERS=$NIX_BUILD_CORES
export threads=$NIX_BUILD_CORES
export CRYSTAL_CACHE_DIR=$TMP
export MACOSX_DEPLOYMENT_TARGET=10.11
''
+ lib.optionalString hasEpochFile ''
preBuild = ''
export CRYSTAL_WORKERS=$NIX_BUILD_CORES
export threads=$NIX_BUILD_CORES
export CRYSTAL_CACHE_DIR=$TMP
export MACOSX_DEPLOYMENT_TARGET=10.11
# Available since 1.13.0 https://github.com/crystal-lang/crystal/pull/14574
if [[ -f src/SOURCE_DATE_EPOCH ]]; then
export SOURCE_DATE_EPOCH="$(<src/SOURCE_DATE_EPOCH)"
'';
fi
'';
strictDeps = true;
nativeBuildInputs = [
@ -299,12 +299,12 @@ rec {
};
};
# When removing this version, also remove checks for src/SOURCE_DATE_EPOCH existence
crystal_1_11 = generic {
version = "1.11.2";
sha256 = "sha256-BBEDWqFtmFUNj0kuGBzv71YHO3KjxV4d2ySTCD4HhLc=";
binary = binaryCrystal_1_10;
llvmPackages = llvmPackages_15;
hasEpochFile = false;
};
crystal_1_14 = generic {