2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, ncurses, libiconv }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "stfl";
|
|
|
|
version = "0.24";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-12-06 16:07:01 +00:00
|
|
|
url = "http://www.clifford.at/stfl/stfl-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "1460d5lc780p3q38l3wc9jfr2a7zlyrcra0li65aynj738cam9yl";
|
|
|
|
};
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ ncurses libiconv ];
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
preBuild = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i s/gcc/cc/g Makefile
|
|
|
|
sed -i s%ncursesw/ncurses.h%ncurses.h% stfl_internals.h
|
2022-01-13 20:06:32 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i s/-soname/-install_name/ Makefile
|
2023-02-16 17:41:37 +00:00
|
|
|
''
|
|
|
|
# upstream builds shared library unconditionally. Also, it has no
|
|
|
|
# support for cross-compilation.
|
|
|
|
+ lib.optionalString stdenv.hostPlatform.isStatic ''
|
|
|
|
sed -i 's/all:.*/all: libstfl.a stfl.pc/' Makefile
|
|
|
|
sed -i 's/\tar /\t${stdenv.cc.targetPrefix}ar /' Makefile
|
|
|
|
sed -i 's/\tranlib /\t${stdenv.cc.targetPrefix}ranlib /' Makefile
|
|
|
|
sed -i '/install -m 644 libstfl.so./d' Makefile
|
|
|
|
sed -i '/ln -fs libstfl.so./d' Makefile
|
|
|
|
'' ;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
DESTDIR=$out prefix=\"\" make install
|
2023-02-16 17:41:37 +00:00
|
|
|
''
|
|
|
|
# some programs rely on libstfl.so.0 to be present, so link it
|
|
|
|
+ lib.optionalString (!stdenv.hostPlatform.isStatic) ''
|
2020-04-24 23:36:52 +00:00
|
|
|
ln -s $out/lib/libstfl.so.0.24 $out/lib/libstfl.so.0
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "http://www.clifford.at/stfl/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A library which implements a curses-based widget set for text terminals";
|
2021-02-05 17:12:51 +00:00
|
|
|
maintainers = with lib.maintainers; [ lovek323 ];
|
2021-12-06 16:07:01 +00:00
|
|
|
license = lib.licenses.lgpl3;
|
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|