[tbb-commits] [Git][tpo/applications/tor-browser-build][main] Bug 41126: Make deb and rpm packages for Tor Browser (alpha/nightly)

boklm (@boklm) git at gitlab.torproject.org
Wed Jun 5 10:49:16 UTC 2024



boklm pushed to branch main at The Tor Project / Applications / tor-browser-build


Commits:
16562e9c by Nicolas Vigier at 2024-06-04T12:16:29+02:00
Bug 41126: Make deb and rpm packages for Tor Browser (alpha/nightly)

- - - - -


6 changed files:

- projects/linux-packages/build
- projects/linux-packages/config
- projects/linux-packages/debian/rules → projects/linux-packages/debian/rules.in
- projects/linux-packages/rpm-package.spec
- projects/mmdebstrap-image/config
- projects/release/config


Changes:

=====================================
projects/linux-packages/build
=====================================
@@ -10,6 +10,16 @@ export SOURCE_DATE_EPOCH='[% c("timestamp") %]'
 umask 0022
 
 [% IF c("var/build_deb_pkg") -%]
+  [% IF c("var/browser-linux-i686") -%]
+    # When building an i386 deb package, dh_strip requires i686-linux-gnu-*
+    # commands not provided by the binutils x86_64 package on debian stretch.
+    # We can use the binutils-i686-gnu package when we switch to buster.
+    mkdir -p /var/tmp/dist/binutils
+    for bin in strip objcopy objdump; do
+      ln -s /usr/bin/$bin /var/tmp/dist/binutils/i686-linux-gnu-$bin
+    done
+    export PATH="/var/tmp/dist/binutils:$PATH"
+  [% END -%]
   cd $distdir
   project_dir=[% c("var/system_pkg/pkg_name") %]-[% c("var/system_pkg/pkg_version") %]
   mkdir "$project_dir"
@@ -41,20 +51,20 @@ umask 0022
   [% END -%]
   [% IF c("var/browser-linux-i686") -%]
     extract_src_tar \
-      $rootdir/[% c('input_files_by_name/linux-x86_64') %]/[% c("var/project-name") %]-linux-i686-[% c("version") %].tar.xz \
+      $rootdir/[% c('input_files_by_name/linux-i686') %]/[% c("var/project-name") %]-linux-i686-[% c("version") %].tar.xz \
       i386
   [% END -%]
 
+  dpkg-buildpackage --unsigned-source --unsigned-changes --build=source
   [% FOREACH deb_arch = c("var_p/system_pkg/deb_archs") -%]
-    dpkg-buildpackage --unsigned-source --unsigned-changes --build=full --host-arch=[% deb_arch %]
+    dpkg-buildpackage --unsigned-source --unsigned-changes --build=binary --host-arch=[% deb_arch %]
     deb_file_name='[% c("var/system_pkg/pkg_name") %]_[% c("var/system_pkg/pkg_version") %]-[% c("var/system_pkg/pkg_revision") %]_[% deb_arch %].deb'
     dpkg-deb --info "../$deb_file_name"
-    pushd ..
-    mv -f "$deb_file_name" *.dsc *.orig.tar.xz *.debian.tar.xz "$OUTDIR/"
-    popd
+    mv -f ../"$deb_file_name" "$OUTDIR/"
   [% END -%]
 
   cd ..
+  mv -f *.dsc *.orig.tar.xz *.debian.tar.xz "$OUTDIR/"
 [% END %]
 
 [% IF c("var/build_rpm_pkg") -%]
@@ -77,10 +87,15 @@ EOF
   [% END -%]
   [% IF c("var/browser-linux-i686") -%]
     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-i686-[% c("var/system_pkg/pkg_version") %].tar.xz
+      SOURCES/[% c("var/system_pkg/pkg_name") %]-linux-i386-[% c("var/system_pkg/pkg_version") %].tar.xz
   [% END -%]
   rpmdir=$(pwd)
