2021-02-05 17:12:51 +00:00
|
|
|
{ config, lib, stdenv, fetchurl, pkg-config, libtool
|
2020-04-24 23:36:52 +00:00
|
|
|
, zip, libffi, libsigsegv, readline, gmp
|
2021-03-19 17:17:44 +00:00
|
|
|
, gnutls, gtk2, cairo, SDL, sqlite
|
2020-04-24 23:36:52 +00:00
|
|
|
, emacsSupport ? config.emacsSupport or 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.
|
|
|
|
# Using the vanilla libsigsegv library results in error: "cannot relocate [...]"
|
|
|
|
# Adding --enable-static=libsigsegv to the gnu-smalltalk configuration flags
|
|
|
|
# does not help, the error still occurs. The only solution is to build a
|
|
|
|
# shared version of libsigsegv.
|
2021-02-05 17:12:51 +00:00
|
|
|
libsigsegv-shared = lib.overrideDerivation libsigsegv (oldAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [ "--enable-shared" ];
|
|
|
|
});
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
version = "3.2.5";
|
|
|
|
pname = "gnu-smalltalk";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnu/smalltalk/smalltalk-${version}.tar.xz";
|
|
|
|
sha256 = "1k2ssrapfzhngc7bg1zrnd9n2vyxp9c9m70byvsma6wapbvib6l1";
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
patches = [
|
|
|
|
# The awk script incorrectly parsed `glib/glib.h` and was trying to find `glib/gwin32.h`,
|
|
|
|
# that isn't included since we're building only for linux.
|
|
|
|
./0000-fix_mkorder.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# The dependencies and their justification are explained at
|
|
|
|
# http://smalltalk.gnu.org/download
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
2021-03-19 17:17:44 +00:00
|
|
|
libtool zip libffi libsigsegv-shared readline gmp gnutls gtk2
|
2020-04-24 23:36:52 +00:00
|
|
|
cairo SDL sqlite
|
|
|
|
]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional emacsSupport emacs;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
configureFlags = lib.optional (!emacsSupport) "--without-emacs";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
installFlags = lib.optional emacsSupport "lispdir=$(out)/share/emacs/site-lisp";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# For some reason the tests fail if executated with nix-build, but pass if
|
|
|
|
# executed within nix-shell --pure.
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Free implementation of the Smalltalk-80 language";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
|
|
|
GNU Smalltalk is a free implementation of the Smalltalk-80 language. It
|
|
|
|
runs on most POSIX compatible operating systems (including GNU/Linux, of
|
|
|
|
course), as well as under Windows. Smalltalk is a dynamic object-oriented
|
|
|
|
language, well-versed to scripting tasks.
|
|
|
|
'';
|
|
|
|
homepage = "http://smalltalk.gnu.org/";
|
|
|
|
license = with licenses; [ gpl2 lgpl2 ];
|
|
|
|
platforms = platforms.linux;
|
2023-11-16 04:20:00 +00:00
|
|
|
maintainers = with maintainers; [ AndersonTorres ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|