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";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "0.52.24";
|
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";
|
2024-01-02 11:29:13 +00:00
|
|
|
sha256 = "sha256-Xe1+Ih+F9kJSHEmxgmyN4ZhFqjcrr11jClF3S1RPvbs=";
|
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
|
|
|
|
'';
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
configureFlags = lib.optionals stdenv.hostPlatform.isDarwin [
|
2023-03-04 12:14:45 +00:00
|
|
|
"--disable-nls"
|
|
|
|
];
|
|
|
|
|
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}"
|
|
|
|
];
|
|
|
|
|
2024-09-26 11:04:55 +00:00
|
|
|
postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
2023-03-04 12:14:45 +00:00
|
|
|
install_name_tool -id $out/lib/libnewt.so.${version} $out/lib/libnewt.so.${version}
|
|
|
|
install_name_tool -change libnewt.so.${version} $out/lib/libnewt.so.${version} $out/bin/whiptail
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Library for color text mode, widget based user interfaces";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "whiptail";
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://pagure.io/newt";
|
|
|
|
changelog = "https://pagure.io/newt/blob/master/f/CHANGES";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.lgpl2;
|
2023-03-04 12:14:45 +00:00
|
|
|
platforms = platforms.unix;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|