Skip to content

Commit

Permalink
libusb: update to 1.0.27
Browse files Browse the repository at this point in the history
Signed-off-by: Rosen Penev <[email protected]>
  • Loading branch information
neheb committed Feb 3, 2024
1 parent add39f4 commit 8a060f8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 20 deletions.
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

0 comments on commit 8a060f8

Please sign in to comment.