mepo: 0.4.2 -> 1.1

This commit is contained in:
laalsaas 2022-10-15 14:15:47 +02:00
parent 0b57dfbdd6
commit e6b7773072
2 changed files with 28 additions and 26 deletions

View file

@ -4,38 +4,38 @@
, pkg-config , pkg-config
, zig , zig
, makeWrapper , makeWrapper
, busybox
, curl , curl
, SDL2 , SDL2
, SDL2_gfx , SDL2_gfx
, SDL2_image , SDL2_image
, SDL2_ttf , SDL2_ttf
, findutils
, jq , jq
, ncurses , ncurses
, inconsolata-nerdfont , gnome
, dmenu , xorg
, xdotool , util-linux
, bemenu , gpsd
, withX11 ? false , geoclue2-with-demo-agent
}: }:
let stdenv.mkDerivation rec {
menuInputs = if withX11 then [ dmenu xdotool ] else [ bemenu ];
in stdenv.mkDerivation rec {
pname = "mepo"; pname = "mepo";
version = "0.4.2"; version = "1.1";
src = fetchFromSourcehut { src = fetchFromSourcehut {
owner = "~mil"; owner = "~mil";
repo = pname; repo = pname;
rev = version; rev = version;
hash = "sha256-k6YXaqB3EwbDPlTvijZf10q+IYwt4/MiqGXL495KIcY="; hash = "sha256-OIZ617QLjiTiDwcsn0DnRussYtjDkVyifr2mdSqA98A=";
}; };
nativeBuildInputs = [ pkg-config zig makeWrapper ]; nativeBuildInputs = [ pkg-config zig makeWrapper ];
buildInputs = [ buildInputs = [
curl SDL2 SDL2_gfx SDL2_image SDL2_ttf inconsolata-nerdfont jq ncurses curl SDL2 SDL2_gfx SDL2_image SDL2_ttf jq ncurses
] ++ menuInputs; ];
preBuild = '' preBuild = ''
export HOME=$TMPDIR export HOME=$TMPDIR
@ -54,30 +54,33 @@ in stdenv.mkDerivation rec {
runHook preInstall runHook preInstall
zig build -Drelease-safe=true -Dcpu=baseline --prefix $out install 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 runHook postInstall
''; '';
postInstall = '' postInstall = ''
wrapProgram $out/bin/mepo_dl.sh\ substituteInPlace $out/bin/mepo_ui_menu_user_pin_updater.sh \
--suffix PATH : ${lib.makeBinPath [ jq ncurses ]} --replace /usr/libexec/geoclue-2.0 ${geoclue2-with-demo-agent}/libexec/geoclue-2.0
wrapProgram $out/bin/mepo_ui_helper_menu.sh\ substituteInPlace $out/bin/mepo_ui_central_menu.sh \
--suffix PATH : ${lib.makeBinPath menuInputs} --replace "grep mepo_" "grep '^\.mepo_\|^mepo_'" \
for script in $(grep -l jq out/bin/mepo_ui_menu_*.sh); do --replace " ls " " ls -a " #circumvent wrapping for script detection
wrapProgram $script --suffix PATH : $out/bin:${lib.makeBinPath [ jq ]} for program in $out/bin/* ; do
done wrapProgram $program \
for prog in $out/bin/mepo*; do --suffix PATH : $out/bin:${lib.makeBinPath ([ jq ncurses curl busybox findutils util-linux gpsd gnome.zenity xorg.xwininfo ])}
if [ ! -f $out/bin/.$(basename $prog)-wrapped ]; then
wrapProgram $prog --suffix PATH : $out/bin
fi
done done
''; '';
meta = with lib; { meta = with lib; {
description = "Fast, simple, and hackable OSM map viewer"; 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; license = licenses.gpl3Plus;
maintainers = with maintainers; [ sikmir McSinyx ]; maintainers = with maintainers; [ sikmir McSinyx laalsaas ];
platforms = platforms.linux; platforms = platforms.linux;
}; };
} }

View file

@ -30240,7 +30240,6 @@ with pkgs;
merkaartor = libsForQt5.callPackage ../applications/misc/merkaartor { }; merkaartor = libsForQt5.callPackage ../applications/misc/merkaartor { };
mepo = callPackage ../applications/misc/mepo { }; mepo = callPackage ../applications/misc/mepo { };
mepo-x11 = callPackage ../applications/misc/mepo { withX11 = true; };
meshcentral = callPackage ../tools/admin/meshcentral { }; meshcentral = callPackage ../tools/admin/meshcentral { };