nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit bc4f9539cea159e6b8c9e533b4045949271e1995
parent 93f77666f7610df466c8f856b20840dd45c86e97
Author: Nikolay Korotkiy <sikmir@gmail.com>
Date:   Wed, 20 Jan 2021 21:51:19 +0300

Add sdlmap

Diffstat:
Mpkgs/default.nix | 4++++
Apkgs/osm/sdlmap/default.nix | 27+++++++++++++++++++++++++++
Apkgs/osm/sdlmap/tile.patch | 28++++++++++++++++++++++++++++
3 files changed, 59 insertions(+), 0 deletions(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -233,6 +233,10 @@ lib.makeScope newScope ( md2gemini = callPackage ./gemini/md2gemini { }; shavit = callPackage ./gemini/shavit { }; + ### OSM + + sdlmap = callPackage ./osm/sdlmap { }; + ### SERVERS dict2rest = callPackage ./servers/dict2rest { }; diff --git a/pkgs/osm/sdlmap/default.nix b/pkgs/osm/sdlmap/default.nix @@ -0,0 +1,27 @@ +{ stdenv, fetchFromGitHub, curl, SDL2, SDL2_image }: + +stdenv.mkDerivation { + pname = "sdlmap"; + version = "2014-02-09"; + + src = fetchFromGitHub { + owner = "jhawthorn"; + repo = "sdlmap"; + rev = "0baa8fb4472751c28bfe8b063070ea8b2d459224"; + sha256 = "125hsfjbpvf2zia6702qgjyqsa84wnxxb75xskawif564b65cksv"; + }; + + patches = [ ./tile.patch ]; + + buildInputs = [ curl SDL2 SDL2_image ]; + + installPhase = "install -Dm755 sdlmap -t $out/bin"; + + meta = with stdenv.lib; { + description = "A SDL + libcurl OpenStreetMap viewer"; + homepage = "https://github.com/jhawthorn/sdlmap"; + license = licenses.free; + maintainers = [ maintainers.sikmir ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/osm/sdlmap/tile.patch b/pkgs/osm/sdlmap/tile.patch @@ -0,0 +1,28 @@ +diff --git i/sdlmap.cc w/sdlmap.cc +index 8fa3483..22dafc4 100644 +--- i/sdlmap.cc ++++ w/sdlmap.cc +@@ -107,7 +107,7 @@ int main(int argc, char *argv[]){ + SDL_Window *window = SDL_CreateWindow("SDLmap", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, width, height, SDL_WINDOW_SHOWN|SDL_WINDOW_RESIZABLE); + + MapView view(window, width, height, zoom); +- view.center_coords(48.4284, -123.3656); ++ view.center_coords(60.0, 30.0); + + runloop(view); + return 0; +diff --git i/tile.cc w/tile.cc +index 086fe3d..ddf0dab 100644 +--- i/tile.cc ++++ w/tile.cc +@@ -21,8 +21,9 @@ std::string Tile::url(){ + char url[4096]; + //snprintf(url, sizeof url, "http://a.tile.openstreetmap.org/%i/%i/%i.png", zoom, x, y); + //snprintf(url, sizeof url, "http://a.tile.stamen.com/toner/%i/%i/%i.png", zoom, x, y); +- snprintf(url, sizeof url, "http://mts0.google.com/vt/hl=en&src=api&x=%i&s=&y=%i&z=%i", x, y, zoom); ++ //snprintf(url, sizeof url, "http://mts0.google.com/vt/hl=en&src=api&x=%i&s=&y=%i&z=%i", x, y, zoom); + //snprintf(url, sizeof url, "http://a.www.toolserver.org/tiles/bw-mapnik/%i/%i/%i.png", zoom, x, y); ++ snprintf(url, sizeof url, "https://tile-a.opentopomap.ru/%i/%i/%i.png", zoom, x, y); + return std::string(url); + } + void Tile::render(SDL_Surface *screen, int offsetx, int offsety){