diff --git a/releases.json b/releases.json index b0135e99b..d97b40065 100644 --- a/releases.json +++ b/releases.json @@ -1813,6 +1813,7 @@ "libusb-1.0" ], "versions": [ + "1.0.27-1", "1.0.26-5", "1.0.26-4", "1.0.26-3", diff --git a/subprojects/libusb.wrap b/subprojects/libusb.wrap index d267d03a9..eebceba46 100644 --- a/subprojects/libusb.wrap +++ b/subprojects/libusb.wrap @@ -1,8 +1,8 @@ [wrap-file] -directory = libusb-1.0.26 -source_url = https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 -source_filename = libusb-1.0.26.tar.bz2 -source_hash = 12ce7a61fc9854d1d2a1ffe095f7b5fac19ddba095c259e6067a46500381b5a5 +directory = libusb-1.0.27 +source_url = https://github.com/libusb/libusb/releases/download/v1.0.27/libusb-1.0.27.tar.bz2 +source_filename = libusb-1.0.27.tar.bz2 +source_hash = ffaa41d741a8a3bee244ac8e54a72ea05bf2879663c098c82fc5757853441575 patch_directory = libusb [provide] diff --git a/subprojects/packagefiles/libusb/meson.build b/subprojects/packagefiles/libusb/meson.build index 273c835fe..6a97335e3 100644 --- a/subprojects/packagefiles/libusb/meson.build +++ b/subprojects/packagefiles/libusb/meson.build @@ -1,8 +1,8 @@ project( 'libusb', 'c', - version: '1.0.26', - meson_version: '>=0.60.0', + version: '1.0.27', + meson_version: '>=0.49.0', ) add_project_arguments('-D_GNU_SOURCE', language: 'c') @@ -30,19 +30,25 @@ if not cdata.get('HAVE_SYSLOG') and get_option('system-log') error('system logging requires syslog to be present') endif -cdata.set('HAVE_CLOCK_GETTIME', cc.has_function('clock_gettime') and host_machine.system() != 'windows') -cdata.set('HAVE_EVENTFD', cc.has_function('eventfd')) -cdata.set('HAVE_TIMERFD', cc.has_function('timerfd_create')) -cdata.set('HAVE_PIPE2', cc.has_function('pipe2')) -cdata.set('HAVE_PTHREAD_CONDATTR_SETCLOCK', cc.has_function('pthread_condattr_setclock', dependencies: thread_dep)) -cdata.set('HAVE_PTHREAD_SETNAME_NP', cc.has_function('pthread_setname_np', dependencies: thread_dep)) -cdata.set('HAVE_PTHREAD_THREADID_NP', cc.has_function('pthread_threadid_np', dependencies: thread_dep)) +functions = { + 'clock_gettime': [], + 'eventfd': [], + 'pipe2': [], + 'pthread_condattr_setclock': thread_dep, + 'pthread_setname_np': thread_dep, + 'pthread_threadid_np': thread_dep, +} + +foreach f, d : functions + cdata.set('HAVE_@0@'.format(f.to_upper()), cc.has_function(f, dependencies: d)) +endforeach -cdata.set('HAVE_ASM_TYPES_H', cc.has_header('asm/types.h')) -cdata.set('HAVE_NFDS_T', cc.has_header('nfds.h')) -cdata.set('HAVE_STRING_H', cc.has_header('string.h')) -cdata.set('HAVE_SYS_TIME_H', cc.has_header('sys/time.h')) +foreach h : ['asm/types.h', 'string.h', 'sys/time.h'] + cdata.set('HAVE_@0@'.format(h.underscorify().to_upper()), cc.has_header(h)) +endforeach +cdata.set('HAVE_TIMERFD', cc.has_function('timerfd_create')) +cdata.set('HAVE_NFDS_T', cc.has_header_symbol('poll.h', 'nfds_t')) cdata.set('HAVE_STRUCT_TIMESPEC', cc.has_header_symbol('time.h', 'struct timespec')) if cc.has_function_attribute('format') @@ -51,6 +57,12 @@ else cdata.set('PRINTF_FORMAT(a, b)', '') endif +if cc.has_function_attribute('visibility:default') + cdata.set('DEFAULT_VISIBILITY', '__attribute__ ((visibility ("default")))') +else + cdata.set('DEFAULT_VISIBILITY', '') +endif + cdata.set('ENABLE_LOGGING', get_option('logging')) cdata.set('ENABLE_DEBUG_LOGGING', get_option('debug-logging')) cdata.set('USE_SYSTEM_LOGGING_FACILITY', get_option('system-log')) @@ -69,17 +81,15 @@ sources = files( if host_machine.system() == 'windows' cdata.set('PLATFORM_WINDOWS', true) - cdata.set('DEFAULT_VISIBILITY', '') sources += files('libusb/os/events_windows.c', 'libusb/os/threads_windows.c') else cdata.set('PLATFORM_POSIX', true) - cdata.set('DEFAULT_VISIBILITY', '__attribute__ ((visibility ("default")))') sources += files('libusb/os/events_posix.c', 'libusb/os/threads_posix.c') endif if host_machine.system() == 'linux' sources += 'libusb/os/linux_usbfs.c' - udev_dep = dependency('libudev', 'libudev-zero', required: get_option('udev')) + udev_dep = dependency('libudev', required: get_option('udev')) if udev_dep.found() cdata.set('HAVE_LIBUDEV', true) sources += 'libusb/os/linux_udev.c' diff --git a/subprojects/packagefiles/libusb/tests/meson.build b/subprojects/packagefiles/libusb/tests/meson.build index ba1b19cf3..e4c4b49c7 100644 --- a/subprojects/packagefiles/libusb/tests/meson.build +++ b/subprojects/packagefiles/libusb/tests/meson.build @@ -10,7 +10,7 @@ stress = executable( include_directories: config_inc, ) -test('libusb_test', stress, timeout: 90) +test('libusb_test', stress, timeout: 240) umockdev_dep = dependency('umockdev', required: false) if umockdev_dep.found()