nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 sfml_2,
7}:
8
9stdenv.mkDerivation (finalAttrs: {
10 pname = "csfml";
11 version = "2.6.1";
12
13 src = fetchFromGitHub {
14 owner = "SFML";
15 repo = "CSFML";
16 tag = finalAttrs.version;
17 hash = "sha256-ECt0ySDpYWF0zuDBSnQzDwUm4Xj4z1+XSC55D6yivac=";
18 };
19
20 # Fix incorrect path joining in cmake
21 # https://github.com/NixOS/nixpkgs/issues/144170
22 postPatch = ''
23 substituteInPlace tools/pkg-config/csfml-*.pc.in \
24 --replace-fail \
25 'libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@' \
26 "libdir=@CMAKE_INSTALL_FULL_LIBDIR@"
27 '';
28
29 nativeBuildInputs = [ cmake ];
30 buildInputs = [ sfml_2 ];
31 cmakeFlags = [
32 (lib.cmakeFeature "CMAKE_MODULE_PATH" "${sfml_2}/share/SFML/cmake/Modules/")
33 ];
34
35 meta = {
36 homepage = "https://www.sfml-dev.org/";
37 description = "Simple and fast multimedia library";
38 longDescription = ''
39 SFML is a simple, fast, cross-platform and object-oriented multimedia API.
40 It provides access to windowing, graphics, audio and network.
41 It is written in C++, and has bindings for various languages such as C, .Net, Ruby, Python.
42 '';
43 license = lib.licenses.zlib;
44 maintainers = [ lib.maintainers.jpdoyle ];
45 platforms = lib.platforms.linux;
46 };
47})