From 2b0c5bfc844c772e27c95ad88ff986694a799911 Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Sat, 23 Sep 2023 11:00:24 -0400 Subject: [PATCH 01/15] Enabled libusb passthrough in builds --- meson.build | 2 +- ubuntu-win64-cross/Dockerfile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 38127c98098..db44a138c3e 100644 --- a/meson.build +++ b/meson.build @@ -1546,7 +1546,7 @@ if not get_option('usb_redir').auto() or have_system endif libusb = not_found if not get_option('libusb').auto() or have_system - libusb = dependency('libusb-1.0', required: get_option('libusb'), + libusb = dependency('libusb-1.0', required: get_option('libusb').enabled(), version: '>=1.0.13', method: 'pkg-config', kwargs: static_kwargs) endif diff --git a/ubuntu-win64-cross/Dockerfile b/ubuntu-win64-cross/Dockerfile index bd26ee81700..d04aacc435b 100644 --- a/ubuntu-win64-cross/Dockerfile +++ b/ubuntu-win64-cross/Dockerfile @@ -4,7 +4,7 @@ FROM ubuntu:22.04 -ENV MXE_VERSION=1707285df63b8590ce6b91c7ff3a5b56e3cc8980 +ENV MXE_VERSION=ea373fe51c02f60111ef0b7597f52dc380c5c162 RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive \ @@ -59,6 +59,7 @@ RUN cd /opt \ cc \ glib \ libepoxy \ + libusb1 \ pixman \ libsamplerate \ openssl \ From 297f79a8a8f86f34062ce2be3ebb5222118569e7 Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Sun, 25 Feb 2024 14:19:56 -0500 Subject: [PATCH 02/15] Added libusb1 to the list of libraries to install on macos to see if this fixes the build on arm64 --- scripts/download-macos-libs.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index 6333e23cc02..231a8d83ceb 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -183,7 +183,8 @@ def main(): 'libepoxy', 'openssl11', 'libpcap', - 'libslirp']) + 'libslirp', + 'libusb1']) if __name__ == '__main__': main() From 5555385f60e92321b3b601a0064683b959ae7afc Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Sun, 25 Feb 2024 18:09:35 -0500 Subject: [PATCH 03/15] changed libusb1 to libusb to see if that will make the package install properly --- scripts/download-macos-libs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index 231a8d83ceb..280f1c82802 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -184,7 +184,7 @@ def main(): 'openssl11', 'libpcap', 'libslirp', - 'libusb1']) + 'libusb']) if __name__ == '__main__': main() From 3aba8f624fc02263b01adcbc71103aa2a78230ae Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Sun, 25 Feb 2024 21:37:43 -0500 Subject: [PATCH 04/15] commented out the libusb package to see what effect that has on the build --- scripts/download-macos-libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index 280f1c82802..459626e879d 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -183,8 +183,8 @@ def main(): 'libepoxy', 'openssl11', 'libpcap', - 'libslirp', - 'libusb']) + 'libslirp']) + # 'libusb']) if __name__ == '__main__': main() From abfe59f4ecd67d58d8f6c2b02405acc3206a8633 Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Sun, 25 Feb 2024 21:53:16 -0500 Subject: [PATCH 05/15] uncommented libusb in the download-macos-libs.py file --- scripts/download-macos-libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index 459626e879d..280f1c82802 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -183,8 +183,8 @@ def main(): 'libepoxy', 'openssl11', 'libpcap', - 'libslirp']) - # 'libusb']) + 'libslirp', + 'libusb']) if __name__ == '__main__': main() From c1421139490d882649d0e21c0eb7d1bcae6f02d7 Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Sun, 25 Feb 2024 23:46:13 -0500 Subject: [PATCH 06/15] added some debugging logging to the download-macos-libs.py script to try to see where the problem is --- scripts/download-macos-libs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index 280f1c82802..f9f8f3db884 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -42,9 +42,13 @@ def __init__(self, arch): def get_latest_pkg_filename_url(self, pkg_name): pkg_base_url = f'{MIRROR}/{pkg_name}' + print(f' [*] [DEBUG] pkg_base_url {pkg_base_url}') pkg_list = urlopen(pkg_base_url).read().decode('utf-8') + print(' [*] [DEBUG] url opened') pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + self._darwin_target + r'\.' + self._arch + r'\.tbz2', pkg_list) + print(' [*] [DEBUG] pkgs retrieved') pkg_filename = pkgs[-1] + print(' [*] [DEBUG] returning pkg_filename, pkg_url') return pkg_filename, f'{pkg_base_url}/{pkg_filename}' def is_pkg_installed(self, pkg_name): @@ -101,8 +105,11 @@ def install_pkg(self, pkg_name): print(f'[*] Fetching {pkg_name}') pkg_filename, pkg_url = self.get_latest_pkg_filename_url(pkg_name) + print(f' [*] [DEBUG] pkg_url {pkg_url}') pkg_version = pkg_filename[re.search(r'-\d', pkg_filename).span()[0]+1:] + print('test') pkg_version = pkg_version[:pkg_version.find('.'+self._darwin_target)] + print(f' [*] [DEBUG] pkg_filename {pkg_filename}') dst_pkg_filename = os.path.join(self._pkgs_path, pkg_filename) print(f' [*] Found package {pkg_filename}') self.download_file(pkg_filename, pkg_url, dst_pkg_filename) From 2a5dc41360b190b201f8577688f9961dd3dfc3fe Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Mon, 26 Feb 2024 00:05:23 -0500 Subject: [PATCH 07/15] changed the print on line 49 to print the length of the pkgs array --- scripts/download-macos-libs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index f9f8f3db884..257c756a640 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -46,7 +46,7 @@ def get_latest_pkg_filename_url(self, pkg_name): pkg_list = urlopen(pkg_base_url).read().decode('utf-8') print(' [*] [DEBUG] url opened') pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + self._darwin_target + r'\.' + self._arch + r'\.tbz2', pkg_list) - print(' [*] [DEBUG] pkgs retrieved') + print(f' [*] [DEBUG] len(pkgs) {len(pkgs)}') pkg_filename = pkgs[-1] print(' [*] [DEBUG] returning pkg_filename, pkg_url') return pkg_filename, f'{pkg_base_url}/{pkg_filename}' From 3fe5cd06ed6a634f3c2cf74f950c4c2738e4b482 Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Mon, 26 Feb 2024 00:56:53 -0500 Subject: [PATCH 08/15] added logic to print pkg_list data when len(pkgs) == 0 --- scripts/download-macos-libs.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index 257c756a640..445e14a793a 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -47,6 +47,9 @@ def get_latest_pkg_filename_url(self, pkg_name): print(' [*] [DEBUG] url opened') pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + self._darwin_target + r'\.' + self._arch + r'\.tbz2', pkg_list) print(f' [*] [DEBUG] len(pkgs) {len(pkgs)}') + if len(pkgs) < 1: + print(f' [*] [ERROR] package {pkg_name} not found for arch {self._arch}') + print(f' [*] [DEBUG] pkg_list: {pkg_list}') pkg_filename = pkgs[-1] print(' [*] [DEBUG] returning pkg_filename, pkg_url') return pkg_filename, f'{pkg_base_url}/{pkg_filename}' From 2157fdbe40c770c5acd092b343a573a54b3a992c Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Mon, 26 Feb 2024 01:10:31 -0500 Subject: [PATCH 09/15] changed darwin target for arm64 from 20 to 21 to see if this fixes package issues. I suspect it'll fail on x86_64 now. --- scripts/download-macos-libs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index 445e14a793a..bd8f46f4bb9 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -19,7 +19,7 @@ class LibInstaller: DARWIN_TARGET_X64="darwin_17" # macOS 10.13 - DARWIN_TARGET_ARM64="darwin_20" # macOS 11.x + DARWIN_TARGET_ARM64="darwin_21" # macOS 11.x def __init__(self, arch): self._queue = [] @@ -48,7 +48,7 @@ def get_latest_pkg_filename_url(self, pkg_name): pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + self._darwin_target + r'\.' + self._arch + r'\.tbz2', pkg_list) print(f' [*] [DEBUG] len(pkgs) {len(pkgs)}') if len(pkgs) < 1: - print(f' [*] [ERROR] package {pkg_name} not found for arch {self._arch}') + print(f' [*] [ERROR] package {pkg_name} not found for arch {self._darwin_target}.{self._arch}') print(f' [*] [DEBUG] pkg_list: {pkg_list}') pkg_filename = pkgs[-1] print(' [*] [DEBUG] returning pkg_filename, pkg_url') From 859eecb36ee89691a6efbfdbff36526d8b5779fc Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Mon, 26 Feb 2024 01:16:02 -0500 Subject: [PATCH 10/15] Added logic to check for packages with darwin_any or noarch before giving up --- scripts/download-macos-libs.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index bd8f46f4bb9..73d83158b3b 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -47,8 +47,18 @@ def get_latest_pkg_filename_url(self, pkg_name): print(' [*] [DEBUG] url opened') pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + self._darwin_target + r'\.' + self._arch + r'\.tbz2', pkg_list) print(f' [*] [DEBUG] len(pkgs) {len(pkgs)}') + + if len(pkgs) < 1: + pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + r'darwin_any\.' + self._arch + r'\.tbz2', pkg_list) + + if len(pkgs) < 1: + pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + self._darwin_target + r'\.noarch\.tbz2', pkg_list) + + if len(pkgs) < 1: + pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + r'darwin_any\.noarch\.tbz2', pkg_list) + if len(pkgs) < 1: - print(f' [*] [ERROR] package {pkg_name} not found for arch {self._darwin_target}.{self._arch}') + print(f' [*] [ERROR] package {pkg_name} not found for arch {self._darwin_target}.{self._arch} or darwin_any.noarch') print(f' [*] [DEBUG] pkg_list: {pkg_list}') pkg_filename = pkgs[-1] print(' [*] [DEBUG] returning pkg_filename, pkg_url') From 5ca1a2dc7d1d33f0f9f9dc2502da9eb55e363ace Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Mon, 26 Feb 2024 08:59:32 -0500 Subject: [PATCH 11/15] added libusb-1.0-0-dev to the list of packages to install for the linux build --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f10a81e852c..0932633f4a6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -187,7 +187,7 @@ jobs: run: | export DEBIAN_FRONTEND=noninteractive sudo apt-get -qy update - sudo apt-get install ccache libfuse2 + sudo apt-get install ccache libfuse2 libusb-1.0-0-dev pushd src sudo apt-get -qy build-dep . - name: Compile From 6f08d43f1ee39117b483daa1408f9ab6a28a68de Mon Sep 17 00:00:00 2001 From: Fred Hallock Date: Tue, 27 Feb 2024 21:09:58 -0500 Subject: [PATCH 12/15] Removed all of the debug print calls and matched the layout and format of the file in the FixMacOsBuild branch --- scripts/download-macos-libs.py | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/scripts/download-macos-libs.py b/scripts/download-macos-libs.py index 73d83158b3b..763d9238f06 100755 --- a/scripts/download-macos-libs.py +++ b/scripts/download-macos-libs.py @@ -19,7 +19,7 @@ class LibInstaller: DARWIN_TARGET_X64="darwin_17" # macOS 10.13 - DARWIN_TARGET_ARM64="darwin_21" # macOS 11.x + DARWIN_TARGET_ARM64="darwin_21" # macOS 12.x def __init__(self, arch): self._queue = [] @@ -42,26 +42,20 @@ def __init__(self, arch): def get_latest_pkg_filename_url(self, pkg_name): pkg_base_url = f'{MIRROR}/{pkg_name}' - print(f' [*] [DEBUG] pkg_base_url {pkg_base_url}') pkg_list = urlopen(pkg_base_url).read().decode('utf-8') - print(' [*] [DEBUG] url opened') pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + self._darwin_target + r'\.' + self._arch + r'\.tbz2', pkg_list) - print(f' [*] [DEBUG] len(pkgs) {len(pkgs)}') - + if len(pkgs) < 1: - pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + r'darwin_any\.' + self._arch + r'\.tbz2', pkg_list) - + pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.darwin_any\.' + self._arch + r'\.tbz2', pkg_list) if len(pkgs) < 1: pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + self._darwin_target + r'\.noarch\.tbz2', pkg_list) - if len(pkgs) < 1: - pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.' + r'darwin_any\.noarch\.tbz2', pkg_list) - + pkgs = re.findall(pkg_name + r'[\w\.\-\_\+]*?\.darwin_any\.noarch\.tbz2', pkg_list) + if len(pkgs) < 1: - print(f' [*] [ERROR] package {pkg_name} not found for arch {self._darwin_target}.{self._arch} or darwin_any.noarch') - print(f' [*] [DEBUG] pkg_list: {pkg_list}') + print(f' [*] [ERROR] Unable to find version of {pkg_name} compatible with {self._darwin_target}.{self._arch}') + pkg_filename = pkgs[-1] - print(' [*] [DEBUG] returning pkg_filename, pkg_url') return pkg_filename, f'{pkg_base_url}/{pkg_filename}' def is_pkg_installed(self, pkg_name): @@ -118,11 +112,8 @@ def install_pkg(self, pkg_name): print(f'[*] Fetching {pkg_name}') pkg_filename, pkg_url = self.get_latest_pkg_filename_url(pkg_name) - print(f' [*] [DEBUG] pkg_url {pkg_url}') pkg_version = pkg_filename[re.search(r'-\d', pkg_filename).span()[0]+1:] - print('test') pkg_version = pkg_version[:pkg_version.find('.'+self._darwin_target)] - print(f' [*] [DEBUG] pkg_filename {pkg_filename}') dst_pkg_filename = os.path.join(self._pkgs_path, pkg_filename) print(f' [*] Found package {pkg_filename}') self.download_file(pkg_filename, pkg_url, dst_pkg_filename) @@ -207,4 +198,4 @@ def main(): 'libusb']) if __name__ == '__main__': - main() + main() \ No newline at end of file From 8058f6472810a6d21078727b019ad84ff7db4de6 Mon Sep 17 00:00:00 2001 From: "specialfred453@gmail.com" Date: Thu, 9 Jan 2025 20:29:16 -0500 Subject: [PATCH 13/15] Added libusb1 back to the ubuntu-win64-cross dockerfile --- ubuntu-win64-cross/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/ubuntu-win64-cross/Dockerfile b/ubuntu-win64-cross/Dockerfile index fc438cf38f0..293b09d1691 100644 --- a/ubuntu-win64-cross/Dockerfile +++ b/ubuntu-win64-cross/Dockerfile @@ -95,6 +95,7 @@ RUN make \ -C ${MXE_PATH} \ glib \ libepoxy \ + libusb1 \ pixman \ libsamplerate \ libressl \ From a25574b1328dc9e505af9e517dd6adbbcc0b85fd Mon Sep 17 00:00:00 2001 From: "specialfred453@gmail.com" Date: Sat, 11 Jan 2025 12:53:12 -0500 Subject: [PATCH 14/15] Added libusb-1.0-0-dev to debian/control and removed .enabled() from meson.build Trying to see if this gets libusb included in builds without having to force it on --- debian/control | 1 + meson.build | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index e74330628fe..a8985bf3d97 100644 --- a/debian/control +++ b/debian/control @@ -18,6 +18,7 @@ Build-Depends: debhelper (>= 11), libpcap-dev, libslirp-dev, libvulkan-dev, + libusb-1.0-0-dev, Standards-Version: 3.9.8 Homepage: https://xemu.app XS-Debian-Vcs-Browser: https://github.com/mborgerson/xemu diff --git a/meson.build b/meson.build index 5067f1ac3c8..6d6aadd0d79 100644 --- a/meson.build +++ b/meson.build @@ -2129,7 +2129,7 @@ if not get_option('usb_redir').auto() or have_system endif libusb = not_found if not get_option('libusb').auto() or have_system - libusb = dependency('libusb-1.0', required: get_option('libusb').enabled(), + libusb = dependency('libusb-1.0', required: get_option('libusb'), version: '>=1.0.13', method: 'pkg-config') endif From 2df8f895c257d3a9111c2f092958bf39f4858858 Mon Sep 17 00:00:00 2001 From: "specialfred453@gmail.com" Date: Sat, 11 Jan 2025 13:15:57 -0500 Subject: [PATCH 15/15] Added .enabled() back to the meson.build for libusb, because it's still required for libusb in builds --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 6d6aadd0d79..5067f1ac3c8 100644 --- a/meson.build +++ b/meson.build @@ -2129,7 +2129,7 @@ if not get_option('usb_redir').auto() or have_system endif libusb = not_found if not get_option('libusb').auto() or have_system - libusb = dependency('libusb-1.0', required: get_option('libusb'), + libusb = dependency('libusb-1.0', required: get_option('libusb').enabled(), version: '>=1.0.13', method: 'pkg-config') endif