Commit b72ff2f5 authored by Kenichi Kamiya's avatar Kenichi Kamiya Committed by Peter Hoeg
Browse files

crystal: replace hasEpochFile with file existence check



Co-authored-by: default avatarPeter H. Hoeg <peter@hoeg.com>
parent 554e9284
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -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,15 +164,16 @@ let
        '';

      # Defaults are 4
      preBuild =
        ''
      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 ''

        # 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;
@@ -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 {