Vivaldi Browser

Request a package to be made here. Make sure you have searched before requesting.

Vivaldi Browser

Postby beakfire » Fri Dec 14, 2018 1:24 am

I'm curious to see if official support can be made for Vivaldi browser. They currently distribute a debian-based binary for 32-bit ARM and also have a 64-bit binary that is distributed (though not advertised) for their browser.

Information for this can be found here:

32-bit ARM
https://vivaldi.com/download/

64-bit ARM
https://forum.vivaldi.net/topic/29271/x64-arm

There is a user that submitted a PKGBUILD to the AUR, but the package appears old and unmaintained which is located here:

https://aur.archlinux.org/packages/vivaldi-rpi/

I've already used debtap to create a PKGBUILD and here is what I have from the last time I ran this:

$this->bbcode_second_pass_code('', '# Generated by debtap
# Maintainer: vivaldi
# Contributor: vivaldi
pkgname=vivaldi-stable-bin
pkgver=2.1.1337.51
pkgrel=1
pkgdesc="A new browser for our friends. Vivaldi browser is made with power users in mind by people who love the Web."
url="https://vivaldi.com"
license=('custom')
groups=('')
depends=('alsa-lib>=1.0.16' 'atk>=1.12.4' 'at-spi2-atk>=2.5.3' 'bash-completion' 'ca-certificates' 'cairo>=1.6.0' 'dbus>=1.2.14' 'desktop-file-utils' 'expat>=2.0.1' 'gdk-pixbuf2>=2.22.0' 'glib2>=2.31.8' 'gtk3>=3.9.10' 'hicolor-icon-theme' 'libappindicator-gtk3' 'libcups>=1.4.0' 'libutil-linux>=2.16' 'libx11>=1.4.99.1' 'libxcb>=1.6' 'libxcomposite>=0.3' 'libxcursor>1.1.2' 'libxdamage>=1.1' 'libxext' 'libxfixes>=5.0' 'libxi>=1.2.99.4' 'libxrandr>=1.2.99.3' 'libxrender' 'libxss' 'libxtst' 'nspr>=4.9' 'nss>=3.22' 'pango' 'qmmp' 'ttf-liberation' 'xdg-utils>=1.0.2')
provides=('www-browser')
options=('!strip' '!emptydirs')
install=${pkgname}.install
source=("https://downloads.vivaldi.com/stable/vivaldi-stable_2.1.1337.51-1_armhf.deb")
sha512sums=('099ecd837a91a44e5f6b32f7c10492fd9798b85485e45aee892735ba2d5f9a5c36ca9df297045e01a6dd016562aaa7b8dea84a15117b750fd49dbaab6298958c')

package(){

# Extract package data
tar xf data.tar.xz -C "${pkgdir}"

}
')

The last time I built the package I got a few errors, but was able to install it. It looks like the other person that submitted a PKGBUILD for this to the AUR took a few extra steps to get it to install the icon.

I verified the U2F functionality also works, out of the box, on my system with UDEV already configured using a Yubikey 4 to login to a gmail account that has U2F functionality enabled.

This was performed using an Odroid-XU4 running ArchLinuxARM.

I removed the optional dependencies (for flash and U2F udev) from the PKGBUILD.

The other file that goes along with the PKGBUILD from debtap is below:

Install file is here:
Filename for install file: vivaldi-stable-bin.install

$this->bbcode_second_pass_code('', 'post_install() {
gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
#
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


# Add icons to the system icons
XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null || true`"
if [ ! -x "$XDG_ICON_RESOURCE" ]; then
echo "Error: Could not find xdg-icon-resource" >&2
exit 1
fi
for icon in product_logo_24.png product_logo_128.png product_logo_256.png product_logo_64.png product_logo_32.png product_logo_48.png product_logo_16.png product_logo_22.png ; do
size="$(echo ${icon} | sed 's/[^0-9]//g')"
"$XDG_ICON_RESOURCE" install --size "${size}" "/opt/vivaldi/${icon}" --novendor \
"vivaldi"
done

UPDATE_MENUS="`which update-mime-database usr/share/mime &> /dev/null 2> /dev/null || true`"
if [ -x "$UPDATE_MENUS" ]; then
update-mime-database usr/share/mime &> /dev/null
fi

# Update cache of .desktop file MIME types. Non-fatal since it's just a cache.
update-desktop-database > /dev/null 2>&1 || true

# Updates defaults.list file if present.
update_defaults_list() {
# $1: name of the .desktop file

local DEFAULTS_FILE="/usr/share/applications/defaults.list"

if [ ! -f "${DEFAULTS_FILE}" ]; then
return
fi

# Split key-value pair out of MimeType= line from the .desktop file,
# then split semicolon-separated list of mime types (they should not contain
# spaces).
mime_types="$(grep MimeType= /usr/share/applications/${1} |
cut -d '=' -f 2- |
tr ';' ' ')"
for mime_type in ${mime_types}; do
if egrep -q "^${mime_type}=" "${DEFAULTS_FILE}"; then
if ! egrep -q "^${mime_type}=.*${1}" "${DEFAULTS_FILE}"; then
default_apps="$(grep ${mime_type}= "${DEFAULTS_FILE}" |
cut -d '=' -f 2-)"
egrep -v "^${mime_type}=" "${DEFAULTS_FILE}" > "${DEFAULTS_FILE}.new"
echo "${mime_type}=${default_apps};${1}" >> "${DEFAULTS_FILE}.new"
mv "${DEFAULTS_FILE}.new" "${DEFAULTS_FILE}"
fi
else
# If there's no mention of the mime type in the file, add it.
echo "${mime_type}=${1};" >> "${DEFAULTS_FILE}"
fi
done
}

update_defaults_list "vivaldi-stable.desktop"

# Add to the alternatives system
#
# On Ubuntu 12.04, we have the following priorities
# (which can be obtain be installing browsers and running
#
# /usr/bin/epiphany-browser 85
# /usr/bin/firefox 40
# /usr/bin/konqueror 30
#
# While we would expect these values to be keyed off the most popular
# browser (Firefox), in practice, we treat Epiphany as the lower bound,
# resulting in the following scheme:

CHANNEL=stable
case $CHANNEL in
stable )
# Good enough to be the default.
PRIORITY=200
;;
beta )
# Almost good enough to be the default. (Firefox stable should arguably be
# higher than this, but since that's below the "Epiphany threshold", we're
# not setting our priority below it. Anyone want to poke Firefox to raise
# their priority?)
PRIORITY=150
;;
unstable )
# Unstable, give it the "lowest" priority.
PRIORITY=120
;;
* )
PRIORITY=0
;;
esac

/usr/bin/vivaldi-stable $PRIORITY
/usr/bin/vivaldi-stable $PRIORITY

/usr/bin/vivaldi-stable $PRIORITY

# System-wide package configuration.
DEFAULTS_FILE="/etc/default/vivaldi"

# sources.list setting for vivaldi updates.
REPOCONFIG="deb http://repo.vivaldi.com/stable/deb/ stable main"
REPOCONFIGREGEX="deb (\[arch=[^]]*armhf[^]]*\][[:space:]]*) https?://repo.vivaldi.com/archive/deb/ stable main"

APT_CONFIG="`which apt-config 2> /dev/null`"

# You may comment out this entry, but any other modifications may be lost.
"

apt_config_val() {
APTVAR="$1"
if [ -x "$APT_CONFIG" ]; then
"$APT_CONFIG" dump | sed -e "/^$APTVAR /"'!d' -e "s/^$APTVAR \"\(.*\)\".*/\1/"
fi
}

# Remove expired repository/package signing key (7B8B44A1), if present.
remove_old_key() {
APT_KEY="`which apt-key 2>/dev/null`"
if [ -x "$APT_KEY" ]; then
if "$APT_KEY" list 2>/dev/null | grep -qF 7B8B44A1; then
"$APT_KEY" del 7B8B44A1 >/dev/null 2>&1
fi
fi
}

# Install the repository/package signing key (C3401E12), if it isn't already.
install_key() {
APT_KEY="`which apt-key 2>/dev/null`"
if [ -x "$APT_KEY" ]; then
if ! "$APT_KEY" list 2>/dev/null | grep -qF C3401E12; then
"$APT_KEY" add - >/dev/null 2>&1 <<KEYDATA
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1

mQINBFh9700BEACfjuPRKbTaFB1y2yPlCMYfA9sw+Mu19g2AEpO4kXsqZPA1mfU0
nGpZEBanbKbWaZNknr+4Gp0KrkSKL4ZywFeCMhEUXDsMU9dBCInVrhP9jzVJV4oP
TfNY1fgcwiWNaOJFRt4rot9NNiEOWRRguCPki2285biGfl6bS5a5UqFyA8XQn0dv
EyyuFQ1mSDJqSw7yYpHFuLsp1hUO1WtmezE6Cqkh1m50eXJmuB5jG8wM1NkGk8lk
t2DgC/bMDwNIijJBsvBTuh9mdqH/u4TF3mysomMDy+vU8m9Uq5eSEoMKh9Bttai2
brxPFfxw2u6OTSYbKdw0KmXCe4pNcyrK6jPKUTLaplhhn8vRnzVilQVeTIJPHM1O
8bsio1LDTQl3K7AQtpqnu2N2nKRLtnTyOyDtfVC+PBS7Jvj4yDoImzqaiOaMcFKO
DpeO8NudVBUunmgPWwUw4lv4rZyY5+6Rq9fHQGoh+dVnTjSyXVjBppD438RpPCRx
MUlUddmpZmPsCYqdjnAV1J3kYlSyYOBu7PtssK9TwkzLP3xaMQFJrSRQw48Bc/Q/
CgaXAYER5pVfQg78thj4gDT3yi1u5ozTmw1hkvaTu9RAJ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2
ErzEbAPt2yax2at6QvS+CBXlPh7qZ0xzuqDAtHJuZ41Umjr1vo2fXUwn+9dr+EtF
0KgR8nB31mEerr6wg+d1JoAKPnQ8Ja1xvlHakMa/WswzhtVwL63Z2G9VhAhN0jWv
4X3uu8Y3gXeQFQoiHHX0zxMKNdv2ujyqG8UQWqENOpgjfcv5TtsaWJrpW267BE61
R6o2nS+jYNBfJ1GD07srhQQtdgjDLgb8u197g8MhI1I=
=iQPH
-----END PGP PUBLIC KEY BLOCK-----
KEYDATA
fi
fi
}

# Install another key (EFB20B23), if it isn't already, for future use.
install_future_key() {
APT_KEY="`which apt-key 2>/dev/null`"
if [ -x "$APT_KEY" ]; then
if ! "$APT_KEY" list 2>/dev/null | grep -qF EFB20B23; then
"$APT_KEY" add - >/dev/null 2>&1 <<KEYDATA
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1

mQINBFpPT1cBEADC/HMlLmdpp/tpd8CXkOAoBvwED9OhzpWD8FuGTH7471KLucPo
vTFXzp//sv83YzTbrrZRGLpF/2lGG7sZoHraO5NqpDg1ySfrged1GnIhvFoHTI4o
qETJNFRuYlCMey9tjNjqGzIwWdX5HvVCAmXFwZLFJU2MXBH04+xKpjK5VZugksVS
7hsOtvMxIdM9/GL0NfHIHxfWFyfWkMgVyr4I1VY6+ICMTtXodyObOnsHaqgKw0DT
lK+DnYp3gzsW/T+CAi0zRoZ1ZeYazxw3HUKIyd8YMnRB/8SoannYtuIsTrKgVXHN
OSYMLyW1uh4ER26TptIzeHufkfhGjPiKcBs/gpf8V98WvL4X+hp73Itd/wbCs6Ak
RMRwKH1fx2HY8IqC9XaPlUmTGgHmKCQlnAf1XdZhoCrftuwNf2RZnoAuJy3lwxmx
4gucckwm3r803dV26hY4CikSj2o9az6BEf9C7sBmA1SfPzLOLPBVuwFY+qGyaBy5
O61pYbZDZzilHsqT1gQ1urqFrpTCBJjsN5a+Nky72Qh3o2YowpaadeRXD/0s6Qc3
sqRI3DMbjBQqx4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WrlfH2m
qqQ/zGdR0VtCatUxd8CsIXkDAVS2GkoOS6RftZwAiVEWvQ8HUk+gkXnAZP2IThTk
lnnMDR/2RsvSQZqGD7Hv+oFhEbMUn7WU8jq7GtjM4+XYDuZsYllo1wSN0dwKjKcS
B49V2bkFDdhoKuj0aZzyAKNxY/M7r8O1kMlA0y/CYVP56+NzcPffTeNJYvWj0KCe
zp5254Hj0gpA4vAxDaHv/dnBTxGWBL2LGytMGtsfR0HZc/bxQMyk8IWXeI9UDgb2
FtbBrH8fIdPJjjRkBKfvD5+D+h0s72xOaMGKWsCdK04=
=/TZJ
-----END PGP PUBLIC KEY BLOCK-----
KEYDATA
fi
fi
}

find_apt_sources() {
eval $("$APT_CONFIG" shell APT_SOURCESDIR 'Dir::Etc::sourceparts/d')
}

# Update the Google repository if it's not set correctly.
# Note: this doesn't necessarily enable the repository, it just makes sure the
# correct settings are available in the sources list.
# Returns:
# 0 - no update necessary
# 2 - error
update_bad_sources() {
if [ ! "$REPOCONFIG" ]; then
return 0
fi

find_apt_sources

SOURCELIST="$APT_SOURCESDIR/vivaldi.list"
# Don't do anything if the file isn't there, since that probably means the
# user disabled it.
if [ ! -r "$SOURCELIST" ]; then
return 0
fi

# Basic check for active configurations (non-blank, non-comment lines).
ACTIVECONFIGS=$(grep -v "^[[:space:]]*\(#.*\)\?$" "$SOURCELIST" 2>/dev/null)

# Check if the correct repository configuration is in there.
REPOMATCH=$(grep -E "^[[:space:]#]*$REPOCONFIGREGEX" "$SOURCELIST" \
2>/dev/null)

# Check if the correct repository is disabled.
MATCH_DISABLED=$(echo "$REPOMATCH" | grep "^[[:space:]]*#" 2>/dev/null)

# Now figure out if we need to fix things.
BADCONFIG=1
if [ "$REPOMATCH" ]; then
# If it's there and active, that's ideal, so nothing to do.
if [ ! "$MATCH_DISABLED" ]; then
BADCONFIG=0
else
# If it's not active, but neither is anything else, that's fine too.
if [ ! "$ACTIVECONFIGS" ]; then
BADCONFIG=0
fi
fi
fi

if [ $BADCONFIG -eq 0 ]; then
return 0
fi

# At this point, either the correct configuration is completely missing, or
# the wrong configuration is active. In that case, just abandon the mess and
# recreate the file with the correct configuration. If there were no active
# configurations before, create the new configuration disabled.
DISABLE=""
if [ ! "$ACTIVECONFIGS" ]; then
DISABLE="#"
fi
printf "$SOURCES_PREAMBLE" > "$SOURCELIST"
printf "$DISABLE$REPOCONFIG
" >> "$SOURCELIST"
if [ $? -eq 0 ]; then
return 0
fi
return 2
}

# Returns:
# 0 - sources list was created
# 2 - error
create_sources_lists() {
if [ ! "$REPOCONFIG" ]; then
return 0
fi

find_apt_sources

SOURCELIST="$APT_SOURCESDIR/vivaldi.list"
if [ -d "$APT_SOURCESDIR" ]; then
printf "$SOURCES_PREAMBLE" > "$SOURCELIST"
printf "$REPOCONFIG
" >> "$SOURCELIST"
if [ $? -eq 0 ]; then
return 0
fi
fi
return 2
}

# Remove our custom sources list file.
# Returns:
# 0 - successfully removed, or not configured
# !0 - failed to remove
clean_sources_lists() {
if [ ! "$REPOCONFIG" ]; then
return 0
fi

find_apt_sources

rm -f "$APT_SOURCESDIR/vivaldi.list"
}

# Detect if the repo config was disabled by distro upgrade and enable if
# necessary.
handle_distro_upgrade() {
if [ ! "$REPOCONFIG" ]; then
return 0
fi

find_apt_sources
SOURCELIST="$APT_SOURCESDIR/vivaldi.list"
if [ -r "$SOURCELIST" ]; then
REPOLINE=$(grep -E "^[[:space:]]*#[[:space:]]*$REPOCONFIGREGEX[[:space:]]*# disabled on upgrade to .*" "$SOURCELIST")
if [ $? -eq 0 ]; then
sed -i -e "s,^[[:space:]]*#[[:space:]]*\(.*\)[[:space:]]*# disabled on upgrade to .*,\1," \
"$SOURCELIST"
LOGGER=$(which logger 2> /dev/null)
if [ "$LOGGER" ]; then
"$LOGGER" -t "$0" "Reverted repository modification: $REPOLINE."
fi
fi
fi
}

DEFAULT_ARCH="armhf"

get_lib_dir() {
if [ "$DEFAULT_ARCH" = "i386" ]; then
LIBDIR=lib/i386-linux-gnu
elif [ "$DEFAULT_ARCH" = "amd64" ]; then
LIBDIR=lib/x86_64-linux-gnu
else
echo Unknown CPU Architecture: "$DEFAULT_ARCH"
exit 1
fi
}

NSS_FILES="libnspr4.so.0d libplds4.so.0d libplc4.so.0d libssl3.so.1d \
libnss3.so.1d libsmime3.so.1d libnssutil3.so.1d"

add_nss_symlinks() {
get_lib_dir
for f in $NSS_FILES
do
target=$(echo $f | sed 's/\.[01]d$//')
if [ -f "/$LIBDIR/$target" ]; then
ln -snf "/$LIBDIR/$target" "/opt/vivaldi/$f"
elif [ -f "/usr/$LIBDIR/$target" ]; then
ln -snf "/usr/$LIBDIR/$target" "/opt/vivaldi/$f"
else
echo $f not found in "/$LIBDIR/$target" or "/usr/$LIBDIR/$target".
exit 1
fi
done
}

remove_nss_symlinks() {
for f in $NSS_FILES
do
rm -rf "/opt/vivaldi/$f"
done
}

remove_udev_symlinks() {
rm -rf "/opt/vivaldi/libudev.so.0"
}

remove_udev_symlinks

## MAIN ##
if [ ! -e "$DEFAULTS_FILE" ]; then
echo 'repo_add_once="true"' > "$DEFAULTS_FILE"
echo 'repo_reenable_on_distupgrade="true"' >> "$DEFAULTS_FILE"
fi

# Run the cron job immediately to perform repository configuration.
nohup sh /etc/cron.daily/vivaldi > /dev/null 2>&1 &
update-desktop-database -q
}

post_upgrade() {
post_install
}

pre_remove() {
#
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


action="$1"
if [ "$2" = "in-favour" ]; then
# Treat conflict remove as an upgrade.
action="upgrade"
fi
# Don't clean-up just for an upgrade.`
if [ "$action" = "upgrade" ] ; then
fi

# Remove icons from the system icons
XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null || true`"
if [ ! -x "$XDG_ICON_RESOURCE" ]; then
echo "Error: Could not find xdg-icon-resource" >&2
exit 1
fi
for icon in product_logo_24.png product_logo_128.png product_logo_256.png product_logo_64.png product_logo_32.png product_logo_48.png product_logo_16.png product_logo_22.png ; do
size="$(echo ${icon} | sed 's/[^0-9]//g')"
"$XDG_ICON_RESOURCE" uninstall --size "${size}" "vivaldi"
done

UPDATE_MENUS="`which update-mime-database usr/share/mime &> /dev/null 2> /dev/null || true`"
if [ -x "$UPDATE_MENUS" ]; then
update-mime-database usr/share/mime &> /dev/null
fi

# Update cache of .desktop file MIME types. Non-fatal since it's just a cache.
update-desktop-database > /dev/null 2>&1 || true

# Remove from the alternatives system

}

post_remove() {
gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
#
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


action="$1"

# Only do complete clean-up on purge.
if [ "$action" != "purge" ] ; then
fi

# System-wide package configuration.
DEFAULTS_FILE="/etc/default/vivaldi"

# sources.list setting for vivaldi updates.
REPOCONFIG="deb http://repo.vivaldi.com/stable/deb/ stable main"
update-desktop-database -q
}')
beakfire
 
Posts: 14
Joined: Sat Apr 21, 2018 10:13 pm

Re: Vivaldi Browser

Postby beakfire » Mon Dec 17, 2018 9:00 pm

Cleaned up and updated the PKGBUILD, now installs the icon and the license.

Essentially just updated what was in the AUR.

Install file in previous post isn't needed.

$this->bbcode_second_pass_code('', '# Generated by debtap
# Maintainer: vivaldi
# Contributor: vivaldi
pkgname=vivaldi-stable-bin
pkgver=2.2.1388.34
pkgrel=1
pkgdesc="A new browser for our friends. Vivaldi browser is made with power users in mind by people who love the Web."
url="https://vivaldi.com"
license=('custom')
groups=('')
depends=('alsa-lib>=1.0.16' 'atk>=1.12.4' 'at-spi2-atk>=2.5.3' 'bash-completion' 'ca-certificates' 'cairo>=1.6.0' 'dbus>=1.2.14' 'desktop-file-utils' 'expat>=2.0.1' 'gdk-pixbuf2>=2.22.0' 'glib2>=2.31.8' 'gtk3>=3.9.10' 'hicolor-icon-theme' 'libappindicator-gtk3' 'libcups>=1.4.0' 'libutil-linux>=2.16' 'libx11>=1.4.99.1' 'libxcb>=1.6' 'libxcomposite>=0.3' 'libxcursor>1.1.2' 'libxdamage>=1.1' 'libxext' 'libxfixes>=5.0' 'libxi>=1.2.99.4' 'libxrandr>=1.2.99.3' 'libxrender' 'libxss' 'libxtst' 'nspr>=4.9' 'nss>=3.22' 'pango' 'qmmp' 'ttf-liberation' 'xdg-utils>=1.0.2')
makedepends=('w3m')
optdepends=('')
provides=('www-browser')
options=('!strip' '!emptydirs')
source=("https://downloads.vivaldi.com/stable/vivaldi-stable_${pkgver}-${pkgrel}_armhf.deb")
sha512sums=('5a51d542334b5d14cc1d2a1d6ad5262a447c831925efdfdacd238beb6ed315afad949d2afef6648ff22d57ba70e95b07b92efd9275e8b499bc0b67d7469efbef')

prepare() {
tar -xf data.tar.xz
}

package() {
cp -a {opt,usr} "$pkgdir"

# suid sandbox
chmod 4755 "$pkgdir/opt/vivaldi/vivaldi-sandbox"

# make /usr/bin/vivaldi-stable available
binf="$pkgdir/usr/bin/vivaldi-stable"
if [[ ! -e "$binf" ]] && [[ ! -f "$binf" ]] && [[ ! -L "$binf" ]]; then
install -dm755 "$pkgdir/usr/bin"
ln -s /opt/vivaldi/vivaldi "$binf"
fi

# install icons
for res in 16 22 24 32 48 64 128 256; do
install -Dm644 "$pkgdir/opt/vivaldi/product_logo_${res}.png" \
"$pkgdir/usr/share/icons/hicolor/${res}x${res}/apps/vivaldi.png"
done

# license
install -dm755 "$pkgdir/usr/share/licenses/$pkgname"
strings "$pkgdir/opt/vivaldi/locales/en-US.pak" \
| tr '\n' ' ' \
| sed -rne 's/.*(<html lang.*>.*html>).*/\1/p' \
| w3m -I 'utf-8' -T 'text/html' \
> "$pkgdir/usr/share/licenses/$pkgname/eula.txt"
}
')
beakfire
 
Posts: 14
Joined: Sat Apr 21, 2018 10:13 pm


Return to Package Requests

Who is online

Users browsing this forum: No registered users and 7 guests