]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add tiv program
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 20 Dec 2018 23:52:11 +0000 (00:52 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Thu, 20 Dec 2018 23:52:11 +0000 (00:52 +0100)
default.nix
hooks/tiv_builder.sh [new file with mode: 0644]

index b46403165988089d05ccdd8092c220ad7724bf6b..28767a9b2dea0225c2da423ea8be9b4789964128 100644 (file)
@@ -146,11 +146,30 @@ let
     };
   };
 
+  tiv = buildPerlPackage rec {
+    name = "tiv-${version}";
+    version = "2015";
+    src = fetchurl {
+      url = "http://xyne.archlinux.ca/projects/tiv/src/tiv-${version}.tar.xz";
+      sha256 = "1vq073v7z7vmcd57lhs4rf4jasji69cpjgkz4dykp94a77p1qq90";
+    };
+    outputs = ["out"];
+    buildInputs = [ perlPackages.PerlMagick ];
+    perlPreHookScript = ./hooks/tiv_builder.sh;
+    perlPreHook = ''
+      source ${perlPreHookScript}
+    '';
+    installPhase = ''
+      install -Dm755 tiv "$out/bin/tiv"
+    '';
+  };
+
 # https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh
 # https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks
 in
   {
     inherit nix-prefetch-scripts;
+    inherit nix-generate-from-cpan;
     inherit ledger;
     inherit taskwarrior vit timewarrior;
     inherit weboob;
@@ -173,5 +192,6 @@ in
     inherit weechat;
     inherit note terminal_velocity;
     inherit mtop;
+    inherit tiv;
     #inherit nixos;
   }
diff --git a/hooks/tiv_builder.sh b/hooks/tiv_builder.sh
new file mode 100644 (file)
index 0000000..ea16682
--- /dev/null
@@ -0,0 +1,8 @@
+orig=$(declare -f preConfigure)
+new_name="preConfigure2 ${orig#preConfigure}"
+eval "$new_name"
+
+preConfigure() {
+  preConfigure2 || true
+}
+