summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e92b3dc246ac4ceec174ee83ce46e48ad631f13f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Maintainer: martadinata666 <martadinata666@gmail.com>

_use_marco=0

_upstream="compiz"
_pkgver=0.8.12
_micro=.3

pkgbase=compiz-core
pkgname=(compiz-core compiz-gtk)
pkgver="${_pkgver}${_micro}"
pkgrel=2
pkgdesc="This is the latest stable release of Compiz without DE deps"
url="https://github.com/compiz-reloaded/${_upstream}/"
license=('GPL' 'LGPL' 'MIT')
arch=('i686' 'x86_64')
depends=('startup-notification' 'librsvg' 'dbus' 'glu' 'libxslt' 'libxrandr' 'libsm' 'libxcomposite' 'libxinerama')
makedepends=('intltool' 'libice')
options=(!libtool !emptydirs)
source=("${url}/releases/download/v${pkgver}/${_upstream}-${pkgver}.tar.xz")

_configure_opts=(
  --prefix=/usr
  --enable-shared
  --enable-dbus
  --enable-dbus-glib
  --enable-librsvg
  --enable-glib
  --disable-static
  --disable-inotify
)

if (("${_use_marco}"));then
  _configure_opts+=("--enable-marco")
  makedepends+=("marco")
  msg "Marco theme support enabled"
else
  _configure_opts+=("--disable-marco")
  msg "Marco theme support disabled, rebuild with _use_marco=1 in the PKGBUILD if you want it"
fi

build()
{
  cd "${srcdir}/${_upstream}-${pkgver}"

  NOCONFIGURE=1 ./autogen.sh
  ./configure "${_configure_opts[@]}"

  if ! grep -q pkg_cv_GTK config.log;then
    # make sure only compiz-core is created if gtk is missing
    msg "Making sure only $pkgbase is made, gtk+2 is missing"
    pkgname=("$pkgbase")
  fi
  make
}

package_compiz-core() {
  cd "${srcdir}/${_upstream}-${pkgver}"

  pkgdesc+=" (Core w/o decorator)"
  provides=("compiz-core=$pkgver")
  conflicts=('compiz' 'compiz-core-git' 'compiz-git')

  make DESTDIR="${pkgdir}" install

  local REMOVE_THESE=(
    "${pkgdir}/usr/bin/gtk-window-decorator"
    "${pkgdir}/usr/share/glib-2.0/schemas/org.compiz-0.gwd.gschema.xml"
    "${pkgdir}/usr/share/icons/hicolor/"*"/apps/gtk-decorator."*
  )
  # Believe it or not, you CAN fill an array using wildcards in bash

  for fname in "${REMOVE_THESE[@]}";do
    if [ -e "$fname" ];then
      rm "$fname"
    fi
  done
}

package_compiz-gtk()
{
  if (("${_use_marco}"));then
    #separating libmarco-private would be nice, but this is a workaround for now
    depends+=('marco')
  else
    depends+=('gtk2')
  fi
  pkgdesc+=" (GTK+ window decorator)"
  conflicts=('compiz-gtk-git')

  cd "${srcdir}/${_upstream}-${pkgver}/gtk"
  make DESTDIR="${pkgdir}" install

  cd "${srcdir}/${_upstream}-${pkgver}/images"
  make DESTDIR="${pkgdir}" install

  local REMOVE_THESE=(
    "${pkgdir}/usr/share/icons/hicolor/"*"/apps/compiz."*
    "${pkgdir}/usr/share/compiz/"*.png
    "${pkgdir}/usr/share/applications/compiz.desktop"
  )
  # Believe it or not, you CAN fill an array using wildcards in bash

  for fname in "${REMOVE_THESE[@]}";do
    if [ -e "$fname" ];then
      rm "$fname"
    fi
  done
}

sha256sums=('6fc5176e3af5d6f434f26d1b654460aeeb3faf723db37f0957b46c2c23955032')