package An official xmake package repository https://xrepo.xmake.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.4 KiB

ZBar: add package (#5530) * zbar: add package * Update dependencies and build configurations * Update gettext package to handle binary installation * Revert "Update gettext package to handle binary installation" This reverts commit 7854133b6ad340d14fc4f0fafdd58125c5f1b05f. * Update deps * Use system libiconv on MacOS * Update gettext package to handle binary installation * Add ldflag of pthread * Add autoconf-archive dep for MacOS * Update deps * Revert "Update gettext package to handle binary installation" This reverts commit d51bbeeab3661af42f19772906be84ab376125ff. * Use host gettext * Depend on private `gettext` * Disable pthread on Android * Add dep: pkg-config * Get aclocal path by running command * Use up-to-date libtool * Include `autoconf` m4 dir for `autoreconf` * Disable Android build on Windows, as for no autotools * Fix incorrect config * Build with xmake port instead of autotools * Add configure options `--without-x` and `--without-jpeg` * Export all symbols for Windows shared library * Fix file pattern for pdf417 decoder in xmake.lua * Fix install headers path * Add extsources * "Null" implementation for window module and video module * Add github git url * Fix multiple definition caused by duplicate implementation * libiconv: add iPhoneOS target platform * Disable processor * libiconv: use xmake port on `iphoneos` * zbar: Drop `iphoneos` support * Requires system libiconv on MacOS * Disable sys/time.h header inclusion * Remove zbar/window.c * Revert "Remove zbar/window.c" This reverts commit 94b839d07e571bea2f38a6520ebe9810fb2e1ca2. * Revert "Disable sys/time.h header inclusion" This reverts commit 331dcff4ec709e1e2783b1db129ce5ff5eeeb532. * Drop `windows` support * Fix invalid target platform limit * Process `config.h.in` instread of using preconfigured file * Fix missing def: LIB_VERSION * Remove `config.h` * Remove invalid `set_configvar` in `option("enable_codebar")` * Format * Simplify dep `libiconv` requirement * Refactor options to mimic original config `--enable-codes=SYMS` * Add package configs to better control symbologies support * Remove "export all symbols" for Windows * More concise configs * Fix invalid config * Format * Use built-in `${VERSION_*}` variables * Update config.h.in * Update xmake.lua * Update xmake.lua --------- Co-authored-by: ruki <waruqi@gmail.com>
2 months ago
package("zbar")
set_homepage("https://github.com/mchehab/zbar")
set_description("Library for reading bar codes from various sources")
set_license("LGPL-2.1")
add_urls("https://github.com/mchehab/zbar/archive/refs/tags/$(version).tar.gz",
"https://github.com/mchehab/zbar.git")
add_versions("0.23.93", "212dfab527894b8bcbcc7cd1d43d63f5604a07473d31a5f02889e372614ebe28")
if is_plat("mingw") and is_subhost("msys") then
add_extsources("pacman::zbar")
elseif is_plat("linux") then
add_extsources("pacman::zbar", "apt::libzbar-dev")
elseif is_plat("macosx") then
add_extsources("brew::zbar")
end
add_configs("symbologies", {description = "Select symbologies to compile", default = {"ean", "databar", "code128", "code93", "code39", "codabar", "i25", "qrcode", "sqcode"}, type = "table"})
if is_plat("linux", "bsd") then
add_syslinks("pthread")
elseif is_plat("windows") then
add_syslinks("winmm")
ZBar: add package (#5530) * zbar: add package * Update dependencies and build configurations * Update gettext package to handle binary installation * Revert "Update gettext package to handle binary installation" This reverts commit 7854133b6ad340d14fc4f0fafdd58125c5f1b05f. * Update deps * Use system libiconv on MacOS * Update gettext package to handle binary installation * Add ldflag of pthread * Add autoconf-archive dep for MacOS * Update deps * Revert "Update gettext package to handle binary installation" This reverts commit d51bbeeab3661af42f19772906be84ab376125ff. * Use host gettext * Depend on private `gettext` * Disable pthread on Android * Add dep: pkg-config * Get aclocal path by running command * Use up-to-date libtool * Include `autoconf` m4 dir for `autoreconf` * Disable Android build on Windows, as for no autotools * Fix incorrect config * Build with xmake port instead of autotools * Add configure options `--without-x` and `--without-jpeg` * Export all symbols for Windows shared library * Fix file pattern for pdf417 decoder in xmake.lua * Fix install headers path * Add extsources * "Null" implementation for window module and video module * Add github git url * Fix multiple definition caused by duplicate implementation * libiconv: add iPhoneOS target platform * Disable processor * libiconv: use xmake port on `iphoneos` * zbar: Drop `iphoneos` support * Requires system libiconv on MacOS * Disable sys/time.h header inclusion * Remove zbar/window.c * Revert "Remove zbar/window.c" This reverts commit 94b839d07e571bea2f38a6520ebe9810fb2e1ca2. * Revert "Disable sys/time.h header inclusion" This reverts commit 331dcff4ec709e1e2783b1db129ce5ff5eeeb532. * Drop `windows` support * Fix invalid target platform limit * Process `config.h.in` instread of using preconfigured file * Fix missing def: LIB_VERSION * Remove `config.h` * Remove invalid `set_configvar` in `option("enable_codebar")` * Format * Simplify dep `libiconv` requirement * Refactor options to mimic original config `--enable-codes=SYMS` * Add package configs to better control symbologies support * Remove "export all symbols" for Windows * More concise configs * Fix invalid config * Format * Use built-in `${VERSION_*}` variables * Update config.h.in * Update xmake.lua * Update xmake.lua --------- Co-authored-by: ruki <waruqi@gmail.com>
2 months ago
end
add_deps("libiconv")
on_install(function (package)
ZBar: add package (#5530) * zbar: add package * Update dependencies and build configurations * Update gettext package to handle binary installation * Revert "Update gettext package to handle binary installation" This reverts commit 7854133b6ad340d14fc4f0fafdd58125c5f1b05f. * Update deps * Use system libiconv on MacOS * Update gettext package to handle binary installation * Add ldflag of pthread * Add autoconf-archive dep for MacOS * Update deps * Revert "Update gettext package to handle binary installation" This reverts commit d51bbeeab3661af42f19772906be84ab376125ff. * Use host gettext * Depend on private `gettext` * Disable pthread on Android * Add dep: pkg-config * Get aclocal path by running command * Use up-to-date libtool * Include `autoconf` m4 dir for `autoreconf` * Disable Android build on Windows, as for no autotools * Fix incorrect config * Build with xmake port instead of autotools * Add configure options `--without-x` and `--without-jpeg` * Export all symbols for Windows shared library * Fix file pattern for pdf417 decoder in xmake.lua * Fix install headers path * Add extsources * "Null" implementation for window module and video module * Add github git url * Fix multiple definition caused by duplicate implementation * libiconv: add iPhoneOS target platform * Disable processor * libiconv: use xmake port on `iphoneos` * zbar: Drop `iphoneos` support * Requires system libiconv on MacOS * Disable sys/time.h header inclusion * Remove zbar/window.c * Revert "Remove zbar/window.c" This reverts commit 94b839d07e571bea2f38a6520ebe9810fb2e1ca2. * Revert "Disable sys/time.h header inclusion" This reverts commit 331dcff4ec709e1e2783b1db129ce5ff5eeeb532. * Drop `windows` support * Fix invalid target platform limit * Process `config.h.in` instread of using preconfigured file * Fix missing def: LIB_VERSION * Remove `config.h` * Remove invalid `set_configvar` in `option("enable_codebar")` * Format * Simplify dep `libiconv` requirement * Refactor options to mimic original config `--enable-codes=SYMS` * Add package configs to better control symbologies support * Remove "export all symbols" for Windows * More concise configs * Fix invalid config * Format * Use built-in `${VERSION_*}` variables * Update config.h.in * Update xmake.lua * Update xmake.lua --------- Co-authored-by: ruki <waruqi@gmail.com>
2 months ago
os.cp(path.join(package:scriptdir(), "port", "config.h.in"), "include/config.h.in")
io.gsub("include/config.h.in", "# ?undef (.-)\n", "${define %1}\n")
os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
io.replace("zbar/processor.h", "#include <unistd.h>", "", {plain = true})
ZBar: add package (#5530) * zbar: add package * Update dependencies and build configurations * Update gettext package to handle binary installation * Revert "Update gettext package to handle binary installation" This reverts commit 7854133b6ad340d14fc4f0fafdd58125c5f1b05f. * Update deps * Use system libiconv on MacOS * Update gettext package to handle binary installation * Add ldflag of pthread * Add autoconf-archive dep for MacOS * Update deps * Revert "Update gettext package to handle binary installation" This reverts commit d51bbeeab3661af42f19772906be84ab376125ff. * Use host gettext * Depend on private `gettext` * Disable pthread on Android * Add dep: pkg-config * Get aclocal path by running command * Use up-to-date libtool * Include `autoconf` m4 dir for `autoreconf` * Disable Android build on Windows, as for no autotools * Fix incorrect config * Build with xmake port instead of autotools * Add configure options `--without-x` and `--without-jpeg` * Export all symbols for Windows shared library * Fix file pattern for pdf417 decoder in xmake.lua * Fix install headers path * Add extsources * "Null" implementation for window module and video module * Add github git url * Fix multiple definition caused by duplicate implementation * libiconv: add iPhoneOS target platform * Disable processor * libiconv: use xmake port on `iphoneos` * zbar: Drop `iphoneos` support * Requires system libiconv on MacOS * Disable sys/time.h header inclusion * Remove zbar/window.c * Revert "Remove zbar/window.c" This reverts commit 94b839d07e571bea2f38a6520ebe9810fb2e1ca2. * Revert "Disable sys/time.h header inclusion" This reverts commit 331dcff4ec709e1e2783b1db129ce5ff5eeeb532. * Drop `windows` support * Fix invalid target platform limit * Process `config.h.in` instread of using preconfigured file * Fix missing def: LIB_VERSION * Remove `config.h` * Remove invalid `set_configvar` in `option("enable_codebar")` * Format * Simplify dep `libiconv` requirement * Refactor options to mimic original config `--enable-codes=SYMS` * Add package configs to better control symbologies support * Remove "export all symbols" for Windows * More concise configs * Fix invalid config * Format * Use built-in `${VERSION_*}` variables * Update config.h.in * Update xmake.lua * Update xmake.lua --------- Co-authored-by: ruki <waruqi@gmail.com>
2 months ago
local configs = { vers = package:version_str(),
symbologies = table.concat(package:config("symbologies"), ",")}
ZBar: add package (#5530) * zbar: add package * Update dependencies and build configurations * Update gettext package to handle binary installation * Revert "Update gettext package to handle binary installation" This reverts commit 7854133b6ad340d14fc4f0fafdd58125c5f1b05f. * Update deps * Use system libiconv on MacOS * Update gettext package to handle binary installation * Add ldflag of pthread * Add autoconf-archive dep for MacOS * Update deps * Revert "Update gettext package to handle binary installation" This reverts commit d51bbeeab3661af42f19772906be84ab376125ff. * Use host gettext * Depend on private `gettext` * Disable pthread on Android * Add dep: pkg-config * Get aclocal path by running command * Use up-to-date libtool * Include `autoconf` m4 dir for `autoreconf` * Disable Android build on Windows, as for no autotools * Fix incorrect config * Build with xmake port instead of autotools * Add configure options `--without-x` and `--without-jpeg` * Export all symbols for Windows shared library * Fix file pattern for pdf417 decoder in xmake.lua * Fix install headers path * Add extsources * "Null" implementation for window module and video module * Add github git url * Fix multiple definition caused by duplicate implementation * libiconv: add iPhoneOS target platform * Disable processor * libiconv: use xmake port on `iphoneos` * zbar: Drop `iphoneos` support * Requires system libiconv on MacOS * Disable sys/time.h header inclusion * Remove zbar/window.c * Revert "Remove zbar/window.c" This reverts commit 94b839d07e571bea2f38a6520ebe9810fb2e1ca2. * Revert "Disable sys/time.h header inclusion" This reverts commit 331dcff4ec709e1e2783b1db129ce5ff5eeeb532. * Drop `windows` support * Fix invalid target platform limit * Process `config.h.in` instread of using preconfigured file * Fix missing def: LIB_VERSION * Remove `config.h` * Remove invalid `set_configvar` in `option("enable_codebar")` * Format * Simplify dep `libiconv` requirement * Refactor options to mimic original config `--enable-codes=SYMS` * Add package configs to better control symbologies support * Remove "export all symbols" for Windows * More concise configs * Fix invalid config * Format * Use built-in `${VERSION_*}` variables * Update config.h.in * Update xmake.lua * Update xmake.lua --------- Co-authored-by: ruki <waruqi@gmail.com>
2 months ago
-- get LIB_VERSION from configure.ac
-- format: AC_SUBST([LIB_VERSION], [3:0:3])
local configure_ac = io.readfile("configure.ac")
for _, key in ipairs({"LIB_VERSION"}) do
local value = configure_ac:match("AC_SUBST%(%[" .. key .. "%]%s*,%s*%[(.-)%]%)")
if value then
configs[key] = value
end
end
import("package.tools.xmake").install(package, configs)
end)
on_test(function (package)
assert(package:check_csnippets({test = [[
void test() {
zbar_image_scanner_t *scanner ;
scanner = zbar_image_scanner_create();
zbar_image_scanner_set_config(scanner, 0, ZBAR_CFG_ENABLE, 1);
zbar_image_scanner_destroy(scanner);
}
]]}, {includes = "zbar.h"}))
end)