depot/third_party/nixpkgs/pkgs/development/libraries/newt/default.nix
Default email ae91cbe6cc Project import generated by Copybara.
GitOrigin-RevId: 536fe36e23ab0fc8b7f35c24603422eee9fc17a2
2021-02-05 18:12:51 +01:00

46 lines
1.3 KiB
Nix

{ lib, fetchurl, stdenv, slang, popt, python }:
let
pythonIncludePath = "${lib.getDev python}/include/python";
in
stdenv.mkDerivation rec {
pname = "newt";
version = "0.52.21";
src = fetchurl {
url = "https://fedorahosted.org/releases/n/e/${pname}/${pname}-${version}.tar.gz";
sha256 = "0cdvbancr7y4nrj8257y5n45hmhizr8isynagy4fpsnpammv8pi6";
};
patchPhase = ''
sed -i -e s,/usr/bin/install,install, -e s,-I/usr/include/slang,, Makefile.in po/Makefile
substituteInPlace configure \
--replace "/usr/include/python" "${pythonIncludePath}"
substituteInPlace configure.ac \
--replace "/usr/include/python" "${pythonIncludePath}"
'';
buildInputs = [ slang popt python ];
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
'';
makeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];
meta = with lib; {
homepage = "https://fedorahosted.org/newt/";
description = "Library for color text mode, widget based user interfaces";
license = licenses.lgpl2;
platforms = platforms.linux;
maintainers = [ maintainers.viric ];
};
}