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

Commits:

17 changed files:

Changes:

  • projects/browser/RelativeLink/start-browser
    ... ... @@ -9,9 +9,9 @@ complain_dialog_title="[% c('var/Project_Name') %]"
    9 9
     
    
    10 10
     # Make sure this script wasn't started as 'sh start-[% c('var/project-name') %]' or similar.
    
    11 11
     if [ "x$BASH" = "x" ]; then
    
    12
    -    echo "$complain_dialog_title should be started as './start-[% c('var/project-name') %]'"
    
    13
    -    echo "Exiting." >&2
    
    14
    -    exit 1;
    
    12
    +  echo "$complain_dialog_title should be started as './start-[% c('var/project-name') %]'"
    
    13
    +  echo "Exiting." >&2
    
    14
    +  exit 1;
    
    15 15
     fi
    
    16 16
     
    
    17 17
     # Do not (try to) connect to the session manager
    
    ... ... @@ -21,84 +21,86 @@ unset SESSION_MANAGER
    21 21
     # Usage: complain message
    
    22 22
     # message must not begin with a dash.
    
    23 23
     complain () {
    
    24
    -	# Trim leading newlines, to avoid breaking formatting in some dialogs.
    
    25
    -	complain_message="`echo "$1" | sed '/./,$!d'`"
    
    26
    -
    
    27
    -	# If we're being run in debug/verbose mode, complain to stderr.
    
    28
    -	if [ "$show_output" -eq 1 ]; then
    
    29
    -		echo "$complain_message" >&2
    
    30
    -		return
    
    31
    -	fi
    
    32
    -
    
    33
    -	# Otherwise, we're being run by a GUI program of some sort;
    
    34
    -	# try to pop up a message in the GUI in the nicest way
    
    35
    -	# possible.
    
    36
    -	#
    
    37
    -	# In mksh, non-existent commands return 127; I'll assume all
    
    38
    -	# other shells set the same exit code if they can't run a
    
    39
    -	# command.  (xmessage returns 1 if the user clicks the WM
    
    40
    -	# close button, so we do need to look at the exact exit code,
    
    41
    -	# not just assume the command failed to display a message if
    
    42
    -	# it returns non-zero.)
    
    43
    -
    
    44
    -	# First, try zenity.
    
    45
    -	zenity --error \
    
    46
    -		--title="$complain_dialog_title" \
    
    47
    -		--text="$complain_message"
    
    48
    -	if [ "$?" -ne 127 ]; then
    
    49
    -		return
    
    50
    -	fi
    
    51
    -
    
    52
    -	# Try kdialog.
    
    53
    -	kdialog --title "$complain_dialog_title" \
    
    54
    -		--error "$complain_message"
    
    55
    -	if [ "$?" -ne 127 ]; then
    
    56
    -		return
    
    57
    -	fi
    
    58
    -
    
    59
    -	# Try xmessage.
    
    60
    -	xmessage -title "$complain_dialog_title" \
    
    61
    -		-center \
    
    62
    -		-buttons OK \
    
    63
    -		-default OK \
    
    64
    -		-xrm '*message.scrollVertical: Never' \
    
    65
    -		"$complain_message"
    
    66
    -	if [ "$?" -ne 127 ]; then
    
    67
    -		return
    
    68
    -	fi
    
    69
    -
    
    70
    -	# Try gxmessage.  This one isn't installed by default on
    
    71
    -	# Debian with the default GNOME installation, so it seems to
    
    72
    -	# be the least likely program to have available, but it might
    
    73
    -	# be used by one of the 'lightweight' Gtk-based desktop
    
    74
    -	# environments.
    
    75
    -	gxmessage -title "$complain_dialog_title" \
    
    76
    -		-center \
    
    77
    -		-buttons GTK_STOCK_OK \
    
    78
    -		-default OK \
    
    79
    -		"$complain_message"
    
    80
    -	if [ "$?" -ne 127 ]; then
    
    81
    -		return
    
    82
    -	fi
    
    24
    +  # Trim leading newlines, to avoid breaking formatting in some dialogs.
    
    25
    +  complain_message="`echo "$1" | sed '/./,$!d'`"
    
    26
    +
    
    27
    +  # If we're being run in debug/verbose mode, complain to stderr.
    
    28
    +  if [ "$show_output" -eq 1 ]; then
    
    29
    +    echo "$complain_message" >&2
    
    30
    +    return
    
    31
    +  fi
    
    32
    +
    
    33
    +  # Otherwise, we're being run by a GUI program of some sort;
    
    34
    +  # try to pop up a message in the GUI in the nicest way
    
    35
    +  # possible.
    
    36
    +  #
    
    37
    +  # In mksh, non-existent commands return 127; I'll assume all
    
    38
    +  # other shells set the same exit code if they can't run a
    
    39
    +  # command.  (xmessage returns 1 if the user clicks the WM
    
    40
    +  # close button, so we do need to look at the exact exit code,
    
    41
    +  # not just assume the command failed to display a message if
    
    42
    +  # it returns non-zero.)
    
    43
    +
    
    44
    +  # First, try zenity.
    
    45
    +  zenity --error \
    
    46
    +         --title="$complain_dialog_title" \
    
    47
    +         --text="$complain_message"
    
    48
    +  if [ "$?" -ne 127 ]; then
    
    49
    +    return
    
    50
    +  fi
    
    51
    +
    
    52
    +  # Try kdialog.
    
    53
    +  kdialog --title "$complain_dialog_title" \
    
    54
    +          --error "$complain_message"
    
    55
    +  if [ "$?" -ne 127 ]; then
    
    56
    +    return
    
    57
    +  fi
    
    58
    +
    
    59
    +  # Try xmessage.
    
    60
    +  xmessage -title "$complain_dialog_title" \
    
    61
    +           -center \
    
    62
    +           -buttons OK \
    
    63
    +           -default OK \
    
    64
    +           -xrm '*message.scrollVertical: Never' \
    
    65
    +           "$complain_message"
    
    66
    +  if [ "$?" -ne 127 ]; then
    
    67
    +    return
    
    68
    +  fi
    
    69
    +
    
    70
    +  # Try gxmessage.  This one isn't installed by default on
    
    71
    +  # Debian with the default GNOME installation, so it seems to
    
    72
    +  # be the least likely program to have available, but it might
    
    73
    +  # be used by one of the 'lightweight' Gtk-based desktop
    
    74
    +  # environments.
    
    75
    +  gxmessage -title "$complain_dialog_title" \
    
    76
    +            -center \
    
    77
    +            -buttons GTK_STOCK_OK \
    
    78
    +            -default OK \
    
    79
    +            "$complain_message"
    
    80
    +  if [ "$?" -ne 127 ]; then
    
    81
    +    return
    
    82
    +  fi
    
    83 83
     }
    
    84 84
     
    
    85 85
     if [ "`id -u`" -eq 0 ]; then
    
    86
    -	complain "The [% c('var/Project_Name') %] should not be run as root.  Exiting."
    
    87
    -	exit 1
    
    86
    +  complain "The [% c('var/Project_Name') %] should not be run as root.  Exiting."
    
    87
    +  exit 1
    
    88 88
     fi
    
    89 89
     
    
    90 90
     if test -r /proc/cpuinfo && ! grep -q '^flags\s*:.* sse2' /proc/cpuinfo; then
    
    91
    -        complain "[% c('var/Project_Name') %] requires a CPU with SSE2 support.  Exiting."
    
    92
    -        exit 1
    
    91
    +  complain "[% c('var/Project_Name') %] requires a CPU with SSE2 support.  Exiting."
    
    92
    +  exit 1
    
    93 93
     fi
    
    94 94
     
    
    95 95
     print_usage () {
    
    96
    -    printf "\n[% c('var/Project_Name') %] Script Options\n"
    
    97
    -    printf "  --verbose         Display [% IF c("var/tor-browser") -%]Tor and [% END -%]the browser output in the terminal\n"
    
    98
    -    printf "  --log [file]      Record [% IF c("var/tor-browser") -%]Tor and [% END -%]the browser output in file (default: [% c('var/project-name') %].log)\n"
    
    99
    -    printf "  --detach          Detach from terminal and run [% c('var/Project_Name') %] in the background.\n"
    
    96
    +  printf "\n[% c('var/Project_Name') %] Script Options\n"
    
    97
    +  printf "  --verbose         Display [% IF c("var/tor-browser") -%]Tor and [% END -%]the browser output in the terminal\n"
    
    98
    +  printf "  --log [file]      Record [% IF c("var/tor-browser") -%]Tor and [% END -%]the browser output in file (default: [% c('var/project-name') %].log)\n"
    
    99
    +  printf "  --detach          Detach from terminal and run [% c('var/Project_Name') %] in the background.\n"
    
    100
    +  if test -z "$system_install"; then
    
    100 101
         printf "  --register-app    Register [% c('var/Project_Name') %] as a desktop app for this user\n"
    
    101 102
         printf "  --unregister-app  Unregister [% c('var/Project_Name') %] as a desktop app for this user\n"
    
    103
    +  fi
    
    102 104
     }
    
    103 105
     log_output=0
    
    104 106
     show_output=0
    
    ... ... @@ -108,116 +110,122 @@ register_desktop_app=0
    108 110
     logfile=/dev/null
    
    109 111
     while :
    
    110 112
     do
    
    111
    -    case "$1" in
    
    112
    -      --detach)
    
    113
    -          detach=1
    
    114
    -          shift
    
    115
    -          ;;
    
    116
    -      -v | --verbose | -d | --debug)
    
    117
    -          show_output=1
    
    118
    -          verbose_arg="$2"
    
    119
    -          shift
    
    120
    -          ;;
    
    121
    -      -h | "-?" | --help | -help)
    
    122
    -          show_usage=1
    
    123
    -          show_output=1
    
    124
    -          shift
    
    125
    -          ;;
    
    126
    -      -l | --log)
    
    127
    -          if [ -z "$2" -o "${2:0:1}" == "-" ]; then
    
    128
    -             printf "Logging [% c('var/Project_Name') %] debug information to [% c('var/project-name') %].log\n"
    
    129
    -             logfile="../[% c('var/project-name') %].log"
    
    130
    -          elif [ "${2:0:1}" == "/" -o "${2:0:1}" == "~" ]; then
    
    131
    -             printf "Logging [% c('var/Project_Name') %] debug information to %s\n" "$2"
    
    132
    -             logfile="$2"
    
    133
    -             shift
    
    134
    -          else
    
    135
    -             printf "Logging [% c('var/Project_Name') %] debug information to %s\n" "$2"
    
    136
    -             logfile="../$2"
    
    137
    -             shift
    
    138
    -          fi
    
    139
    -          log_output=1
    
    140
    -          shift
    
    141
    -          ;;
    
    142
    -      --register-app)
    
    143
    -          register_desktop_app=1
    
    144
    -          show_output=1
    
    145
    -          shift
    
    146
    -          ;;
    
    147
    -      --unregister-app)
    
    148
    -          register_desktop_app=-1
    
    149
    -          show_output=1
    
    150
    -          shift
    
    151
    -          ;;
    
    152
    -      *) # No more options
    
    153
    -          break
    
    154
    -          ;;
    
    155
    -    esac
    
    113
    +  case "$1" in
    
    114
    +    --detach)
    
    115
    +      detach=1
    
    116
    +      shift
    
    117
    +      ;;
    
    118
    +    -v | --verbose | -d | --debug)
    
    119
    +      show_output=1
    
    120
    +      verbose_arg="$2"
    
    121
    +      shift
    
    122
    +      ;;
    
    123
    +    -h | "-?" | --help | -help)
    
    124
    +      show_usage=1
    
    125
    +      show_output=1
    
    126
    +      shift
    
    127
    +      ;;
    
    128
    +    -l | --log)
    
    129
    +      if [ -z "$2" -o "${2:0:1}" == "-" ]; then
    
    130
    +        printf "Logging [% c('var/Project_Name') %] debug information to [% c('var/project-name') %].log\n"
    
    131
    +        logfile="../[% c('var/project-name') %].log"
    
    132
    +      elif [ "${2:0:1}" == "/" -o "${2:0:1}" == "~" ]; then
    
    133
    +        printf "Logging [% c('var/Project_Name') %] debug information to %s\n" "$2"
    
    134
    +        logfile="$2"
    
    135
    +        shift
    
    136
    +      else
    
    137
    +        printf "Logging [% c('var/Project_Name') %] debug information to %s\n" "$2"
    
    138
    +        logfile="../$2"
    
    139
    +        shift
    
    140
    +      fi
    
    141
    +      log_output=1
    
    142
    +      shift
    
    143
    +      ;;
    
    144
    +    --register-app)
    
    145
    +      register_desktop_app=1
    
    146
    +      show_output=1
    
    147
    +      shift
    
    148
    +      ;;
    
    149
    +    --unregister-app)
    
    150
    +      register_desktop_app=-1
    
    151
    +      show_output=1
    
    152
    +      shift
    
    153
    +      ;;
    
    154
    +    *) # No more options
    
    155
    +      break
    
    156
    +      ;;
    
    157
    +  esac
    
    156 158
     done
    
    157 159
     
    
    158 160
     # We can't detach and show output at the same time..
    
    159 161
     if [ "$show_output" -eq 1 -a "$detach" -eq 1 ]; then
    
    160
    -    detach=0
    
    162
    +  detach=0
    
    161 163
     fi
    
    162 164
     
    
    163 165
     if [ "$show_output" -eq 0 ]; then
    
    164
    -    # If the user hasn't requested 'debug mode' or --help, close stdout and stderr,
    
    165
    -    # to keep Firefox and the stuff loaded by/for it (including the
    
    166
    -    # system's shared-library loader) from printing messages to
    
    167
    -    # $HOME/.xsession-errors or other files. (Users wouldn't have seen
    
    168
    -    # messages there anyway.)
    
    169
    -    exec > "$logfile"
    
    170
    -    exec 2> "$logfile"
    
    166
    +  # If the user hasn't requested 'debug mode' or --help, close stdout and stderr,
    
    167
    +  # to keep Firefox and the stuff loaded by/for it (including the
    
    168
    +  # system's shared-library loader) from printing messages to
    
    169
    +  # $HOME/.xsession-errors or other files. (Users wouldn't have seen
    
    170
    +  # messages there anyway.)
    
    171
    +  exec > "$logfile"
    
    172
    +  exec 2> "$logfile"
    
    171 173
     fi
    
    172 174
     
    
    173 175
     # If XAUTHORITY is unset, set it to its default value of $HOME/.Xauthority
    
    174 176
     # before we change HOME below.  (See xauth(1) and #1945.)  XDM and KDM rely
    
    175 177
     # on applications using this default value.
    
    176 178
     if [ -z "$XAUTHORITY" ]; then
    
    177
    -	XAUTHORITY=~/.Xauthority
    
    178
    -	export XAUTHORITY
    
    179
    +  XAUTHORITY=~/.Xauthority
    
    180
    +  export XAUTHORITY
    
    179 181
     fi
    
    180 182
     
    
    181 183
     # If this script is being run through a symlink, we need to know where
    
    182 184
     # in the filesystem the script itself is, not where the symlink is.
    
    183 185
     myname="$0"
    
    184 186
     if [ -L "$myname" ]; then
    
    185
    -	# XXX readlink is not POSIX, but is present in GNU coreutils
    
    186
    -	# and on FreeBSD.  Unfortunately, the -f option (which follows
    
    187
    -	# a whole chain of symlinks until it reaches a non-symlink
    
    188
    -	# path name) is a GNUism, so we have to have a fallback for
    
    189
    -	# FreeBSD.  Fortunately, FreeBSD has realpath instead;
    
    190
    -	# unfortunately, that's also non-POSIX and is not present in
    
    191
    -	# GNU coreutils.
    
    192
    -	#
    
    193
    -	# If this launcher were a C program, we could just use the
    
    194
    -	# realpath function, which *is* POSIX.  Too bad POSIX didn't
    
    195
    -	# make that function accessible to shell scripts.
    
    196
    -
    
    197
    -	# If realpath is available, use it; it Does The Right Thing.
    
    198
    -	possibly_my_real_name="`realpath "$myname" 2>/dev/null`"
    
    199
    -	if [ "$?" -eq 0 ]; then
    
    200
    -		myname="$possibly_my_real_name"
    
    201
    -	else
    
    202
    -		# realpath is not available; hopefully readlink -f works.
    
    203
    -		myname="`readlink -f "$myname" 2>/dev/null`"
    
    204
    -		if [ "$?" -ne 0 ]; then
    
    205
    -			# Ugh.
    
    206
    -			complain "start-[% c('var/project-name') %] cannot be run using a symlink on this operating system."
    
    207
    -		fi
    
    208
    -	fi
    
    187
    +  # XXX readlink is not POSIX, but is present in GNU coreutils
    
    188
    +  # and on FreeBSD.  Unfortunately, the -f option (which follows
    
    189
    +  # a whole chain of symlinks until it reaches a non-symlink
    
    190
    +  # path name) is a GNUism, so we have to have a fallback for
    
    191
    +  # FreeBSD.  Fortunately, FreeBSD has realpath instead;
    
    192
    +  # unfortunately, that's also non-POSIX and is not present in
    
    193
    +  # GNU coreutils.
    
    194
    +  #
    
    195
    +  # If this launcher were a C program, we could just use the
    
    196
    +  # realpath function, which *is* POSIX.  Too bad POSIX didn't
    
    197
    +  # make that function accessible to shell scripts.
    
    198
    +
    
    199
    +  # If realpath is available, use it; it Does The Right Thing.
    
    200
    +  possibly_my_real_name="`realpath "$myname" 2>/dev/null`"
    
    201
    +  if [ "$?" -eq 0 ]; then
    
    202
    +    myname="$possibly_my_real_name"
    
    203
    +  else
    
    204
    +    # realpath is not available; hopefully readlink -f works.
    
    205
    +    myname="`readlink -f "$myname" 2>/dev/null`"
    
    206
    +    if [ "$?" -ne 0 ]; then
    
    207
    +      # Ugh.
    
    208
    +      complain "start-[% c('var/project-name') %] cannot be run using a symlink on this operating system."
    
    209
    +    fi
    
    210
    +  fi
    
    209 211
     fi
    
    210 212
     
    
    211
    -# Try to be agnostic to where we're being started from, chdir to where
    
    212
    -# the script is.
    
    213
    -mydir="`dirname "$myname"`"
    
    214
    -test -d "$mydir" && cd "$mydir"
    
    213
    +cd "$(dirname "$myname")"
    
    214
    +browser_dir="$(pwd)"
    
    215
    +if test -f "$browser_dir/is-packaged-app"; then
    
    216
    +  system_install=1
    
    217
    +  browser_home="$HOME/.[% pc('linux-packages', 'var/system_pkg/pkg_name') %]"
    
    218
    +  mkdir -p "$browser_home"
    
    219
    +  cd "$browser_home"
    
    220
    +else
    
    221
    +  browser_home="$browser_dir"
    
    222
    +fi
    
    215 223
     
    
    216 224
     # If ${PWD} results in a zero length string, we can try something else...
    
    217 225
     if [ ! "${PWD}" ]; then
    
    218
    -	# "hacking around some braindamage"
    
    219
    -	PWD="`pwd`"
    
    220
    -	surveysays="This system has a messed up shell.\n"
    
    226
    +  # "hacking around some braindamage"
    
    227
    +  PWD="`pwd`"
    
    228
    +  surveysays="This system has a messed up shell.\n"
    
    221 229
     fi
    
    222 230
     
    
    223 231
     # This is a fix for an ibus issue on some Linux systems. See #9353 for more
    
    ... ... @@ -227,46 +235,48 @@ if [ ! -d ".config/ibus" ]; then
    227 235
       ln -nsf ~/.config/ibus/bus .config/ibus
    
    228 236
     fi
    
    229 237
     
    
    230
    -# Fix up .desktop Icon and Exec Paths, and update the .desktop file from the
    
    231
    -# canonical version if it was changed by the updater.
    
    232
    -cp start-[% c('var/project-name') %].desktop ../
    
    233
    -sed -i -e "s,^Name=.*,Name=[% c('var/Project_Name') %],g" ../start-[% c('var/project-name') %].desktop
    
    234
    -sed -i -e "s,^Icon=.*,Icon=$PWD/browser/chrome/icons/default/default128.png,g" ../start-[% c('var/project-name') %].desktop
    
    235
    -sed -i -e "s,^Icon=.*,Icon=$PWD/browser/chrome/icons/default/default128.png,g" start-[% c('var/project-name') %].desktop
    
    236
    -sed -i -e "s,^Exec=.*,Exec=sh -c '\"$PWD/start-[% c('var/project-name') %]\" --detach || ([ !  -x \"$PWD/start-[% c('var/project-name') %]\" ] \&\& \"\$(dirname \"\$*\")\"/Browser/start-[% c('var/project-name') %] --detach)' dummy %k,g" ../start-[% c('var/project-name') %].desktop
    
    237
    -
    
    238
    -if [ "$register_desktop_app" -eq 1 ]; then
    
    239
    -	mkdir -p "$HOME/.local/share/applications/"
    
    240
    -	cp ../start-[% c('var/project-name') %].desktop "$HOME/.local/share/applications/"
    
    241
    -	update-desktop-database "$HOME/.local/share/applications/"
    
    242
    -	printf "[% c('var/Project_Name') %] has been registered as a desktop app for this user in ~/.local/share/applications/\n"
    
    243
    -	exit 0
    
    244
    -fi
    
    245
    -
    
    246
    -if [ "$register_desktop_app" -eq -1 ]; then
    
    247
    -	if [ -e "$HOME/.local/share/applications/start-[% c('var/project-name') %].desktop" ]; then
    
    248
    -		rm -f "$HOME/.local/share/applications/start-[% c('var/project-name') %].desktop"
    
    249
    -		update-desktop-database "$HOME/.local/share/applications/"
    
    250
    -		printf "[% c('var/Project_Name') %] has been removed as a user desktop app (from ~/.local/share/applications/)\n"
    
    251
    -	else
    
    252
    -		printf "[% c('var/Project_Name') %] does not appear to be a desktop app (not present in ~/.local/share/applications/)\n"
    
    253
    -	fi
    
    254
    -	exit 0
    
    238
    +if test -z "$system_install"; then
    
    239
    +  # Fix up .desktop Icon and Exec Paths, and update the .desktop file from the
    
    240
    +  # canonical version if it was changed by the updater.
    
    241
    +  cp start-[% c('var/project-name') %].desktop ../
    
    242
    +  sed -i -e "s,^Name=.*,Name=[% c('var/Project_Name') %],g" ../start-[% c('var/project-name') %].desktop
    
    243
    +  sed -i -e "s,^Icon=.*,Icon=$PWD/browser/chrome/icons/default/default128.png,g" ../start-[% c('var/project-name') %].desktop
    
    244
    +  sed -i -e "s,^Icon=.*,Icon=$PWD/browser/chrome/icons/default/default128.png,g" start-[% c('var/project-name') %].desktop
    
    245
    +  sed -i -e "s,^Exec=.*,Exec=sh -c '\"$PWD/start-[% c('var/project-name') %]\" --detach || ([ !  -x \"$PWD/start-[% c('var/project-name') %]\" ] \&\& \"\$(dirname \"\$*\")\"/Browser/start-[% c('var/project-name') %] --detach)' dummy %k,g" ../start-[% c('var/project-name') %].desktop
    
    246
    +
    
    247
    +  if [ "$register_desktop_app" -eq 1 ]; then
    
    248
    +    mkdir -p "$HOME/.local/share/applications/"
    
    249
    +    cp ../start-[% c('var/project-name') %].desktop "$HOME/.local/share/applications/"
    
    250
    +    update-desktop-database "$HOME/.local/share/applications/"
    
    251
    +    printf "[% c('var/Project_Name') %] has been registered as a desktop app for this user in ~/.local/share/applications/\n"
    
    252
    +    exit 0
    
    253
    +  fi
    
    254
    +
    
    255
    +  if [ "$register_desktop_app" -eq -1 ]; then
    
    256
    +    if [ -e "$HOME/.local/share/applications/start-[% c('var/project-name') %].desktop" ]; then
    
    257
    +      rm -f "$HOME/.local/share/applications/start-[% c('var/project-name') %].desktop"
    
    258
    +      update-desktop-database "$HOME/.local/share/applications/"
    
    259
    +      printf "[% c('var/Project_Name') %] has been removed as a user desktop app (from ~/.local/share/applications/)\n"
    
    260
    +    else
    
    261
    +      printf "[% c('var/Project_Name') %] does not appear to be a desktop app (not present in ~/.local/share/applications/)\n"
    
    262
    +    fi
    
    263
    +    exit 0
    
    264
    +  fi
    
    255 265
     fi
    
    256 266
     
    
    257 267
     export BB_ORIGINAL_HOME="$HOME"
    
    258
    -HOME="${PWD}"
    
    268
    +HOME="$browser_home"
    
    259 269
     export HOME
    
    260 270
     
    
    261 271
     # Prevent disk leaks in $HOME/.local/share (tor-browser#17560)
    
    262 272
     function erase_leaky() {
    
    263
    -	local leaky="$1"
    
    264
    -	[ -e "$leaky" ] &&
    
    265
    -	( srm -r "$leaky" ||
    
    266
    -	  wipe -r "$leaky" ||
    
    267
    -	  find "$leaky" -type f -exec shred -u {} \; ;
    
    268
    -	  rm -rf "$leaky"
    
    269
    -	) > /dev/null 2>&1
    
    273
    +  local leaky="$1"
    
    274
    +  [ -e "$leaky" ] &&
    
    275
    +    ( srm -r "$leaky" ||
    
    276
    +      wipe -r "$leaky" ||
    
    277
    +      find "$leaky" -type f -exec shred -u {} \; ;
    
    278
    +      rm -rf "$leaky"
    
    279
    +    ) > /dev/null 2>&1
    
    270 280
     }
    
    271 281
     local_dir="$HOME/.local/"
    
    272 282
     share_dir="$local_dir/share"
    
    ... ... @@ -275,14 +285,14 @@ share_dir="$local_dir/share"
    275 285
     # We're not using realpath/readlink for consistency with the (possibly
    
    276 286
     # outdated) availability assumptions made elsewhere in this script.
    
    277 287
     if ! [ -L "$local_dir" -o -L "$share_dir" ]; then
    
    278
    -	if [ -d "$share_dir" ]; then
    
    279
    -		for leaky_path in "gvfs-metadata" "recently-used.xbel"; do
    
    280
    -			erase_leaky "$share_dir/$leaky_path"
    
    281
    -		done
    
    282
    -	else
    
    283
    -		mkdir -p "$local_dir"
    
    284
    -	fi
    
    285
    -	ln -fs /dev/null "$share_dir"
    
    288
    +  if [ -d "$share_dir" ]; then
    
    289
    +    for leaky_path in "gvfs-metadata" "recently-used.xbel"; do
    
    290
    +      erase_leaky "$share_dir/$leaky_path"
    
    291
    +    done
    
    292
    +  else
    
    293
    +    mkdir -p "$local_dir"
    
    294
    +  fi
    
    295
    +  ln -fs /dev/null "$share_dir"
    
    286 296
     fi
    
    287 297
     [ -L "$HOME/.cache" ] || erase_leaky "$HOME/.cache/nvidia"
    
    288 298
     
    
    ... ... @@ -291,8 +301,8 @@ SYSARCHITECTURE=$(getconf LONG_BIT)
    291 301
     TORARCHITECTURE=$(expr "$(file TorBrowser/Tor/tor)" : '.*ELF \([[:digit:]]*\)')
    
    292 302
     
    
    293 303
     if [ $SYSARCHITECTURE -ne $TORARCHITECTURE ]; then
    
    294
    -   complain "Wrong architecture? 32-bit vs. 64-bit."
    
    295
    -   exit 1
    
    304
    +  complain "Wrong architecture? 32-bit vs. 64-bit."
    
    305
    +  exit 1
    
    296 306
     fi
    
    297 307
     [% END -%]
    
    298 308
     
    
    ... ... @@ -305,27 +315,27 @@ export ASAN_OPTIONS
    305 315
     
    
    306 316
     [% IF c("var/tor-browser") -%]
    
    307 317
     function setControlPortPasswd() {
    
    308
    -    local ctrlPasswd=$1
    
    309
    -
    
    310
    -    if test -z "$ctrlPasswd" -o "$ctrlPasswd" = $'\"secret\"' ; then
    
    311
    -        unset TOR_CONTROL_PASSWD
    
    312
    -        return
    
    313
    -    fi
    
    314
    -
    
    315
    -    if test "${ctrlPasswd:0:1}" = $'\"'; then  # First 2 chars were '"
    
    316
    -        printf "Using system Tor process.\n"
    
    317
    -        export TOR_CONTROL_PASSWD
    
    318
    -    else
    
    319
    -        complain "There seems to have been a quoting problem with your \
    
    318
    +  local ctrlPasswd=$1
    
    319
    +
    
    320
    +  if test -z "$ctrlPasswd" -o "$ctrlPasswd" = $'\"secret\"' ; then
    
    321
    +    unset TOR_CONTROL_PASSWD
    
    322
    +    return
    
    323
    +  fi
    
    324
    +
    
    325
    +  if test "${ctrlPasswd:0:1}" = $'\"'; then  # First 2 chars were '"
    
    326
    +    printf "Using system Tor process.\n"
    
    327
    +    export TOR_CONTROL_PASSWD
    
    328
    +  else
    
    329
    +    complain "There seems to have been a quoting problem with your \
    
    320 330
     TOR_CONTROL_PASSWD environment variable."
    
    321
    -	echo "The Tor ControlPort password should be given inside double"
    
    322
    -	echo "quotes, inside single quotes. That is, if the ControlPort"
    
    323
    -	echo 'password is “secret” (without curly quotes) then we must'
    
    324
    -	echo "start this script after setting the environment variable"
    
    325
    -	echo "exactly like this:"
    
    326
    -	echo
    
    327
    -	echo "  \$ TOR_CONTROL_PASSWD='\"secret\"' $myname"
    
    328
    -    fi
    
    331
    +    echo "The Tor ControlPort password should be given inside double"
    
    332
    +    echo "quotes, inside single quotes. That is, if the ControlPort"
    
    333
    +    echo 'password is “secret” (without curly quotes) then we must'
    
    334
    +    echo "start this script after setting the environment variable"
    
    335
    +    echo "exactly like this:"
    
    336
    +    echo
    
    337
    +    echo "  \$ TOR_CONTROL_PASSWD='\"secret\"' $myname"
    
    338
    +  fi
    
    329 339
     }
    
    330 340
     
    
    331 341
     # Using a system-installed Tor process with Tor Browser:
    
    ... ... @@ -367,7 +377,7 @@ setControlPortPasswd ${TOR_CONTROL_PASSWD:='"secret"'}
    367 377
     [% END -%]
    
    368 378
     
    
    369 379
     # Set up custom bundled fonts. See fonts-conf(5).
    
    370
    -export FONTCONFIG_PATH="${HOME}/fontconfig"
    
    380
    +export FONTCONFIG_PATH="$browser_dir/fontconfig"
    
    371 381
     export FONTCONFIG_FILE="fonts.conf"
    
    372 382
     [% # tor-browser#41776: We cannot make the updater remove this file.
    
    373 383
        # So, let's remove it on this script, since we know that at this point the
    
    ... ... @@ -397,19 +407,19 @@ cd "${HOME}"
    397 407
     # prevent from mixing up with them).
    
    398 408
     
    
    399 409
     if [ "$show_usage" -eq 1 ]; then
    
    400
    -    # Display Firefox help, then our help
    
    401
    -    [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] ./[% c('var/exe_name') %] --help 2>/dev/null
    
    402
    -    print_usage
    
    410
    +  # Display Firefox help, then our help
    
    411
    +  [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] "$browser_dir"/[% c('var/exe_name') %] --help 2>/dev/null
    
    412
    +  print_usage
    
    403 413
     elif [ "$detach" -eq 1 ] ; then
    
    404
    -    [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] ./[% c('var/exe_name') %] "${@}" > "$logfile" 2>&1 </dev/null &
    
    405
    -        disown "$!"
    
    414
    +  [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] "$browser_dir"/[% c('var/exe_name') %] "${@}" > "$logfile" 2>&1 </dev/null &
    
    415
    +  disown "$!"
    
    406 416
     elif [ "$log_output" -eq 1 -a "$show_output" -eq 1 ]; then
    
    407
    -    [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] ./[% c('var/exe_name') %] "${@}" 2>&1 </dev/null | \
    
    408
    -        tee "$logfile"
    
    417
    +  [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] "$browser_dir"/[% c('var/exe_name') %] "${@}" 2>&1 </dev/null | \
    
    418
    +    tee "$logfile"
    
    409 419
     elif [ "$show_output" -eq 1 ]; then
    
    410
    -    [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] ./[% c('var/exe_name') %] "${@}" < /dev/null
    
    420
    +  [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] "$browser_dir"/[% c('var/exe_name') %] "${@}" < /dev/null
    
    411 421
     else
    
    412
    -    [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] ./[% c('var/exe_name') %] "${@}" > "$logfile" 2>&1 </dev/null
    
    422
    +  [% IF c("var/tor-browser") %]TOR_CONTROL_PASSWD=${TOR_CONTROL_PASSWD}[% END %] "$browser_dir"/[% c('var/exe_name') %] "${@}" > "$logfile" 2>&1 </dev/null
    
    413 423
     fi
    
    414 424
     
    
    415 425
     exit $?

  • projects/browser/config
    ... ... @@ -14,7 +14,9 @@ var:
    14 14
       mar_osname: '[% c("var/osname") %]'
    
    15 15
       version_json: version.json
    
    16 16
     
    
    17
    +
    
    17 18
     targets:
    
    19
    +
    
    18 20
       linux:
    
    19 21
         var:
    
    20 22
           arch_deps:
    
    ... ... @@ -23,6 +25,7 @@ targets:
    23 25
             # share the container to reduce space used.
    
    24 26
             - libc6-i386
    
    25 27
           pt_path: ./TorBrowser/Tor/PluggableTransports/
    
    28
    +
    
    26 29
       macos:
    
    27 30
         var:
    
    28 31
           arch_deps:
    
    ... ... @@ -32,14 +35,17 @@ targets:
    32 35
             - python3-distutils-extra
    
    33 36
             - python3-psutil
    
    34 37
           pt_path: PluggableTransports/
    
    38
    +
    
    35 39
       macos-universal:
    
    36 40
         var:
    
    37 41
           mar_osname: macos
    
    42
    +
    
    38 43
       windows:
    
    39 44
         var:
    
    40 45
           arch_deps:
    
    41 46
             - python3-pefile
    
    42 47
           pt_path: TorBrowser\Tor\PluggableTransports\
    
    48
    +
    
    43 49
       android:
    
    44 50
         build: '[% INCLUDE build.android %]'
    
    45 51
         var:
    
    ... ... @@ -53,17 +59,21 @@ targets:
    53 59
             # apksigner.
    
    54 60
             suite: bookworm
    
    55 61
             arch: amd64
    
    62
    +
    
    56 63
       torbrowser:
    
    57 64
         var:
    
    58 65
           prefs_file: 000-tor-browser.js
    
    59 66
           version_json: tbb_version.json
    
    67
    +
    
    60 68
       basebrowser:
    
    61 69
         var:
    
    62 70
           prefs_file: 001-base-profile.js
    
    71
    +
    
    63 72
       mullvadbrowser:
    
    64 73
         var:
    
    65 74
           prefs_file: 001-base-profile.js
    
    66 75
     
    
    76
    +
    
    67 77
     input_files:
    
    68 78
       - project: container-image
    
    69 79
       - project: firefox
    

  • projects/linux-packages/Makefile.in
    1
    +build:
    
    2
    +	rm -f "${DEB_TARGET_ARCH}/Browser/start-[% c('var/project-name') %].desktop"
    
    3
    +	echo 'This is a packaged app.' > "${DEB_TARGET_ARCH}/Browser/is-packaged-app"
    
    4
    +	[% c("touch") %] "${DEB_TARGET_ARCH}/Browser/is-packaged-app"
    
    5
    +
    
    6
    +clean:
    
    7
    +	rm -f "${DEB_TARGET_ARCH}/Browser/is-packaged-app"

  • projects/linux-packages/build
    1
    +#!/bin/bash
    
    2
    +[% c("var/set_default_env") -%]
    
    3
    +distdir=/var/tmp/dist/[% project %]
    
    4
    +
    
    5
    +OUTDIR='[% dest_dir _ "/" _ c("filename") %]'
    
    6
    +mkdir -p $OUTDIR
    
    7
    +mkdir -p "$distdir"
    
    8
    +
    
    9
    +export SOURCE_DATE_EPOCH='[% c("timestamp") %]'
    
    10
    +
    
    11
    +[% IF c("var/build_deb_pkg") -%]
    
    12
    +  cd $distdir
    
    13
    +  project_dir=[% c("var/system_pkg/pkg_name") %]-[% c("var/system_pkg/pkg_version") %]
    
    14
    +  mkdir "$project_dir"
    
    15
    +  mv $rootdir/Makefile "$project_dir"
    
    16
    +  [% c('tar', {
    
    17
    +        tar_src => [ '$project_dir' ],
    
    18
    +        tar_args => '-cJf ' _ c("var/system_pkg/pkg_name") _ '_' _ c("var/system_pkg/pkg_version") _ '.orig.tar.xz',
    
    19
    +       }) %]
    
    20
    +
    
    21
    +  cd "$project_dir"
    
    22
    +  mv $rootdir/debian .
    
    23
    +  chmod +x debian/install debian/docs debian/rules
    
    24
    +  mkdir debian/source
    
    25
    +  echo -n '3.0 (quilt)' > debian/source/format
    
    26
    +
    
    27
    +
    
    28
    +  function extract_src_tar {
    
    29
    +    src_tar="$1"
    
    30
    +    deb_arch="$2"
    
    31
    +    mkdir $deb_arch
    
    32
    +    tar -C $deb_arch --strip-components=1 -xf "$src_tar"
    
    33
    +    mv "$src_tar" \
    
    34
    +      ../[% c("var/system_pkg/pkg_name") %]_[% c("var/system_pkg/pkg_version") %].orig-$deb_arch.tar.xz
    
    35
    +  }
    
    36
    +  [% IF c("var/browser-linux-x86_64") -%]
    
    37
    +    extract_src_tar \
    
    38
    +      $rootdir/[% c('input_files_by_name/linux-x86_64') %]/[% c("var/project-name") %]-linux-x86_64-[% c("version") %].tar.xz \
    
    39
    +      amd64
    
    40
    +  [% END -%]
    
    41
    +  [% IF c("var/browser-linux-i686") -%]
    
    42
    +    extract_src_tar \
    
    43
    +      $rootdir/[% c('input_files_by_name/linux-x86_64') %]/[% c("var/project-name") %]-linux-i686-[% c("version") %].tar.xz \
    
    44
    +      i386
    
    45
    +  [% END -%]
    
    46
    +
    
    47
    +  [% FOREACH deb_arch = c("var_p/system_pkg/deb_archs") -%]
    
    48
    +    dpkg-buildpackage --unsigned-source --unsigned-changes --build=full --host-arch=[% deb_arch %]
    
    49
    +    deb_file_name='[% c("var/system_pkg/pkg_name") %]_[% c("var/system_pkg/pkg_version") %]-[% c("var/system_pkg/pkg_revision") %]_[% deb_arch %].deb'
    
    50
    +    dpkg-deb --info "../$deb_file_name"
    
    51
    +    pushd ..
    
    52
    +    mv -f "$deb_file_name" *.dsc *.orig.tar.xz *.debian.tar.xz "$OUTDIR/"
    
    53
    +    popd
    
    54
    +  [% END -%]
    
    55
    +[% END %]

  • projects/linux-packages/config
    1
    +# vim: filetype=yaml sw=2
    
    2
    +version: '[% c("var/torbrowser_version") %]'
    
    3
    +filename: '[% c("var/project-name") %]-[% c("version") %]-[% c("var/build_id") %]'
    
    4
    +timestamp: '[% c("var/browser_release_date_timestamp") %]'
    
    5
    +container:
    
    6
    +  use_container: 1
    
    7
    +
    
    8
    +var:
    
    9
    +  build_deb_pkg: '[% c("var/mullvad-browser") %]'
    
    10
    +  system_pkg:
    
    11
    +    install_path: 'usr/lib/[% c("var/system_pkg/pkg_name") %]'
    
    12
    +    pkg_name: '[% c("var/project-name") %]-[% c("var/channel") %]'
    
    13
    +    pkg_version: '[% c("var/torbrowser_version") %]-[% c("var/torbrowser_build") %]'
    
    14
    +    pkg_revision: '1'
    
    15
    +    pkg_description: '[% c("var/display_name") %]'
    
    16
    +    deb_release_date: '[% USE date; date.format(c("timestamp"), format = "%a, %d %b %Y 01:02:03 +0000", locale = "en_US") %]'
    
    17
    +    # Use var_p/system_pkg/deb_archs for the processed list
    
    18
    +    deb_archs_list:
    
    19
    +      - '[% IF c("var/browser-linux-x86_64") %]amd64[% END %]'
    
    20
    +      - '[% IF c("var/browser-linux-i686") %]i386[% END %]'
    
    21
    +
    
    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
    +
    
    39
    +targets:
    
    40
    +
    
    41
    +  browser-all:
    
    42
    +    - browser-linux-x86_64
    
    43
    +    - browser-linux-i686
    
    44
    +
    
    45
    +  browser-all-desktop: browser-all
    
    46
    +
    
    47
    +  browser-linux-x86_64:
    
    48
    +    var:
    
    49
    +      browser-linux-x86_64: 1
    
    50
    +  browser-linux-i686:
    
    51
    +    var:
    
    52
    +      browser-linux-i686: '[% c("var/browser_type") != "mullvadbrowser" %]'
    
    53
    +
    
    54
    +  torbrowser:
    
    55
    +    var:
    
    56
    +      browser_type: torbrowser
    
    57
    +  basebrowser:
    
    58
    +    var:
    
    59
    +      browser_type: basebrowser
    
    60
    +  mullvadbrowser:
    
    61
    +    var:
    
    62
    +      browser_type: mullvadbrowser
    
    63
    +      system_pkg:
    
    64
    +        pkg_description: 'Mullvad Browser is a privacy-focused web browser designed to minimize tracking and fingerprinting.'
    
    65
    +
    
    66
    +  release:
    
    67
    +    var:
    
    68
    +      build_target: release
    
    69
    +      system_pkg:
    
    70
    +        pkg_name: '[% c("var/project-name") %]'
    
    71
    +  nightly:
    
    72
    +    var:
    
    73
    +      build_target: nightly
    
    74
    +      system_pkg:
    
    75
    +        # debian package version needs to start with a number
    
    76
    +        pkg_version: '[% pc("firefox", "var/browser_series") %]~[% c("var/torbrowser_version") FILTER remove("tbb-nightly.") %]'
    
    77
    +  alpha:
    
    78
    +    var:
    
    79
    +      build_target: alpha
    
    80
    +  testbuild:
    
    81
    +    var:
    
    82
    +      testbuild: 1
    
    83
    +      build_target: '[% c("var/browser_type") %]-testbuild'
    
    84
    +
    
    85
    +
    
    86
    +input_files:
    
    87
    +
    
    88
    +  - project: container-image
    
    89
    +
    
    90
    +  - name: linux-x86_64
    
    91
    +    project: browser
    
    92
    +    enable: '[% c("var/browser-linux-x86_64") %]'
    
    93
    +    target:
    
    94
    +      - '[% c("var/build_target") %]'
    
    95
    +      - '[% c("var/browser_type") %]-linux-x86_64'
    
    96
    +
    
    97
    +  - name: linux-i686
    
    98
    +    project: browser
    
    99
    +    enable: '[% c("var/browser-linux-i686") %]'
    
    100
    +    target:
    
    101
    +      - '[% c("var/build_target") %]'
    
    102
    +      - '[% c("var/browser_type") %]-linux-i686'
    
    103
    +
    
    104
    +  - filename: Makefile
    
    105
    +    content: "[% INCLUDE 'Makefile.in' %]"
    
    106
    +    refresh_input: 1
    
    107
    +
    
    108
    +  # Debian Package
    
    109
    +  - filename: debian/changelog
    
    110
    +    content: "[% INCLUDE 'debian/changelog.in' %]"
    
    111
    +    refresh_input: 1
    
    112
    +    enable: '[% c("var/build_deb_pkg") %]'
    
    113
    +  - filename: debian/compat
    
    114
    +    enable: '[% c("var/build_deb_pkg") %]'
    
    115
    +  - filename: debian/control
    
    116
    +    content: "[% INCLUDE 'debian/control.in' %]"
    
    117
    +    refresh_input: 1
    
    118
    +    enable: '[% c("var/build_deb_pkg") %]'
    
    119
    +  - filename: debian/copyright
    
    120
    +    content: "[% INCLUDE 'debian/copyright.in' %]"
    
    121
    +    refresh_input: 1
    
    122
    +    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
    +  - filename: debian/docs
    
    128
    +    content: "[% INCLUDE 'debian/docs.in' %]"
    
    129
    +    refresh_input: 1
    
    130
    +    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
    +  - filename: debian/rules
    
    140
    +    enable: '[% c("var/build_deb_pkg") %]'
    
    141
    +
    
    142
    +--- |
    
    143
    +  # This part of the file contains options written in perl
    
    144
    +  (
    
    145
    +    var_p => {
    
    146
    +      system_pkg => {
    
    147
    +        deb_archs => sub {
    
    148
    +          my ($project, $options) = @_;
    
    149
    +          my $deb_archs = project_config($project,
    
    150
    +                                    'var/system_pkg/deb_archs_list', $options);
    
    151
    +          return [
    
    152
    +            grep { $_ } map { process_template($project, $_, '.') } @$deb_archs
    
    153
    +          ];
    
    154
    +        },
    
    155
    +      },
    
    156
    +    },
    
    157
    +  )

  • projects/linux-packages/debian/browser.desktop.in
    1
    +[Desktop Entry]
    
    2
    +Type=Application
    
    3
    +Name=[% c("var/Project_Name") %]
    
    4
    +GenericName=Web Browser
    
    5
    +Comment=[% c("var/system_pkg/pkg_description") %]
    
    6
    +Categories=Network;WebBrowser;Security;
    
    7
    +Exec=/[% c("var/system_pkg/install_path") %]/start-[% c("var/project-name") %]  --detach
    
    8
    +X-[% c("var/ProjectName") %]-ExecShell=/[% c("var/system_pkg/install_path") %]/start-[% c("var/project-name") %]  --detach
    
    9
    +Icon=[% c("var/system_pkg/pkg_name") %]
    
    10
    +StartupWMClass=[% c("var/display_name") %]

  • projects/linux-packages/debian/changelog.in
    1
    +[% c("var/system_pkg/pkg_name") %] ([% c("var/system_pkg/pkg_version") %]-[% c("var/system_pkg/pkg_revision") %]) UNRELEASED; urgency=medium
    
    2
    +
    
    3
    +  * [% c("var/Project_Name") %] [% c("var/torbrowser_version") %]
    
    4
    +
    
    5
    + -- [% c("var/Project_Name") %] Developers <torbrowser@torproject.org>  [% c("var/system_pkg/deb_release_date") %]

  • projects/linux-packages/debian/compat
    1
    +9

  • projects/linux-packages/debian/control.in
    1
    +Source: [% c("var/system_pkg/pkg_name") %]
    
    2
    +Maintainer: [% c("var/Project_Name") %] Developers <torbrowser@torproject.org>
    
    3
    +Priority: optional
    
    4
    +Section: web
    
    5
    +Build-Depends: debhelper (>= 9)
    
    6
    +
    
    7
    +Package: [% c("var/system_pkg/pkg_name") %]
    
    8
    +Architecture: [% c("var_p/system_pkg/deb_archs").join(" ") %]
    
    9
    +Depends: ${shlibs:Depends},
    
    10
    +Description: [% c('var/display_name') %]
    
    11
    + [% c("var/system_pkg/pkg_description") %]

  • projects/linux-packages/debian/copyright.in
    1
    +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
    
    2
    +Source:: https://gitlab.torproject.org/tpo/applications/tor-browser-build/
    
    3
    +Upstream-Name: [% c("var/Project_Name") %]
    
    4
    +Comment:
    
    5
    + License for the build recipes and tools used for building [% c("var/Project_Name") %]
    
    6
    + can be found at this URL:
    
    7
    +  https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/blob/main/LICENSE
    
    8
    + For the license of specific components included in [% c("var/Project_Name") %], see
    
    9
    + this directory:
    
    10
    +  /usr/share/doc/[% c("var/system_pkg/pkg_name") %]/Licenses

  • projects/linux-packages/debian/docs.in
    1
    +#! /usr/bin/dh-exec
    
    2
    +${DEB_HOST_ARCH}/Browser/[% c("var/ProjectName") %]/Docs/ChangeLog.txt
    
    3
    +${DEB_HOST_ARCH}/Browser/[% c("var/ProjectName") %]/Docs/Licenses/

  • projects/linux-packages/debian/install.in
    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
    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/debian/rules
    1
    +#!/usr/bin/make -f
    
    2
    +
    
    3
    +%:
    
    4
    +	dh $@
    
    5
    +
    
    6
    +override_dh_strip_nondeterminism:
    
    7
    +	dh_strip_nondeterminism -Xxpi
    
    8
    +
    
    9
    +override_dh_shlibdeps:
    
    10
    +	dh_shlibdeps -Xabicheck

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

  • projects/release/config
    ... ... @@ -47,6 +47,7 @@ targets:
    47 47
       browser-linux-x86_64:
    
    48 48
         var:
    
    49 49
           browser-linux-x86_64: 1
    
    50
    +      linux-packages: '[% c("var/mullvad-browser") %]'
    
    50 51
       browser-linux-x86_64-asan:
    
    51 52
         var:
    
    52 53
           browser-linux-x86_64: 1
    
    ... ... @@ -54,6 +55,7 @@ targets:
    54 55
       browser-linux-i686:
    
    55 56
         var:
    
    56 57
           browser-linux-i686: '[% c("var/browser_type") != "mullvadbrowser" %]'
    
    58
    +      linux-packages: '[% c("var/mullvad-browser") %]'
    
    57 59
       browser-windows-i686:
    
    58 60
         var:
    
    59 61
           browser-windows-i686: '[% c("var/browser_type") != "mullvadbrowser" %]'
    
    ... ... @@ -186,6 +188,14 @@ input_files:
    186 188
           - '[% c("var/build_target") %]'
    
    187 189
           - '[% c("var/browser_type") %]-linux-i686'
    
    188 190
     
    
    191
    +  - name: linux-packages
    
    192
    +    project: linux-packages
    
    193
    +    enable: '[% c("var/linux-packages") %]'
    
    194
    +    # Add linux-x86_64 targets for container config
    
    195
    +    target_prepend:
    
    196
    +      - linux-x86_64
    
    197
    +      - linux
    
    198
    +
    
    189 199
       - name: windows-i686
    
    190 200
         project: browser
    
    191 201
         enable: '[% c("var/browser-windows-i686") %]'
    

  • rbm
    1
    -Subproject commit 10c6b24e90e3dc9c2578290a7d82a87b7f4eb9a3
    1
    +Subproject commit 05e32169dfad9f3cc3eb6aa3f93d9b7a1690290e