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.1 #312161

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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,41 @@
{ 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/" ];

meta = with lib; {
postPatch = ''
substituteInPlace tools/pkg-config/* \
--replace-fail 'libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@' "libdir=@CMAKE_INSTALL_FULL_LIBDIR@"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try to upstream this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for late response
SFML/CSFML#374

'';

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; [ drawbu jpdoyle ];
platforms = lib.platforms.unix;
};
}
})
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)
99 changes: 99 additions & 0 deletions pkgs/by-name/sf/sfml/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
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.hostPlatform.isLinux udev
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
libX11
libXrandr
libXrender
xcbutilimage
libXcursor
]
++ lib.optionals stdenv.hostPlatform.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; [
drawbu
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 @@ -22948,11 +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 { };

shibboleth-sp = callPackage ../development/libraries/shibboleth-sp { };
Expand Down