[Nix-dev] [Nix-commits] SVN commit: nix - r29342 - in nixpkgs/trunk/pkgs: data/misc/poppler-data development/libraries/poppler top-level

Lluís Batlle i Rossell viriketo at gmail.com
Mon Sep 19 11:57:59 CEST 2011


Hello,

Is there any sense in keeping poppler-data in a different store path than
poppler?

Maybe having a single store path for both would mean an easier expression and
use of poppler.

Regards,
Lluís.

On Mon, Sep 19, 2011 at 08:35:30AM +0000, Yury G. Kudryashov wrote:
> Author: urkud
> Date: Mon Sep 19 08:35:30 2011
> New Revision: 29342
> URL: https://ssl.nixos.org/websvn/nix/?rev=29342&sc=1
> 
> Log:
> Let poppler use ${POPPLER_DATADIR}
> 
> Also upgrade poppler-data
> 
> Modified:
>    nixpkgs/trunk/pkgs/data/misc/poppler-data/default.nix
>    nixpkgs/trunk/pkgs/development/libraries/poppler/datadir_env.patch
>    nixpkgs/trunk/pkgs/development/libraries/poppler/default.nix
>    nixpkgs/trunk/pkgs/top-level/all-packages.nix
> 
> Modified: nixpkgs/trunk/pkgs/data/misc/poppler-data/default.nix
> ==============================================================================
> --- nixpkgs/trunk/pkgs/data/misc/poppler-data/default.nix	Mon Sep 19 05:17:00 2011	(r29341)
> +++ nixpkgs/trunk/pkgs/data/misc/poppler-data/default.nix	Mon Sep 19 08:35:30 2011	(r29342)
> @@ -1,20 +1,23 @@
>  { fetchurl, stdenv, cmake }:
>  
>  stdenv.mkDerivation rec {
> -  name = "poppler-data-0.4.3";
> +  name = "poppler-data-0.4.5";
>  
>    src = fetchurl {
>      url = "http://poppler.freedesktop.org/${name}.tar.gz";
> -    sha256 = "19jq5miinzzrzlv6696j82hr60ga2r4msk6a34s9537vid410q22";
> +    sha256 = "1zbh1zd083wfwrcw7vxc2bn32h42y6iyh24syxcb3r5ggd2vr41i";
>    };
>  
>    buildInputs = [ cmake ];
>  
> -  postInstall = ''
> -    ensureDir ''${out}/etc/profile.d
> -    echo "export POPPLER_DATADIR=''${out}/share/poppler" > \
> -      ''${out}/etc/profile.d/60-poppler.sh
> -  '';
> +# TODO: actually use $prefix/etc/profile.d in NixOS
> +  postInstall =
> +    ''
> +      mkdir -pv ''${out}/etc/profile.d
> +      echo "export POPPLER_DATADIR=''${out}/share/poppler" |
> +        tee ''${out}/etc/profile.d/60-poppler.sh
> +      chmod -c +x ''${out}/etc/profile.d/60-poppler.sh
> +    '';
>  
>    meta = {
>      homepage = http://poppler.freedesktop.org/;
> 
> Modified: nixpkgs/trunk/pkgs/development/libraries/poppler/datadir_env.patch
> ==============================================================================
> --- nixpkgs/trunk/pkgs/development/libraries/poppler/datadir_env.patch	Mon Sep 19 05:17:00 2011	(r29341)
> +++ nixpkgs/trunk/pkgs/development/libraries/poppler/datadir_env.patch	Mon Sep 19 08:35:30 2011	(r29342)
> @@ -1,56 +1,13 @@
> -diff -ur poppler-0.6.1/poppler/GlobalParams.cc poppler-0.6.1-patched/poppler/GlobalParams.cc
> ---- poppler-0.6.1/poppler/GlobalParams.cc	2007-09-17 20:37:58.000000000 +0200
> -+++ poppler-0.6.1-patched/poppler/GlobalParams.cc	2007-11-06 16:11:55.995595933 +0100
> -@@ -654,27 +654,39 @@
> +diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
> +index 2e11bb0..a277ab9 100644
> +--- a/poppler/GlobalParams.cc
> ++++ b/poppler/GlobalParams.cc
> +@@ -748,7 +748,7 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
> + void GlobalParams::scanEncodingDirs() {
>     GDir *dir;
>     GDirEntry *entry;
> - 
> --  dir = new GDir(POPPLER_DATADIR "/nameToUnicode", gFalse);
> -+  GooString *real_datadir = new GooString (getenv("POPPLER_DATADIR"));
> -+  if (!real_datadir->getCString())
> -+	  real_datadir->Set(POPPLER_DATADIR);
> -+  GooString *dirname;
> -+
> -+  dirname = real_datadir->copy();
> -+  dir = new GDir(dirname->append("/nameToUnicode")->getCString(), gFalse);
> -   while (entry = dir->getNextEntry(), entry != NULL) {
> -     parseNameToUnicode(entry->getFullPath());
> -     delete entry;
> -   }
> -   delete dir;
> -+  delete dirname;
> - 
> --  dir = new GDir(POPPLER_DATADIR "/cidToUnicode", gFalse);
> -+  dirname = real_datadir->copy();
> -+  dir = new GDir(dirname->append("/cidToUnicode")->getCString(), gFalse);
> -   while (entry = dir->getNextEntry(), entry != NULL) {
> -     addCIDToUnicode(entry->getName(), entry->getFullPath());
> -     delete entry;
> -   }
> -   delete dir;
> -+  delete dirname;
> - 
> --  dir = new GDir(POPPLER_DATADIR "/unicodeMap", gFalse);
> -+  dirname = real_datadir->copy();
> -+  dir = new GDir(dirname->append("/unicodeMap")->getCString(), gFalse);
> -   while (entry = dir->getNextEntry(), entry != NULL) {
> -     addUnicodeMap(entry->getName(), entry->getFullPath());
> -     delete entry;
> -   }
> -   delete dir;
> -+  delete dirname;
> - 
> -+  dirname = real_datadir->copy();
> -   dir = new GDir(POPPLER_DATADIR "/cMap", gFalse);
> -   while (entry = dir->getNextEntry(), entry != NULL) {
> -     addCMapDir(entry->getName(), entry->getFullPath());
> -@@ -682,6 +694,9 @@
> -     delete entry;
> -   }
> -   delete dir;
> -+  delete dirname;
> -+
> -+  delete real_datadir;
> - }
> - 
> - void GlobalParams::parseNameToUnicode(GooString *name) {
> +-  const char *dataRoot = popplerDataDir ? popplerDataDir : POPPLER_DATADIR;
> ++  const char *dataRoot = popplerDataDir ? popplerDataDir : ( getenv("POPPLER_DATADIR") ? getenv("POPPLER_DATADIR") : POPPLER_DATADIR );
> +   
> +   // allocate buffer large enough to append "/nameToUnicode"
> +   size_t bufSize = strlen(dataRoot) + strlen("/nameToUnicode") + 1;
> 
> Modified: nixpkgs/trunk/pkgs/development/libraries/poppler/default.nix
> ==============================================================================
> --- nixpkgs/trunk/pkgs/development/libraries/poppler/default.nix	Mon Sep 19 05:17:00 2011	(r29341)
> +++ nixpkgs/trunk/pkgs/development/libraries/poppler/default.nix	Mon Sep 19 08:35:30 2011	(r29342)
> @@ -24,6 +24,8 @@
>  
>    cmakeFlags = "-DENABLE_XPDF_HEADERS=ON -DENABLE_LIBCURL=ON -DENABLE_ZLIB=ON";
>  
> +  patches = [ ./datadir_env.patch ];
> +
>    # XXX: The Poppler/Qt4 test suite refers to non-existent PDF files
>    # such as `../../../test/unittestcases/UseNone.pdf'.
>    #doCheck = !qt4Support;
> 
> Modified: nixpkgs/trunk/pkgs/top-level/all-packages.nix
> ==============================================================================
> --- nixpkgs/trunk/pkgs/top-level/all-packages.nix	Mon Sep 19 05:17:00 2011	(r29341)
> +++ nixpkgs/trunk/pkgs/top-level/all-packages.nix	Mon Sep 19 08:35:30 2011	(r29342)
> @@ -6080,7 +6080,7 @@
>  
>    iana_etc = callPackage ../data/misc/iana-etc { };
>  
> -  popplerData = callPackage ../data/misc/poppler-data { };
> +  poppler_data = callPackage ../data/misc/poppler-data { };
>  
>    r3rs = callPackage ../data/documentation/rnrs/r3rs.nix { };
>  
> _______________________________________________
> nix-commits mailing list
> nix-commits at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-commits


More information about the nix-dev mailing list