aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--internal/rosa/package/lua/conf-prefix.patch13
-rw-r--r--internal/rosa/package/lua/lua.pc23
-rw-r--r--internal/rosa/package/lua/package.az36
3 files changed, 72 insertions, 0 deletions
diff --git a/internal/rosa/package/lua/conf-prefix.patch b/internal/rosa/package/lua/conf-prefix.patch
new file mode 100644
index 00000000..cb7bbe5f
--- /dev/null
+++ b/internal/rosa/package/lua/conf-prefix.patch
@@ -0,0 +1,13 @@
+diff --git a/src/luaconf.h b/src/luaconf.h
+index 96a7780..0bfa66c 100644
+--- a/src/luaconf.h
++++ b/src/luaconf.h
+@@ -239,7 +239,7 @@
+
+ #else /* }{ */
+
+-#define LUA_ROOT "/usr/local/"
++#define LUA_ROOT "/system/"
+ #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/"
+ #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/"
+
diff --git a/internal/rosa/package/lua/lua.pc b/internal/rosa/package/lua/lua.pc
new file mode 100644
index 00000000..0bc54c70
--- /dev/null
+++ b/internal/rosa/package/lua/lua.pc
@@ -0,0 +1,23 @@
+# lua.pc -- pkg-config data for Lua
+
+prefix=/system
+INSTALL_BIN=${prefix}/bin
+INSTALL_INC=${prefix}/include
+INSTALL_LIB=${prefix}/lib
+INSTALL_MAN=${prefix}/man/man1
+INSTALL_LMOD=${prefix}/share/lua/@MAJOR_VER@.@MINOR_VER@
+INSTALL_CMOD=${prefix}/lib/lua/@MAJOR_VER@.@MINOR_VER@
+
+# canonical vars
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: Lua
+Description: An Extensible Extension Language
+Version: @MAJOR_VER@.@MINOR_VER@
+Requires:
+Libs: -L${libdir} -llua -lm
+Cflags: -I${includedir}
+
+# (end of lua@MAJOR_VER@.pc)
diff --git a/internal/rosa/package/lua/package.az b/internal/rosa/package/lua/package.az
new file mode 100644
index 00000000..2d61eee5
--- /dev/null
+++ b/internal/rosa/package/lua/package.az
@@ -0,0 +1,36 @@
+package lua {
+ description = "the programming language lua";
+ website = "https://www.lua.org/home.html";
+ anitya = 1847;
+
+ version# = "5.5.0";
+ source = remoteTar {
+ url = "https://www.lua.org/ftp/lua-"+version+".tar.gz";
+ compress = gzip;
+ checksum = "YPyC6868M6mB1p0ARV1WJy9EmFc0ERBoueqJnMvJ_YXjSSvkVtO94C01n6pnd8Te";
+ };
+ patches = [ "conf-prefix.patch" ];
+
+ files = {
+ "lua.pc";
+ };
+
+ enterSource = true;
+ writable = true;
+ chmod = true;
+
+ exec = make {
+ inPlace = true;
+ skipConfigure = true;
+ make = [ "CC='clang -fPIC'", "all" ];
+ check = [ "test" ];
+ install = `
+make INSTALL_TOP=/work/system install
+mkdir /work/system/lib/pkgconfig
+sed \
+ -e "s|@MAJOR_VER@|$(cc -P -E -include src/lua.h - <<< LUA_VERSION_MAJOR_N | tail -n 1)|g" \
+ -e "s|@MINOR_VER@|$(cc -P -E -include src/lua.h - <<< LUA_VERSION_MINOR_N | tail -n 1)|g" \
+ ../lua.pc > /work/system/lib/pkgconfig/lua.pc
+`;
+ };
+}