summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Dunham <andrew@du.nham.ca>2018-11-06 21:13:03 -0800
committerAndrew Dunham <andrew@du.nham.ca>2018-11-06 21:27:30 -0800
commit13e1235a802460219c9c8edddbd5ebbe2cb3c978 (patch)
tree863fc594d0f17b0da2bfb8948d4f3728484decf2
parent50602de85e3da378e6ccc449a2a75bc5b5da7d9b (diff)
downloadnixpkgs-13e1235a802460219c9c8edddbd5ebbe2cb3c978.tar
nixpkgs-13e1235a802460219c9c8edddbd5ebbe2cb3c978.tar.gz
nixpkgs-13e1235a802460219c9c8edddbd5ebbe2cb3c978.tar.bz2
nixpkgs-13e1235a802460219c9c8edddbd5ebbe2cb3c978.tar.lz
nixpkgs-13e1235a802460219c9c8edddbd5ebbe2cb3c978.tar.xz
nixpkgs-13e1235a802460219c9c8edddbd5ebbe2cb3c978.tar.zst
nixpkgs-13e1235a802460219c9c8edddbd5ebbe2cb3c978.zip
calibre: remove references to podofo
-rw-r--r--pkgs/applications/misc/calibre/default.nix17
-rw-r--r--pkgs/development/libraries/podofo/default.nix7
2 files changed, 20 insertions, 4 deletions
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index 1ad236f0d13..3554c36f519 100644
--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, poppler_utils, pkgconfig, libpng
 , imagemagick, libjpeg, fontconfig, podofo, qtbase, qmake, icu, sqlite
 , makeWrapper, unrarSupport ? false, chmlib, python2Packages, libusb1, libmtp
-, xdg_utils, makeDesktopItem, wrapGAppsHook
+, xdg_utils, makeDesktopItem, wrapGAppsHook, removeReferencesTo
 }:
 
 stdenv.mkDerivation rec {
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  nativeBuildInputs = [ makeWrapper pkgconfig qmake ];
+  nativeBuildInputs = [ makeWrapper pkgconfig qmake removeReferencesTo ];
 
   buildInputs = [
     poppler_utils libpng imagemagick libjpeg
@@ -58,8 +58,8 @@ stdenv.mkDerivation rec {
     export MAGICK_LIB=${imagemagick.out}/lib
     export FC_INC_DIR=${fontconfig.dev}/include/fontconfig
     export FC_LIB_DIR=${fontconfig.lib}/lib
-    export PODOFO_INC_DIR=${podofo}/include/podofo
-    export PODOFO_LIB_DIR=${podofo}/lib
+    export PODOFO_INC_DIR=${podofo.dev}/include/podofo
+    export PODOFO_LIB_DIR=${podofo.lib}/lib
     export SIP_BIN=${python2Packages.sip}/bin/sip
     ${python2Packages.python.interpreter} setup.py install --prefix=$out
 
@@ -88,6 +88,15 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
+  # Remove some references to shrink the closure size. This reference (as of
+  # 2018-11-06) was a single string like the following:
+  #   /nix/store/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-podofo-0.9.6-dev/include/podofo/base/PdfVariant.h
+  preFixup = ''
+    remove-references-to -t ${podofo.dev} $out/lib/calibre/calibre/plugins/podofo.so
+  '';
+
+  disallowedReferences = [ podofo.dev ];
+
   calibreDesktopItem = makeDesktopItem {
     name = "calibre";
     desktopName = "calibre";
diff --git a/pkgs/development/libraries/podofo/default.nix b/pkgs/development/libraries/podofo/default.nix
index 9ddb70c7a8c..ce3f5ab6b78 100644
--- a/pkgs/development/libraries/podofo/default.nix
+++ b/pkgs/development/libraries/podofo/default.nix
@@ -21,6 +21,8 @@ stdenv.mkDerivation rec {
     })
   ];
 
+  outputs = [ "out" "dev" "lib" ];
+
   nativeBuildInputs = [ cmake pkgconfig ];
 
   buildInputs = [ zlib freetype libjpeg libtiff fontconfig openssl libpng
@@ -31,6 +33,11 @@ stdenv.mkDerivation rec {
     "-DPODOFO_BUILD_STATIC=OFF"
     "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON"
   ];
+
+  postInstall = ''
+    moveToOutput lib "$lib"
+  '';
+
   meta = with stdenv.lib; {
     homepage = http://podofo.sourceforge.net;
     description = "A library to work with the PDF file format";