From a20615066d435cd3160f80196d25a2d7fb3e8ccc Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Mon, 27 Feb 2023 21:43:34 +0100 Subject: [PATCH] Simplify libusb prebuilt scripts In theory, include/ might be slightly different for win32 and win64 builds. Use each one separately to simplify. --- app/meson.build | 5 ++--- app/prebuilt-deps/prepare-libusb.sh | 7 +++---- cross_win32.txt | 3 +-- cross_win64.txt | 3 +-- release.mk | 4 ++-- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/app/meson.build b/app/meson.build index 5d779756..a16a000b 100644 --- a/app/meson.build +++ b/app/meson.build @@ -144,9 +144,8 @@ else ) prebuilt_libusb = meson.get_cross_property('prebuilt_libusb') - prebuilt_libusb_root = meson.get_cross_property('prebuilt_libusb_root') - libusb_bin_dir = meson.current_source_dir() + '/prebuilt-deps/data/' + prebuilt_libusb - libusb_include_dir = 'prebuilt-deps/data/' + prebuilt_libusb_root + '/include' + libusb_bin_dir = meson.current_source_dir() + '/prebuilt-deps/data/' + prebuilt_libusb + '/bin' + libusb_include_dir = 'prebuilt-deps/data/' + prebuilt_libusb + '/include' libusb = declare_dependency( dependencies: [ diff --git a/app/prebuilt-deps/prepare-libusb.sh b/app/prebuilt-deps/prepare-libusb.sh index a0c3721d..47cf1df4 100755 --- a/app/prebuilt-deps/prepare-libusb.sh +++ b/app/prebuilt-deps/prepare-libusb.sh @@ -22,13 +22,12 @@ get_file "https://github.com/libusb/libusb/releases/download/v1.0.26/$FILENAME" mkdir "$DEP_DIR" cd "$DEP_DIR" -# include/ is the same in all folders of the archive 7z x "../$FILENAME" \ libusb-1.0.26-binaries/libusb-MinGW-Win32/bin/msys-usb-1.0.dll \ + libusb-1.0.26-binaries/libusb-MinGW-Win32/include/ \ libusb-1.0.26-binaries/libusb-MinGW-x64/bin/msys-usb-1.0.dll \ libusb-1.0.26-binaries/libusb-MinGW-x64/include/ -mv libusb-1.0.26-binaries/libusb-MinGW-Win32/bin MinGW-Win32 -mv libusb-1.0.26-binaries/libusb-MinGW-x64/bin MinGW-x64 -mv libusb-1.0.26-binaries/libusb-MinGW-x64/include . +mv libusb-1.0.26-binaries/libusb-MinGW-Win32 . +mv libusb-1.0.26-binaries/libusb-MinGW-x64 . rm -rf libusb-1.0.26-binaries diff --git a/cross_win32.txt b/cross_win32.txt index 32226949..e50c0bc8 100644 --- a/cross_win32.txt +++ b/cross_win32.txt @@ -21,5 +21,4 @@ ffmpeg_avformat = 'avformat-58' ffmpeg_avutil = 'avutil-56' prebuilt_ffmpeg = 'ffmpeg-win32-4.3.1' prebuilt_sdl2 = 'SDL2-2.26.1/i686-w64-mingw32' -prebuilt_libusb_root = 'libusb-1.0.26' -prebuilt_libusb = 'libusb-1.0.26/MinGW-Win32' +prebuilt_libusb = 'libusb-1.0.26/libusb-MinGW-Win32' diff --git a/cross_win64.txt b/cross_win64.txt index 4dde4ab1..2dc876a6 100644 --- a/cross_win64.txt +++ b/cross_win64.txt @@ -21,5 +21,4 @@ ffmpeg_avformat = 'avformat-59' ffmpeg_avutil = 'avutil-57' prebuilt_ffmpeg = 'ffmpeg-win64-5.1.2' prebuilt_sdl2 = 'SDL2-2.26.1/x86_64-w64-mingw32' -prebuilt_libusb_root = 'libusb-1.0.26' -prebuilt_libusb = 'libusb-1.0.26/MinGW-x64' +prebuilt_libusb = 'libusb-1.0.26/libusb-MinGW-x64' diff --git a/release.mk b/release.mk index 06443e1a..67578022 100644 --- a/release.mk +++ b/release.mk @@ -109,7 +109,7 @@ dist-win32: build-server build-win32 cp app/prebuilt-deps/data/platform-tools-33.0.3/AdbWinApi.dll "$(DIST)/$(WIN32_TARGET_DIR)/" cp app/prebuilt-deps/data/platform-tools-33.0.3/AdbWinUsbApi.dll "$(DIST)/$(WIN32_TARGET_DIR)/" cp app/prebuilt-deps/data/SDL2-2.26.1/i686-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN32_TARGET_DIR)/" - cp app/prebuilt-deps/data/libusb-1.0.26/MinGW-Win32/msys-usb-1.0.dll "$(DIST)/$(WIN32_TARGET_DIR)/" + cp app/prebuilt-deps/data/libusb-1.0.26/libusb-MinGW-Win32/bin/msys-usb-1.0.dll "$(DIST)/$(WIN32_TARGET_DIR)/" dist-win64: build-server build-win64 mkdir -p "$(DIST)/$(WIN64_TARGET_DIR)" @@ -128,7 +128,7 @@ dist-win64: build-server build-win64 cp app/prebuilt-deps/data/platform-tools-33.0.3/AdbWinApi.dll "$(DIST)/$(WIN64_TARGET_DIR)/" cp app/prebuilt-deps/data/platform-tools-33.0.3/AdbWinUsbApi.dll "$(DIST)/$(WIN64_TARGET_DIR)/" cp app/prebuilt-deps/data/SDL2-2.26.1/x86_64-w64-mingw32/bin/SDL2.dll "$(DIST)/$(WIN64_TARGET_DIR)/" - cp app/prebuilt-deps/data/libusb-1.0.26/MinGW-x64/msys-usb-1.0.dll "$(DIST)/$(WIN64_TARGET_DIR)/" + cp app/prebuilt-deps/data/libusb-1.0.26/libusb-MinGW-x64/bin/msys-usb-1.0.dll "$(DIST)/$(WIN64_TARGET_DIR)/" zip-win32: dist-win32 cd "$(DIST)"; \