Skip to content

Instantly share code, notes, and snippets.

@EndlessEden
Last active October 21, 2020 17:13
Show Gist options
  • Save EndlessEden/eb674b6820a2d5968e21434c812408a8 to your computer and use it in GitHub Desktop.
Save EndlessEden/eb674b6820a2d5968e21434c812408a8 to your computer and use it in GitHub Desktop.
cinnamon-git PKGBUILD
# Maintainer: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: Alexandre Filgueira <alexfilgueira@cinnarch.com>
# Contributor: M0Rf30
# Contributor: unifiedlinux
# Contributor: CReimer
pkgname=cinnamon-git
pkgver=4.6.7.r56.g71e1cf14a
pkgrel=1
pkgdesc="Linux desktop which provides advanced innovative features and a traditional user experience"
arch=('x86_64')
url="https://github.com/linuxmint/${pkgname%-git}"
license=('GPL2')
depends=('accountsservice' 'caribou' 'cinnamon-control-center' 'cinnamon-menus' 'cinnamon-screensaver'
'cinnamon-session' 'cinnamon-settings-daemon' 'cjs-git' 'gnome-backgrounds'
'gnome-themes-extra' 'gstreamer' 'libcroco' 'libgnomekbd' 'libkeybinder3' 'librsvg' 'muffin'
'network-manager-applet' 'nemo' 'polkit-gnome' 'python-cairo' 'python-dbus'
'python-gobject' 'python-pam' 'python-pexpect' 'python-pillow' 'python-pyinotify'
'python-pytz' 'python-tinycss2' 'python-xapp' 'timezonemap' 'xapps')
optdepends=('blueberry: Bluetooth support'
'cinnamon-translations: i18n'
'gnome-panel: fallback mode'
'metacity: fallback mode'
'system-config-printer: printer settings')
provides=("${pkgname%-git}=${pkgver}")
conflicts=("${pkgname%-git}")
makedepends=('git' 'intltool' 'gtk-doc' 'gobject-introspection')
options=('!emptydirs')
source=("git+${url}.git"
"0001-cinnamon-settings-don-t-rely-on-the-presence-of-cinn.patch"
"set_wheel.diff"
"default-theme.patch")
sha256sums=('SKIP'
'edb5c1cf43913da086aa11f303b0919bbea232d140afa33ceac52fe367d15fcf'
'7517d651d440361947f9539fe8f42548d5eb43a09c28c9a11f51cfdfdefd042f'
'SKIP')
pkgver() {
cd "${srcdir}"/${pkgname%-git}
git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd "${srcdir}"/${pkgname%-git}
# Check for the cc-panel module path, not for the irrelevant binary
# https://github.com/linuxmint/Cinnamon/pull/7382
patch --no-backup-if-mismatch -p1 -i ../0001-cinnamon-settings-don-t-rely-on-the-presence-of-cinn.patch
# Use wheel group instread of sudo (taken from Fedora)
patch -Np1 -i ../set_wheel.diff
# Set default theme to 'cinnamon'
patch -Np1 -i ../default-theme.patch
# Replace MintInstall with GNOME Software
sed -i 's/mintinstall.desktop/org.gnome.Software.desktop/' data/org.cinnamon.gschema.xml
# Add polkit agent to required components
sed -i 's/RequiredComponents=\(.*\)$/RequiredComponents=\1polkit-gnome-authentication-agent-1;/' \
cinnamon*.session.in
# https://github.com/linuxmint/Cinnamon/issues/3575#issuecomment-374887122
# Cinnamon has no upstream backgrounds, use GNOME backgrounds instead
sed -i 's|/usr/share/cinnamon-background-properties|/usr/share/gnome-background-properties|' \
files/usr/share/cinnamon/cinnamon-settings/modules/cs_backgrounds.py
}
build() {
cd "${srcdir}"/${pkgname%-git}
# fix -mfpu= flags that break a build e.g. for neon on armv7 due to
# basically makepkg.conf being "bad' with default CFLAGS having
# -mfpu=vfpv3-d16
export CFLAGS=`echo -n $CFLAGS | sed 's/-mfpu=vfpv3-d16/-mfpu=neon-vfpv4/g'`
export CFLAGS="$CFLAGS -fvisibility=hidden"
export CXXFLAGS="$CXXFLAGS -fvisibility=hidden"
# this is so this will build on ALARM on a raspberry pi with 1GB RAM...
# and ninja doesnt do MAKEFLAKGS or NINJAFLAGS thus have to pass -j N
MEM=`free -m | head -2 | tail -1 | awk '{printf("%s", $7);}'`
if test "$MEM" -lt 300; then MEM=300; fi
J=`expr $MEM / 300`
CPUS=`echo /sys/devices/system/cpu/cpu[0-9]* | wc -w`
if test "$J" -gt $CPUS; then J=$CPUS; fi
if test "$J" -lt 1; then J=1; fi
echo "Free Mem: $MEM M, using $J threads for build"
arch-meson --prefix=/usr \
--sysconfdir=/etc \
--libexecdir=/usr/lib/cinnamon \
--localstatedir=/var \
--buildtype=release \
--default-library=shared \
--optimization=3 \
-Ddocs=false \
. build
# https://bugzilla.gnome.org/show_bug.cgi?id=656231
#sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
sed -i -e 's/-D_FORTIFY_SOURCE=2 --cflags-end/-D_FORTIFY_SOURCE=2 -O1 --cflags-end/g' build/build.ninja
sed -i -e 's/-D_FORTIFY_SOURCE=2 --cflags-end/-D_FORTIFY_SOURCE=2 -O1 --cflags-end/g' build/build.ninja
ninja -j $J -C build
}
package() {
cd "${srcdir}"/${pkgname%-git}
make DESTDIR="${pkgdir}" install
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment