summary refs log tree commit diff
path: root/pkgs/development/libraries/libpaper
diff options
context:
space:
mode:
authorBenno Fünfstück <benno.fuenfstueck@gmail.com>2016-12-30 16:18:18 +0100
committerBenno Fünfstück <benno.fuenfstueck@gmail.com>2016-12-30 16:18:28 +0100
commit087c244c067a1bc881874bda8fd7b4dac2331fb3 (patch)
tree39c2c8c1ccaf82ec6fa7529a9550398da1932aa8 /pkgs/development/libraries/libpaper
parent59361a2a81bf86f203de5c6cb14801f4915c55e7 (diff)
downloadnixpkgs-087c244c067a1bc881874bda8fd7b4dac2331fb3.tar
nixpkgs-087c244c067a1bc881874bda8fd7b4dac2331fb3.tar.gz
nixpkgs-087c244c067a1bc881874bda8fd7b4dac2331fb3.tar.bz2
nixpkgs-087c244c067a1bc881874bda8fd7b4dac2331fb3.tar.lz
nixpkgs-087c244c067a1bc881874bda8fd7b4dac2331fb3.tar.xz
nixpkgs-087c244c067a1bc881874bda8fd7b4dac2331fb3.tar.zst
nixpkgs-087c244c067a1bc881874bda8fd7b4dac2331fb3.zip
fix #21521
Diffstat (limited to 'pkgs/development/libraries/libpaper')
-rw-r--r--pkgs/development/libraries/libpaper/default.nix19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkgs/development/libraries/libpaper/default.nix b/pkgs/development/libraries/libpaper/default.nix
index 7bc4b316673..a423727b913 100644
--- a/pkgs/development/libraries/libpaper/default.nix
+++ b/pkgs/development/libraries/libpaper/default.nix
@@ -9,6 +9,25 @@ stdenv.mkDerivation rec {
     sha256 = "0zhcx67afb6b5r936w5jmaydj3ks8zh83n9rm5sv3m3k8q8jib1q";
   };
 
+  # The configure script of libpaper is buggy: it uses AC_SUBST on a headerfile
+  # to compile sysconfdir into the library. Autoconf however defines sysconfdir
+  # as "${prefix}/etc", which is not expanded by AC_SUBST so libpaper will look
+  # for config files in (literally, without expansion) '${prefix}/etc'. Manually
+  # setting sysconfdir fixes this issue.
+  preConfigure = ''
+    configureFlagsArray+=(
+      "--sysconfdir=$out/etc"
+    )
+  '';
+
+  # Set the default paper to letter (this is what libpaper uses as default as well,
+  # if you call getdefaultpapername()).
+  # The user can still override this with the PAPERCONF environment variable.
+  postInstall = ''
+    mkdir -p $out/etc
+    echo letter > $out/etc/papersize
+  '';
+
   meta = {
     description = "Library for handling paper characteristics";
     homepage = "http://packages.debian.org/unstable/source/libpaper";