2022-01-19 23:45:15 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromSourcehut
|
|
|
|
, pkg-config
|
|
|
|
, zig
|
|
|
|
, curl
|
|
|
|
, SDL2
|
2022-02-10 20:34:41 +00:00
|
|
|
, SDL2_gfx
|
2022-01-19 23:45:15 +00:00
|
|
|
, SDL2_image
|
|
|
|
, SDL2_ttf
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mepo";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "0.3";
|
2022-01-19 23:45:15 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~mil";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-02-10 20:34:41 +00:00
|
|
|
hash = "sha256-B7BOAFhiOTILUdzh49hTMrNNHZpCNRDLW2uekXyptqQ=";
|
2022-01-19 23:45:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkg-config zig ];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
buildInputs = [ curl SDL2 SDL2_gfx SDL2_image SDL2_ttf ];
|
2022-01-19 23:45:15 +00:00
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
preBuild = ''
|
2022-01-19 23:45:15 +00:00
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
|
|
|
|
zig build test
|
|
|
|
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
zig build -Drelease-safe=true -Dcpu=baseline --prefix $out install
|
2022-01-19 23:45:15 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Fast, simple, and hackable OSM map viewer";
|
|
|
|
homepage = "https://sr.ht/~mil/mepo/";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ sikmir ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
broken = stdenv.isDarwin; # See https://github.com/NixOS/nixpkgs/issues/86299
|
|
|
|
};
|
|
|
|
}
|