Unverified Commit efa78c18 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #226932 from wegank/crystal-pcre

crystal: migrate to pcre2 on 1.8
parents 2fe0919e 995ace10
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
{ stdenv
, lib
, crystal
, pcre2
, shards
, git
, pkg-config
@@ -90,7 +91,8 @@ stdenv.mkDerivation (mkDerivationArgs // {

  inherit enableParallelBuilding;
  strictDeps = true;
  buildInputs = args.buildInputs or [ ] ++ [ crystal ];
  buildInputs = args.buildInputs or [ ] ++ [ crystal ]
    ++ lib.optional (lib.versionAtLeast crystal.version "1.8") pcre2;

  nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [
    crystal
+13 −16
Original line number Diff line number Diff line
@@ -72,18 +72,6 @@ let
      meta.platforms = lib.attrNames sha256s;
    };

  commonBuildInputs = extraBuildInputs: [
    boehmgc
    pcre
    pcre2
    libevent
    libyaml
    zlib
    libxml2
    openssl
  ] ++ extraBuildInputs
  ++ lib.optionals stdenv.isDarwin [ libiconv ];

  generic = (
    { version
    , sha256
@@ -92,7 +80,7 @@ let
    , extraBuildInputs ? [ ]
    , buildFlags ? [ "all" "docs" "release=1"]
    }:
    lib.fix (compiler: stdenv.mkDerivation {
    lib.fix (compiler: stdenv.mkDerivation (finalAttrs: {
      pname = "crystal";
      inherit buildFlags doCheck version;

@@ -172,7 +160,16 @@ let

      strictDeps = true;
      nativeBuildInputs = [ binary makeWrapper which pkg-config llvmPackages.llvm ];
      buildInputs = commonBuildInputs extraBuildInputs;
      buildInputs = [
        boehmgc
        (if lib.versionAtLeast version "1.8" then pcre2 else pcre)
        libevent
        libyaml
        zlib
        libxml2
        openssl
      ] ++ extraBuildInputs
      ++ lib.optionals stdenv.isDarwin [ libiconv ];

      makeFlags = [
        "CRYSTAL_CONFIG_VERSION=${version}"
@@ -202,7 +199,7 @@ let
          --suffix PATH : ${lib.makeBinPath [ pkg-config llvmPackages.clang which ]} \
          --suffix CRYSTAL_PATH : lib:$lib/crystal \
          --suffix CRYSTAL_LIBRARY_PATH : ${
            lib.makeLibraryPath (commonBuildInputs extraBuildInputs)
            lib.makeLibraryPath finalAttrs.buildInputs
          }
        install -dm755 $lib/crystal
        cp -r src/* $lib/crystal/
@@ -248,7 +245,7 @@ let
        license = licenses.asl20;
        maintainers = with maintainers; [ david50407 manveru peterhoeg ];
      };
    })
    }))
  );

in