diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/poppler/default.nix')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/poppler/default.nix | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/nixpkgs/pkgs/development/libraries/poppler/default.nix b/nixpkgs/pkgs/development/libraries/poppler/default.nix index 8d2e91513f1e..d99e5150678e 100644 --- a/nixpkgs/pkgs/development/libraries/poppler/default.nix +++ b/nixpkgs/pkgs/development/libraries/poppler/default.nix @@ -1,7 +1,7 @@ { lib , stdenv , fetchurl -, fetchpatch +, fetchFromGitLab , cairo , cmake , pcre @@ -23,7 +23,7 @@ , texlive , zlib , withData ? true, poppler_data -, qt5Support ? false, qtbase ? null +, qt5Support ? false, qt6Support ? false, qtbase ? null , introspectionSupport ? false, gobject-introspection ? null , utils ? false, nss ? null , minimal ? false @@ -32,16 +32,28 @@ let mkFlag = optset: flag: "-DENABLE_${flag}=${if optset then "on" else "off"}"; + + # unclear relationship between test data repo versions and poppler + # versions, though files don't appear to be updated after they're + # added, so it's probably safe to just always use the latest available + # version. + testData = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "poppler"; + repo = "test"; + rev = "920c89f8f43bdfe8966c8e397e7f67f5302e9435"; + hash = "sha256-ySP7zcVI3HW4lk8oqVMPTlFh5pgvBwqcE0EXE71iWos="; + }; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: rec { pname = "poppler-${suffix}"; - version = "22.08.0"; # beware: updates often break cups-filters build, check texlive and scribus too! + version = "23.02.0"; # beware: updates often break cups-filters build, check texlive and scribus too! outputs = [ "out" "dev" ]; src = fetchurl { url = "https://poppler.freedesktop.org/poppler-${version}.tar.xz"; - sha256 = "sha256-tJMyhyFALyXLdSP5zcL318WfRa2Zm951xjyQYE2w8gs="; + hash = "sha256-MxXdonD+KzXPH0HSdZSMOWUvqGO5DeB2b2spPZpVj8k="; }; nativeBuildInputs = [ @@ -56,7 +68,7 @@ stdenv.mkDerivation rec { pcre libiconv libintl - ] ++ lib.optional withData [ + ] ++ lib.optionals withData [ poppler_data ]; @@ -72,7 +84,7 @@ stdenv.mkDerivation rec { lcms curl nss - ] ++ lib.optionals qt5Support [ + ] ++ lib.optionals (qt5Support || qt6Support) [ qtbase ] ++ lib.optionals introspectionSupport [ gobject-introspection @@ -85,7 +97,11 @@ stdenv.mkDerivation rec { (mkFlag (!minimal) "LIBCURL") (mkFlag utils "UTILS") (mkFlag qt5Support "QT5") + (mkFlag qt6Support "QT6") + ] ++ lib.optionals finalAttrs.doCheck [ + "-DTESTDATADIR=${testData}" ]; + disallowedReferences = lib.optional finalAttrs.doCheck testData; dontWrapQtApps = true; @@ -94,7 +110,10 @@ stdenv.mkDerivation rec { sed -i -e '1i cmake_policy(SET CMP0025 NEW)' CMakeLists.txt ''; + doCheck = true; + passthru = { + inherit testData; tests = { # These depend on internal poppler code that frequently changes. inherit inkscape cups-filters texlive scribus; @@ -112,4 +131,4 @@ stdenv.mkDerivation rec { platforms = platforms.all; maintainers = with maintainers; [ ttuegel ] ++ teams.freedesktop.members; }; -} +}) |