Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 29 additions & 34 deletions pkgs/applications/misc/mupdf/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ stdenv
, lib
, fetchurl
, fetchFromGitHub
, copyDesktopItems
, makeDesktopItem
, desktopToDarwinBundle
Expand Down Expand Up @@ -37,41 +36,28 @@
, xcbuild
, gitUpdater

# for passthru.tests
# for passthru.tests
, cups-filters
, zathura
, mupdf
}:

assert enablePython -> enableCxx;

let

freeglut-mupdf = freeglut.overrideAttrs (old: rec {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be happy to remove this in my PR as well. What made you remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repository was not updated in 3 years, so I want to know if this is really necessary or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the Arch package, they seem to be using freeglut from upstream too.

pname = "freeglut-mupdf";
version = "3.0.0-r${src.rev}";
src = fetchFromGitHub {
owner = "ArtifexSoftware";
repo = "thirdparty-freeglut";
rev = "13ae6aa2c2f9a7b4266fc2e6116c876237f40477";
hash = "sha256-0fuE0lm9rlAaok2Qe0V1uUrgP4AjMWgp3eTbw8G6PMM=";
};
});

in
stdenv.mkDerivation rec {
version = "1.23.6";
version = "1.24.0";
pname = "mupdf";

src = fetchurl {
url = "https://mupdf.com/downloads/archive/${pname}-${version}-source.tar.gz";
sha256 = "sha256-rBHrhZ3UBEiOUVPNyWUbtDQeW6r007Pyfir8gvmq3Ck=";
hash = "sha256-UvYwA6b02J8jTp7ftLTIPSFrg6rrMjz9pgR8t1RZmuA=";
};

patches = [ ./0001-Use-command-v-in-favor-of-which.patch
./0002-Add-Darwin-deps.patch
./0003-Fix-cpp-build.patch
];
patches = [
./0001-Use-command-v-in-favor-of-which.patch
./0002-Add-Darwin-deps.patch
./0003-Fix-cpp-build.patch
];

postPatch = ''
substituteInPlace Makerules --replace "(shell pkg-config" "(shell $PKG_CONFIG"
Expand All @@ -93,8 +79,8 @@ stdenv.mkDerivation rec {
"USE_SYSTEM_LIBS=yes"
"PKG_CONFIG=${buildPackages.pkg-config}/bin/${buildPackages.pkg-config.targetPrefix}pkg-config"
] ++ lib.optionals (!enableX11) [ "HAVE_X11=no" ]
++ lib.optionals (!enableGL) [ "HAVE_GLUT=no" ]
++ lib.optionals (enableOcr) [ "USE_TESSERACT=yes" ];
++ lib.optionals (!enableGL) [ "HAVE_GLUT=no" ]
++ lib.optionals (enableOcr) [ "USE_TESSERACT=yes" ];

nativeBuildInputs = [ pkg-config ]
++ lib.optional (enableGL || enableX11) copyDesktopItems
Expand All @@ -107,11 +93,11 @@ stdenv.mkDerivation rec {
++ lib.optionals enableX11 [ libX11 libXext libXi libXrandr ]
++ lib.optionals enableCurl [ curl openssl ]
++ lib.optionals enableGL (
if stdenv.isDarwin then
with darwin.apple_sdk.frameworks; [ GLUT OpenGL ]
else
[ freeglut-mupdf libGLU ]
)
if stdenv.isDarwin then
with darwin.apple_sdk.frameworks; [ GLUT OpenGL ]
else
[ freeglut libGLU ]
)
++ lib.optionals enableOcr [ leptonica tesseract ]
;
outputs = [ "bin" "dev" "out" "man" "doc" ];
Expand Down Expand Up @@ -145,8 +131,16 @@ stdenv.mkDerivation rec {
];
categories = [ "Graphics" "Viewer" ];
keywords = [
"mupdf" "comic" "document" "ebook" "viewer"
"cbz" "epub" "fb2" "pdf" "xps"
"mupdf"
"comic"
"document"
"ebook"
"viewer"
"cbz"
"epub"
"fb2"
"pdf"
"xps"
];
})
];
Expand Down Expand Up @@ -175,9 +169,10 @@ stdenv.mkDerivation rec {
cp docs/logo/mupdf.png $bin/share/icons/hicolor/48x48/apps
'') + (if enableGL then ''
ln -s "$bin/bin/mupdf-gl" "$bin/bin/mupdf"
'' else lib.optionalString (enableX11) ''
ln -s "$bin/bin/mupdf-x11" "$bin/bin/mupdf"
'') + (lib.optionalString (enableCxx) ''
'' else
lib.optionalString (enableX11) ''
ln -s "$bin/bin/mupdf-x11" "$bin/bin/mupdf"
'') + (lib.optionalString (enableCxx) ''
cp platform/c++/include/mupdf/*.h $out/include/mupdf
cp build/*/libmupdfcpp.so $out/lib
'') + (lib.optionalString (enablePython) (''
Expand Down
6 changes: 3 additions & 3 deletions pkgs/development/python-modules/pymupdf/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ let
mupdf-cxx = mupdf.override { enableOcr = true; enableCxx = true; enablePython = true; python3 = python; };
in buildPythonPackage rec {
pname = "pymupdf";
version = "1.23.26";
version = "1.24.0";
pyproject = true;

disabled = pythonOlder "3.7";
disabled = pythonOlder "3.8";

src = fetchFromGitHub {
owner = "pymupdf";
repo = "PyMuPDF";
rev = "refs/tags/${version}";
hash = "sha256-m2zq04+PDnlzFuqeSt27UhdHXTHxpHdMPIg5RQl/5bQ=";
hash = "sha256-lTyYVKKbrIUNrU7N+JOjjMslsXARSTdjdPNsuHI0tiw=";
};

# swig is not wrapped as python package
Expand Down