From c958486eea989e47b5e0b2a4e674c5f185e12f74 Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Wed, 1 Apr 2015 13:51:56 +0200 Subject: [PATCH] gnu-smalltalk: optional emacs support --- pkgs/development/compilers/gnu-smalltalk/default.nix | 11 ++++++++--- pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/gnu-smalltalk/default.nix b/pkgs/development/compilers/gnu-smalltalk/default.nix index f001de2700da..5d9ca621648b 100644 --- a/pkgs/development/compilers/gnu-smalltalk/default.nix +++ b/pkgs/development/compilers/gnu-smalltalk/default.nix @@ -1,5 +1,7 @@ { stdenv, fetchurl, pkgconfig, libtool, zip, libffi, libsigsegv, readline, gmp, -gnutls, gnome, cairo, SDL, sqlite }: +gnutls, gnome, cairo, SDL, sqlite, emacsSupport ? false, emacs ? null }: + +assert emacsSupport -> (emacs != null); let # The gnu-smalltalk project has a dependency to the libsigsegv library. # The project ships with sources for this library, but deprecated this option. @@ -26,9 +28,12 @@ in stdenv.mkDerivation rec { buildInputs = [ pkgconfig libtool zip libffi libsigsegv-shared readline gmp gnutls gnome.gtk cairo SDL sqlite - ]; + ] + ++ stdenv.lib.optional emacsSupport emacs; - configureFlags = [ "--without-emacs" ]; + configureFlags = stdenv.lib.optional (!emacsSupport) "--without-emacs"; + + installFlags = stdenv.lib.optional emacsSupport "lispdir=$(out)/share/emacs/site-lisp"; # For some reason the tests fail if executated with nix-build, but pass if # executed within nix-shell --pure. diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b8daf0f6ec30..4eb921b84429 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3574,7 +3574,9 @@ let inherit fetchurl stdenv; }); - gnu-smalltalk = callPackage ../development/compilers/gnu-smalltalk { }; + gnu-smalltalk = callPackage ../development/compilers/gnu-smalltalk { + emacsSupport = config.emacsSupport or false; + }; gccgo = gccgo48;