diff options
author | Jakub Janczak <kubek2k@gmail.com> | 2021-04-06 10:21:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-06 10:21:52 +0200 |
commit | 38e880950a4c1dda5e7147beeda73eb0e3d1d575 (patch) | |
tree | 1dd89e6aff26567b85e33d1467c84e27bfab76ea /pkgs/applications/misc/mupdf | |
parent | 75bef0868bf90282542365d17dd54848272fcea6 (diff) |
mupdf: fixing x11 and gl disabling (#116295)
Diffstat (limited to 'pkgs/applications/misc/mupdf')
-rw-r--r-- | pkgs/applications/misc/mupdf/default.nix | 56 |
1 files changed, 39 insertions, 17 deletions
diff --git a/pkgs/applications/misc/mupdf/default.nix b/pkgs/applications/misc/mupdf/default.nix index 333e3cd93157a..21c699da3face 100644 --- a/pkgs/applications/misc/mupdf/default.nix +++ b/pkgs/applications/misc/mupdf/default.nix @@ -1,11 +1,27 @@ -{ stdenv, lib, fetchurl, fetchpatch, pkg-config, freetype, harfbuzz, openjpeg -, jbig2dec, libjpeg , darwin +{ stdenv +, lib +, fetchurl +, fetchpatch +, pkg-config +, freetype +, harfbuzz +, openjpeg +, jbig2dec +, libjpeg +, darwin , gumbo -, enableX11 ? true, libX11, libXext, libXi, libXrandr -, enableCurl ? true, curl, openssl -, enableGL ? true, freeglut, libGLU +, enableX11 ? true +, libX11 +, libXext +, libXi +, libXrandr +, enableCurl ? true +, curl +, openssl +, enableGL ? true +, freeglut +, libGLU }: - let # OpenJPEG version is hardcoded in package source @@ -13,7 +29,8 @@ let lib.versions.majorMinor (lib.getVersion openjpeg); -in stdenv.mkDerivation rec { +in +stdenv.mkDerivation rec { version = "1.18.0"; pname = "mupdf"; @@ -52,17 +69,21 @@ in stdenv.mkDerivation rec { # Use shared libraries to decrease size buildFlags = [ "shared" ]; - makeFlags = [ "prefix=$(out) USE_SYSTEM_LIBS=yes" ]; + makeFlags = [ "prefix=$(out)" "USE_SYSTEM_LIBS=yes" ] + ++ lib.optionals (!enableX11) [ "HAVE_X11=no" ] + ++ lib.optionals (!enableGL) [ "HAVE_GLUT=no" ]; + nativeBuildInputs = [ pkg-config ]; - buildInputs = [ freetype harfbuzz openjpeg jbig2dec libjpeg freeglut libGLU gumbo ] - ++ 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 libGLU ]) - ; + buildInputs = [ freetype harfbuzz openjpeg jbig2dec libjpeg gumbo ] + ++ 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 libGLU ] + ) + ; outputs = [ "bin" "dev" "out" "man" "doc" ]; preConfigure = '' @@ -85,6 +106,7 @@ in stdenv.mkDerivation rec { EOF moveToOutput "bin" "$bin" + '' + lib.optionalString enableX11 '' ln -s "$bin/bin/mupdf-x11" "$bin/bin/mupdf" mkdir -p $bin/share/applications cat > $bin/share/applications/mupdf.desktop <<EOF |