From 569fad38cf7b94b0ca8d105b94d958a218b45635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Tue, 21 May 2024 10:44:53 +0200 Subject: [PATCH] csfml: use substitutePatch instead of file patch Co-authored-by: Yohann Boniface --- pkgs/by-name/cs/csfml/package.nix | 6 +- pkgs/by-name/cs/csfml/pkgconfig.patch | 87 --------------------------- 2 files changed, 5 insertions(+), 88 deletions(-) delete mode 100644 pkgs/by-name/cs/csfml/pkgconfig.patch diff --git a/pkgs/by-name/cs/csfml/package.nix b/pkgs/by-name/cs/csfml/package.nix index b47f3e00af581..65388235791d8 100644 --- a/pkgs/by-name/cs/csfml/package.nix +++ b/pkgs/by-name/cs/csfml/package.nix @@ -20,7 +20,11 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ]; buildInputs = [ sfml ]; cmakeFlags = [ "-DCMAKE_MODULE_PATH=${sfml}/share/SFML/cmake/Modules/" ]; - patches = [ ./pkgconfig.patch ]; + + prePatch = '' + substituteInPlace tools/pkg-config/* \ + --replace-fail 'libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@' "libdir=@CMAKE_INSTALL_FULL_LIBDIR@" + ''; meta = { homepage = "https://www.sfml-dev.org/"; diff --git a/pkgs/by-name/cs/csfml/pkgconfig.patch b/pkgs/by-name/cs/csfml/pkgconfig.patch deleted file mode 100644 index 1fb62d1940cf6..0000000000000 --- a/pkgs/by-name/cs/csfml/pkgconfig.patch +++ /dev/null @@ -1,87 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index fdf29f5..b0b456a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -76,7 +76,9 @@ endif() - csfml_set_option(CSFML_INSTALL_PKGCONFIG_FILES ${CSFML_INSTALL_PKGCONFIG_DEFAULT} BOOL "TRUE to automatically install pkg-config files so other projects can find SFML") - - if(CSFML_INSTALL_PKGCONFIG_FILES) -- csfml_set_option(CSFML_PKGCONFIG_INSTALL_DIR "${CSFML_PKGCONFIG_DIR}" PATH "Install directory for CSFML's pkg-config .pc files") -+ file(RELATIVE_PATH CSFML_RELATIVE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_LIBDIR}) -+ set(CSFML_PKGCONFIG_DIR "/${CSFML_RELATIVE_INSTALL_LIBDIR}/pkgconfig") -+ csfml_set_option(CSFML_PKGCONFIG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${CSFML_PKGCONFIG_DIR}" PATH "Install directory for CSFML's pkg-config .pc files") - - foreach(csfml_module IN ITEMS all system window graphics audio network) - configure_file( -diff --git a/tools/pkg-config/csfml-all.pc.in b/tools/pkg-config/csfml-all.pc.in -index 61e0d3e..bebe44c 100644 ---- a/tools/pkg-config/csfml-all.pc.in -+++ b/tools/pkg-config/csfml-all.pc.in -@@ -1,6 +1,6 @@ - prefix=@CMAKE_INSTALL_PREFIX@ - exec_prefix=${prefix} --libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ -+libdir=${exec_prefix}/@SFML_RELATIVE_INSTALL_LIBDIR@ - includedir=${prefix}/include - - Name: CSFML-all -diff --git a/tools/pkg-config/csfml-audio.pc.in b/tools/pkg-config/csfml-audio.pc.in -index 4a5391b..3946fce 100644 ---- a/tools/pkg-config/csfml-audio.pc.in -+++ b/tools/pkg-config/csfml-audio.pc.in -@@ -1,6 +1,6 @@ - prefix=@CMAKE_INSTALL_PREFIX@ - exec_prefix=${prefix} --libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ -+libdir=${exec_prefix}/@SFML_RELATIVE_INSTALL_LIBDIR@ - includedir=${prefix}/include - - Name: CSFML-audio -diff --git a/tools/pkg-config/csfml-graphics.pc.in b/tools/pkg-config/csfml-graphics.pc.in -index aee20e0..d05b026 100644 ---- a/tools/pkg-config/csfml-graphics.pc.in -+++ b/tools/pkg-config/csfml-graphics.pc.in -@@ -1,6 +1,6 @@ - prefix=@CMAKE_INSTALL_PREFIX@ - exec_prefix=${prefix} --libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ -+libdir=${exec_prefix}/@SFML_RELATIVE_INSTALL_LIBDIR@ - includedir=${prefix}/include - - Name: CSFML-graphics -diff --git a/tools/pkg-config/csfml-network.pc.in b/tools/pkg-config/csfml-network.pc.in -index 7dcaecb..9a5b950 100644 ---- a/tools/pkg-config/csfml-network.pc.in -+++ b/tools/pkg-config/csfml-network.pc.in -@@ -1,6 +1,6 @@ - prefix=@CMAKE_INSTALL_PREFIX@ - exec_prefix=${prefix} --libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ -+libdir=${exec_prefix}/@SFML_RELATIVE_INSTALL_LIBDIR@ - includedir=${prefix}/include - - Name: CSFML-network -diff --git a/tools/pkg-config/csfml-system.pc.in b/tools/pkg-config/csfml-system.pc.in -index 71b5e1f..80f63ba 100644 ---- a/tools/pkg-config/csfml-system.pc.in -+++ b/tools/pkg-config/csfml-system.pc.in -@@ -1,6 +1,6 @@ - prefix=@CMAKE_INSTALL_PREFIX@ - exec_prefix=${prefix} --libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ -+libdir=${exec_prefix}/@SFML_RELATIVE_INSTALL_LIBDIR@ - includedir=${prefix}/include - - Name: CSFML-system -diff --git a/tools/pkg-config/csfml-window.pc.in b/tools/pkg-config/csfml-window.pc.in -index 6672372..02bc751 100644 ---- a/tools/pkg-config/csfml-window.pc.in -+++ b/tools/pkg-config/csfml-window.pc.in -@@ -1,6 +1,6 @@ - prefix=@CMAKE_INSTALL_PREFIX@ - exec_prefix=${prefix} --libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@ -+libdir=${exec_prefix}/@SFML_RELATIVE_INSTALL_LIBDIR@ - includedir=${prefix}/include - - Name: CSFML-window