about summary refs log tree commit diff
path: root/pkgs/applications/misc/mepo
diff options
context:
space:
mode:
authorlaalsaas <laalsaas@systemli.org>2022-10-15 14:15:47 +0200
committerlaalsaas <laalsaas@systemli.org>2022-11-07 20:26:59 +0100
commite6b77730725277ce96284c715ac26d0c10215876 (patch)
tree410fe1e51eddc7f78e3c4a950ff1493d630016e4 /pkgs/applications/misc/mepo
parent0b57dfbdd6dc70f6374f80bdf19a40f19cfd83ad (diff)
mepo: 0.4.2 -> 1.1
Diffstat (limited to 'pkgs/applications/misc/mepo')
-rw-r--r--pkgs/applications/misc/mepo/default.nix53
1 files changed, 28 insertions, 25 deletions
diff --git a/pkgs/applications/misc/mepo/default.nix b/pkgs/applications/misc/mepo/default.nix
index 1afcd3c3f1a76..5a7640c2414f6 100644
--- a/pkgs/applications/misc/mepo/default.nix
+++ b/pkgs/applications/misc/mepo/default.nix
@@ -4,38 +4,38 @@
 , pkg-config
 , zig
 , makeWrapper
+, busybox
 , curl
 , SDL2
 , SDL2_gfx
 , SDL2_image
 , SDL2_ttf
+, findutils
 , jq
 , ncurses
-, inconsolata-nerdfont
-, dmenu
-, xdotool
-, bemenu
-, withX11 ? false
+, gnome
+, xorg
+, util-linux
+, gpsd
+, geoclue2-with-demo-agent
 }:
 
-let
-  menuInputs = if withX11 then [ dmenu xdotool ] else [ bemenu ];
-in stdenv.mkDerivation rec {
+stdenv.mkDerivation rec {
   pname = "mepo";
-  version = "0.4.2";
+  version = "1.1";
 
   src = fetchFromSourcehut {
     owner = "~mil";
     repo = pname;
     rev = version;
-    hash = "sha256-k6YXaqB3EwbDPlTvijZf10q+IYwt4/MiqGXL495KIcY=";
+    hash = "sha256-OIZ617QLjiTiDwcsn0DnRussYtjDkVyifr2mdSqA98A=";
   };
 
   nativeBuildInputs = [ pkg-config zig makeWrapper ];
 
   buildInputs = [
-    curl SDL2 SDL2_gfx SDL2_image SDL2_ttf inconsolata-nerdfont jq ncurses
-  ] ++ menuInputs;
+    curl SDL2 SDL2_gfx SDL2_image SDL2_ttf jq ncurses
+  ];
 
   preBuild = ''
     export HOME=$TMPDIR
@@ -54,30 +54,33 @@ in stdenv.mkDerivation rec {
     runHook preInstall
 
     zig build -Drelease-safe=true -Dcpu=baseline --prefix $out install
+    install -d $out/share/man/man1
+    $out/bin/mepo -docman > $out/share/man/man1/mepo.1
 
     runHook postInstall
   '';
 
   postInstall = ''
-    wrapProgram $out/bin/mepo_dl.sh\
-      --suffix PATH : ${lib.makeBinPath [ jq ncurses ]}
-    wrapProgram $out/bin/mepo_ui_helper_menu.sh\
-      --suffix PATH : ${lib.makeBinPath menuInputs}
-    for script in $(grep -l jq out/bin/mepo_ui_menu_*.sh); do
-      wrapProgram $script --suffix PATH : $out/bin:${lib.makeBinPath [ jq ]}
-    done
-    for prog in $out/bin/mepo*; do
-      if [ ! -f $out/bin/.$(basename $prog)-wrapped ]; then
-        wrapProgram $prog --suffix PATH : $out/bin
-      fi
+    substituteInPlace $out/bin/mepo_ui_menu_user_pin_updater.sh \
+      --replace /usr/libexec/geoclue-2.0 ${geoclue2-with-demo-agent}/libexec/geoclue-2.0
+    substituteInPlace $out/bin/mepo_ui_central_menu.sh \
+      --replace "grep mepo_" "grep '^\.mepo_\|^mepo_'" \
+      --replace " ls " " ls -a " #circumvent wrapping for script detection
+    for program in $out/bin/* ; do
+      wrapProgram $program \
+        --suffix PATH : $out/bin:${lib.makeBinPath ([ jq ncurses curl busybox findutils util-linux gpsd gnome.zenity xorg.xwininfo ])}
     done
   '';
 
   meta = with lib; {
     description = "Fast, simple, and hackable OSM map viewer";
-    homepage = "https://sr.ht/~mil/mepo/";
+    longDescription = ''
+      It is recommended to use the corresponding NixOS module.
+    '';
+
+    homepage = "https://mepo.milesalan.com";
     license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ sikmir McSinyx ];
+    maintainers = with maintainers; [ sikmir McSinyx laalsaas ];
     platforms = platforms.linux;
   };
 }