From 5b42ce1da780a024a8d78846ad1fa0ef408caa5d Mon Sep 17 00:00:00 2001 From: Robert Scott Date: Sat, 7 May 2022 13:02:26 +0100 Subject: [PATCH] imlib2: add explicit svg & heif support-disabling instead of just buildInput omission. darwin still fails to build with svg or heif support, but a change in one of the present dependencies may cause one of these libraries to be detected and the support accidentally enabled. --- pkgs/development/libraries/imlib2/default.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/imlib2/default.nix b/pkgs/development/libraries/imlib2/default.nix index a882a660833..26f904b49b0 100644 --- a/pkgs/development/libraries/imlib2/default.nix +++ b/pkgs/development/libraries/imlib2/default.nix @@ -5,6 +5,10 @@ , libid3tag, librsvg, libheif , freetype , bzip2, pkg-config , x11Support ? true, xlibsWrapper ? null +# Compilation error on Darwin with librsvg. For more information see: +# https://github.com/NixOS/nixpkgs/pull/166452#issuecomment-1090725613 +, svgSupport ? !stdenv.isDarwin +, heifSupport ? !stdenv.isDarwin }: let @@ -21,11 +25,10 @@ stdenv.mkDerivation rec { buildInputs = [ libjpeg libtiff giflib libpng libwebp - bzip2 freetype libid3tag libheif + bzip2 freetype libid3tag ] ++ optional x11Support xlibsWrapper - # Compilation error on Darwin with librsvg. For more information see: - # https://github.com/NixOS/nixpkgs/pull/166452#issuecomment-1090725613 - ++ optional (!stdenv.isDarwin) librsvg; + ++ optional heifSupport libheif + ++ optional svgSupport librsvg; nativeBuildInputs = [ pkg-config ]; @@ -34,6 +37,8 @@ stdenv.mkDerivation rec { # Do not build amd64 assembly code on Darwin, because it fails to compile # with unknow directive errors configureFlags = optional stdenv.isDarwin "--enable-amd64=no" + ++ optional (!svgSupport) "--without-svg" + ++ optional (!heifSupport) "--without-heif" ++ optional (!x11Support) "--without-x"; outputs = [ "bin" "out" "dev" ];