From c671e34ba6b0b894e7fffff45458601b2c661160 Mon Sep 17 00:00:00 2001 From: Rahul Butani Date: Wed, 4 Sep 2024 01:49:59 -0700 Subject: [PATCH] sv-lang: use @dtzWill's patch instead of `substituteInPlace` (didn't realize there was already a patch; only saw ^ in the cross-refs for NixOS/nixpkgs#144170) Note that this commit intentionally references the commit via `MikePopoloski/slang` instead of `dtzWill/slang` just in case the latter (fork repo) is deleted. --- pkgs/by-name/sv/sv-lang/package.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/pkgs/by-name/sv/sv-lang/package.nix b/pkgs/by-name/sv/sv-lang/package.nix index 9ae4329229da6f7..bcdfd6de2db29d2 100644 --- a/pkgs/by-name/sv/sv-lang/package.nix +++ b/pkgs/by-name/sv/sv-lang/package.nix @@ -1,6 +1,7 @@ { lib , stdenv , fetchFromGitHub +, fetchpatch , testers # build deps: , cmake @@ -33,23 +34,19 @@ # See: https://github.com/NixOS/nixpkgs/issues/144170 # See: https://github.com/MikePopoloski/slang/blob/v6.0/scripts/sv-lang.pc.in#L2-L3 + # See: https://github.com/dtzWill/slang/commit/36138d6775be144968dd9d126ba4089277c14054 # # slang's `includedir` and `libdir` in `sv-lang.pc` are hardcoded to be # `${prefix}`-relative paths; when using multiple outputs (i.e. `lib`, `dev`) # these directories do not share a prefix. So, we strip `${prefix}` from the # pkg-config template — `CMAKE_INSTALL_INCLUDEDIR` and `CMAKE_INSTALL_LIBDIR` # are (when set by the cmake setup hook) already absolute paths. - patchPhase = '' - runHook prePatch - - substituteInPlace ./scripts/sv-lang.pc.in \ - --replace-fail \ - "\''${prefix}/@CMAKE_INSTALL_INCLUDEDIR@" '@CMAKE_INSTALL_INCLUDEDIR@' \ - --replace-fail \ - "\''${prefix}/@CMAKE_INSTALL_LIBDIR@" '@CMAKE_INSTALL_LIBDIR@' - - runHook postPatch - ''; + patches = [ + (fetchpatch { + url = "https://github.com/MikePopoloski/slang/commit/36138d6775be144968dd9d126ba4089277c14054.patch"; + hash = "sha256-U540bNyOonR0WJJlqudojDNSgldka4l85LTtZWDNZJk="; + }) + ]; inherit includeTools useMimalloc; cmakeFlags = [