Skip to content

Commit

Permalink
sv-lang: use @dtzWill's patch instead of substituteInPlace
Browse files Browse the repository at this point in the history
(didn't realize there was already a patch; only saw ^ in the cross-refs
for NixOS#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.
  • Loading branch information
rrbutani committed Sep 4, 2024
1 parent 3ae6e20 commit 0387500
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions pkgs/by-name/sv/sv-lang/package.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, testers

# build deps:
Expand Down Expand Up @@ -30,23 +31,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=";
})
];

cmakeFlags = [
(lib.cmakeBool "SLANG_INCLUDE_TESTS" finalAttrs.doCheck)
Expand Down

0 comments on commit 0387500

Please sign in to comment.