-  rpmbuild --define "_topdir $rpmdir" -v -bb SPECS/[% c("var/system_pkg/pkg_name") %].spec
+  [% IF c("var/browser-linux-x86_64") -%]
+    rpmbuild --define "_topdir $rpmdir" -v -bb SPECS/[% c("var/system_pkg/pkg_name") %].spec
+  [% END -%]
+  [% 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 -%]
   mv RPMS/*/*.rpm "$OUTDIR/"
 
 [% END %]


=====================================
projects/linux-packages/config
=====================================
@@ -23,7 +23,12 @@ targets:
 
   deb:
     var:
-      build_deb_pkg: '[% c("var/mullvad-browser") %]'
+      build_deb_pkg: 1
+      pre_pkginst: |
+        dpkg --add-architecture i386
+        # some :i386 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
@@ -40,10 +45,20 @@ targets:
         - libpulse-dev
         - libx11-xcb-dev
         - libxt-dev
+        - linux-libc-dev:i386
+        - libasound2-dev:i386
+        - libfontconfig1-dev:i386
+        - libfreetype6-dev:i386
+        - libgconf2-dev:i386
+        - libgtk-3-dev:i386
+        - libpango1.0-dev:i386
+        - libpulse-dev:i386
+        - libx11-xcb-dev:i386
+        - libxt-dev:i386
 
   rpm:
     var:
-      build_rpm_pkg: '[% c("var/mullvad-browser") %]'
+      build_rpm_pkg: 1
 
       arch_deps:
         # Packages needed to build the rpm package
@@ -71,6 +86,7 @@ targets:
     var:
       browser_type: torbrowser
       system_pkg:
+        pkg_description: 'Tor Browser is a privacy-focused web browser designed to minimize tracking and fingerprinting, using the Tor network to protect your privacy and anonymity.'
         pkg_url: 'https://torproject.org/'
   basebrowser:
     var:
@@ -149,6 +165,8 @@ input_files:
     refresh_input: 1
     enable: '[% c("var/build_deb_pkg") %]'
   - filename: debian/rules
+    content: "[% INCLUDE 'debian/rules.in' %]"
+    refresh_input: 1
     enable: '[% c("var/build_deb_pkg") %]'
 
   # rpm package


=====================================
projects/linux-packages/debian/rules → projects/linux-packages/debian/rules.in
=====================================
@@ -7,4 +7,4 @@ override_dh_strip_nondeterminism:
 	dh_strip_nondeterminism -Xxpi
 
 override_dh_shlibdeps:
-	dh_shlibdeps -Xabicheck
+	dh_shlibdeps -Xabicheck[% IF c("var/tor-browser") %] -l$(CURDIR)/debian/[% c("var/system_pkg/pkg_name") %]/[% c('var/system_pkg/install_path') %]/TorBrowser/Tor[% END %]


=====================================
projects/linux-packages/rpm-package.spec
=====================================
@@ -34,7 +34,7 @@ Source1: [% c("var/system_pkg/pkg_name") %].desktop
 Source2: %{name}-linux-x86_64-%{version}.tar.xz
 [% END -%]
 [% IF c("var/browser-linux-i686") -%]
-Source3: %{name}-linux-i686-%{version}.tar.xz
+Source3: %{name}-linux-i386-%{version}.tar.xz
 [% END -%]
 
 %description


=====================================
projects/mmdebstrap-image/config
=====================================
@@ -42,6 +42,12 @@ targets:
           "deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://archive.debian.org/debian-archive/debian/ stretch main"
           "deb [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://archive.debian.org/debian-archive/debian-security/ stretch/updates main"
 
+  buster-amd64:
+    var:
+      minimal_apt_version: 1.8.2
+      container:
+        suite: buster
+        arch: amd64
 
   bullseye-amd64:
     var:


=====================================
projects/release/config
=====================================
@@ -47,7 +47,7 @@ targets:
   browser-linux-x86_64:
     var:
       browser-linux-x86_64: 1
-      linux-packages: '[% c("var/mullvad-browser") %]'
+      linux-packages: '[% c("var/mullvad-browser") || c("var/tor-browser-linux-packages") %]'
   browser-linux-x86_64-asan:
     var:
       browser-linux-x86_64: 1
@@ -55,7 +55,7 @@ targets:
   browser-linux-i686:
     var:
       browser-linux-i686: '[% c("var/browser_type") != "mullvadbrowser" %]'
-      linux-packages: '[% c("var/mullvad-browser") %]'
+      linux-packages: '[% c("var/mullvad-browser") || c("var/tor-browser-linux-packages") %]'
   browser-windows-i686:
     var:
       browser-windows-i686: '[% c("var/browser_type") != "mullvadbrowser" %]'
@@ -93,6 +93,7 @@ targets:
     var:
       browser_type: torbrowser
       git_tag_prefix: tbb
+      tor-browser-linux-packages: '[% ! c("var/release") %]'
   basebrowser:
     var:
       browser_type: basebrowser



View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/16562e9c4568a596a52479e1886e5dce0b95b13b

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/16562e9c4568a596a52479e1886e5dce0b95b13b
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20240605/fcb03121/attachment-0001.htm>


More information about the tbb-commits mailing list