From 5a184be96f87d647f4261d83f32d08ae2f1a7403 Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Tue, 22 Nov 2016 21:08:19 +0100 Subject: [PATCH] imlib2: add version without X11 --- pkgs/development/libraries/imlib2/default.nix | 18 ++++++++++++------ pkgs/top-level/all-packages.nix | 3 +++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/imlib2/default.nix b/pkgs/development/libraries/imlib2/default.nix index 85e9979ebb07..5181ff886166 100644 --- a/pkgs/development/libraries/imlib2/default.nix +++ b/pkgs/development/libraries/imlib2/default.nix @@ -1,4 +1,8 @@ -{ stdenv, fetchurl, xlibsWrapper, libjpeg, libtiff, giflib, libpng, bzip2, pkgconfig }: +{ stdenv, fetchurl, libjpeg, libtiff, giflib, libpng, bzip2, pkgconfig +, freetype +, x11Support ? true, xlibsWrapper ? null }: + +with stdenv.lib; stdenv.mkDerivation rec { name = "imlib2-1.4.9"; @@ -8,7 +12,8 @@ stdenv.mkDerivation rec { sha256 = "08809xxk2555yj6glixzw9a0x3x8cx55imd89kj3r0h152bn8a3x"; }; - buildInputs = [ xlibsWrapper libjpeg libtiff giflib libpng bzip2 ]; + buildInputs = [ libjpeg libtiff giflib libpng bzip2 freetype ] + ++ optional x11Support xlibsWrapper; nativeBuildInputs = [ pkgconfig ]; @@ -21,7 +26,8 @@ stdenv.mkDerivation rec { # Do not build amd64 assembly code on Darwin, because it fails to compile # with unknow directive errors - configureFlags = if stdenv.isDarwin then [ "--enable-amd64=no" ] else null; + configureFlags = optional stdenv.isDarwin "--enable-amd64=no" + ++ optional (!x11Support) "--without-x"; meta = { description = "Image manipulation library"; @@ -34,8 +40,8 @@ stdenv.mkDerivation rec { easily, without sacrificing speed. ''; - license = stdenv.lib.licenses.free; - platforms = stdenv.lib.platforms.unix; - maintainers = with stdenv.lib.maintainers; [ spwhitt ]; + license = licenses.free; + platforms = platforms.unix; + maintainers = with maintainers; [ spwhitt ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ecb48fd70887..3c7e2ccdc096 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7452,6 +7452,9 @@ in iml = callPackage ../development/libraries/iml { }; imlib2 = callPackage ../development/libraries/imlib2 { }; + imlib2-nox = imlib2.override { + x11Support = false; + }; imlibsetroot = callPackage ../applications/graphics/imlibsetroot { libXinerama = xorg.libXinerama; } ;