aports/testing/apk-tools3/lua-module.patch

71 lines
1.3 KiB
Diff

Fix path of lua module
diff --git a/src/lua-apk.c b/lua/apk.c
similarity index 100%
rename from src/lua-apk.c
rename to lua/apk.c
diff --git a/lua/meson.build b/lua/meson.build
new file mode 100644
index 0000000..03b02e8
--- /dev/null
+++ b/lua/meson.build
@@ -0,0 +1,19 @@
+luaapk_src = [
+ 'apk.c',
+]
+
+libluaapk = shared_module(
+ 'apk',
+ luaapk_src,
+ dependencies: [
+ lua_dep,
+ libapk_dep,
+ apk_deps,
+ libportability_dep.partial_dependency(includes: true),
+ ],
+ install: not subproject,
+ install_dir: get_option('libdir') / 'lua' / get_option('lua_version'),
+ include_directories: ['../src'],
+ name_prefix: '',
+ c_args: apk_cargs,
+)
--- a/meson.build
+++ b/meson.build
@@ -40,4 +40,7 @@ else
libfetch_dep = dependency('', required: false)
endif
subdir('src')
+if(lua_dep.found())
+ subdir('lua')
+endif
subdir('tests')
--- a/src/meson.build
+++ b/src/meson.build
@@ -172,26 +172,6 @@ if not subproject
)
endif
-if(lua_dep.found())
- luaapk_src = [
- 'lua-apk.c',
- ]
-
- libluaapk = library(
- 'luaapk',
- luaapk_src,
- dependencies: [
- lua_dep,
- libapk_dep,
- apk_deps,
- libportability_dep.partial_dependency(includes: true),
- ],
- install: true,
- install_dir: lua_dep.get_variable(pkgconfig: 'libdir'),
- c_args: apk_cargs,
- )
-endif
-
apk_exe = executable(
'apk',
apk_src,