mupdf: enable on darwin

authored by Dmitry Kalinkin and committed by Domen Kožar 21db6f6a e714179c

+49 -6
+35
pkgs/applications/misc/mupdf/darwin.patch
···
··· 1 + diff --git a/Makerules b/Makerules 2 + --- a/Makerules 3 + +++ b/Makerules 4 + @@ -81,22 +81,10 @@ HAVE_GLUT ?= yes 5 + SYS_GLUT_CFLAGS := -Wno-deprecated-declarations 6 + SYS_GLUT_LIBS := -framework GLUT -framework OpenGL 7 + 8 + -CC = xcrun cc 9 + -AR = xcrun ar 10 + -LD = xcrun ld 11 + -RANLIB_CMD = xcrun ranlib $@ 12 + - 13 + -# Linux uses pkg-config for system libraries. 14 + -else ifeq "$(OS)" "Linux" 15 + - 16 + HAVE_PTHREAD := yes 17 + SYS_PTHREAD_CFLAGS := 18 + SYS_PTHREAD_LIBS := -lpthread 19 + 20 + -HAVE_GLUT := yes 21 + -SYS_GLUT_CFLAGS := 22 + -SYS_GLUT_LIBS := -lglut -lGL 23 + - 24 + ifeq "$(shell pkg-config --exists 'libcrypto <= 1.0.1t' && echo yes)" "yes" 25 + HAVE_LIBCRYPTO := yes 26 + SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto) 27 + @@ -113,7 +101,7 @@ SYS_CURL_CFLAGS += $(shell pkg-config --cflags openssl) 28 + SYS_CURL_DEPS += $(shell pkg-config --libs openssl) 29 + endif 30 + endif 31 + -SYS_CURL_DEPS += -lpthread -lrt 32 + +SYS_CURL_DEPS += -lpthread 33 + 34 + ifeq "$(shell pkg-config --exists x11 xext && echo yes)" "yes" 35 + HAVE_X11 := yes
+14 -6
pkgs/applications/misc/mupdf/default.nix
··· 1 - { stdenv, lib, fetchurl, fetchpatch, pkgconfig 2 - , freetype, harfbuzz, openjpeg, jbig2dec, libjpeg 3 , enableX11 ? true, libX11, libXext, libXi, libXrandr 4 , enableCurl ? true, curl, openssl 5 , enableGL ? true, freeglut, mesa_glu ··· 29 url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/0001-mupdf-openjpeg.patch?h=packages/mupdf&id=a910cd33a2b311712f83710dc042fbe80c104306"; 30 sha256 = "05i9v2ia586jyjqdb7g68ss4vkfwgp6cwhagc8zzggsba83azyqk"; 31 }) 32 33 - ./mupdf-1.12-shared_libs-1.patch 34 35 - ]; 36 37 postPatch = '' 38 sed -i "s/__OPENJPEG__VERSION__/${openJpegVersion}/" source/fitz/load-jpx.c ··· 43 buildInputs = [ freetype harfbuzz openjpeg jbig2dec libjpeg freeglut mesa_glu ] 44 ++ lib.optionals enableX11 [ libX11 libXext libXi libXrandr ] 45 ++ lib.optionals enableCurl [ curl openssl ] 46 - ++ lib.optionals enableGL [ freeglut mesa_glu ]; 47 outputs = [ "bin" "dev" "out" "man" "doc" ]; 48 49 preConfigure = '' ··· 86 description = "Lightweight PDF, XPS, and E-book viewer and toolkit written in portable C"; 87 license = licenses.agpl3Plus; 88 maintainers = with maintainers; [ viric vrthra fpletz ]; 89 - platforms = platforms.linux; 90 }; 91 }
··· 1 + { stdenv, lib, fetchurl, fetchpatch, pkgconfig, freetype, harfbuzz, openjpeg 2 + , jbig2dec, libjpeg , darwin 3 , enableX11 ? true, libX11, libXext, libXi, libXrandr 4 , enableCurl ? true, curl, openssl 5 , enableGL ? true, freeglut, mesa_glu ··· 29 url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/0001-mupdf-openjpeg.patch?h=packages/mupdf&id=a910cd33a2b311712f83710dc042fbe80c104306"; 30 sha256 = "05i9v2ia586jyjqdb7g68ss4vkfwgp6cwhagc8zzggsba83azyqk"; 31 }) 32 + ] 33 34 + # Use shared libraries to decrease size 35 + ++ stdenv.lib.optional (!stdenv.isDarwin) ./mupdf-1.12-shared_libs-1.patch 36 37 + ++ stdenv.lib.optional stdenv.isDarwin ./darwin.patch 38 + ; 39 40 postPatch = '' 41 sed -i "s/__OPENJPEG__VERSION__/${openJpegVersion}/" source/fitz/load-jpx.c ··· 46 buildInputs = [ freetype harfbuzz openjpeg jbig2dec libjpeg freeglut mesa_glu ] 47 ++ lib.optionals enableX11 [ libX11 libXext libXi libXrandr ] 48 ++ lib.optionals enableCurl [ curl openssl ] 49 + ++ lib.optionals enableGL ( 50 + if stdenv.isDarwin then 51 + with darwin.apple_sdk.frameworks; [ GLUT OpenGL ] 52 + else 53 + [ freeglut mesa_glu ]) 54 + ; 55 outputs = [ "bin" "dev" "out" "man" "doc" ]; 56 57 preConfigure = '' ··· 94 description = "Lightweight PDF, XPS, and E-book viewer and toolkit written in portable C"; 95 license = licenses.agpl3Plus; 96 maintainers = with maintainers; [ viric vrthra fpletz ]; 97 + platforms = platforms.unix; 98 }; 99 }