2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
2021-01-02 19:39:37 +00:00
|
|
|
, libiconv
|
|
|
|
, libpng
|
|
|
|
, ncurses
|
|
|
|
, pcre
|
|
|
|
, readline
|
|
|
|
, zlib
|
|
|
|
}:
|
2005-12-25 14:02:09 +00:00
|
|
|
|
2014-09-21 19:26:28 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2021-01-02 19:39:37 +00:00
|
|
|
pname = "slang";
|
|
|
|
version = "2.3.2";
|
|
|
|
|
2005-12-25 14:02:09 +00:00
|
|
|
src = fetchurl {
|
2021-01-02 19:39:37 +00:00
|
|
|
url = "https://www.jedsoft.org/releases/slang/${pname}-${version}.tar.bz2";
|
|
|
|
sha256 = "sha256-/J47D8T2fDwfbUPJDBalxC0Re44oRXxbRoMbi1064xo=";
|
2005-12-25 14:02:09 +00:00
|
|
|
};
|
2014-09-22 19:17:33 +01:00
|
|
|
|
2017-07-11 10:14:14 +01:00
|
|
|
outputs = [ "out" "dev" "man" "doc" ];
|
2015-10-06 10:52:25 +01:00
|
|
|
|
2018-11-24 00:00:46 +00:00
|
|
|
patches = [ ./terminfo-dirs.patch ];
|
|
|
|
|
2009-09-16 18:52:54 +01:00
|
|
|
# Fix some wrong hardcoded paths
|
2009-09-16 18:08:33 +01:00
|
|
|
preConfigure = ''
|
2021-01-02 19:39:37 +00:00
|
|
|
sed -ie "s|/usr/lib/terminfo|${ncurses.out}/lib/terminfo|" configure
|
|
|
|
sed -ie "s|/usr/lib/terminfo|${ncurses.out}/lib/terminfo|" src/sltermin.c
|
|
|
|
sed -ie "s|/bin/ln|ln|" src/Makefile.in
|
|
|
|
sed -ie "s|-ltermcap|-lncurses|" ./configure
|
2009-09-16 18:08:33 +01:00
|
|
|
'';
|
2018-05-10 06:25:31 +01:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-pcre=${pcre.dev}"
|
2021-01-02 19:39:37 +00:00
|
|
|
"--with-png=${libpng.dev}"
|
2018-05-10 06:25:31 +01:00
|
|
|
"--with-readline=${readline.dev}"
|
2021-01-02 19:39:37 +00:00
|
|
|
"--with-z=${zlib.dev}"
|
2018-05-10 06:25:31 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-01-02 19:39:37 +00:00
|
|
|
libpng
|
|
|
|
pcre
|
|
|
|
readline
|
|
|
|
zlib
|
2021-01-21 17:00:13 +00:00
|
|
|
] ++ lib.optionals (stdenv.isDarwin) [ libiconv ];
|
2018-05-10 06:25:31 +01:00
|
|
|
|
2015-10-06 10:52:25 +01:00
|
|
|
propagatedBuildInputs = [ ncurses ];
|
|
|
|
|
2022-04-30 20:48:47 +01:00
|
|
|
buildFlags = lib.optional stdenv.hostPlatform.isStatic "static";
|
|
|
|
installTargets = lib.optional stdenv.hostPlatform.isStatic "install-static";
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
makeFlagsArray+=(AR_CR="${stdenv.cc.targetPrefix}ar cr")
|
|
|
|
'';
|
|
|
|
|
2018-05-10 06:25:31 +01:00
|
|
|
# slang 2.3.2 does not support parallel building
|
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
2015-10-06 10:52:25 +01:00
|
|
|
postInstall = ''
|
|
|
|
find "$out"/lib/ -name '*.so' -exec chmod +x "{}" \;
|
|
|
|
sed '/^Libs:/s/$/ -lncurses/' -i "$dev"/lib/pkgconfig/slang.pc
|
|
|
|
'';
|
2014-09-21 19:26:28 +01:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2021-01-02 19:39:37 +00:00
|
|
|
description = "A small, embeddable multi-platform programming library";
|
|
|
|
longDescription = ''
|
|
|
|
S-Lang is an interpreted language that was designed from the start to be
|
|
|
|
easily embedded into a program to provide it with a powerful extension
|
|
|
|
language. Examples of programs that use S-Lang as an extension language
|
|
|
|
include the jed text editor and the slrn newsreader. Although S-Lang does
|
|
|
|
not exist as a separate application, it is distributed with a quite
|
|
|
|
capable program called slsh ("slang-shell") that embeds the interpreter
|
|
|
|
and allows one to execute S-Lang scripts, or simply experiment with S-Lang
|
|
|
|
at an interactive prompt. Many of the the examples in this document are
|
|
|
|
presented in the context of one of the above applications.
|
|
|
|
|
|
|
|
S-Lang is also a programmer's library that permits a programmer to develop
|
|
|
|
sophisticated platform-independent software. In addition to providing the
|
|
|
|
S-Lang interpreter, the library provides facilities for screen management,
|
|
|
|
keymaps, low-level terminal I/O, etc. However, this document is concerned
|
|
|
|
only with the extension language and does not address these other features
|
|
|
|
of the S-Lang library. For information about the other components of the
|
|
|
|
library, the reader is referred to the S-Lang Library C Programmer's
|
|
|
|
Guide.
|
|
|
|
'';
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.jedsoft.org/slang/";
|
2015-10-06 10:52:25 +01:00
|
|
|
license = licenses.gpl2Plus;
|
2021-01-02 19:39:37 +00:00
|
|
|
maintainers = with maintainers; [ AndersonTorres ];
|
2022-05-05 01:52:27 +01:00
|
|
|
mainProgram = "slsh";
|
2015-10-06 10:52:25 +01:00
|
|
|
platforms = platforms.unix;
|
2014-09-21 19:26:28 +01:00
|
|
|
};
|
2005-12-25 14:02:09 +00:00
|
|
|
}
|