From d279bf976744ba6a48144909a7214ddaef6c9cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sun, 12 Sep 2021 15:11:49 +0200 Subject: [PATCH] taskopen: modernize --- pkgs/applications/misc/taskopen/default.nix | 29 +++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/misc/taskopen/default.nix b/pkgs/applications/misc/taskopen/default.nix index 91790359af4..88050d2f449 100644 --- a/pkgs/applications/misc/taskopen/default.nix +++ b/pkgs/applications/misc/taskopen/default.nix @@ -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 ]; }; }