From be8b504367ecb5f70b734d90b8f8b7f3be0a038a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Thu, 16 May 2024 10:57:11 +0200 Subject: [PATCH 01/17] sfml: 2.5.1 -> 2.6.1 --- pkgs/development/libraries/sfml/default.nix | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/pkgs/development/libraries/sfml/default.nix b/pkgs/development/libraries/sfml/default.nix index 2b28228c5f57e..a161514402921 100644 --- a/pkgs/development/libraries/sfml/default.nix +++ b/pkgs/development/libraries/sfml/default.nix @@ -1,7 +1,6 @@ { lib , stdenv , fetchFromGitHub -, fetchpatch , cmake , libX11 , freetype @@ -18,35 +17,24 @@ , Foundation , AppKit , OpenAL +, libXcursor }: stdenv.mkDerivation rec { pname = "sfml"; - version = "2.5.1"; + version = "2.6.1"; src = fetchFromGitHub { owner = "SFML"; repo = "SFML"; rev = version; - sha256 = "sha256-Xt2Ct4vV459AsSvJxQfwMsNs6iA5y3epT95pLWJGeSk="; + hash = "sha256-olEa3m9muPdlzekAqlwzqI+iEBhV4CGlpHLGJpGfci0="; }; - patches = [ - (fetchpatch { - url = "https://github.com/macports/macports-ports/raw/4df1fc235a708ff28200ffc0a39120974ed4b6e1/multimedia/sfml/files/patch-apple-silicon.diff"; - extraPrefix = ""; - sha256 = "sha256-9dNawJaYtkugR+2NvhQOhgsf6w9ZXHkBgsDRh8yAJc0="; - }) - (fetchpatch { - url = "https://github.com/SFML/SFML/commit/bf92efe9a4035fee0258386173d53556aa196e49.patch"; - hash = "sha256-1htwPfpn7Z6s/3b+/i1tQ+btjr/tWv5m6IyDVMBNqQA="; - }) - ]; - nativeBuildInputs = [ cmake ]; buildInputs = [ freetype libjpeg openal flac libvorbis glew ] ++ lib.optional stdenv.hostPlatform.isLinux udev - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ libX11 libXrandr libXrender xcbutilimage ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ libX11 libXrandr libXrender xcbutilimage libXcursor ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ IOKit Foundation AppKit OpenAL ]; cmakeFlags = [ @@ -54,6 +42,7 @@ stdenv.mkDerivation rec { "-DSFML_MISC_INSTALL_PREFIX=share/SFML" "-DSFML_BUILD_FRAMEWORKS=no" "-DSFML_USE_SYSTEM_DEPS=yes" + "-DSFML_PKGCONFIG_INSTALL_PREFIX=share/pkgconfig" ]; meta = with lib; { From 4185a7e22a1fe407d5768e1340a36e18d33857c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Thu, 16 May 2024 10:57:35 +0200 Subject: [PATCH 02/17] csfml: 2.5.2 -> 2.6.0 --- pkgs/development/libraries/csfml/default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/csfml/default.nix b/pkgs/development/libraries/csfml/default.nix index 397d5186a1c4f..6c9d19d998031 100644 --- a/pkgs/development/libraries/csfml/default.nix +++ b/pkgs/development/libraries/csfml/default.nix @@ -2,16 +2,19 @@ stdenv.mkDerivation rec { pname = "csfml"; - version = "2.5.2"; + version = "2.6.0"; src = fetchFromGitHub { owner = "SFML"; repo = "CSFML"; rev = version; - sha256 = "sha256-A5C/4SnxUX7mW1wkPWJWX3dwMhrJ79DkBuZ7UYzTOqE="; + hash = "sha256-wwDHuyh4zMi0XCjIK7dUWiscPA+r8zLEvomuul6nlyQ="; }; nativeBuildInputs = [ cmake ]; buildInputs = [ sfml ]; - cmakeFlags = [ "-DCMAKE_MODULE_PATH=${sfml}/share/SFML/cmake/Modules/" ]; + cmakeFlags = [ + "-DCMAKE_MODULE_PATH=${sfml}/share/SFML/cmake/Modules/" + "-DCSFML_PKGCONFIG_INSTALL_PREFIX=share/pkgconfig" + ]; meta = with lib; { homepage = "https://www.sfml-dev.org/"; From bd2dca478c81276f3663f1f6a7095f7d39d58987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Thu, 16 May 2024 12:26:48 +0200 Subject: [PATCH 03/17] sfml: use correct hash --- pkgs/development/libraries/sfml/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/sfml/default.nix b/pkgs/development/libraries/sfml/default.nix index a161514402921..186575b876e60 100644 --- a/pkgs/development/libraries/sfml/default.nix +++ b/pkgs/development/libraries/sfml/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { owner = "SFML"; repo = "SFML"; rev = version; - hash = "sha256-olEa3m9muPdlzekAqlwzqI+iEBhV4CGlpHLGJpGfci0="; + hash = "sha256-R+ULgaKSPadcPNW4D2/jlxMKHc1L9e4FprgqLRuyZk4="; }; nativeBuildInputs = [ cmake ]; From 007724ec039e955b5997335f20446457bc0bbfec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Fri, 17 May 2024 17:14:45 +0200 Subject: [PATCH 04/17] sfml: reformat with nixfmt-rfc-style --- pkgs/development/libraries/sfml/default.nix | 74 +++++++++++++-------- 1 file changed, 47 insertions(+), 27 deletions(-) diff --git a/pkgs/development/libraries/sfml/default.nix b/pkgs/development/libraries/sfml/default.nix index 186575b876e60..9133b92c8e401 100644 --- a/pkgs/development/libraries/sfml/default.nix +++ b/pkgs/development/libraries/sfml/default.nix @@ -1,23 +1,24 @@ -{ lib -, stdenv -, fetchFromGitHub -, cmake -, libX11 -, freetype -, libjpeg -, openal -, flac -, libvorbis -, glew -, libXrandr -, libXrender -, udev -, xcbutilimage -, IOKit -, Foundation -, AppKit -, OpenAL -, libXcursor +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + libX11, + freetype, + libjpeg, + openal, + flac, + libvorbis, + glew, + libXrandr, + libXrender, + udev, + xcbutilimage, + IOKit, + Foundation, + AppKit, + OpenAL, + libXcursor, }: stdenv.mkDerivation rec { @@ -32,10 +33,29 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ cmake ]; - buildInputs = [ freetype libjpeg openal flac libvorbis glew ] + buildInputs = + [ + freetype + libjpeg + openal + flac + libvorbis + glew + ] ++ lib.optional stdenv.hostPlatform.isLinux udev - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ libX11 libXrandr libXrender xcbutilimage libXcursor ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ IOKit Foundation AppKit OpenAL ]; + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + libX11 + libXrandr + libXrender + xcbutilimage + libXcursor + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + IOKit + Foundation + AppKit + OpenAL + ]; cmakeFlags = [ "-DSFML_INSTALL_PKGCONFIG_FILES=yes" @@ -45,7 +65,7 @@ stdenv.mkDerivation rec { "-DSFML_PKGCONFIG_INSTALL_PREFIX=share/pkgconfig" ]; - meta = with lib; { + meta = { homepage = "https://www.sfml-dev.org/"; description = "Simple and fast multimedia library"; longDescription = '' @@ -53,8 +73,8 @@ stdenv.mkDerivation rec { It provides access to windowing, graphics, audio and network. It is written in C++, and has bindings for various languages such as C, .Net, Ruby, Python. ''; - license = licenses.zlib; - maintainers = [ maintainers.astsmtl ]; - platforms = platforms.unix; + license = lib.licenses.zlib; + maintainers = with lib.maintainers; [ astsmtl ]; + platforms = lib.platforms.unix; }; } From d92cae97191a0d8bd22ebd4e89f048f41ff441e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Fri, 17 May 2024 17:14:51 +0200 Subject: [PATCH 05/17] csfml: reformat with nixfmt-rfc-style --- pkgs/development/libraries/csfml/default.nix | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/csfml/default.nix b/pkgs/development/libraries/csfml/default.nix index 6c9d19d998031..12d01d0e01198 100644 --- a/pkgs/development/libraries/csfml/default.nix +++ b/pkgs/development/libraries/csfml/default.nix @@ -1,12 +1,18 @@ -{ lib, stdenv, fetchFromGitHub, cmake, sfml }: +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + sfml, +}: stdenv.mkDerivation rec { pname = "csfml"; version = "2.6.0"; src = fetchFromGitHub { owner = "SFML"; - repo = "CSFML"; - rev = version; + repo = "CSFML"; + rev = version; hash = "sha256-wwDHuyh4zMi0XCjIK7dUWiscPA+r8zLEvomuul6nlyQ="; }; nativeBuildInputs = [ cmake ]; @@ -16,7 +22,7 @@ stdenv.mkDerivation rec { "-DCSFML_PKGCONFIG_INSTALL_PREFIX=share/pkgconfig" ]; - meta = with lib; { + meta = { homepage = "https://www.sfml-dev.org/"; description = "Simple and fast multimedia library"; longDescription = '' @@ -24,8 +30,8 @@ stdenv.mkDerivation rec { It provides access to windowing, graphics, audio and network. It is written in C++, and has bindings for various languages such as C, .Net, Ruby, Python. ''; - license = licenses.zlib; - maintainers = [ maintainers.jpdoyle ]; - platforms = platforms.linux; + license = lib.licenses.zlib; + maintainers = with lib.maintainers; [ jpdoyle ]; + platforms = lib.platforms.linux; }; } From 0ccfd7fc9f81dcdb9621436475cc242c9c4fec95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Fri, 17 May 2024 17:18:44 +0200 Subject: [PATCH 06/17] sfml: use finalAttrs instead of rec Co-authored-by: Sigmanificient --- pkgs/development/libraries/sfml/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/sfml/default.nix b/pkgs/development/libraries/sfml/default.nix index 9133b92c8e401..63357482fd4fa 100644 --- a/pkgs/development/libraries/sfml/default.nix +++ b/pkgs/development/libraries/sfml/default.nix @@ -21,14 +21,14 @@ libXcursor, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "sfml"; version = "2.6.1"; src = fetchFromGitHub { owner = "SFML"; repo = "SFML"; - rev = version; + rev = finalAttrs.version; hash = "sha256-R+ULgaKSPadcPNW4D2/jlxMKHc1L9e4FprgqLRuyZk4="; }; @@ -77,4 +77,4 @@ stdenv.mkDerivation rec { maintainers = with lib.maintainers; [ astsmtl ]; platforms = lib.platforms.unix; }; -} +}) From a8fc0ddeb9b1b2aee44028a0262737e8bcfc0628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Fri, 17 May 2024 17:19:21 +0200 Subject: [PATCH 07/17] csfml: use finalAttrs instead of rec Co-authored-by: Sigmanificient --- pkgs/development/libraries/csfml/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/csfml/default.nix b/pkgs/development/libraries/csfml/default.nix index 12d01d0e01198..c0952eec2a358 100644 --- a/pkgs/development/libraries/csfml/default.nix +++ b/pkgs/development/libraries/csfml/default.nix @@ -6,15 +6,17 @@ sfml, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "csfml"; version = "2.6.0"; + src = fetchFromGitHub { owner = "SFML"; repo = "CSFML"; - rev = version; + rev = finalAttrs.version; hash = "sha256-wwDHuyh4zMi0XCjIK7dUWiscPA+r8zLEvomuul6nlyQ="; }; + nativeBuildInputs = [ cmake ]; buildInputs = [ sfml ]; cmakeFlags = [ @@ -34,4 +36,4 @@ stdenv.mkDerivation rec { maintainers = with lib.maintainers; [ jpdoyle ]; platforms = lib.platforms.linux; }; -} +}) From 8fd5b41eb5d11eef153a8486ff4f63ea69599bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Fri, 17 May 2024 17:29:15 +0200 Subject: [PATCH 08/17] sfml: move to by-name --- .../sf/sfml/package.nix} | 20 +++++++++---------- pkgs/top-level/all-packages.nix | 3 --- 2 files changed, 10 insertions(+), 13 deletions(-) rename pkgs/{development/libraries/sfml/default.nix => by-name/sf/sfml/package.nix} (88%) diff --git a/pkgs/development/libraries/sfml/default.nix b/pkgs/by-name/sf/sfml/package.nix similarity index 88% rename from pkgs/development/libraries/sfml/default.nix rename to pkgs/by-name/sf/sfml/package.nix index 63357482fd4fa..24fd39a5b54ee 100644 --- a/pkgs/development/libraries/sfml/default.nix +++ b/pkgs/by-name/sf/sfml/package.nix @@ -14,10 +14,7 @@ libXrender, udev, xcbutilimage, - IOKit, - Foundation, - AppKit, - OpenAL, + darwin, libXcursor, }: @@ -50,12 +47,15 @@ stdenv.mkDerivation (finalAttrs: { xcbutilimage libXcursor ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - IOKit - Foundation - AppKit - OpenAL - ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin ( + with darwin.apple_sdk.frameworks; + [ + IOKit + Foundation + AppKit + OpenAL + ] + ); cmakeFlags = [ "-DSFML_INSTALL_PKGCONFIG_FILES=yes" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b15df4f0cfdef..1fabfc2ffb32c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22948,9 +22948,6 @@ with pkgs; simpleitk = callPackage ../development/libraries/simpleitk { lua = lua5_4; }; - sfml = callPackage ../development/libraries/sfml { - inherit (darwin.apple_sdk.frameworks) IOKit Foundation AppKit OpenAL; - }; csfml = callPackage ../development/libraries/csfml { }; sharness = callPackage ../development/libraries/sharness { }; From 5a41764d25e6a0c8b6f9882021fdc02ef6cc434d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Fri, 17 May 2024 17:29:22 +0200 Subject: [PATCH 09/17] csfml: move to by-name move to byname --- .../csfml/default.nix => by-name/cs/csfml/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{development/libraries/csfml/default.nix => by-name/cs/csfml/package.nix} (100%) diff --git a/pkgs/development/libraries/csfml/default.nix b/pkgs/by-name/cs/csfml/package.nix similarity index 100% rename from pkgs/development/libraries/csfml/default.nix rename to pkgs/by-name/cs/csfml/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1fabfc2ffb32c..83b3b32b2d2e3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -22948,8 +22948,6 @@ with pkgs; simpleitk = callPackage ../development/libraries/simpleitk { lua = lua5_4; }; - csfml = callPackage ../development/libraries/csfml { }; - sharness = callPackage ../development/libraries/sharness { }; shibboleth-sp = callPackage ../development/libraries/shibboleth-sp { }; From 2221cab9a3c50ebe41b77b6e40e35473e3ad42d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Mon, 20 May 2024 11:49:59 +0200 Subject: [PATCH 10/17] sfml: fix pkg-config --- .../sf/sfml/CMakeLists.txt-pkgconfig.patch | 14 ++++++++++++++ pkgs/by-name/sf/sfml/package.nix | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 pkgs/by-name/sf/sfml/CMakeLists.txt-pkgconfig.patch diff --git a/pkgs/by-name/sf/sfml/CMakeLists.txt-pkgconfig.patch b/pkgs/by-name/sf/sfml/CMakeLists.txt-pkgconfig.patch new file mode 100644 index 0000000000000..c8e36750419da --- /dev/null +++ b/pkgs/by-name/sf/sfml/CMakeLists.txt-pkgconfig.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index fc9a268e..512eb6a7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -301,6 +301,9 @@ endif() + sfml_set_option(SFML_INSTALL_PKGCONFIG_FILES ${SFML_INSTALL_PKGCONFIG_DEFAULT} BOOL "TRUE to automatically install pkg-config files so other projects can find SFML") + + if(SFML_INSTALL_PKGCONFIG_FILES) ++ file(RELATIVE_PATH SFML_RELATIVE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_LIBDIR}) ++ set(SFML_PKGCONFIG_DIR "/${SFML_RELATIVE_INSTALL_LIBDIR}/pkgconfig") ++ + sfml_set_option(SFML_PKGCONFIG_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/${SFML_PKGCONFIG_DIR}" PATH "Install directory for SFML's pkg-config .pc files") + + foreach(sfml_module IN ITEMS all system window graphics audio network) diff --git a/pkgs/by-name/sf/sfml/package.nix b/pkgs/by-name/sf/sfml/package.nix index 24fd39a5b54ee..38cd27fe151e3 100644 --- a/pkgs/by-name/sf/sfml/package.nix +++ b/pkgs/by-name/sf/sfml/package.nix @@ -16,6 +16,7 @@ xcbutilimage, darwin, libXcursor, + fetchpatch, }: stdenv.mkDerivation (finalAttrs: { @@ -62,7 +63,19 @@ stdenv.mkDerivation (finalAttrs: { "-DSFML_MISC_INSTALL_PREFIX=share/SFML" "-DSFML_BUILD_FRAMEWORKS=no" "-DSFML_USE_SYSTEM_DEPS=yes" - "-DSFML_PKGCONFIG_INSTALL_PREFIX=share/pkgconfig" + ]; + + patches = [ + # Fix pkg-config + # See https://github.com/SFML/SFML/issues/2815 + # Also, too much changes in CMakeLists.txt and changelog.md, + # so we patchin cmake ourself + (fetchpatch { + url = "https://patch-diff.githubusercontent.com/raw/SFML/SFML/pull/2835.patch"; + hash = "sha256-kdOAXR9YPQllx64z9dgwCV+vy0cJvIsZZboZKFc4Q8Q="; + excludes = [ "changelog.md" "CMakeLists.txt" ]; + }) + ./CMakeLists.txt-pkgconfig.patch ]; meta = { From 2c67068660bfe79a16e041c0908bdad1bfb0e1f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Mon, 20 May 2024 12:09:09 +0200 Subject: [PATCH 11/17] sfml: fix pkg-config --- pkgs/by-name/cs/csfml/package.nix | 6 +- pkgs/by-name/cs/csfml/pkgconfig.patch | 87 +++++++++++++++++++++++++++ 2 files changed, 89 insertions(+), 4 deletions(-) create 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 c0952eec2a358..e0ed03b7a49f7 100644 --- a/pkgs/by-name/cs/csfml/package.nix +++ b/pkgs/by-name/cs/csfml/package.nix @@ -19,10 +19,8 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake ]; buildInputs = [ sfml ]; - cmakeFlags = [ - "-DCMAKE_MODULE_PATH=${sfml}/share/SFML/cmake/Modules/" - "-DCSFML_PKGCONFIG_INSTALL_PREFIX=share/pkgconfig" - ]; + cmakeFlags = [ "-DCMAKE_MODULE_PATH=${sfml}/share/SFML/cmake/Modules/" ]; + patches = [ ./pkgconfig.patch ]; 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 new file mode 100644 index 0000000000000..1fb62d1940cf6 --- /dev/null +++ b/pkgs/by-name/cs/csfml/pkgconfig.patch @@ -0,0 +1,87 @@ +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 From 37fb5deaea3e4e9c435a67da4b00098bbef861b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Mon, 20 May 2024 12:09:27 +0200 Subject: [PATCH 12/17] csfml: 2.6.0 -> 2.6.1 --- pkgs/by-name/cs/csfml/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/cs/csfml/package.nix b/pkgs/by-name/cs/csfml/package.nix index e0ed03b7a49f7..d67954bd3f572 100644 --- a/pkgs/by-name/cs/csfml/package.nix +++ b/pkgs/by-name/cs/csfml/package.nix @@ -8,13 +8,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "csfml"; - version = "2.6.0"; + version = "2.6.1"; src = fetchFromGitHub { owner = "SFML"; repo = "CSFML"; rev = finalAttrs.version; - hash = "sha256-wwDHuyh4zMi0XCjIK7dUWiscPA+r8zLEvomuul6nlyQ="; + hash = "sha256-ECt0ySDpYWF0zuDBSnQzDwUm4Xj4z1+XSC55D6yivac="; }; nativeBuildInputs = [ cmake ]; From 0de0712dfe9b07b5e038e09842d500d948438755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Mon, 20 May 2024 12:10:03 +0200 Subject: [PATCH 13/17] csfml: mark platform to unix instead of linux --- pkgs/by-name/cs/csfml/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/cs/csfml/package.nix b/pkgs/by-name/cs/csfml/package.nix index d67954bd3f572..b47f3e00af581 100644 --- a/pkgs/by-name/cs/csfml/package.nix +++ b/pkgs/by-name/cs/csfml/package.nix @@ -32,6 +32,6 @@ stdenv.mkDerivation (finalAttrs: { ''; license = lib.licenses.zlib; maintainers = with lib.maintainers; [ jpdoyle ]; - platforms = lib.platforms.linux; + platforms = lib.platforms.unix; }; }) From c15a08ad841b60a200c4bb60bfd5b58692d2500e 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 14/17] 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 From 63ba299377901b5ccdab2cc72a179e17c2c25f57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Thu, 6 Jun 2024 14:26:13 +0200 Subject: [PATCH 15/17] {csfml,sfml}: add drawbu to meta.maintainers --- pkgs/by-name/cs/csfml/package.nix | 2 +- pkgs/by-name/sf/sfml/package.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/cs/csfml/package.nix b/pkgs/by-name/cs/csfml/package.nix index 65388235791d8..4db1d78ba5662 100644 --- a/pkgs/by-name/cs/csfml/package.nix +++ b/pkgs/by-name/cs/csfml/package.nix @@ -35,7 +35,7 @@ stdenv.mkDerivation (finalAttrs: { It is written in C++, and has bindings for various languages such as C, .Net, Ruby, Python. ''; license = lib.licenses.zlib; - maintainers = with lib.maintainers; [ jpdoyle ]; + maintainers = with lib.maintainers; [ drawbu jpdoyle ]; platforms = lib.platforms.unix; }; }) diff --git a/pkgs/by-name/sf/sfml/package.nix b/pkgs/by-name/sf/sfml/package.nix index 38cd27fe151e3..8770065041f14 100644 --- a/pkgs/by-name/sf/sfml/package.nix +++ b/pkgs/by-name/sf/sfml/package.nix @@ -87,7 +87,7 @@ stdenv.mkDerivation (finalAttrs: { It is written in C++, and has bindings for various languages such as C, .Net, Ruby, Python. ''; license = lib.licenses.zlib; - maintainers = with lib.maintainers; [ astsmtl ]; + maintainers = with lib.maintainers; [ drawbu astsmtl ]; platforms = lib.platforms.unix; }; }) From aac0c39ad098a0106fe736c93c0995ada09b9235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Sat, 12 Oct 2024 21:09:55 +0200 Subject: [PATCH 16/17] csfml: replace `prePatch` with `postPatch` Co-authored-by: Sandro --- pkgs/by-name/cs/csfml/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/cs/csfml/package.nix b/pkgs/by-name/cs/csfml/package.nix index 4db1d78ba5662..1b9b6c5b84ce1 100644 --- a/pkgs/by-name/cs/csfml/package.nix +++ b/pkgs/by-name/cs/csfml/package.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ sfml ]; cmakeFlags = [ "-DCMAKE_MODULE_PATH=${sfml}/share/SFML/cmake/Modules/" ]; - prePatch = '' + postPatch = '' substituteInPlace tools/pkg-config/* \ --replace-fail 'libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@' "libdir=@CMAKE_INSTALL_FULL_LIBDIR@" ''; From 043ce09b3d7e0ccd9dae431290cbbaebb4deab7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Sun, 13 Oct 2024 11:33:53 +0200 Subject: [PATCH 17/17] sfml: applied `nixfmt-rfc-style` --- pkgs/by-name/sf/sfml/package.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/sf/sfml/package.nix b/pkgs/by-name/sf/sfml/package.nix index 8770065041f14..be5719afad97b 100644 --- a/pkgs/by-name/sf/sfml/package.nix +++ b/pkgs/by-name/sf/sfml/package.nix @@ -73,7 +73,10 @@ stdenv.mkDerivation (finalAttrs: { (fetchpatch { url = "https://patch-diff.githubusercontent.com/raw/SFML/SFML/pull/2835.patch"; hash = "sha256-kdOAXR9YPQllx64z9dgwCV+vy0cJvIsZZboZKFc4Q8Q="; - excludes = [ "changelog.md" "CMakeLists.txt" ]; + excludes = [ + "changelog.md" + "CMakeLists.txt" + ]; }) ./CMakeLists.txt-pkgconfig.patch ]; @@ -87,7 +90,10 @@ stdenv.mkDerivation (finalAttrs: { It is written in C++, and has bindings for various languages such as C, .Net, Ruby, Python. ''; license = lib.licenses.zlib; - maintainers = with lib.maintainers; [ drawbu astsmtl ]; + maintainers = with lib.maintainers; [ + drawbu + astsmtl + ]; platforms = lib.platforms.unix; }; })