Skip to content

Commit

Permalink
rewrite-tbd: avoid infinite recursion when cmake is not cmakeMinimal
Browse files Browse the repository at this point in the history
This was found while working on the Darwin stdenv rework. This change
allows rewrite-tbd to use the provided Makefile instead of depending on
cmake and pkg-config.

Co-authored-by: Weijia Wang <[email protected]>
  • Loading branch information
reckenrode and wegank committed May 31, 2023
1 parent 5611fa7 commit 259b15f
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkgs/os-specific/darwin/rewrite-tbd/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, libyaml }:
{ stdenv, lib, fetchFromGitHub, libyaml }:

stdenv.mkDerivation {
pname = "rewrite-tbd";
Expand All @@ -11,9 +11,17 @@ stdenv.mkDerivation {
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 ];

makeFlags = [ "-f" "Makefile.boot" "PREFIX=${placeholder "out"}"];

meta = with lib; {
homepage = "https://github.com/thefloweringash/rewrite-tbd/";
description = "Rewrite filepath in .tbd to Nix applicable format";
Expand Down

0 comments on commit 259b15f

Please sign in to comment.