nixpkgs/pkgs/applications/misc/mepo/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

87 lines
1.9 KiB
Nix
Raw Normal View History

2022-01-13 09:00:46 +00:00
{ lib
, stdenv
, fetchFromSourcehut
, pkg-config
, zig
2022-03-24 11:45:59 +00:00
, makeWrapper
2022-10-15 12:15:47 +00:00
, busybox
2022-01-13 09:00:46 +00:00
, curl
, SDL2
2022-01-31 07:43:17 +00:00
, SDL2_gfx
2022-01-13 09:00:46 +00:00
, SDL2_image
, SDL2_ttf
2022-10-15 12:15:47 +00:00
, findutils
2022-03-24 11:45:59 +00:00
, jq
, ncurses
2022-10-15 12:15:47 +00:00
, gnome
, xorg
, util-linux
, gpsd
, geoclue2-with-demo-agent
2022-01-13 09:00:46 +00:00
}:
2022-10-15 12:15:47 +00:00
stdenv.mkDerivation rec {
2022-01-13 09:00:46 +00:00
pname = "mepo";
2022-10-15 12:15:47 +00:00
version = "1.1";
2022-01-13 09:00:46 +00:00
src = fetchFromSourcehut {
owner = "~mil";
repo = pname;
rev = version;
2022-10-15 12:15:47 +00:00
hash = "sha256-OIZ617QLjiTiDwcsn0DnRussYtjDkVyifr2mdSqA98A=";
2022-01-13 09:00:46 +00:00
};
2022-03-24 11:45:59 +00:00
nativeBuildInputs = [ pkg-config zig makeWrapper ];
2022-01-13 09:00:46 +00:00
2022-03-24 11:45:59 +00:00
buildInputs = [
2022-10-15 12:15:47 +00:00
curl SDL2 SDL2_gfx SDL2_image SDL2_ttf jq ncurses
];
2022-01-13 09:00:46 +00:00
2022-01-31 07:43:17 +00:00
preBuild = ''
2022-01-13 09:00:46 +00:00
export HOME=$TMPDIR
'';
doCheck = true;
checkPhase = ''
runHook preCheck
zig build test
runHook postCheck
'';
installPhase = ''
runHook preInstall
2022-01-31 07:43:17 +00:00
zig build -Drelease-safe=true -Dcpu=baseline --prefix $out install
2022-10-15 12:15:47 +00:00
install -d $out/share/man/man1
$out/bin/mepo -docman > $out/share/man/man1/mepo.1
2022-01-13 09:00:46 +00:00
runHook postInstall
'';
2022-03-24 11:45:59 +00:00
postInstall = ''
2022-10-15 12:15:47 +00:00
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 ])}
2022-03-24 11:45:59 +00:00
done
'';
2022-01-13 09:00:46 +00:00
meta = with lib; {
description = "Fast, simple, and hackable OSM map viewer";
2022-10-15 12:15:47 +00:00
longDescription = ''
It is recommended to use the corresponding NixOS module.
'';
homepage = "https://mepo.milesalan.com";
2022-01-13 09:00:46 +00:00
license = licenses.gpl3Plus;
2022-10-15 12:15:47 +00:00
maintainers = with maintainers; [ sikmir McSinyx laalsaas ];
2022-03-24 11:45:59 +00:00
platforms = platforms.linux;
2022-01-13 09:00:46 +00:00
};
}