1{ stdenv, fetchurl, pkgconfig, libtool, zip, libffi, libsigsegv, readline, gmp, 2gnutls, gnome, cairo, SDL, sqlite, emacsSupport ? false, emacs ? null }: 3 4assert emacsSupport -> (emacs != null); 5 6let # The gnu-smalltalk project has a dependency to the libsigsegv library. 7 # The project ships with sources for this library, but deprecated this option. 8 # Using the vanilla libsigsegv library results in error: "cannot relocate [...]" 9 # Adding --enable-static=libsigsegv to the gnu-smalltalk configuration flags 10 # does not help, the error still occurs. The only solution is to build a 11 # shared version of libsigsegv. 12 libsigsegv-shared = stdenv.lib.overrideDerivation libsigsegv (oldAttrs: { 13 configureFlags = [ "--enable-shared" ]; 14 }); 15 16in stdenv.mkDerivation rec { 17 18 version = "3.2.5"; 19 name = "gnu-smalltalk-${version}"; 20 21 src = fetchurl { 22 url = "mirror://gnu/smalltalk/smalltalk-${version}.tar.xz"; 23 sha256 = "1k2ssrapfzhngc7bg1zrnd9n2vyxp9c9m70byvsma6wapbvib6l1"; 24 }; 25 26 # The dependencies and their justification are explained at 27 # http://smalltalk.gnu.org/download 28 buildInputs = [ 29 pkgconfig libtool zip libffi libsigsegv-shared readline gmp gnutls gnome.gtk 30 cairo SDL sqlite 31 ] 32 ++ stdenv.lib.optional emacsSupport emacs; 33 34 configureFlags = stdenv.lib.optional (!emacsSupport) "--without-emacs"; 35 36 installFlags = stdenv.lib.optional emacsSupport "lispdir=$(out)/share/emacs/site-lisp"; 37 38 # For some reason the tests fail if executated with nix-build, but pass if 39 # executed within nix-shell --pure. 40 doCheck = false; 41 42 meta = with stdenv.lib; { 43 description = "A free implementation of the Smalltalk-80 language"; 44 longDescription = '' 45 GNU Smalltalk is a free implementation of the Smalltalk-80 language. It 46 runs on most POSIX compatible operating systems (including GNU/Linux, of 47 course), as well as under Windows. Smalltalk is a dynamic object-oriented 48 language, well-versed to scripting tasks. 49 ''; 50 homepage = http://smalltalk.gnu.org/; 51 license = with licenses; [ gpl2 lgpl2 ]; 52 platforms = platforms.linux; 53 maintainers = with maintainers; [ skeidel ]; 54 }; 55}