tasknc: update (0.8 -> 2017-05-15), fix, cleanup and man pages

This commit is contained in:
Silvan Mosberger 2018-02-02 10:23:29 +01:00
parent 65170e9404
commit b7b4f7bdbd
No known key found for this signature in database
GPG Key ID: 9424360B4B85C9E7

View File

@ -1,48 +1,42 @@
{ stdenv, fetchurl, taskwarrior, perl, ncurses }: { stdenv, fetchFromGitHub, makeWrapper, perl, ncurses, taskwarrior }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "0.8"; version = "2017-05-15";
name = "tasknc-${version}"; name = "tasknc-${version}";
src = fetchurl { src = fetchFromGitHub {
url = "https://github.com/mjheagle8/tasknc/archive/v${version}.tar.gz"; owner = "lharding";
sha256 = "0max5schga9hmf3vfqk2ic91dr6raxglyyjcqchzla280kxn5c28"; repo = "tasknc";
rev = "c41d0240e9b848e432f01de735f28de93b934ae7";
sha256 = "0f7l7fy06p33vw6f6sjnjxfhw951664pmwhjl573jvmh6gi2h1yr";
}; };
nativeBuildInputs = [
makeWrapper
perl # For generating the man pages with pod2man
];
buildInputs = [ ncurses ];
hardeningDisable = [ "format" ]; hardeningDisable = [ "format" ];
# buildFlags = [ "VERSION=${version}" ];
# I know this is ugly, but the Makefile does strange things in this package,
# so we have to:
#
# 1. Remove the "doc" task dependency from the "all" target
# 2. Remove the "tasknc.1" task dependency from the "install" target
# 3. Remove the installing of the tasknc.1 file from the install target as
# we just removed the build target for it.
#
# TODO : One could also provide a patch for the doc/manual.pod file so it
# actually builds, but I'm not familiar with this, so this is the faster
# approach for me. We have no manpage, though.
#
preConfigure = ''
sed -i -r 's,(all)(.*)doc,\1\2,' Makefile
sed -i -r 's,(install)(.*)tasknc\.1,\1\2,' Makefile
sed -i -r 's,install\ -D\ -m644\ tasknc\.1\ (.*),,' Makefile
'';
installPhase = '' installPhase = ''
mkdir $out/bin/ -p mkdir -p $out/bin/
mkdir $out/share/man1 -p mkdir -p $out/share/man/man1
mkdir $out/share/tasknc -p mkdir -p $out/share/tasknc
DESTDIR=$out PREFIX= MANPREFIX=share make install
DESTDIR=$out PREFIX= MANPREFIX=/share/man make install
wrapProgram $out/bin/tasknc --prefix PATH : ${taskwarrior}/bin
''; '';
buildInputs = [ taskwarrior perl ncurses ];
meta = { meta = with stdenv.lib; {
homepage = https://github.com/mjheagle8/tasknc; homepage = https://github.com/lharding/tasknc;
description = "A ncurses wrapper around taskwarrior"; description = "A ncurses wrapper around taskwarrior";
maintainers = [ stdenv.lib.maintainers.matthiasbeyer ]; maintainers = with maintainers; [ matthiasbeyer infinisil ];
platforms = stdenv.lib.platforms.linux; # Cannot test others platforms = platforms.linux; # Cannot test others
}; };
} }