about summary refs log tree commit diff
path: root/pkgs/development/libraries/pslib/default.nix
blob: 02a8fcde91efcdaa610b2f70b92b9331ba555c75 (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
{ lib, stdenv, fetchurl, cmake, pkg-config, zlib, libpng, libjpeg, giflib, libtiff
}:

stdenv.mkDerivation rec {
  pname = "pslib";
  version = "0.4.8";

  src = fetchurl {
    name = "${pname}-snixource-${version}.tar.gz";
    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
    sha256 = "sha256-gaWNvBLuUUy0o+HWCOyG6KmzxDrYCY6PV3WbA/jjH64=";
  };

  nativeBuildInputs = [ cmake pkg-config ];
  buildInputs = [ zlib libpng libjpeg giflib libtiff ];

  env = lib.optionalAttrs stdenv.isDarwin {
    NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
  };

  doCheck = true;

  outputs = [ "out" "dev" "doc" ];

  installPhase = ''
    mkdir -p $out/lib
    for path in *.dylib *.so *.so.* *.o *.o.*; do
      mv $path $out/lib/
    done
    mkdir -p $dev/include
    mv ../include/libps $dev/include
    if test -d nix-support; then
      mv nix-support $dev
    fi
    mkdir -p $doc/share/doc/${pname}
    cp -r ../doc/. $doc/share/doc/${pname}
  '';

  meta = with lib; {
    description = "C-library for generating multi page PostScript documents";
    homepage = "https://pslib.sourceforge.net/";
    changelog =
      "https://sourceforge.net/p/pslib/git/ci/master/tree/pslib/ChangeLog";
    license = licenses.gpl2;
    maintainers = with maintainers; [ ShamrockLee ];
    platforms = platforms.unix;
  };
}