summaryrefslogtreecommitdiffstats
path: root/pkgs/by-name/cs/csfml_2/package.nix
blob: f0f169dc97c0163240e8af0d18c8147a835c0762 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  sfml_2,
}:

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

  src = fetchFromGitHub {
    owner = "SFML";
    repo = "CSFML";
    tag = finalAttrs.version;
    hash = "sha256-ECt0ySDpYWF0zuDBSnQzDwUm4Xj4z1+XSC55D6yivac=";
  };

  # Fix incorrect path joining in cmake
  # https://github.com/NixOS/nixpkgs/issues/144170
  postPatch = ''
    substituteInPlace tools/pkg-config/csfml-*.pc.in \
      --replace-fail \
        'libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@' \
        "libdir=@CMAKE_INSTALL_FULL_LIBDIR@"
  '';

  nativeBuildInputs = [ cmake ];
  buildInputs = [ sfml_2 ];
  cmakeFlags = [
    (lib.cmakeFeature "CMAKE_MODULE_PATH" "${sfml_2}/share/SFML/cmake/Modules/")
  ];

  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 = [ lib.maintainers.jpdoyle ];
    platforms = lib.platforms.linux ++ lib.platforms.darwin;
  };
})