Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
212 lines (171 sloc) 7.81 KB
# Maintainer: Xiao-Long Chen <chenxiaolong@cxl.epac.to>
# Some comments are taken from the Ubuntu packaging files
# vercheck-pkgbuild: auto
# vercheck-ubuntu: name=${pkgname%-*}, repo=zesty
# vercheck-launchpad: name=${pkgname%-*}
_use_ppa=false
pkgname=compiz-ubuntu
epoch=1
_actual_ver=0.9.13.1
_extra_ver=+17.04.20161114.1
if [[ "${_use_ppa}" != true ]]; then
_ubuntu_rel=0ubuntu1
_archive_dir="compiz-${_actual_ver}${_extra_ver}"
else
_ppa_rel=0ubuntu3\+ppa1
_archive_dir=compiz.vivid
fi
pkgver=${_actual_ver}${_extra_ver/+/.}
pkgrel=1
pkgdesc="OpenGL window and compositing manager"
url="http://www.compiz.org/"
arch=(i686 x86_64)
license=(GPL)
depends=(boost-libs dbus fuse glibmm glu librsvg libxcomposite libxdamage
libxinerama libxrandr libxslt libwnck3 mesa metacity
startup-notification protobuf pygtk pyrex gsettings-desktop-schemas)
# The schemas from gnome-settings-daemon are needed
depends+=(gnome-settings-daemon)
makedepends=(boost cmake intltool)
# FIXME: For modifying rpath
makedepends+=(patchelf)
optdepends=('gnome-control-center: GNOME Control Center'
'unity-control-center: Unity Control Center')
groups=(unity)
options=(emptydirs)
conflicts=(compiz metacity-ubuntu)
provides=(compiz-core compiz)
if [[ "${_use_ppa}" != true ]]; then
source=("https://launchpad.net/ubuntu/+archive/primary/+files/compiz_${_actual_ver}${_extra_ver}.orig.tar.gz"
"https://launchpad.net/ubuntu/+archive/primary/+files/compiz_${_actual_ver}${_extra_ver}-${_ubuntu_rel}.diff.gz")
else
source=("https://launchpad.net/~townsend/+archive/ubuntu/compiz-nvidia-refresh-test/+files/compiz_${_actual_ver}${_extra_ver}-${_ppa_rel}.tar.gz")
fi
source+=(compiz.reset
0001-Fix-cmake-install-directory.patch
0002-Fix-python-install-command.patch
0003-Use-Python-2.patch
0004-Disable-Werror.patch)
sha512sums=('26d3414556244aba6f3e38578d053ed62be0147a06d0e099cd56f98396b5ff07f632669161754341ac779d4ac8f955a24880a48cebb962df24c17e0a58ad5abd'
'a6ffd5f16ef767b1cc0d8d2acbf92ef8feab825895ace7547be6459ab690d46f4a52e1cd76c6e55629fa68a060a5500c4c19aae1cc7f807a86feda5340695245'
'5f4b38c5fe3af9de0fe7897b9fdd04184dff9bf448f21ef19d9ae1b224c972061d8b183aa01cf8dcdf4fb37bb3466233ce53a6dfbbe51b0ff04f17568d2dc7ff'
'64b1a6f3cfc00e9c0c7c32d012d171b7452f8d1ea3afeaadf441316621226bbc85b75237c0726290d8552570ffbc5c4fef5c5cae2663da9369221145623dbdfa'
'122b7858413a7114573fdb2a8d8e30f78309b364963f4a45f474409fa3ecdfbe956368a0b014294710a1e4efd19593a6fef55f3e1ce40951d2379501295455e7'
'9c2c27af5d36a1f253638fd660755f514edc0712c0e261bea4580f6344788cda229049a514629fd432ea2d82920454f3a8b8d79c9b8849f2ba87efcf70c213bb'
'31601ebeaa200671557ff94a54e3518b9af50914ce24004c628b1bacbadd4da418cb2e9cba46cdfe206c83517311f31c6480fc7dc4bf4c7bcea73dde20e88ae5')
prepare() {
#cd "${_archive_dir}"
# Fix the directory for FindCompiz.cmake and FindCompizConfig.cmake
patch -p1 -i 0001-Fix-cmake-install-directory.patch
# Compiz's build system appends --install-layout=deb to the python 2 install
# command (for python-compizconfig and ccsm) whether or not COMPIZ_DEB_BUILD
# is set to 1
patch -p1 -i 0002-Fix-python-install-command.patch
# Use python 2
patch -p1 -i 0003-Use-Python-2.patch
# Don't treat warnings as errors
patch -p1 -i 0004-Disable-Werror.patch
# Apply Ubuntu patches
if [[ "${_use_ppa}" != true ]]; then
patch -p1 -i compiz_${_actual_ver}${_extra_ver}-${_ubuntu_rel}.diff
fi
for i in $(grep -v '#' debian/patches/series); do
msg "Applying ${i}"
patch -p1 -i "debian/patches/${i}"
done
}
build() {
#cd "${_archive_dir}"
# Fix build on i686
export CXXFLAGS+=" -lc"
# Disable '-Bsymbolic-functions' if present so libcompiz_core won't be
# loaded once per plugin
export LDFLAGS="$(echo ${LDFLAGS} | sed 's/-B[ ]*symbolic-functions//')"
# Disable rpath in Python 2 bindings
export COMPIZ_DISABLE_RPATH=1
# Compiz will segfault if the CMake built target is set to 'Release'
# Disable tests since they can't run on a headless build server
[[ -d build ]] && rm -rvf build/
mkdir build/
cd build/
cmake .. \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCOMPIZ_BUILD_WITH_RPATH=FALSE \
`# -DCMAKE_BUILD_TYPE=RelWithDebInfo` \
-DCMAKE_BUILD_TYPE=Debug \
-DCOMPIZ_PACKAGING_ENABLED=TRUE \
-DUSE_GSETTINGS=ON \
-DCOMPIZ_DISABLE_GS_SCHEMAS_INSTALL=OFF \
-DCOMPIZ_BUILD_TESTING=OFF \
-DCOMPIZ_DISABLE_PLUGIN_KDE=ON \
-DUSE_KDE4=OFF \
`# Necessary for new versions of Compiz` \
`# https://bugs.launchpad.net/compiz/+bug/1070211` \
-DPYTHON_INCLUDE_DIR=/usr/include/python2.7 \
-DPYTHON_LIBRARY=/usr/lib/libpython2.7.so \
-Dlibdir=/usr/lib \
-Dlibcompizconfig_libdir=/usr/lib
make
}
package() {
#cd "${_archive_dir}/build"
cd build
make install DESTDIR="${pkgdir}"
# Stupid findcompiz_install needs COMPIZ_DESTDIR and install needs DESTDIR
#make findcompiz_install
CMAKE_DIR=$(cmake --system-information | grep '^CMAKE_ROOT' \
| awk -F\" '{print $2}')
install -dm755 "${pkgdir}${CMAKE_DIR}/Modules/"
install -m644 ../cmake/FindCompiz.cmake \
"${pkgdir}${CMAKE_DIR}/Modules/"
# Install documentation
install -dm755 "${pkgdir}/usr/share/doc/compiz/"
install ../{AUTHORS,NEWS,README} \
"${pkgdir}/usr/share/doc/compiz/"
# Install Ubuntu's files
install -dm755 "${pkgdir}/usr/share/man/man1/"
install -dm755 "${pkgdir}/etc/X11/xinit/xinitrc.d/"
install -dm755 "${pkgdir}/etc/compizconfig/upgrades/"
install -dm755 "${pkgdir}/usr/share/gnome/wm-properties/"
# Install manual pages
install -m644 ../debian/{ccsm,compiz,gtk-window-decorator}.1 \
"${pkgdir}/usr/share/man/man1/"
# Window manager desktop file for GNOME
install -m644 \
"${pkgdir}/usr/share/applications/compiz.desktop" \
"${pkgdir}/usr/share/gnome/wm-properties/"
# Install X11 startup script
install -m755 ../debian/65compiz_profile-on-session \
"${pkgdir}/etc/X11/xinit/xinitrc.d/"
# Unity Compiz profile configuration file
install -m644 ../debian/unity*.ini "${pkgdir}/etc/compizconfig/"
# Install Compiz profile configuration file
install -m644 ../debian/compizconfig "${pkgdir}/etc/compizconfig/config"
# Compiz profile upgrade helper files for ensuring smooth upgrades from older
# configuration files
pushd ../debian/profile_upgrades/
find . -type f -name '*.upgrade' -exec \
install -m644 {} "${pkgdir}"/etc/compizconfig/upgrades/{} \;
popd
install -dm755 "${pkgdir}/usr/lib/compiz/migration/"
pushd ../postinst/convert-files/
find . -type f -name '*.convert' -exec \
install -m644 {} "${pkgdir}"/usr/lib/compiz/migration/{} \;
popd
# Install keybinding files
install -dm755 "${pkgdir}/usr/share/gnome-control-center/keybindings/"
install -dm755 "${pkgdir}/usr/share/unity-control-center/keybindings/"
find ../*/gtk/gnome/ -name *.xml -exec install {} \
"${pkgdir}/usr/share/gnome-control-center/keybindings/" \;
find ../*/gtk/gnome/ -name *.xml -exec install {} \
"${pkgdir}/usr/share/unity-control-center/keybindings/" \;
# Default GSettings settings
install -m644 ../debian/compiz-gnome.gsettings-override \
"${pkgdir}/usr/share/glib-2.0/schemas/10_compiz-ubuntu.gschema.override"
# Install script for resetting all of Compiz's settings
install "${srcdir}/compiz.reset" "${pkgdir}/usr/bin/compiz.reset"
# Don't disable gnomecompat plugin
rm "${pkgdir}/etc/compizconfig/upgrades/com.canonical.unity.unity.07.upgrade"
sed -ri '/s0_active_plugins/s/$/;gnomecompat/g' \
"${pkgdir}/etc/compizconfig/unity.ini"
}