1{ lib
2, fetchFromGitHub
3, stdenv
4, zlib
5, ninja
6, meson
7, pkg-config
8, cmake
9, libpng
10}:
11
12stdenv.mkDerivation rec {
13 pname = "libspng";
14 version = "0.7.4";
15
16 src = fetchFromGitHub {
17 owner = "randy408";
18 repo = pname;
19 rev = "v${version}";
20 sha256 = "sha256-BiRuPQEKVJYYgfUsglIuxrBoJBFiQ0ygQmAFrVvCz4Q=";
21 };
22
23 doCheck = true;
24
25 mesonBuildType = "release";
26
27 mesonFlags = [
28 # this is required to enable testing
29 # https://github.com/randy408/libspng/blob/bc383951e9a6e04dbc0766f6737e873e0eedb40b/tests/README.md#testing
30 "-Ddev_build=true"
31 ];
32
33 outputs = [ "out" "dev" ];
34
35 nativeCheckInputs = [
36 cmake
37 libpng
38 ];
39
40 buildInputs = [
41 zlib
42 ];
43
44 nativeBuildInputs = [
45 ninja
46 meson
47 pkg-config
48 ];
49
50 meta = with lib; {
51 description = "Simple, modern libpng alternative";
52 homepage = "https://libspng.org/";
53 license = with licenses; [ bsd2 ];
54 maintainers = with maintainers; [ humancalico ];
55 platforms = platforms.all;
56 };
57}