boklm pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits: 4c9640b6 by NoisyCoil at 2024-12-12T12:03:29+01:00 Bug 41317: Add the linux-aarch64 target to linux-packages
Also fixing #41335 (linux-package project is not getting the channel target in testbuilds).
Co-authored-by: Nicolas Vigier boklm@torproject.org
- - - - -
6 changed files:
- projects/linux-packages/build - projects/linux-packages/config - projects/linux-packages/debian/control.in - projects/linux-packages/rpm-package.spec - projects/release/build - projects/release/config
Changes:
===================================== projects/linux-packages/build ===================================== @@ -57,6 +57,11 @@ umask 0022 $rootdir/[% c('input_files_by_name/linux-i686') %]/[% c("var/project-name") %]-linux-i686-[% c("version") %].tar.xz \ i386 [% END -%] + [% IF c("var/browser-linux-aarch64") -%] + extract_src_tar \ + $rootdir/[% c('input_files_by_name/linux-aarch64') %]/[% c("var/project-name") %]-linux-aarch64-[% c("version") %].tar.xz \ + arm64 + [% END -%]
dpkg-buildpackage --unsigned-source --unsigned-changes --build=source [% FOREACH deb_arch = c("var_p/system_pkg/deb_archs") -%] @@ -92,6 +97,10 @@ EOF cp -a $rootdir/[% c('input_files_by_name/linux-i686') %]/[% c("var/project-name") %]-linux-i686-[% c("version") %].tar.xz \ SOURCES/[% c("var/system_pkg/pkg_name") %]-linux-i386-[% c("var/system_pkg/pkg_version") %].tar.xz [% END -%] + [% IF c("var/browser-linux-aarch64") -%] + cp -a $rootdir/[% c('input_files_by_name/linux-aarch64') %]/[% c("var/project-name") %]-linux-aarch64-[% c("version") %].tar.xz \ + SOURCES/[% c("var/system_pkg/pkg_name") %]-linux-aarch64-[% c("var/system_pkg/pkg_version") %].tar.xz + [% END -%] rpmdir=$(pwd) [% IF c("var/browser-linux-x86_64") -%] rpmbuild --define "_topdir $rpmdir" -v -bb SPECS/[% c("var/system_pkg/pkg_name") %].spec @@ -99,6 +108,9 @@ EOF [% IF c("var/browser-linux-i686") -%] rpmbuild --define "_topdir $rpmdir" --target i686-redhat-linux -v -bb SPECS/[% c("var/system_pkg/pkg_name") %].spec [% END -%] + [% IF c("var/browser-linux-aarch64") -%] + rpmbuild --define "_topdir $rpmdir" --target aarch64-redhat-linux -v -bb SPECS/[% c("var/system_pkg/pkg_name") %].spec + [% END -%] mv RPMS/*/*.rpm "$OUTDIR/"
[% END %]
===================================== projects/linux-packages/config ===================================== @@ -19,6 +19,7 @@ var: deb_archs_list: - '[% IF c("var/browser-linux-x86_64") %]amd64[% END %]' - '[% IF c("var/browser-linux-i686") %]i386[% END %]' + - '[% IF c("var/browser-linux-aarch64") %]arm64[% END %]'
targets: @@ -28,7 +29,7 @@ targets: build_deb_pkg: 1 pre_pkginst: | dpkg --add-architecture i386 - # some :i386 packages fail to install when /var/lib/dpkg/available + # some foreign-arch packages fail to install when /var/lib/dpkg/available # does not exist, so create it as an empty file echo > /var/lib/dpkg/available arch_deps: @@ -58,6 +59,31 @@ targets: - libpulse-dev:i386 - libx11-xcb-dev:i386 - libxt-dev:i386 + deb-arm64: + var: + build_deb_pkg: 1 + pre_pkginst: | + dpkg --add-architecture arm64 + # some foreign-arch packages fail to install when /var/lib/dpkg/available + # does not exist, so create it as an empty file + echo > /var/lib/dpkg/available + arch_deps: + # Packages needed to build the deb package + - dpkg-dev + - debhelper + - dh-exec + - dh-apparmor + # Packages needed to generate dependencies for the deb package + - linux-libc-dev:arm64 + - libasound2-dev:arm64 + - libfontconfig1-dev:arm64 + - libfreetype6-dev:arm64 + - libgconf2-dev:arm64 + - libgtk-3-dev:arm64 + - libpango1.0-dev:arm64 + - libpulse-dev:arm64 + - libx11-xcb-dev:arm64 + - libxt-dev:arm64
rpm: var: @@ -72,18 +98,15 @@ targets: container: suite: bookworm
- browser-all: - - browser-linux-x86_64 - - browser-linux-i686 - - browser-all-desktop: browser-all - browser-linux-x86_64: var: browser-linux-x86_64: 1 browser-linux-i686: var: browser-linux-i686: '[% c("var/browser_type") != "mullvadbrowser" %]' + browser-linux-aarch64: + var: + browser-linux-aarch64: 1
torbrowser: var: @@ -139,6 +162,13 @@ input_files: - '[% c("var/build_target") %]' - '[% c("var/browser_type") %]-linux-i686'
+ - name: linux-aarch64 + project: browser + enable: '[% c("var/browser-linux-aarch64") %]' + target: + - '[% c("var/build_target") %]' + - '[% c("var/browser_type") %]-linux-aarch64' + - filename: Makefile content: "[% INCLUDE 'Makefile.in' %]" refresh_input: 1
===================================== projects/linux-packages/debian/control.in ===================================== @@ -5,7 +5,7 @@ Section: web Build-Depends: debhelper (>= 9), dh-apparmor
Package: [% c("var/system_pkg/pkg_name") %] -Architecture: [% c("var_p/system_pkg/deb_archs").join(" ") %] +Architecture: amd64 i386 arm64 Depends: ${shlibs:Depends}, Description: [% c('var/display_name') %] [% c("var/system_pkg/pkg_description") %]
===================================== projects/linux-packages/rpm-package.spec ===================================== @@ -21,6 +21,7 @@ %global privlibs %{privlibs}|libxul %global __provides_exclude ^(%{privlibs})\.so %global __requires_exclude ^(%{privlibs})\.so +%global __strip true
Summary: [% c("var/display_name") %] Name: [% c("var/system_pkg/pkg_name") %] @@ -36,6 +37,9 @@ Source2: %{name}-linux-x86_64-%{version}.tar.xz [% IF c("var/browser-linux-i686") -%] Source3: %{name}-linux-i386-%{version}.tar.xz [% END -%] +[% IF c("var/browser-linux-aarch64") -%] +Source4: %{name}-linux-aarch64-%{version}.tar.xz +[% END -%]
%description [% c("var/system_pkg/pkg_description") %]
===================================== projects/release/build ===================================== @@ -40,8 +40,13 @@ mkdir -p "$destdir" [% IF c("var/browser-linux-aarch64") -%] mv [% c('input_files_by_name/linux-aarch64') %]/* "$destdir"/ [% END -%] -[% IF c("var/linux-packages") -%] - mv [% c('input_files_by_name/deb-packages') %]/* "$destdir"/ +[% IF c("var/linux-packages") || c("var/linux-packages-aarch64") -%] + [% IF c("var/linux-packages") -%] + mv [% c('input_files_by_name/deb-packages') %]/* "$destdir"/ + [% END -%] + [% IF c("var/linux-packages-aarch64") -%] + mv [% c('input_files_by_name/deb-packages-aarch64') %]/* "$destdir"/ + [% END -%] mv [% c('input_files_by_name/rpm-packages') %]/* "$destdir"/ [% END -%] [% IF c("var/browser-src") -%]
===================================== projects/release/config ===================================== @@ -63,7 +63,7 @@ targets: browser-linux-aarch64: var: browser-linux-aarch64: '[% ! c("var/browser-all-target") || c("var/testbuild") || c("var/nightly") %]' - linux-packages: 0 + linux-packages-aarch64: '[% (! c("var/browser-all-target") || c("var/testbuild") || c("var/nightly")) && (c("var/mullvad-browser") || c("var/tor-browser-linux-packages")) %]' browser-windows-i686: var: browser-windows-i686: '[% c("var/browser_type") != "mullvadbrowser" %]' @@ -210,20 +210,40 @@ input_files: - name: deb-packages project: linux-packages enable: '[% c("var/linux-packages") %]' - # Add linux-x86_64 targets for container config - target_prepend: + # Add $browser_type-linux-x86_64 target for container config + target: + - '[% IF c("var/testbuild") %]testbuild[% END %]' + - '[% c("var/build_target") %]' + - '[% IF c("var/browser-linux-i686") %]browser-linux-i686[% END %]' + - '[% IF c("var/browser-linux-x86_64") %]browser-linux-x86_64[% END %]' - deb - - linux-x86_64 - - linux + - '[% c("var/browser_type") %]-linux-x86_64' + + # linux-aarch64 requires a separate container because of multi-arch + # conflicts between amd64 and arm64 + - name: deb-packages-aarch64 + project: linux-packages + enable: '[% c("var/linux-packages-aarch64") %]' + # Add $browser_type-linux-x86_64 target for container config + target: + - '[% IF c("var/testbuild") %]testbuild[% END %]' + - '[% c("var/build_target") %]' + - browser-linux-aarch64 + - deb-arm64 + - '[% c("var/browser_type") %]-linux-x86_64'
- name: rpm-packages project: linux-packages - enable: '[% c("var/linux-packages") %]' - # Add linux-x86_64 targets for container config - target_prepend: + enable: '[% c("var/linux-packages") || c("var/linux-packages-aarch64") %]' + # Add $browser_type-linux-x86_64 target for container config + target: + - '[% IF c("var/testbuild") %]testbuild[% END %]' + - '[% c("var/build_target") %]' + - '[% IF c("var/browser-linux-i686") %]browser-linux-i686[% END %]' + - '[% IF c("var/browser-linux-x86_64") %]browser-linux-x86_64[% END %]' + - '[% IF c("var/linux-packages-aarch64") %]browser-linux-aarch64[% END %]' - rpm - - linux-x86_64 - - linux + - '[% c("var/browser_type") %]-linux-x86_64'
- name: windows-i686 project: browser
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/4c...
tor-commits@lists.torproject.org