diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-12-17 23:57:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-17 23:57:59 +0100 |
commit | bfbd2fd65ddd6520cb81c7c1b83502fd2cf948f0 (patch) | |
tree | 9afbda4080fb8e941e8b5059f7fe596cf1e9bc30 /pkgs/development/tools | |
parent | 91201ea5fc6afd42f2bf2c258ccd39ff97c8d2b7 (diff) | |
parent | efd788a5e91062c421025a60d131f882fa8aaea7 (diff) |
Merge pull request #273134 from wegank/creduce-bump
creduce: port to LLVM 16
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r-- | pkgs/development/tools/misc/creduce/default.nix | 39 |
1 files changed, 30 insertions, 9 deletions
diff --git a/pkgs/development/tools/misc/creduce/default.nix b/pkgs/development/tools/misc/creduce/default.nix index 77493bd166471..918bd2efab734 100644 --- a/pkgs/development/tools/misc/creduce/default.nix +++ b/pkgs/development/tools/misc/creduce/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, cmake, makeWrapper +{ lib, stdenv, fetchurl, fetchpatch, cmake, makeWrapper , llvm, libclang , flex , zlib @@ -15,6 +15,35 @@ stdenv.mkDerivation rec { sha256 = "2xwPEjln8k1iCwQM69UwAb89zwPkAPeFVqL/LhH+oGM="; }; + patches = [ + # Port to LLVM 15 + (fetchpatch { + url = "https://github.com/csmith-project/creduce/commit/e507cca4ccb32585c5692d49b8d907c1051c826c.patch"; + hash = "sha256-jO5E85AvHcjlErbUhzuQDXwQkhQsXklcTMQfWBd09OU="; + }) + (fetchpatch { + url = "https://github.com/csmith-project/creduce/commit/8d56bee3e1d2577fc8afd2ecc03b1323d6873404.patch"; + hash = "sha256-dRaBaJAYkvMyxKvfriOcg4D+4i6+6orZ85zws1AFx/s="; + }) + # Port to LLVM 16 + (fetchpatch { + url = "https://github.com/csmith-project/creduce/commit/8ab9a69caf13ce24172737e8bfd09de51a1ecb6a.patch"; + hash = "sha256-gPNXxYHnsyUvXmC0CGtsulH2Fu/EMnDE4GdOYc0UbiQ="; + }) + ]; + + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace "-std=c++11" "-std=c++17" + '' + # On Linux, c-reduce's preferred way to reason about + # the cpu architecture/topology is to use 'lscpu', + # so let's make sure it knows where to find it: + + lib.optionalString stdenv.isLinux '' + substituteInPlace creduce/creduce_utils.pm --replace \ + lscpu ${util-linux}/bin/lscpu + ''; + nativeBuildInputs = [ cmake makeWrapper llvm.dev ]; buildInputs = [ # Ensure stdenv's CC is on PATH before clang-unwrapped @@ -24,14 +53,6 @@ stdenv.mkDerivation rec { flex zlib ] ++ (with perlPackages; [ perl ExporterLite FileWhich GetoptTabular RegexpCommon TermReadKey ]); - # On Linux, c-reduce's preferred way to reason about - # the cpu architecture/topology is to use 'lscpu', - # so let's make sure it knows where to find it: - postPatch = lib.optionalString stdenv.isLinux '' - substituteInPlace creduce/creduce_utils.pm --replace \ - lscpu ${util-linux}/bin/lscpu - ''; - postInstall = '' wrapProgram $out/bin/creduce --prefix PERL5LIB : "$PERL5LIB" ''; |