taskopen: modernize

This commit is contained in:
Sandro Jäckel 2021-09-12 15:11:49 +02:00
parent 5da2746c8d
commit d279bf9767
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5

View file

@ -1,20 +1,27 @@
{ fetchurl, lib, stdenv, makeWrapper, which, perl, perlPackages }:
{ lib, stdenv, fetchFromGitHub, makeWrapper, which, perl, perlPackages }:
stdenv.mkDerivation {
name = "taskopen-1.1.5";
src = fetchurl {
url = "https://github.com/ValiValpas/taskopen/archive/v1.1.5.tar.gz";
sha256 = "sha256-7fncdt1wCJ4zNLrCf93yRFD8Q4XQ3DCJ1+zJg9Gcl3w=";
stdenv.mkDerivation rec {
pname = "taskopen";
version = "1.1.5";
src = fetchFromGitHub {
owner = "ValiValpas";
repo = "taskopen";
rev = "v${version}";
sha256 = "sha256-/xf7Ph2KKiZ5lgLKk95nCgw/z9wIBmuWf3QGaNebgHg=";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ which perl ] ++ (with perlPackages; [ JSON ]);
installPhase = ''
postPatch = ''
# We don't need a DESTDIR and an empty string results in an absolute path
# (due to the trailing slash) which breaks the build.
sed 's|$(DESTDIR)/||' -i Makefile
'';
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ which ]
++ (with perlPackages; [ JSON perl ]);
installPhase = ''
make PREFIX=$out
make PREFIX=$out install
'';
@ -28,7 +35,7 @@ stdenv.mkDerivation {
description = "Script for taking notes and open urls with taskwarrior";
homepage = "https://github.com/ValiValpas/taskopen";
platforms = platforms.linux;
license = lib.licenses.free ;
license = licenses.free;
maintainers = [ maintainers.winpat ];
};
}