From 26ebbe21b5cbc074adfeddf2b4f6c6e836888f2d Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Tue, 27 May 2025 13:31:54 +0100 Subject: [PATCH] hack in rxi-json --- pkgs/maps/default.nix | 11 ++++++----- pkgs/maps/shell.nix | 2 +- pkgs/maps/tiles.fnl | 3 +++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pkgs/maps/default.nix b/pkgs/maps/default.nix index 54e0e6c..8bb3815 100644 --- a/pkgs/maps/default.nix +++ b/pkgs/maps/default.nix @@ -34,11 +34,14 @@ let hash = "sha256-VYr/DV1FAyzPe6p6Quc1nmsHup23IAMfz532rL167Q4="; }; }; + rxi-json = callPackage ../rxi-json { lua = lua5_3; }; lua = lua5_3.withPackages (ps: with ps; [ lgi luafilesystem luaposix readline + http + rxi-json ]); pname = "maps"; in stdenv.mkDerivation { @@ -49,15 +52,12 @@ in stdenv.mkDerivation { buildInputs = [ lua gtk3.dev - gobject-introspection # .dev + gobject-introspection osm-gps-map glib-networking -# gdk-pixbuf - # glib -# libchamplain ]; nativeBuildInputs = [ - buildPackages.lua +# lua gobject-introspection makeWrapper fennel @@ -65,6 +65,7 @@ in stdenv.mkDerivation { copyDesktopItems ]; GIO_EXTRA_MODULES = [ "${glib-networking.out}/lib/gio/modules" ]; + RXI_JSON="${rxi-json}/"; makeFlags = [ "PREFIX=${placeholder "out"}" "NAME=${pname}" ]; diff --git a/pkgs/maps/shell.nix b/pkgs/maps/shell.nix index 0ce9d22..ec8d430 100644 --- a/pkgs/maps/shell.nix +++ b/pkgs/maps/shell.nix @@ -4,6 +4,6 @@ in package.overrideAttrs(o: { shellHook = '' export LUA_CPATH=$(lua -e "print(package.cpath)") - export LUA_PATH=$(lua -e "print(package.path)") + export LUA_PATH=$(lua -e "print(package.path)")\;$RXI_JSON/share/lua/5.3/?.lua ''; }) diff --git a/pkgs/maps/tiles.fnl b/pkgs/maps/tiles.fnl index 29a516c..81e4f44 100644 --- a/pkgs/maps/tiles.fnl +++ b/pkgs/maps/tiles.fnl @@ -1,7 +1,10 @@ (local req (require :http.request)) (local { : dict_to_query } (require :http.util)) +(local json (require :json)) + (local { : view } (require :fennel)) + (local query (->