summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 415c824a379b976f5ca40391e4c0be694ddb59a6 (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
# Contributor: tobias <tobias@archlinux.org>
# Contributor: Tobias Kieslich <tobias@justdreams.de>

pkgname=(libgda libgda-{firebird,jdbc,mysql,postgres})
pkgver=5.2.10
pkgrel=5
pkgdesc="Database access library"
url="https://www.gnome-db.org/"
arch=(x86_64)
license=(GPL)
depends=(gtksourceview3 libxslt python libsecret graphviz goocanvas iso-codes libgee openssl)
makedepends=(glade mariadb-libs postgresql-libs libfbclient jdk11-openjdk intltool
             gobject-introspection gtk-doc vala itstool gnome-common git)
_commit=85a2532df64698306fd3be324bb2052fb1b80fd3  # tags/LIBGDA_5_2_10^0
source=("git+https://gitlab.gnome.org/GNOME/libgda.git#commit=$_commit"
        0001-Use-single-header-with-GtkSource.patch
        0002-Use-goocanvas-3.0.patch)
sha256sums=('SKIP'
            '104594a6034b041d87c1129b0b5544c8899393d66a6a0fb7a8b55f7fcb77e560'
            '81ab26fd12f7174e880815f6aa624c24821b1f9c7f386ae566293df7f041b25b')

_apiver=5.0

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^LIBGDA_//;s/_/./g;s/-/+/g'
}

prepare() {
  mkdir providers

  cd $pkgname

  # Remove conflicting typedef
  git revert -n e1aea5ffb3fd9b49ad8c0dc01a915b47de3dc3d2

  # Fix use of gtksourceview headers
  git apply -3 ../0001-Use-single-header-with-GtkSource.patch

  # Port to goocanvas-3.0
  git apply -3 ../0002-Use-goocanvas-3.0.patch

  NOCONFIGURE=1 ./autogen.sh
}

build() {
  cd $pkgname
  CFLAGS+=" -Wno-deprecated-declarations"
  ./configure --prefix=/usr --sysconfdir=/etc --disable-static \
      --with-bdb=/usr --with-bdb-libdir-name=lib \
      --enable-json --enable-system-sqlite --enable-binreloc \
      --enable-vala --enable-gtk-doc
  sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  make
}

package_libgda() {
  optdepends=('libgda-firebird: provider for Firebird'
              'libgda-jdbc: provider for JDBC'
              'libgda-mysql: provider for MySQL'
              'libgda-postgres: provider for PostgreSQL')
  options+=(emptydirs)

  cd $pkgname
  make DESTDIR="$pkgdir" install

  mkdir -p providers
  local provider
  for provider in firebird jdbc mysql postgres; do
    mv "$pkgdir"/usr/lib/libgda-$_apiver/providers/libgda-$provider[-.]*so \
       "$pkgdir"/usr/lib/pkgconfig/libgda-$provider-$_apiver.pc \
       "$pkgdir"/usr/share/libgda-$_apiver/${provider}_specs_*.xml \
       "$srcdir/providers"
  done

  mv "$pkgdir"/usr/lib/libgda-$_apiver/providers/gdaprovider-${_apiver}.jar \
     "$pkgdir"/usr/bin/gda-list-jdbc-providers-${_apiver} \
     "$srcdir/providers"
}

_packageprovider() {
  install -d "$pkgdir"/usr/lib/{pkgconfig,libgda-$_apiver/providers} \
             "$pkgdir"/usr/share/libgda-$_apiver
  mv providers/libgda-${1}[-.]*so "$pkgdir/usr/lib/libgda-$_apiver/providers"
  mv providers/libgda-${1}-$_apiver.pc "$pkgdir/usr/lib/pkgconfig"
  mv providers/${1}_specs_*.xml "$pkgdir/usr/share/libgda-$_apiver"
}

package_libgda-firebird() {
  pkgdesc="libgda provider for Firebird"
  depends=(libgda libfbclient)
  _packageprovider firebird
}

package_libgda-jdbc() {
  pkgdesc="libgda provider for JDBC"
  depends=(libgda java-environment)
  _packageprovider jdbc
  install -d "$pkgdir/usr/bin"
  mv providers/gda-list-jdbc-providers-$_apiver "$pkgdir/usr/bin"
  mv providers/gdaprovider-$_apiver.jar "$pkgdir/usr/lib/libgda-$_apiver/providers"
}

package_libgda-mysql() {
  pkgdesc="libgda provider for MySQL"
  depends=(libgda mariadb-libs)
  _packageprovider mysql
}

package_libgda-postgres() {
  pkgdesc="libgda provider for PostgreSQL"
  depends=(libgda postgresql-libs)
  _packageprovider postgres
}