Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sfml: 2.5.1 -> 2.6.1; csfml: 2.5.2 -> 2.6.0 #312161

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,28 +1,37 @@
{ lib, stdenv, fetchFromGitHub, cmake, sfml }:
{
lib,
stdenv,
fetchFromGitHub,
cmake,
sfml,
}:

stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "csfml";
version = "2.5.2";
version = "2.6.1";

src = fetchFromGitHub {
owner = "SFML";
repo = "CSFML";
rev = version;
sha256 = "sha256-A5C/4SnxUX7mW1wkPWJWX3dwMhrJ79DkBuZ7UYzTOqE=";
repo = "CSFML";
rev = finalAttrs.version;
hash = "sha256-ECt0ySDpYWF0zuDBSnQzDwUm4Xj4z1+XSC55D6yivac=";
};

nativeBuildInputs = [ cmake ];
buildInputs = [ sfml ];
cmakeFlags = [ "-DCMAKE_MODULE_PATH=${sfml}/share/SFML/cmake/Modules/" ];
patches = [ ./pkgconfig.patch ];

meta = with lib; {
drawbu marked this conversation as resolved.
Show resolved Hide resolved
meta = {
homepage = "https://www.sfml-dev.org/";
description = "Simple and fast multimedia library";
longDescription = ''
SFML is a simple, fast, cross-platform and object-oriented multimedia API.
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.unix;
};
}
})
87 changes: 87 additions & 0 deletions pkgs/by-name/cs/csfml/pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions pkgs/by-name/sf/sfml/CMakeLists.txt-pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -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)
93 changes: 93 additions & 0 deletions pkgs/by-name/sf/sfml/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
lib,
stdenv,
fetchFromGitHub,
cmake,
libX11,
freetype,
libjpeg,
openal,
flac,
libvorbis,
glew,
libXrandr,
libXrender,
udev,
xcbutilimage,
darwin,
libXcursor,
fetchpatch,
}:

stdenv.mkDerivation (finalAttrs: {
pname = "sfml";
version = "2.6.1";

src = fetchFromGitHub {
owner = "SFML";
repo = "SFML";
rev = finalAttrs.version;
hash = "sha256-R+ULgaKSPadcPNW4D2/jlxMKHc1L9e4FprgqLRuyZk4=";
};

nativeBuildInputs = [ cmake ];
buildInputs =
[
freetype
libjpeg
openal
flac
libvorbis
glew
]
++ lib.optional stdenv.isLinux udev
++ lib.optionals (!stdenv.isDarwin) [
libX11
libXrandr
libXrender
xcbutilimage
libXcursor
]
++ lib.optionals stdenv.isDarwin (
with darwin.apple_sdk.frameworks;
[
IOKit
Foundation
AppKit
OpenAL
]
);

cmakeFlags = [
"-DSFML_INSTALL_PKGCONFIG_FILES=yes"
"-DSFML_MISC_INSTALL_PREFIX=share/SFML"
"-DSFML_BUILD_FRAMEWORKS=no"
"-DSFML_USE_SYSTEM_DEPS=yes"
];

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
];

drawbu marked this conversation as resolved.
Show resolved Hide resolved
meta = {
homepage = "https://www.sfml-dev.org/";
description = "Simple and fast multimedia library";
longDescription = ''
SFML is a simple, fast, cross-platform and object-oriented multimedia API.
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 = lib.licenses.zlib;
maintainers = with lib.maintainers; [ astsmtl ];
platforms = lib.platforms.unix;
};
})
71 changes: 0 additions & 71 deletions pkgs/development/libraries/sfml/default.nix

This file was deleted.

5 changes: 0 additions & 5 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24306,11 +24306,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 { };

shapelib = callPackage ../development/libraries/shapelib { };

sharness = callPackage ../development/libraries/sharness { };
Expand Down
Loading