Compare commits

...

2 Commits

Author SHA1 Message Date
184ba482f9 and decode 2025-05-27 13:34:09 +01:00
26ebbe21b5 hack in rxi-json 2025-05-27 13:31:54 +01:00
3 changed files with 12 additions and 8 deletions

View File

@ -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}" ];

View File

@ -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
'';
})

View File

@ -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
(->
@ -17,7 +20,7 @@
"-96.339893442898"
");"
");"
"out geom;"
"out ;"
]
(table.concat "\n")))
@ -28,5 +31,5 @@
(r:set_body (dict_to_query { :data query }))
(let [(headers stream) (r:go)]
(print (view headers))
(print (stream:get_body_as_string))))
(print (view (json.decode (stream:get_body_as_string))))))