Merge pull request #234855 from reckenrode/rewrite-tbd-fix

rewrite-tbd: avoid infinite recursion when cmake is not cmakeMinimal
This commit is contained in:
Weijia Wang 2023-05-31 13:12:27 +02:00 committed by GitHub
commit 7849b5f9bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, libyaml }: { stdenv, lib, fetchFromGitHub, libyaml }:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "rewrite-tbd"; pname = "rewrite-tbd";
@ -11,9 +11,17 @@ stdenv.mkDerivation {
sha256 = "08sk91zwj6n9x2ymwid2k7y0rwv5b7p6h1b25ipx1dv0i43p6v1a"; sha256 = "08sk91zwj6n9x2ymwid2k7y0rwv5b7p6h1b25ipx1dv0i43p6v1a";
}; };
nativeBuildInputs = [ cmake pkg-config ]; # Nix takes care of these paths. Avoiding the use of `pkg-config` prevents an infinite recursion.
postPatch = ''
substituteInPlace Makefile.boot \
--replace '$(shell pkg-config --cflags yaml-0.1)' "" \
--replace '$(shell pkg-config --libs yaml-0.1)' "-lyaml"
'';
buildInputs = [ libyaml ]; buildInputs = [ libyaml ];
makeFlags = [ "-f" "Makefile.boot" "PREFIX=${placeholder "out"}"];
meta = with lib; { meta = with lib; {
homepage = "https://github.com/thefloweringash/rewrite-tbd/"; homepage = "https://github.com/thefloweringash/rewrite-tbd/";
description = "Rewrite filepath in .tbd to Nix applicable format"; description = "Rewrite filepath in .tbd to Nix applicable format";