diff --git a/packages/z/zbar/port/config.h.in b/packages/z/zbar/port/config.h.in new file mode 100644 index 00000000000..aa68a2f0365 --- /dev/null +++ b/packages/z/zbar/port/config.h.in @@ -0,0 +1,479 @@ +/* include/config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if using 'alloca.c'. */ +#undef C_ALLOCA + +/* whether to build support for Codabar symbology */ +#undef ENABLE_CODABAR + +/* whether to build support for Code 128 symbology */ +#undef ENABLE_CODE128 + +/* whether to build support for Code 39 symbology */ +#undef ENABLE_CODE39 + +/* whether to build support for Code 93 symbology */ +#undef ENABLE_CODE93 + +/* whether to build support for DataBar symbology */ +#undef ENABLE_DATABAR + +/* whether to build support for EAN symbologies */ +#undef ENABLE_EAN + +/* whether to build support for Interleaved 2 of 5 symbology */ +#undef ENABLE_I25 + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +#undef ENABLE_NLS + +/* whether to build support for PDF417 symbology (incomplete) */ +#undef ENABLE_PDF417 + +/* whether to build support for QR Code */ +#undef ENABLE_QRCODE + +/* whether to build support for SQ Code */ +#undef ENABLE_SQCODE + +/* Define to 1 if you have the 'alarm' function. */ +#undef HAVE_ALARM + +/* Define to 1 if you have 'alloca', as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define to 1 if works. */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_INET_H + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +#undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +#undef HAVE_CFPREFERENCESCOPYAPPVALUE + +/* Define to 1 if you have the 'clock_gettime' function. */ +#undef HAVE_CLOCK_GETTIME + +/* Define to 1 to use dbus */ +#undef HAVE_DBUS + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +#undef HAVE_DCGETTEXT + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FEATURES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FLOAT_H + +/* Define to 1 if you have the 'floor' function. */ +#undef HAVE_FLOOR + +/* Define to 1 if fseeko (and ftello) are declared in stdio.h. */ +#undef HAVE_FSEEKO + +/* Define to 1 if you have the 'getcwd' function. */ +#undef HAVE_GETCWD + +/* Define to 1 if you have the 'getpagesize' function. */ +#undef HAVE_GETPAGESIZE + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + +/* Define to 1 if you have the 'gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 to use GraphicsMagick */ +#undef HAVE_GRAPHICSMAGICK + +/* Define if you have the iconv() function and it works. */ +#undef HAVE_ICONV + +/* Define to 1 to use ImageMagick */ +#undef HAVE_IMAGEMAGICK + +/* Define to 1 to use ImageMagick 7 */ +#undef HAVE_IMAGEMAGICK7 + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_JERROR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_JNI_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_JPEGLIB_H + +/* Define to 1 if you have the 'jpeg' library (-ljpeg). */ +#undef HAVE_LIBJPEG + +/* Define to 1 if you have the 'pthread' library (-lpthread). */ +#undef HAVE_LIBPTHREAD + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBV4L2_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_VIDEODEV2_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_VIDEODEV_H + +/* Define to 1 if you have the 'localeconv' function. */ +#undef HAVE_LOCALECONV + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MAGICKWAND_MAGICKWAND_H + +/* Define to 1 if you have the 'malloc' function. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the 'memchr' function. */ +#undef HAVE_MEMCHR + +/* Define to 1 if you have the 'memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the 'memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have a working 'mmap' system call. */ +#undef HAVE_MMAP + +/* Define to 1 if you have the header file. */ +#undef HAVE_MNTENT_H + +/* Define to 1 if you have the 'modf' function. */ +#undef HAVE_MODF + +/* Define to 1 if you have the 'munmap' function. */ +#undef HAVE_MUNMAP + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_POLL_H + +/* Define to 1 if you have the 'pow' function. */ +#undef HAVE_POW + +/* Define to 1 if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PYTHON_H + +/* Define to 1 if you have the 'realloc' function. */ +#undef HAVE_REALLOC + +/* Define to 1 if you have the 'select' function. */ +#undef HAVE_SELECT + +/* Define to 1 if you have the 'setenv' function. */ +#undef HAVE_SETENV + +/* Define to 1 if you have the header file. */ +#undef HAVE_SHADOW_H + +/* Define to 1 if you have the 'sqrt' function. */ +#undef HAVE_SQRT + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDDEF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the 'strcasecmp' function. */ +#undef HAVE_STRCASECMP + +/* Define to 1 if you have the 'strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the 'strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the 'strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the 'strrchr' function. */ +#undef HAVE_STRRCHR + +/* Define to 1 if you have the 'strstr' function. */ +#undef HAVE_STRSTR + +/* Define to 1 if you have the 'strtol' function. */ +#undef HAVE_STRTOL + +/* Define to 1 if you have the 'strtoul' function. */ +#undef HAVE_STRTOUL + +/* Define to 1 if 'st_rdev' is a member of 'struct stat'. */ +#undef HAVE_STRUCT_STAT_ST_RDEV + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_FILE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IPC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MMAN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MOUNT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SHM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STATFS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STATVFS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIMES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_VFS_H + +/* Define to 1 if the system has the type 'uintptr_t'. */ +#undef HAVE_UINTPTR_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_VALUES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_VFW_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_WAND_MAGICKWAND_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_X11_EXTENSIONS_XSHM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_X11_EXTENSIONS_XVLIB_H + +/* Define to 1 if the system has the type '_Bool'. */ +#undef HAVE__BOOL + +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST + +/* Library major version */ +#undef LIB_VERSION_MAJOR + +/* Library minor version */ +#undef LIB_VERSION_MINOR + +/* Library revision */ +#undef LIB_VERSION_REVISION + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Define to 1 if 'major', 'minor', and 'makedev' are declared in . + */ +#undef MAJOR_IN_MKDEV + +/* Define to 1 if 'major', 'minor', and 'makedev' are declared in + . */ +#undef MAJOR_IN_SYSMACROS + +/* Define to 1 if assertions should be disabled. */ +#undef NDEBUG + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if all of the C89 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING + +/* Program major version (before the '.') as a number */ +#undef ZBAR_VERSION_MAJOR + +/* Program minor version (after '.') as a number */ +#undef ZBAR_VERSION_MINOR + +/* Program patch version (after the second '.') as a number */ +#undef ZBAR_VERSION_PATCH + +/* Define to 1 if necessary to make fseeko visible. */ +#undef _LARGEFILE_SOURCE + +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + +/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + +/* Define for Solaris 2.5.1 so the uint8_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT8_T + +/* Minimum Windows API version */ +#undef _WIN32_WINNT + +/* used only for pthread debug attributes */ +#undef __USE_UNIX98 + +/* Define to empty if 'const' does not conform to ANSI C. */ +#undef const + +/* Define as 'int' if doesn't define. */ +#undef gid_t + +/* Define to '__inline__' or '__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef int32_t + +/* Define to the type of a signed integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef int64_t + +/* Define to 'long int' if does not define. */ +#undef off_t + +/* Define as 'unsigned int' if doesn't define. */ +#undef size_t + +/* Define as 'int' if doesn't define. */ +#undef uid_t + +/* Define to the type of an unsigned integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef uint16_t + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t + +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef uint64_t + +/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +#undef uint8_t + +/* Define to the type of an unsigned integer type wide enough to hold a + pointer, if such a type exists, and if the system does not define it. */ +#undef uintptr_t + +#ifndef X_DISPLAY_MISSING +# define HAVE_X +#endif + diff --git a/packages/z/zbar/port/xmake.lua b/packages/z/zbar/port/xmake.lua index e6ad2dbbe82..bf385d3e87f 100644 --- a/packages/z/zbar/port/xmake.lua +++ b/packages/z/zbar/port/xmake.lua @@ -6,6 +6,98 @@ else add_requires("libiconv") end +-- add options +option("enable_codebar") + set_default(true) + set_description("whether to build support for Codabar symbology") + set_configvar("ENABLE_CODABAR", "1") +option_end() +if has_config("enable_codebar") then set_configvar("ENABLE_CODABAR", 1) end + +option("enable_code128") + set_default(true) + set_description("whether to build support for Code 128 symbology") +option_end() +if has_config("enable_code128") then set_configvar("ENABLE_CODE128", 1) end + +option("enable_code39") + set_default(true) + set_description("whether to build support for Code 39 symbology") +option_end() +if has_config("enable_code39") then set_configvar("ENABLE_CODE39", 1) end + +option("enable_code93") + set_default(true) + set_description("whether to build support for Code 93 symbology") +option_end() +if has_config("enable_code93") then set_configvar("ENABLE_CODE93", 1) end + +option("enable_databar") + set_default(true) + set_description("whether to build support for DataBar symbology") +option_end() +if has_config("enable_databar") then set_configvar("ENABLE_DATABAR", 1) end + +option("enable_ean") + set_default(true) + set_description("whether to build support for EAN symbologies") +option_end() +if has_config("enable_ean") then set_configvar("ENABLE_EAN", 1) end + +option("enable_i25") + set_default(true) + set_description("whether to build support for Interleaved 2 of 5 symbology") +option_end() +if has_config("enable_i25") then set_configvar("ENABLE_I25", 1) end + +option("enable_pdf417") + set_default(false) + set_description("whether to build support for PDF417 symbology (incomplete)") +option_end() +if has_config("enable_pdf417") then set_configvar("ENABLE_PDF417", 1) end + +option("enable_qrcode") + set_default(true) + set_description("whether to build support for QR Code") +option_end() +if has_config("enable_qrcode") then set_configvar("ENABLE_QRCODE", 1) end + +option("enable_sqcode") + set_default(true) + set_description("whether to build support for SQ Code") +option_end() +if has_config("enable_sqcode") then set_configvar("ENABLE_SQCODE", 1) end + +option("vers") + set_default("") + set_showmenu(true) +option_end() +if has_config("vers") then + set_configvar("VERSION", get_config("vers")) + set_configvar("PACKAGE_VERSION", get_config("vers")) + set_configvar("PACKAGE_STRING", "zbar " .. get_config("vers")) + + local vers = get_config("vers"):split("%.") + major_ver = vers[1] or "" + minor_ver = vers[2] or "" + patch_ver = vers[3] or "" + set_configvar("ZBAR_VERSION_MAJOR", major_ver, {quote = false}) + set_configvar("ZBAR_VERSION_MINOR", minor_ver, {quote = false}) + set_configvar("ZBAR_VERSION_PATCH", patch_ver, {quote = false}) +end + +set_configvar("PACKAGE", "zbar") +set_configvar("PACKAGE_NAME", "zbar") +set_configvar("PACKAGE_TARNAME", "zbar") +set_configvar("PACKAGE_BUGREPORT", "mchehab+huawei@kernel.org") +set_configvar("PACKAGE_URL", "") + +includes("@builtin/check") + +-- config.h variables +configvar_check_cincludes("HAVE_SYS_TIME_H", "sys/time.h") +configvar_check_cincludes("HAVE_INTTYPES_H", "inttypes.h") + target("zbar") set_kind("$(kind)") @@ -28,6 +120,9 @@ target("zbar") "include/zbar/ImageScanner.h", "include/zbar/Video.h", "include/zbar/Window.h", "include/zbar/Processor.h", {prefixdir = "zbar"}) + set_configdir("include") + add_configfiles("include/(config.h.in)", {filename = "config.h"}) + add_files( "zbar/config.c", "zbar/error.c", @@ -42,9 +137,37 @@ target("zbar") "zbar/decoder.c", "zbar/misc.c", "zbar/sqcode.c") - -- pdf417 is incomplete - add_files("zbar/decoder/*.c|pdf417*.c") - add_files("zbar/qrcode/*.c") + if has_config("enable_ean") then + add_files("zbar/decoder/ean.c") + end + if has_config("enable_databar") then + add_files("zbar/decoder/databar.c") + end + if has_config("enable_code128") then + add_files("zbar/decoder/code128.c") + end + if has_config("enable_code93") then + add_files("zbar/decoder/code93.c") + end + if has_config("enable_code39") then + add_files("zbar/decoder/code39.c") + end + if has_config("enable_codebar") then + add_files("zbar/decoder/codabar.c") + end + if has_config("enable_i25") then + add_files("zbar/decoder/i25.c") + end + if has_config("enable_pdf417") then + add_files("zbar/decoder/pdf417.c") + end + if has_config("enable_qrcode") then + add_files("zbar/decoder/qr_finder.c", "zbar/qrcode/*.c") + end + if has_config("enable_sqcode") then + add_files("zbar/decoder/sq_finder.c") + end + -- "null" implementation for window module and video module add_files("zbar/window/null.c", "zbar/video/null.c", "zbar/processor/null.c") diff --git a/packages/z/zbar/xmake.lua b/packages/z/zbar/xmake.lua index 2999e2a9a1a..da5624d4279 100644 --- a/packages/z/zbar/xmake.lua +++ b/packages/z/zbar/xmake.lua @@ -26,9 +26,13 @@ package("zbar") end on_install("!iphoneos and !windows", function (package) - os.cp(path.join(package:scriptdir(), "port", "config.h"), "include/config.h") + 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") - import("package.tools.xmake").install(package) + + import("package.tools.xmake").install(package, { + vers = package:version_str() + }) end) on_test(function (package)