-
-
Save trilader/2cf0dd41b075b8da37f9b326c7ddd457 to your computer and use it in GitHub Desktop.
Modified version of skypeforlinux-stable-bin PKGBUILD that extracts the installation from the snap package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Maintainer: mark.blakeney at bullet-systems dot net | |
# Original Maintainer: Jameson Pugh <imntreal@gmail.com> | |
_pkgname=skypeforlinux | |
pkgname="$_pkgname-stable-bin" | |
pkgver=8.113.0.210 | |
_snap_id=QRDEfjn4WJYnm0FzDKwqqRZZI77awQEV | |
_snap_rev=330 | |
pkgrel=1 | |
pkgdesc="Skype for Linux - Stable/Release Version" | |
arch=("x86_64") | |
url="http://www.skype.com" | |
license=("custom") | |
makedepends=("squashfs-tools" "desktop-file-utils") | |
depends=("gtk3" "libxss" "alsa-lib" "libxtst" "libsecret" "nss" | |
"glibc>=2.28-4") | |
optdepends=("org.freedesktop.secrets: keyring/password support" | |
"libappindicator-gtk3: systray icon support") | |
conflicts=("$_pkgname" "$_pkgname-preview-bin" "skype") | |
provides=("$_pkgname" "skype") | |
install="$pkgname-install" | |
source=( | |
"${_pkgname}_${pkgver}_${_snap_rev}_amd64.snap::https://api.snapcraft.io/api/v1/snaps/download/${_snap_id}_${_snap_rev}.snap" | |
"skypeforlinux-launcher" | |
) | |
sha256sums=('ab0cc12e3967b991c8b059060449ab4fb5add3a8f2299f72c97f3fd7af8c0b05' | |
'33bf5143ae89fc19db076a2bbaa42dc99fafd15a67be8ab73a9a5e8ed2cb4a1d') | |
prepare() { | |
unsquashfs -f "$srcdir/${_pkgname}_${pkgver}_${_snap_rev}_amd64.snap" | |
} | |
package() { | |
basedir="$srcdir/squashfs-root" | |
install -d "$pkgdir/usr/bin" "$pkgdir/usr/share" "$pkgdir/usr/share/applications" "$pkgdir/usr/share/doc" "$pkgdir/usr/share/licenses/$pkgname" | |
cp "$basedir/usr/share/$_pkgname/LICENSES.chromium.html" "$pkgdir/usr/share/licenses/$pkgname/" | |
cp -r "$basedir/usr/share/$_pkgname" "$pkgdir/usr/share" | |
cp -r "$basedir/usr/share/doc/$_pkgname" "$pkgdir/usr/share" | |
cp -r "$basedir/usr/share/kservices5" "$pkgdir/usr/share" | |
cp -r "$basedir/usr/share/pixmaps" "$pkgdir/usr/share" | |
for size in 16x16 32x32 256x256 512x512 1024x1024; do | |
install -D "$basedir/usr/share/icons/hicolor/$size/apps/${_pkgname}.png" "$pkgdir/usr/share/icons/hicolor/$size/apps/${_pkgname}.png" | |
done | |
install -m755 "$srcdir/skypeforlinux-launcher" "$pkgdir/usr/bin/skypeforlinux" | |
install -t "$pkgdir/usr/share/applications/" "$basedir/snap/gui/skypeforlinux.desktop" "$basedir/snap/gui/skypeforlinux-share.desktop" | |
desktop-file-edit "$pkgdir/usr/share/applications/skypeforlinux.desktop" --set-icon $_pkgname --set-key Exec --set-value "/usr/bin/skypeforlinux %U" | |
desktop-file-edit "$pkgdir/usr/share/applications/skypeforlinux-share.desktop" --set-icon $_pkgname --set-key Exec --set-value "/usr/bin/skypeforlinux --share-file=%f" | |
# desktop-file-edit can't handle actions (like the quit one in skypeforlinux.desktop) so fix up the shutdown command manually | |
sed -i "$pkgdir/usr/share/applications/skypeforlinux.desktop" -e 's|Exec=skype --shutdown|Exec=/usr/bin/skypeforlinux --shutdown|' | |
} | |
# vim:set ts=2 sw=2 et: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SCRIPT=$(readlink -f "$0") | |
USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..) | |
SKYPE_PATH="$USR_DIRECTORY/share/skypeforlinux/skypeforlinux" | |
SKYPE_LOGS="$HOME/.config/skypeforlinux/logs" | |
mkdir -p $SKYPE_LOGS | |
nohup "$SKYPE_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$SKYPE_LOGS/skype-startup.log" 2>&1 & |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_pkgname="skypeforlinux" | |
_userns="kernel.unprivileged_userns_clone" | |
post_install() { | |
userns="$(sysctl -n $_userns 2>/dev/null)" | |
if [[ $? -eq 0 && $userns -ne 1 ]]; then | |
echo -ne "\e[34;1m" | |
echo === | |
echo === !!! WARNING !!! | |
echo === | |
echo === $_userns is not set on this system. | |
echo === You will need to set it manually so $_pkgname can start. | |
echo === | |
echo -ne "\033[0m" | |
fi | |
} | |
post_upgrade() { | |
post_install | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment