2020-11-03 02:18:15 +00:00
|
|
|
{ lib, fetchurl, stdenv, slang, popt, python }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
let
|
|
|
|
pythonIncludePath = "${lib.getDev python}/include/python";
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "newt";
|
2023-02-16 17:41:37 +00:00
|
|
|
version = "0.52.23";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-10-17 02:12:59 +00:00
|
|
|
url = "https://releases.pagure.org/${pname}/${pname}-${version}.tar.gz";
|
2023-02-16 17:41:37 +00:00
|
|
|
sha256 = "sha256-yqNykHsU7Oz+KY8NUSpi9B0zspBhAkSliu0Hu8WtoSo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postPatch = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i -e s,/usr/bin/install,install, -e s,-I/usr/include/slang,, Makefile.in po/Makefile
|
2020-11-03 02:18:15 +00:00
|
|
|
|
|
|
|
substituteInPlace configure \
|
|
|
|
--replace "/usr/include/python" "${pythonIncludePath}"
|
|
|
|
substituteInPlace configure.ac \
|
|
|
|
--replace "/usr/include/python" "${pythonIncludePath}"
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
substituteInPlace Makefile.in \
|
|
|
|
--replace "ar rv" "${stdenv.cc.targetPrefix}ar rv"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [ python ];
|
|
|
|
buildInputs = [ slang popt ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
NIX_LDFLAGS = "-lncurses";
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# If CPP is set explicitly, configure and make will not agree about which
|
|
|
|
# programs to use at different stages.
|
|
|
|
unset CPP
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
makeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
2020-04-24 23:36:52 +00:00
|
|
|
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-10-17 02:12:59 +00:00
|
|
|
homepage = "https://pagure.io/newt";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Library for color text mode, widget based user interfaces";
|
|
|
|
|
|
|
|
license = licenses.lgpl2;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.viric ];
|
|
|
|
};
|
|
|
|
}
|