commit 5c08af77486e2f60565b107c50a62dd1f8d424e4
parent 165a02d35bb2e18be29777ee11ba8d9c03dacf58
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date: Wed, 24 Nov 2021 23:57:31 +0300
Add mepo
Diffstat:
2 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -311,6 +311,17 @@ lib.makeScope newScope (
map-machine = callPackage ./osm/map-machine { };
map-stylizer = callPackage ./osm/map-stylizer { };
maperitive-bin = callPackage ./osm/maperitive/bin.nix { };
+ mepo = callPackage ./osm/mepo {
+ # See https://github.com/libsdl-org/SDL_ttf/issues/152
+ SDL2_ttf = pkgs.SDL2_ttf.overrideAttrs (old: {
+ src = pkgs.fetchFromGitHub {
+ owner = "libsdl-org";
+ repo = "SDL_ttf";
+ rev = "12013b24df59f11394c1761aad08700a4c5099be";
+ hash = "sha256-pOAlxdgfMDQiCER39hC4mDfHNhodouX/yCS+Y/dCA3Y=";
+ };
+ });
+ };
osm-area-tools = callPackage ./osm/osm-area-tools { };
osm-python-tools = callPackage ./osm/osm-python-tools { };
osmcoastline = callPackage ./osm/osmcoastline { };
diff --git a/pkgs/osm/mepo/default.nix b/pkgs/osm/mepo/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchFromSourcehut, pkg-config, zig
+, curl, SDL2, SDL2_image, SDL2_ttf
+}:
+
+stdenv.mkDerivation rec {
+ pname = "mepo";
+ version = "2021-11-22";
+
+ src = fetchFromSourcehut {
+ owner = "~mil";
+ repo = pname;
+ rev = "c188f27c67c17514656389986defdbce9705ed14";
+ hash = "sha256-oshI/Oo6KgOymT/njVc/NgeyB27iox9R2DBwWZdt/0A=";
+ };
+
+ nativeBuildInputs = [ pkg-config zig ];
+
+ buildInputs = [ curl SDL2 SDL2_image SDL2_ttf ];
+
+ buildPhase = ''
+ export HOME=$TMPDIR
+ zig build -Drelease-safe=true
+ '';
+
+ doCheck = true;
+ checkPhase = ''
+ zig build test
+ '';
+
+ installPhase = ''
+ install -Dm755 zig-out/bin/mepo -t $out/bin
+ install -Dm755 scripts/mepo_* $out/bin
+ '';
+
+ meta = with lib; {
+ description = "Fast, simple, and hackable OSM map viewer";
+ inherit (src.meta) homepage;
+ license = licenses.gpl3Plus;
+ maintainers = [ maintainers.sikmir ];
+ platforms = platforms.unix;
+ broken = stdenv.isDarwin; # https://github.com/NixOS/nixpkgs/issues/86299
+ };
+}