about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libspng/default.nix
blob: dba098b4468a1bdc681d82ece055748009e86905 (plain) (blame)
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
48
49
50
51
52
53
54
55
56
57
{ lib
, fetchFromGitHub
, stdenv
, zlib
, ninja
, meson
, pkg-config
, cmake
, libpng
}:

stdenv.mkDerivation rec {
  pname = "libspng";
  version = "0.7.2";

  src = fetchFromGitHub {
    owner = "randy408";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-GgrTWC/cesDlEh2J6StCyKiLRk62xfy2+E4lnmJMLGs=";
  };

  doCheck = true;

  mesonBuildType = "release";

  mesonFlags = [
    # this is required to enable testing
    # https://github.com/randy408/libspng/blob/bc383951e9a6e04dbc0766f6737e873e0eedb40b/tests/README.md#testing
    "-Ddev_build=true"
  ];

  outputs = [ "out" "dev" ];

  checkInputs = [
    cmake
    libpng
  ];

  buildInputs = [
    pkg-config
    zlib
  ];

  nativeBuildInputs = [
    ninja
    meson
  ];

  meta = with lib; {
    description = "Simple, modern libpng alternative";
    homepage = "https://libspng.org/";
    license = with licenses; [ bsd2 ];
    maintainers = with maintainers; [ humancalico ];
    platforms = platforms.all;
  };
}