btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / li / libspng / package.nix
blob98e4aa0641ce95c5e6ab253f8583662e0d3160ba
1 { lib
2 , fetchFromGitHub
3 , stdenv
4 , zlib
5 , ninja
6 , meson
7 , pkg-config
8 , cmake
9 , libpng
12 stdenv.mkDerivation rec {
13   pname = "libspng";
14   version = "0.7.4";
16   src = fetchFromGitHub {
17     owner = "randy408";
18     repo = pname;
19     rev = "v${version}";
20     sha256 = "sha256-BiRuPQEKVJYYgfUsglIuxrBoJBFiQ0ygQmAFrVvCz4Q=";
21   };
23   doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
25   mesonBuildType = "release";
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   ];
33   outputs = [ "out" "dev" ];
35   strictDeps = true;
37   nativeCheckInputs = [
38     cmake
39   ];
41   buildInputs = [
42     zlib
43     libpng
44   ];
46   nativeBuildInputs = [
47     ninja
48     meson
49     pkg-config
50   ];
52   meta = with lib; {
53     description = "Simple, modern libpng alternative";
54     homepage = "https://libspng.org/";
55     license = with licenses; [ bsd2 ];
56     maintainers = with maintainers; [ humancalico ];
57     platforms = platforms.all;
58   };