Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libusb: update to 1.0.27 #1389

Merged
merged 2 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -1813,6 +1813,7 @@
"libusb-1.0"
],
"versions": [
"1.0.27-1",
"1.0.26-5",
"1.0.26-4",
"1.0.26-3",
Expand Down
8 changes: 4 additions & 4 deletions subprojects/libusb.wrap
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
42 changes: 26 additions & 16 deletions subprojects/packagefiles/libusb/meson.build
Original file line number Diff line number Diff line change
@@ -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')
Expand Down Expand Up @@ -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')
Expand All @@ -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'))
Expand All @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion subprojects/packagefiles/libusb/tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading