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

Commits:

10 changed files:

Changes:

  • projects/linux-packages/Makefile.in
    ... ... @@ -3,5 +3,25 @@ build:
    3 3
     	echo 'This is a packaged app.' > "${DEB_TARGET_ARCH}/Browser/is-packaged-app"
    
    4 4
     	[% c("touch") %] "${DEB_TARGET_ARCH}/Browser/is-packaged-app"
    
    5 5
     
    
    6
    +install:
    
    7
    +	mkdir -p "${DESTDIR}/[% c('var/system_pkg/install_path') %]"
    
    8
    +	cp -a "${DEB_TARGET_ARCH}/Browser"/* "${DESTDIR}/[% c('var/system_pkg/install_path') %]"
    
    9
    +	chmod -R go+rX "${DESTDIR}/[% c('var/system_pkg/install_path') %]"
    
    10
    +	mkdir -p "${DESTDIR}/usr/share/applications"
    
    11
    +	cp -a [% c("var/system_pkg/pkg_name") %].desktop "${DESTDIR}/usr/share/applications"
    
    12
    +	mkdir -p "${DESTDIR}/usr/bin"
    
    13
    +	ln -s "/[% c('var/system_pkg/install_path') %]/start-[% c('var/project-name') %]" \
    
    14
    +		"${DESTDIR}/usr/bin/[% c('var/system_pkg/pkg_name') %]"
    
    15
    +	for res in 16 32 48 64 128 ;\
    
    16
    +	do \
    
    17
    +	  resdir="${DESTDIR}/usr/share/icons/hicolor/$${res}x$${res}/apps"; \
    
    18
    +	  mkdir -p "$$resdir"; \
    
    19
    +	  ln -s "/[% c('var/system_pkg/install_path') %]/browser/chrome/icons/default/default$${res}.png" \
    
    20
    +		  "$${resdir}/[% c('var/system_pkg/pkg_name') %].png"; \
    
    21
    +	done
    
    22
    +	mkdir -p "${DESTDIR}/usr/share/icons/hicolor/scalable/apps"
    
    23
    +	ln -s "/[% c('var/system_pkg/install_path') %]/browser/chrome/icons/default/about-logo.svg" \
    
    24
    +		"${DESTDIR}/usr/share/icons/hicolor/scalable/apps/[% c('var/system_pkg/pkg_name') %].svg"
    
    25
    +
    
    6 26
     clean:
    
    7 27
     	rm -f "${DEB_TARGET_ARCH}/Browser/is-packaged-app"

  • projects/linux-packages/debian/browser.desktop.inprojects/linux-packages/browser.desktop.in

  • projects/linux-packages/build
    ... ... @@ -7,12 +7,13 @@ mkdir -p $OUTDIR
    7 7
     mkdir -p "$distdir"
    
    8 8
     
    
    9 9
     export SOURCE_DATE_EPOCH='[% c("timestamp") %]'
    
    10
    +umask 0022
    
    10 11
     
    
    11 12
     [% IF c("var/build_deb_pkg") -%]
    
    12 13
       cd $distdir
    
    13 14
       project_dir=[% c("var/system_pkg/pkg_name") %]-[% c("var/system_pkg/pkg_version") %]
    
    14 15
       mkdir "$project_dir"
    
    15
    -  mv $rootdir/Makefile "$project_dir"
    
    16
    +  cp -a $rootdir/Makefile $rootdir/[% c("var/system_pkg/pkg_name") %].desktop "$project_dir"
    
    16 17
       [% c('tar', {
    
    17 18
             tar_src => [ '$project_dir' ],
    
    18 19
             tar_args => '-cJf ' _ c("var/system_pkg/pkg_name") _ '_' _ c("var/system_pkg/pkg_version") _ '.orig.tar.xz',
    
    ... ... @@ -20,7 +21,7 @@ export SOURCE_DATE_EPOCH='[% c("timestamp") %]'
    20 21
     
    
    21 22
       cd "$project_dir"
    
    22 23
       mv $rootdir/debian .
    
    23
    -  chmod +x debian/install debian/docs debian/rules
    
    24
    +  chmod +x debian/docs debian/rules
    
    24 25
       mkdir debian/source
    
    25 26
       echo -n '3.0 (quilt)' > debian/source/format
    
    26 27
     
    
    ... ... @@ -30,7 +31,7 @@ export SOURCE_DATE_EPOCH='[% c("timestamp") %]'
    30 31
         deb_arch="$2"
    
    31 32
         mkdir $deb_arch
    
    32 33
         tar -C $deb_arch --strip-components=1 -xf "$src_tar"
    
    33
    -    mv "$src_tar" \
    
    34
    +    cp "$src_tar" \
    
    34 35
           ../[% c("var/system_pkg/pkg_name") %]_[% c("var/system_pkg/pkg_version") %].orig-$deb_arch.tar.xz
    
    35 36
       }
    
    36 37
       [% IF c("var/browser-linux-x86_64") -%]
    
    ... ... @@ -52,4 +53,34 @@ export SOURCE_DATE_EPOCH='[% c("timestamp") %]'
    52 53
         mv -f "$deb_file_name" *.dsc *.orig.tar.xz *.debian.tar.xz "$OUTDIR/"
    
    53 54
         popd
    
    54 55
       [% END -%]
    
    56
    +
    
    57
    +  cd ..
    
    58
    +[% END %]
    
    59
    +
    
    60
    +[% IF c("var/build_rpm_pkg") -%]
    
    61
    +
    
    62
    +  cat > ~/.rpmmacros << EOF
    
    63
    +  %clamp_mtime_to_source_date_epoch 1
    
    64
    +  %use_source_date_epoch_as_buildtime 1
    
    65
    +  %build_mtime_policy clamp_to_source_date_epoch
    
    66
    +  %_buildhost localhost
    
    67
    +EOF
    
    68
    +
    
    69
    +  mkdir rpm
    
    70
    +  cd rpm
    
    71
    +  mkdir SPECS SOURCES
    
    72
    +  cp -a $rootdir/[% c("var/system_pkg/pkg_name") %].spec SPECS
    
    73
    +  cp -a $rootdir/Makefile $rootdir/[% c("var/system_pkg/pkg_name") %].desktop SOURCES/
    
    74
    +  [% IF c("var/browser-linux-x86_64") -%]
    
    75
    +    cp -a $rootdir/[% c('input_files_by_name/linux-x86_64') %]/[% c("var/project-name") %]-linux-x86_64-[% c("version") %].tar.xz \
    
    76
    +      SOURCES/[% c("var/system_pkg/pkg_name") %]-linux-x86_64-[% c("var/system_pkg/pkg_version") %].tar.xz
    
    77
    +  [% END -%]
    
    78
    +  [% IF c("var/browser-linux-i686") -%]
    
    79
    +    cp -a $rootdir/[% c('input_files_by_name/linux-i686') %]/[% c("var/project-name") %]-linux-i686-[% c("version") %].tar.xz \
    
    80
    +      SOURCES/[% c("var/system_pkg/pkg_name") %]-linux-i686-[% c("var/system_pkg/pkg_version") %].tar.xz
    
    81
    +  [% END -%]
    
    82
    +  rpmdir=$(pwd)
    
    83
    +  rpmbuild --define "_topdir $rpmdir" -v -bb SPECS/[% c("var/system_pkg/pkg_name") %].spec
    
    84
    +  mv RPMS/*/*.rpm "$OUTDIR/"
    
    85
    +
    
    55 86
     [% END %]

  • projects/linux-packages/config
    ... ... @@ -6,11 +6,10 @@ container:
    6 6
       use_container: 1
    
    7 7
     
    
    8 8
     var:
    
    9
    -  build_deb_pkg: '[% c("var/mullvad-browser") %]'
    
    10 9
       system_pkg:
    
    11 10
         install_path: 'usr/lib/[% c("var/system_pkg/pkg_name") %]'
    
    12 11
         pkg_name: '[% c("var/project-name") %]-[% c("var/channel") %]'
    
    13
    -    pkg_version: '[% c("var/torbrowser_version") %]-[% c("var/torbrowser_build") %]'
    
    12
    +    pkg_version: '[% c("var/torbrowser_version") %]'
    
    14 13
         pkg_revision: '1'
    
    15 14
         pkg_description: '[% c("var/display_name") %]'
    
    16 15
         deb_release_date: '[% USE date; date.format(c("timestamp"), format = "%a, %d %b %Y 01:02:03 +0000", locale = "en_US") %]'
    
    ... ... @@ -19,25 +18,42 @@ var:
    19 18
           - '[% IF c("var/browser-linux-x86_64") %]amd64[% END %]'
    
    20 19
           - '[% IF c("var/browser-linux-i686") %]i386[% END %]'
    
    21 20
     
    
    22
    -  arch_deps:
    
    23
    -    # Packages needed to build the deb package
    
    24
    -    - dpkg-dev
    
    25
    -    - debhelper
    
    26
    -    - dh-exec
    
    27
    -    # Packages needed to generate dependencies for the deb package
    
    28
    -    - linux-libc-dev
    
    29
    -    - libasound2-dev
    
    30
    -    - libfontconfig1-dev
    
    31
    -    - libfreetype6-dev
    
    32
    -    - libgconf2-dev
    
    33
    -    - libgtk-3-dev
    
    34
    -    - libpango1.0-dev
    
    35
    -    - libpulse-dev
    
    36
    -    - libx11-xcb-dev
    
    37
    -    - libxt-dev
    
    38 21
     
    
    39 22
     targets:
    
    40 23
     
    
    24
    +  deb:
    
    25
    +    var:
    
    26
    +      build_deb_pkg: '[% c("var/mullvad-browser") %]'
    
    27
    +      arch_deps:
    
    28
    +        # Packages needed to build the deb package
    
    29
    +        - dpkg-dev
    
    30
    +        - debhelper
    
    31
    +        - dh-exec
    
    32
    +        # Packages needed to generate dependencies for the deb package
    
    33
    +        - linux-libc-dev
    
    34
    +        - libasound2-dev
    
    35
    +        - libfontconfig1-dev
    
    36
    +        - libfreetype6-dev
    
    37
    +        - libgconf2-dev
    
    38
    +        - libgtk-3-dev
    
    39
    +        - libpango1.0-dev
    
    40
    +        - libpulse-dev
    
    41
    +        - libx11-xcb-dev
    
    42
    +        - libxt-dev
    
    43
    +
    
    44
    +  rpm:
    
    45
    +    var:
    
    46
    +      build_rpm_pkg: '[% c("var/mullvad-browser") %]'
    
    47
    +
    
    48
    +      arch_deps:
    
    49
    +        # Packages needed to build the rpm package
    
    50
    +        - rpm
    
    51
    +
    
    52
    +      # Use bookworm since rpm version from stretch does not produce
    
    53
    +      # reproducible rpm files
    
    54
    +      container:
    
    55
    +        suite: bookworm
    
    56
    +
    
    41 57
       browser-all:
    
    42 58
         - browser-linux-x86_64
    
    43 59
         - browser-linux-i686
    
    ... ... @@ -54,6 +70,8 @@ targets:
    54 70
       torbrowser:
    
    55 71
         var:
    
    56 72
           browser_type: torbrowser
    
    73
    +      system_pkg:
    
    74
    +        pkg_url: 'https://torproject.org/'
    
    57 75
       basebrowser:
    
    58 76
         var:
    
    59 77
           browser_type: basebrowser
    
    ... ... @@ -62,6 +80,7 @@ targets:
    62 80
           browser_type: mullvadbrowser
    
    63 81
           system_pkg:
    
    64 82
             pkg_description: 'Mullvad Browser is a privacy-focused web browser designed to minimize tracking and fingerprinting.'
    
    83
    +        pkg_url: 'https://mullvad.net/browser'
    
    65 84
     
    
    66 85
       release:
    
    67 86
         var:
    
    ... ... @@ -105,6 +124,11 @@ input_files:
    105 124
         content: "[% INCLUDE 'Makefile.in' %]"
    
    106 125
         refresh_input: 1
    
    107 126
     
    
    127
    +  - filename: '[% c("var/system_pkg/pkg_name") %].desktop'
    
    128
    +    content: "[% INCLUDE 'browser.desktop.in' %]"
    
    129
    +    refresh_input: 1
    
    130
    +    enable: '[% c("var/build_deb_pkg") || c("var/build_rpm_pkg") %]'
    
    131
    +
    
    108 132
       # Debian Package
    
    109 133
       - filename: debian/changelog
    
    110 134
         content: "[% INCLUDE 'debian/changelog.in' %]"
    
    ... ... @@ -120,25 +144,19 @@ input_files:
    120 144
         content: "[% INCLUDE 'debian/copyright.in' %]"
    
    121 145
         refresh_input: 1
    
    122 146
         enable: '[% c("var/build_deb_pkg") %]'
    
    123
    -  - filename: debian/install
    
    124
    -    content: "[% INCLUDE 'debian/install.in' %]"
    
    125
    -    refresh_input: 1
    
    126
    -    enable: '[% c("var/build_deb_pkg") %]'
    
    127 147
       - filename: debian/docs
    
    128 148
         content: "[% INCLUDE 'debian/docs.in' %]"
    
    129 149
         refresh_input: 1
    
    130 150
         enable: '[% c("var/build_deb_pkg") %]'
    
    131
    -  - filename: 'debian/[% c("var/system_pkg/pkg_name") %].desktop'
    
    132
    -    content: "[% INCLUDE 'debian/browser.desktop.in' %]"
    
    133
    -    refresh_input: 1
    
    134
    -    enable: '[% c("var/build_deb_pkg") %]'
    
    135
    -  - filename: debian/links
    
    136
    -    content: "[% INCLUDE 'debian/links.in' %]"
    
    137
    -    refresh_input: 1
    
    138
    -    enable: '[% c("var/build_deb_pkg") %]'
    
    139 151
       - filename: debian/rules
    
    140 152
         enable: '[% c("var/build_deb_pkg") %]'
    
    141 153
     
    
    154
    +  # rpm package
    
    155
    +  - filename: '[% c("var/system_pkg/pkg_name") %].spec'
    
    156
    +    content: "[% INCLUDE 'rpm-package.spec' %]"
    
    157
    +    refresh_input: 1
    
    158
    +    enable: '[% c("var/build_rpm_pkg") %]'
    
    159
    +
    
    142 160
     --- |
    
    143 161
       # This part of the file contains options written in perl
    
    144 162
       (
    

  • projects/linux-packages/debian/install.in deleted
    1
    -#! /usr/bin/dh-exec
    
    2
    -${DEB_HOST_ARCH}/Browser/* [% c("var/system_pkg/install_path") %]
    
    3
    -debian/[% c("var/system_pkg/pkg_name") %].desktop usr/share/applications

  • projects/linux-packages/debian/links.in deleted
    1
    -[% c("var/system_pkg/install_path") %]/start-[% c("var/project-name") %] usr/bin/[% c("var/system_pkg/pkg_name") %]
    
    2
    -[% c("var/system_pkg/install_path") %]/browser/chrome/icons/default/default16.png usr/share/icons/hicolor/16x16/apps/[% c("var/system_pkg/pkg_name") %].png
    
    3
    -[% c("var/system_pkg/install_path") %]/browser/chrome/icons/default/default32.png usr/share/icons/hicolor/32x32/apps/[% c("var/system_pkg/pkg_name") %].png
    
    4
    -[% c("var/system_pkg/install_path") %]/browser/chrome/icons/default/default48.png usr/share/icons/hicolor/48x48/apps/[% c("var/system_pkg/pkg_name") %].png
    
    5
    -[% c("var/system_pkg/install_path") %]/browser/chrome/icons/default/default64.png usr/share/icons/hicolor/64x64/apps/[% c("var/system_pkg/pkg_name") %].png
    
    6
    -[% c("var/system_pkg/install_path") %]/browser/chrome/icons/default/default128.png usr/share/icons/hicolor/128x128/apps/[% c("var/system_pkg/pkg_name") %].png
    
    7
    -[% c("var/system_pkg/install_path") %]/browser/chrome/icons/default/about-logo.svg usr/share/icons/hicolor/scalable/apps/[% c("var/system_pkg/pkg_name") %].svg

  • projects/linux-packages/rpm-package.spec
    1
    +# Avoid provides/requires from private libraries
    
    2
    +%global privlibs             libfreeblpriv3
    
    3
    +%global privlibs %{privlibs}|libipcclientcerts
    
    4
    +%global privlibs %{privlibs}|liblgpllibs
    
    5
    +%global privlibs %{privlibs}|libmozavcodec
    
    6
    +%global privlibs %{privlibs}|libmozavutil
    
    7
    +%global privlibs %{privlibs}|libmozgtk
    
    8
    +%global privlibs %{privlibs}|libmozsandbox
    
    9
    +%global privlibs %{privlibs}|libmozsqlite3
    
    10
    +%global privlibs %{privlibs}|libmozwayland
    
    11
    +%global privlibs %{privlibs}|libnspr4
    
    12
    +%global privlibs %{privlibs}|libnss3
    
    13
    +%global privlibs %{privlibs}|libnssckbi
    
    14
    +%global privlibs %{privlibs}|libnssutil3
    
    15
    +%global privlibs %{privlibs}|libplc4
    
    16
    +%global privlibs %{privlibs}|libplds4
    
    17
    +%global privlibs %{privlibs}|libsmime3
    
    18
    +%global privlibs %{privlibs}|libsoftokn3
    
    19
    +%global privlibs %{privlibs}|libssl3
    
    20
    +%global privlibs %{privlibs}|libstdc\\+\\+
    
    21
    +%global privlibs %{privlibs}|libxul
    
    22
    +%global __provides_exclude ^(%{privlibs})\\.so
    
    23
    +%global __requires_exclude ^(%{privlibs})\\.so
    
    24
    +
    
    25
    +Summary: [% c("var/display_name") %]
    
    26
    +Name:    [% c("var/system_pkg/pkg_name") %]
    
    27
    +Version: [% c("var/system_pkg/pkg_version") %]
    
    28
    +Release: [% c("var/system_pkg/pkg_revision") %]
    
    29
    +URL:     [% c("var/system_pkg/pkg_url") %]
    
    30
    +License: MPL-2.0 AND GPL-3.0-or-later AND OFL-1.1 AND Apache-2.0[% IF c("var/tor-browser") %] AND BSD-3-Clause AND CC0-1.0 AND MIT[% END %]
    
    31
    +Source0: Makefile
    
    32
    +Source1: [% c("var/system_pkg/pkg_name") %].desktop
    
    33
    +[% IF c("var/browser-linux-x86_64") -%]
    
    34
    +Source2: %{name}-linux-x86_64-%{version}.tar.xz
    
    35
    +[% END -%]
    
    36
    +[% IF c("var/browser-linux-i686") -%]
    
    37
    +Source3: %{name}-linux-i686-%{version}.tar.xz
    
    38
    +[% END -%]
    
    39
    +
    
    40
    +%description
    
    41
    +[% c("var/system_pkg/pkg_description") %]
    
    42
    +
    
    43
    +%prep
    
    44
    +mkdir -p "%name-%version"
    
    45
    +cd "%name-%version"
    
    46
    +cp %{_sourcedir}/Makefile .
    
    47
    +cp %{_sourcedir}/[% c("var/system_pkg/pkg_name") %].desktop .
    
    48
    +mkdir %{_arch}
    
    49
    +tar -C %{_arch} --strip-components=1 -xf %{_sourcedir}/%{name}-linux-%{_arch}-%{version}.tar.xz
    
    50
    +
    
    51
    +%build
    
    52
    +cd "%name-%version"
    
    53
    +DEB_TARGET_ARCH=%{_arch} make build
    
    54
    +
    
    55
    +%install
    
    56
    +cd "%name-%version"
    
    57
    +DEB_TARGET_ARCH=%{_arch} make install DESTDIR="$RPM_BUILD_ROOT"
    
    58
    +
    
    59
    +%files
    
    60
    +%defattr(-,root,root)
    
    61
    +/[% c('var/system_pkg/install_path') %]
    
    62
    +/usr/bin/[% c('var/system_pkg/pkg_name') %]
    
    63
    +/usr/share/applications/[% c("var/system_pkg/pkg_name") %].desktop
    
    64
    +/usr/share/icons/hicolor/16x16/apps/[% c("var/system_pkg/pkg_name") %].png
    
    65
    +/usr/share/icons/hicolor/32x32/apps/[% c("var/system_pkg/pkg_name") %].png
    
    66
    +/usr/share/icons/hicolor/48x48/apps/[% c("var/system_pkg/pkg_name") %].png
    
    67
    +/usr/share/icons/hicolor/64x64/apps/[% c("var/system_pkg/pkg_name") %].png
    
    68
    +/usr/share/icons/hicolor/128x128/apps/[% c("var/system_pkg/pkg_name") %].png
    
    69
    +/usr/share/icons/hicolor/scalable/apps/[% c("var/system_pkg/pkg_name") %].svg

  • projects/release/build
    ... ... @@ -38,7 +38,8 @@ mkdir -p "$destdir"
    38 38
       mv [% c('input_files_by_name/linux-x86_64') %]/* "$destdir"/
    
    39 39
     [% END -%]
    
    40 40
     [% IF c("var/linux-packages") -%]
    
    41
    -  mv [% c('input_files_by_name/linux-packages') %]/* "$destdir"/
    
    41
    +  mv [% c('input_files_by_name/deb-packages') %]/* "$destdir"/
    
    42
    +  mv [% c('input_files_by_name/rpm-packages') %]/* "$destdir"/
    
    42 43
     [% END -%]
    
    43 44
     [% IF c("var/browser-src") -%]
    
    44 45
       mv  [% c('input_files_by_name/src-firefox') %]      \
    
    ... ... @@ -62,7 +63,7 @@ EOF
    62 63
     # empty any existing sh256sums file
    
    63 64
     echo -n > sha256sums-unsigned-build.txt
    
    64 65
     # concat sha256sum entry for each file in set
    
    65
    -for i in $(ls -1 *.exe *.tar.xz *.dmg *.mar *.zip *.tar.gz *.apk *.bspatch *.json *.deb | grep -v '\.incremental\.mar$' | sort)
    
    66
    +for i in $(ls -1 *.exe *.tar.xz *.dmg *.mar *.zip *.tar.gz *.apk *.bspatch *.json *.deb *.rpm | grep -v '\.incremental\.mar$' | sort)
    
    66 67
     do
    
    67 68
       sha256sum $i >> sha256sums-unsigned-build.txt
    
    68 69
     done
    

  • projects/release/config
    ... ... @@ -188,11 +188,21 @@ input_files:
    188 188
           - '[% c("var/build_target") %]'
    
    189 189
           - '[% c("var/browser_type") %]-linux-i686'
    
    190 190
     
    
    191
    -  - name: linux-packages
    
    191
    +  - name: deb-packages
    
    192 192
         project: linux-packages
    
    193 193
         enable: '[% c("var/linux-packages") %]'
    
    194 194
         # Add linux-x86_64 targets for container config
    
    195 195
         target_prepend:
    
    196
    +      - deb
    
    197
    +      - linux-x86_64
    
    198
    +      - linux
    
    199
    +
    
    200
    +  - name: rpm-packages
    
    201
    +    project: linux-packages
    
    202
    +    enable: '[% c("var/linux-packages") %]'
    
    203
    +    # Add linux-x86_64 targets for container config
    
    204
    +    target_prepend:
    
    205
    +      - rpm
    
    196 206
           - linux-x86_64
    
    197 207
           - linux
    
    198 208
     
    

  • tools/signing/linux-signer-gpg-sign
    ... ... @@ -10,7 +10,7 @@ test -n "$GPG_PASS" || read -sp "Enter gpg passphrase: " GPG_PASS
    10 10
     currentdir=$(pwd)
    
    11 11
     for i in `find . -name "*.dmg" -o -name "*.exe" -o -name "*.tar.xz" \
    
    12 12
       -o -name "*.txt" -o -name "*.zip" -o -name "*.tar.gz" -o -name "*.apk" \
    
    13
    -  -o -name "*.deb" | sort`
    
    13
    +  -o -name "*.deb" -o -name "*.rpm" | sort`
    
    14 14
     do
    
    15 15
       if test -f "$i.asc"
    
    16 16
       then