]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Add foopgp packages
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Tue, 28 Jun 2022 21:05:23 +0000 (23:05 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 9 Apr 2023 15:16:23 +0000 (17:16 +0200)
pkgs/bash-libs/default.nix [new file with mode: 0644]
pkgs/default.nix
pkgs/pgpid/default.nix [new file with mode: 0644]

diff --git a/pkgs/bash-libs/default.nix b/pkgs/bash-libs/default.nix
new file mode 100644 (file)
index 0000000..991c9d2
--- /dev/null
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, makeWrapper, shellcheck, bashInteractive, coreutils, gnugrep, gawk, file, aspell, util-linux, gnused }:
+stdenv.mkDerivation {
+  pname = "bash-libs";
+  version = "master";
+  src = fetchFromGitHub {
+    owner = "foopgp";
+    repo = "bash-libs";
+    rev = "4bf7fe3a488f55beecc74b76e0daf24244bd824f";
+    sha256 = "sha256-8AHUXPd1dQpo1Ce9MT4++eFhJT3X8SYtgaIKbPFUYjM=";
+  };
+
+  buildInputs = [ shellcheck makeWrapper bashInteractive ];
+  phases = [ "checkPhase" "installPhase" ];
+  checkPhase = ''
+    shellcheck bin/*
+  '';
+  installPhase = 
+  let binPath = lib.makeBinPath [
+    coreutils file aspell util-linux gnused gnugrep gawk
+  ];
+  in ''
+    mkdir -p $out/bin $out/nix-support $out/share/doc/bash-libs $out/share/bash-libs/include
+
+    for i in $src/bin/*; do
+      name=$(basename $i)
+      cp "$i" $out/share/bash-libs/include
+      patchShebangs $out/share/bash-libs/include/$name
+      makeWrapper $out/share/bash-libs/include/$name $out/bin/$name --set PATH ${binPath}
+    done
+    echo "${binPath}" > $out/nix-support/propagated-build-inputs
+    cp $src/man/* $out/share/doc/bash-libs
+  '';
+}
index 006460a41891f19ead08396847e4d1233cb661d9..6f817d9078727acc2357798f8be8837ccba5ac8b 100644 (file)
@@ -6,6 +6,7 @@ in
 rec {
   sources = import ../nix/sources.nix;
   myEnvironments = callPackage ../environments {};
 rec {
   sources = import ../nix/sources.nix;
   myEnvironments = callPackage ../environments {};
+  bash-libs = callPackage ./bash-libs {};
   boinctui = callPackage ./boinctui {};
   cnagios = callPackage ./cnagios { inherit mylibs; };
   commento = callPackage ./commento {};
   boinctui = callPackage ./boinctui {};
   cnagios = callPackage ./cnagios { inherit mylibs; };
   commento = callPackage ./commento {};
@@ -23,6 +24,7 @@ rec {
   notmuch-python2 = callPackage ./notmuch/notmuch-python { pythonPackages = python2Packages; };
   notmuch-python3 = callPackage ./notmuch/notmuch-python { pythonPackages = python38Packages; };
   notmuch-vim = callPackage ./notmuch/notmuch-vim {};
   notmuch-python2 = callPackage ./notmuch/notmuch-python { pythonPackages = python2Packages; };
   notmuch-python3 = callPackage ./notmuch/notmuch-python { pythonPackages = python38Packages; };
   notmuch-vim = callPackage ./notmuch/notmuch-vim {};
+  pgpid = callPackage ./pgpid {};
   predixy = callPackage ./predixy { inherit mylibs; };
   rrsync_sudo = callPackage ./rrsync_sudo {};
   signaldctl = callPackage ./signaldctl {};
   predixy = callPackage ./predixy { inherit mylibs; };
   rrsync_sudo = callPackage ./rrsync_sudo {};
   signaldctl = callPackage ./signaldctl {};
diff --git a/pkgs/pgpid/default.nix b/pkgs/pgpid/default.nix
new file mode 100644 (file)
index 0000000..a1fb9c2
--- /dev/null
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, makeWrapper, bashInteractive, bash-libs, coreutils, file, gnugrep, texlive, pandoc, aspell, util-linux, findutils, gnused, gnupg, gawk, facedetect, graphicsmagick, qrencode, tesseract4, zbar, cups, vim }:
+stdenv.mkDerivation {
+  pname = "pgpid";
+  version = "master";
+  src = fetchFromGitHub {
+    owner = "foopgp";
+    repo = "pgpid";
+    rev = "26c2137951775652e9e774977639ecaea5845cf7";
+    sha256 = "sha256-noXDYWWxUryFnV99pyl0eV7hJLUkSy97Vqylx5dKN9g=";
+  };
+
+  buildInputs = [ makeWrapper ];
+  phases = [ "installPhase" ];
+  installPhase = ''
+    mkdir -p $out/bin $out/share/pgpid $out/share/doc/pgpid
+
+    cp $src/pgpid-gen $src/pgpid-qrscan $out/bin
+    cp -r $src/doc $out/share/doc/pgpid
+    cp -r $src/data $out/share/pgpid
+    cp -r $src/imgsamples $out/share/pgpid
+    for i in $out/bin/*; do
+      patchShebangs $i
+      sed -i -e "/^TESSDATADIR/d" -e "/^GEOLIST_CENTROID/d" $i
+      sed -i -e 's@"$(dirname "$BASH_SOURCE")"@${bash-libs}/share/bash-libs/include@' $i
+      wrapProgram $i --set PATH ${lib.makeBinPath [
+        facedetect graphicsmagick qrencode tesseract4 zbar cups gnugrep vim gnupg findutils
+        pandoc (texlive.combine { scheme-small = texlive.scheme-small; pdfcrop = texlive.pdfcrop; })
+      ]}:$(cat ${bash-libs}/nix-support/propagated-build-inputs) \
+        --set TESSDATADIR $out/share/pgpid/data \
+        --set GEOLIST_CENTROID $out/share/pgpid/data/geolist_centroid.txt
+    done
+  '';
+}