commit 09ff018ecffad74fb20d6ec77d337335173eed9b Author: Nicolas Narvaez Date: Thu Oct 28 21:42:04 2021 -0500 Microsoft Edge Stable diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..764a4cd12d70 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,38 @@ +pkgbase = microsoft-edge-stable-bin + pkgdesc = A browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier + pkgver = 95.0.1020.38 + pkgrel = 1 + url = https://www.microsoftedgeinsider.com/en-us/download + arch = x86_64 + license = custom + makedepends = imagemagick + depends = gtk3 + depends = libcups + depends = nss + depends = alsa-lib + depends = libxtst + depends = libdrm + depends = mesa + optdepends = libpipewire02: WebRTC desktop sharing under Wayland + optdepends = kdialog: for file dialogs in KDE + optdepends = gnome-keyring: for storing passwords in GNOME keyring + optdepends = kwallet: for storing passwords in KWallet + optdepends = libunity: for download progress on KDE + optdepends = ttf-liberation: fix fonts for some PDFs - CRBug #369991 + optdepends = xdg-utils + provides = microsoft-edge-stable + provides = edge-stable + conflicts = microsoft-edge-stable + conflicts = edge-stable + conflicts = edge-stable-bin + conflicts = edge + options = !strip + options = !zipman + source = https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_95.0.1020.38-1_amd64.deb + source = microsoft-edge-stable.sh + source = Microsoft Standard Application License Terms - Standalone (free) Use Terms.pdf + sha256sums = a33b5aa228a015b44c7665df1e27560b515185fcefb6191adfd9b8c714489f41 + sha256sums = ccb0d8939af2f129da97f75ef063b6ff2d9484e94c090aef82570001eba8dd71 + sha256sums = edf2ed596eb068f168287fc76aa713ad5e0afb59f0a0a47a4f29c0c124ade15e + +pkgname = microsoft-edge-stable-bin diff --git a/Microsoft Standard Application License Terms - Standalone (free) Use Terms.pdf b/Microsoft Standard Application License Terms - Standalone (free) Use Terms.pdf new file mode 100644 index 000000000000..ac3251c09abe Binary files /dev/null and b/Microsoft Standard Application License Terms - Standalone (free) Use Terms.pdf differ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..063482d6cdad --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,64 @@ +# Maintainer: Nicolas Narvaez +# Contributor: EsauPR + +pkgname=microsoft-edge-stable-bin +_pkgname=microsoft-edge +_pkgshortname=msedge +pkgver=95.0.1020.38 +pkgrel=1 +pkgdesc="A browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier" +arch=('x86_64') +url="https://www.microsoftedgeinsider.com/en-us/download" +license=('custom') +provides=('microsoft-edge-stable' 'edge-stable') +conflicts=('microsoft-edge-stable' 'edge-stable' 'edge-stable-bin' 'edge') +depends=('gtk3' 'libcups' 'nss' 'alsa-lib' 'libxtst' 'libdrm' 'mesa') +makedepends=('imagemagick') +optdepends=('libpipewire02: WebRTC desktop sharing under Wayland' + 'kdialog: for file dialogs in KDE' + 'gnome-keyring: for storing passwords in GNOME keyring' + 'kwallet: for storing passwords in KWallet' + 'libunity: for download progress on KDE' + 'ttf-liberation: fix fonts for some PDFs - CRBug #369991' + 'xdg-utils') +options=(!strip !zipman) +_channel=stable +source=("https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/${_pkgname}-stable_${pkgver}-1_amd64.deb" + "microsoft-edge-stable.sh" + "Microsoft Standard Application License Terms - Standalone (free) Use Terms.pdf") +sha256sums=('a33b5aa228a015b44c7665df1e27560b515185fcefb6191adfd9b8c714489f41' + 'dc3765d2de6520b13f105b8001aa0e40291bc9457ac508160b23eea8811e26af' + 'edf2ed596eb068f168287fc76aa713ad5e0afb59f0a0a47a4f29c0c124ade15e') + +package() { + bsdtar -xf data.tar.xz -C "$pkgdir/" + + # suid sandbox + chmod 4755 "${pkgdir}/opt/microsoft/${_pkgshortname}/msedge-sandbox" + + # 256 and 24 are proper colored icons + for res in 128 64 48 32; do + convert "${pkgdir}/opt/microsoft/${_pkgshortname}/product_logo_256.png" \ + -resize ${res}x${res} \ + "${pkgdir}/opt/microsoft/${_pkgshortname}/product_logo_${res}.png" + done + for res in 22 16; do + convert "${pkgdir}/opt/microsoft/${_pkgshortname}/product_logo_24.png" \ + -resize ${res}x${res} \ + "${pkgdir}/opt/microsoft/${_pkgshortname}/product_logo_${res}.png" + done + + # install icons + for res in 16 22 24 32 48 64 128 256; do + install -Dm644 "${pkgdir}/opt/microsoft/${_pkgshortname}/product_logo_${res}.png" \ + "${pkgdir}/usr/share/icons/hicolor/${res}x${res}/apps/${_pkgname}.png" + done + # User flag aware launcher + install -m755 microsoft-edge-stable.sh "${pkgdir}/usr/bin/microsoft-edge-stable" + + # License + install -Dm644 'Microsoft Standard Application License Terms - Standalone (free) Use Terms.pdf' "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE.pdf" + rm -r "${pkgdir}/etc/cron.daily/" "${pkgdir}/opt/microsoft/${_pkgshortname}/cron/" + # Globbing seems not to work inside double parenthesis + rm "${pkgdir}/opt/microsoft/${_pkgshortname}"/product_logo_*.png +} diff --git a/microsoft-edge-stable.install b/microsoft-edge-stable.install new file mode 100644 index 000000000000..8e6fecda973d --- /dev/null +++ b/microsoft-edge-stable.install @@ -0,0 +1,22 @@ +# Colored makepkg-like functions +msg_blue() { + printf "${blue}==>${bold} $1${all_off}\n" +} + +note() { + printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n" +} + +all_off="$(tput sgr0)" +bold="${all_off}$(tput bold)" +blue="${bold}$(tput setaf 4)" +yellow="${bold}$(tput setaf 3)" + +post_install() { + note "Custom flags should be put directly in: ~/.config/microsoft-edge-stable-flags.conf" + note "The launcher is called: 'microsoft-edge-stable'" +} + +post_upgrade() { + post_install +} diff --git a/microsoft-edge-stable.sh b/microsoft-edge-stable.sh new file mode 100644 index 000000000000..c0ec97379378 --- /dev/null +++ b/microsoft-edge-stable.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env sh +# Launches MS Edge with flags specified in $XDG_CONFIG_HOME/microsoft-edge-beta-flags.conf + +# Make script fail if `cat` fails for some reason +set -e + +# Set default value if variable is unset/null +XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-${HOME}/.config}" + +# Attempt to read a config file if it exists +if [ -r "${XDG_CONFIG_HOME}/microsoft-edge-stable-flags.conf" ]; then + EDGE_USER_FLAGS="$(cat "$XDG_CONFIG_HOME/microsoft-edge-stable-flags.conf")" +fi + +exec /opt/microsoft/msedge/microsoft-edge $EDGE_USER_FLAGS "$@" diff --git a/update_version.sh b/update_version.sh new file mode 100755 index 000000000000..2fd5a316a068 --- /dev/null +++ b/update_version.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +# This script updates the package version if a new version is available + +set -euxo pipefail + +# Get channel +CHANNEL=$(awk -F '=' '/^_channel/{ print $2 }' PKGBUILD) +PKG="microsoft-edge-${CHANNEL}" + +# Get latest version +VER=$(curl -sSf https://packages.microsoft.com/repos/edge/dists/stable/main/binary-amd64/Packages | + grep -A6 "Package: ${PKG}" | + awk '/Version/{print $2}' | + cut -d '-' -f1 | + head -n1) + +# Insert latest version into PKGBUILD and update hashes +sed -i \ + -e "s/^pkgver=.*/pkgver=${VER}/" \ + PKGBUILD + +# Check whether this changed anything +if (git diff --exit-code PKGBUILD); then + echo "Package ${PKG} has most recent version ${VER}" + exit 0 +fi + +# updpkgsums +SUM256=$(curl -sSf https://packages.microsoft.com/repos/edge/dists/stable/main/binary-amd64/Packages | + grep -A15 "Package: ${PKG}" | + awk '/SHA256/{print $2}' | + head -n1) + +# Insert latest shasum into PKGBUILD and update hashes +sed -i \ + -e "s/^sha256sums=('.*/sha256sums=('${SUM256}'/" \ + PKGBUILD + +# Reset pkgrel +sed -i \ + -e 's/pkgrel=.*/pkgrel=1/' \ + PKGBUILD + +# Update .SRCINFO +makepkg --printsrcinfo >.SRCINFO + +# Start generate package +makepkg -Acsf . + +# Commit changes +git add PKGBUILD .SRCINFO +git commit -m "Update ${PKG} to v${VER}"