about summary refs log tree commit diff
path: root/pkgs/development/libraries/podofo/default.nix
blob: b1464817a7014681ce83c0fa045cb26b6230aa31 (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
{ stdenv, fetchurl, cmake, zlib, freetype, libjpeg, libtiff, fontconfig
, openssl, libpng, lua5 }:

stdenv.mkDerivation rec {
  name = "podofo-0.9.2";

  src = fetchurl {
    url = "mirror://sourceforge/podofo/${name}.tar.gz";
    sha256 = "1wx3s0718rmhdzdwyi8hgpf2s92sk3hijy8f4glrmnjpiihr2la6";
  };

  propagatedBuildInputs = [ zlib freetype libjpeg libtiff fontconfig openssl libpng ];
  nativeBuildInputs = [ cmake ];
  buildInputs = [ lua5 stdenv.gcc.libc ];

  crossAttrs = {
    propagatedBuildInputs = [ zlib.crossDrv freetype.crossDrv libjpeg.crossDrv
      libtiff.crossDrv fontconfig.crossDrv openssl.crossDrv libpng.crossDrv
      lua5.crossDrv stdenv.gccCross.libc ];
  };

  # fix finding freetype-2.5
  preConfigure = ''
    substituteInPlace ./CMakeLists.txt \
      --replace FREETYPE_INCLUDE_DIR FREETYPE_INCLUDE_DIRS \
      --replace 'FIND_PACKAGE(FREETYPE' 'FIND_PACKAGE(Freetype'

    rm ./cmake/modules/Find{FREETYPE,ZLIB,PkgConfig}.cmake
  '';

  cmakeFlags = "-DPODOFO_BUILD_SHARED=ON -DPODOFO_BUILD_STATIC=OFF";

  meta = {
    homepage = http://podofo.sourceforge.net;
    description = "A library to work with the PDF file format";
    platforms = stdenv.lib.platforms.all;
    maintainers = [ stdenv.lib.maintainers.urkud ];
  };
}