2021-09-07 13:41:39 +01:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, stdenv
|
|
|
|
, zlib
|
|
|
|
, ninja
|
|
|
|
, meson
|
|
|
|
, pkg-config
|
|
|
|
, cmake
|
|
|
|
, libpng
|
|
|
|
}:
|
2021-08-31 09:52:01 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libspng";
|
2021-12-07 11:34:48 +00:00
|
|
|
version = "0.7.1";
|
2021-08-31 09:52:01 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "randy408";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-12-07 11:34:48 +00:00
|
|
|
sha256 = "sha256-JBNFYmmd1UnoIfV6iWeDIw/kgvl8AArxfHK+TKjZ9rk=";
|
2021-08-31 09:52:01 +01:00
|
|
|
};
|
|
|
|
|
2021-09-07 13:41:39 +01:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-08-31 09:52:01 +01:00
|
|
|
mesonBuildType = "release";
|
|
|
|
|
2021-09-07 13:41:39 +01:00
|
|
|
mesonFlags = [
|
|
|
|
# this is required to enable testing
|
|
|
|
# https://github.com/randy408/libspng/blob/bc383951e9a6e04dbc0766f6737e873e0eedb40b/tests/README.md#testing
|
|
|
|
"-Ddev_build=true"
|
|
|
|
];
|
|
|
|
|
2021-08-31 09:52:01 +01:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2021-09-07 13:41:39 +01:00
|
|
|
checkInputs = [
|
|
|
|
cmake
|
|
|
|
libpng
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
pkg-config
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
ninja
|
|
|
|
meson
|
|
|
|
];
|
2021-08-31 09:52:01 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Simple, modern libpng alternative";
|
|
|
|
homepage = "https://github.com/randy408/libspng";
|
|
|
|
license = with licenses; [ bsd2 ];
|
|
|
|
maintainers = with maintainers; [ humancalico ];
|
|
|
|
};
|
|
|
|
}
|