summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b530bc91af024e359c66264a23412a9915ad4da5 (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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# Maintainer:  Sapphira Armageddos <shadowkyogre.public@gmail.com>
# Contributor: martadinata666 <martadinata666@gmail.com>

# Flag for whether to use marco
_use_marco=0

# Flag for whether to use GTK+3
# Autoset depending on marco option
_use_gtk3=0

_upstream="compiz-core"

pkgbase=compiz-core-git
pkgname=(compiz-core-git compiz-gtk-git)
pkgver=0.8.14.r43.g09b96469
pkgrel=1
pkgdesc="This is the latest git release of Compiz without DE deps"
url="https://gitlab.com/compiz/${_upstream}"
license=('GPL' 'LGPL' 'MIT')
arch=('i686' 'x86_64')
depends=('startup-notification' 'librsvg' 'dbus' 'glu' 'libxslt' 'libxrandr' 'libsm' 'libxcomposite' 'libxinerama')
makedepends=('intltool' 'libice' 'libxi' 'libxcursor')
options=(!libtool !emptydirs)
source=(
	"git+https://gitlab.com/compiz/${_upstream}.git"
	compiz-gtk-update-icon-cache.hook
	compiz-gtk-update-icon-cache.script
	compiz-gtk-remove-icon-cache.hook
	compiz-gtk-remove-icon-cache.script
)

sha1sums=('SKIP')

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

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

if (("${_use_gtk3}" >= 1)); then
	_configure_opts+=("--with-gtk=3.0")
	msg "Using GTK+3 for gtk-window-decorator"
else
	_configure_opts+=("--with-gtk=2.0")
	msg "Using GTK+2 for gtk-window-decorator"
fi

pkgver() {
  cd "${srcdir}/${_upstream}"
  git describe --long --tags|sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

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

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

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

  make
}

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

  pkgdesc+=" (Core w/o decorator)"
  depends+=('hicolor-icon-theme' 'libxi' 'libxcursor')
  provides=("compiz-core=$pkgver")
  conflicts=('compiz' 'compiz-core')

  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

  install -Dm644 "${srcdir}/compiz-gtk-update-icon-cache.hook" "${pkgdir}/usr/share/libalpm/hooks/compiz-gtk-update-icon-cache.hook"
  install -Dm755 "${srcdir}/compiz-gtk-update-icon-cache.script" "${pkgdir}/usr/share/libalpm/scripts/compiz-gtk-update-icon-cache"
  install -Dm644 "${srcdir}/compiz-gtk-remove-icon-cache.hook" "${pkgdir}/usr/share/libalpm/hooks/compiz-gtk-remove-icon-cache.hook"
  install -Dm755 "${srcdir}/compiz-gtk-remove-icon-cache.script" "${pkgdir}/usr/share/libalpm/scripts/compiz-gtk-remove-icon-cache"
}

package_compiz-gtk-git()
{
  depends+=('compiz-core-git')
  #separating libmarco-private would be nice, but this is a workaround for now
  if (("${_use_marco}" == 1));then
    depends+=('marco')
  elif (("${_use_marco}" == 2));then
    depends+=('marco-gtk2')
  fi

  if (( "${_use_gtk3}" >= 1 ));then
    depends+=('libwnck3')
  else
    depends+=('libwnck')
  fi


  pkgdesc+=" (GTK+ window decorator)"
  provides=("compiz-gtk=$pkgver")
  conflicts=('compiz-gtk')

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

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

  local REMOVE_THESE=(
    "${pkgdir}/usr/share/icons/hicolor/"*"/apps/compiz."*
    "${pkgdir}/usr/share/compiz/"*.png
  )
  # 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
}

sha1sums=('SKIP'
          '157cc6fd3930d715a076a66a61969b99951871e5'
          'a40694c0fbcc5179a42fb6ced0842ef7dda9570e'
          'c40f1b1135695f4db834810d1307defe36ea1eab'
          'a572626cef5c368f54f08f99b51757ef6790a81c')