netpbm: Clean up

* Format with nixpkgs-fmt
* Move build tools to nativeBuildInputs
* Clarify license
This commit is contained in:
Jan Tojnar 2020-02-20 08:53:04 +01:00
parent b19ce7cfe9
commit 8ea075bcb9
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4

View file

@ -1,6 +1,18 @@
{ lib, stdenv, fetchsvn, pkgconfig, libjpeg, libpng, flex, zlib, perl, libxml2
, makeWrapper, libtiff
, enableX11 ? false, libX11 }:
{ lib
, stdenv
, fetchsvn
, pkgconfig
, libjpeg
, libpng
, flex
, zlib
, perl
, libxml2
, makeWrapper
, libtiff
, enableX11 ? false
, libX11
}:
stdenv.mkDerivation {
# Determine version and revision from:
@ -18,9 +30,20 @@ stdenv.mkDerivation {
--replace '"-dSAFER"' '"-dPARANOIDSAFER"'
'';
buildInputs =
[ pkgconfig flex zlib perl libpng libjpeg libxml2 makeWrapper libtiff ]
++ lib.optional enableX11 libX11;
nativeBuildInputs = [
pkgconfig
flex
makeWrapper
];
buildInputs = [
zlib
perl
libpng
libjpeg
libxml2
libtiff
] ++ lib.optional enableX11 libX11;
configurePhase = ''
cp config.mk.in config.mk
@ -30,7 +53,7 @@ stdenv.mkDerivation {
--replace "TIFFHDR_DIR =" "TIFFHDR_DIR = ${libtiff.dev}/include" \
--replace "JPEGLIB = NONE" "JPEGLIB = ${libjpeg.out}/lib/libjpeg.so" \
--replace "JPEGHDR_DIR =" "JPEGHDR_DIR = ${libjpeg.dev}/include"
'' + stdenv.lib.optionalString stdenv.isDarwin ''
'' + stdenv.lib.optionalString stdenv.isDarwin ''
echo "LDSHLIB=-dynamiclib -install_name $out/lib/libnetpbm.\$(MAJ).dylib" >> config.mk
echo "NETPBMLIBTYPE = dylib" >> config.mk
echo "NETPBMLIBSUFFIX = dylib" >> config.mk
@ -64,9 +87,9 @@ stdenv.mkDerivation {
passthru.updateScript = ./update.sh;
meta = {
homepage = http://netpbm.sourceforge.net/;
homepage = "http://netpbm.sourceforge.net/";
description = "Toolkit for manipulation of graphic images";
license = "GPL,free";
license = lib.licenses.free; # http://netpbm.svn.code.sourceforge.net/p/netpbm/code/trunk/doc/copyright_summary
platforms = with stdenv.lib.platforms; linux ++ darwin;
};
}