diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-01-28 01:58:28 +0100 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-02-07 11:53:35 +0100 |
commit | 9de1a651d6a361e0776574a4e677c339df775d73 (patch) | |
tree | ae8cdcf28c03e84ecf8e26f2fbcf519a9a752457 /main/postgresql | |
parent | d5cc4bcc08adee1937aa44bd4eefb56f9034b12b (diff) | |
download | aports-9de1a651d6a361e0776574a4e677c339df775d73.tar.bz2 aports-9de1a651d6a361e0776574a4e677c339df775d73.tar.xz |
main/postgresql: build PL/Python for both Python versions
Diffstat (limited to 'main/postgresql')
-rw-r--r-- | main/postgresql/APKBUILD | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/main/postgresql/APKBUILD b/main/postgresql/APKBUILD index 08ccd2207e..1470172ca0 100644 --- a/main/postgresql/APKBUILD +++ b/main/postgresql/APKBUILD @@ -1,5 +1,6 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> # Contributor: G.J.R. Timmer <gjr.timmer@gmail.com> +# Contributor: Jakub Jirutka <jakub@jirutka.cz> pkgname=postgresql pkgver=9.6.1 pkgrel=1 @@ -13,9 +14,10 @@ pkgusers="postgres" pkggroups="postgres" depends_dev="libressl-dev" makedepends="$depends_dev libedit-dev zlib-dev libxml2-dev util-linux-dev - openldap-dev tcl-dev perl-dev python-dev" + openldap-dev tcl-dev perl-dev python2-dev python3-dev" subpackages="$pkgname-contrib $pkgname-dev $pkgname-doc libpq $pkgname-libs - $pkgname-client $pkgname-plperl $pkgname-plpython $pkgname-pltcl" + $pkgname-client $pkgname-plperl $pkgname-plpython2 $pkgname-plpython3 + $pkgname-pltcl" source="ftp://ftp.$pkgname.org/pub/source/v$pkgver/$pkgname-$pkgver.tar.bz2 initdb.patch perl-rpath.patch @@ -28,7 +30,6 @@ builddir="$srcdir/$pkgname-$pkgver" prepare() { default_prepare || return 1 - cd "$builddir" # sanity check of conf.d ( @@ -38,10 +39,36 @@ prepare() { die "PGDATA is $PGDATA while $_datadir is expected" fi ) || return 1 + + cp -al "$builddir" "$builddir"~py3 } +# NOTE: plpython requires separate configure/build runs to build against +# python 2 versus python 3. Note that the installed Makefile.global will +# reflect the python 2 build, which seems appropriate since that's still +# considered the default plpython version. build() { + msg "Building plpython3" + + cd "$builddir"~py3 + export PYTHON=/usr/bin/python3 + + _configure || return 1 + make -C src/backend submake-errcodes || return 1 + make -C src/pl/plpython all || return 1 + + + msg "Building all" + cd "$builddir" + export PYTHON=/usr/bin/python2 + + _configure && make world || return 1 + + unset PYTHON +} + +_configure() { ./configure \ --build=$CBUILD \ --host=$CHOST \ @@ -55,10 +82,7 @@ build() { --disable-rpath \ --with-perl \ --with-python \ - --with-tcl \ - || return 1 - - make world || return 1 + --with-tcl } package() { @@ -134,9 +158,9 @@ plperl() { mv "$pkgdir"/usr/share/postgresql/extension/plperl* "$subpkgdir"/usr/share/postgresql/extension/ } -plpython() { +plpython2() { depends="" - pkgdesc="PL/Python procedural language for PostgreSQL" + pkgdesc="PL/Python2 procedural language for PostgreSQL" mkdir -p "$subpkgdir"/usr/lib/postgresql mv "$pkgdir"/usr/lib/postgresql/plpython2.so "$subpkgdir"/usr/lib/postgresql/plpython2.so @@ -145,6 +169,15 @@ plpython() { mv "$pkgdir"/usr/share/postgresql/extension/plpython* "$subpkgdir"/usr/share/postgresql/extension/ } +plpython3() { + pkgdesc="PL/Python3 procedural language for PostgreSQL" + depends="" + + cd "$builddir"~py3 + make -C src/pl/plpython DESTDIR="$subpkgdir" install || return 1 + rm -R "$subpkgdir"/usr/include +} + pltcl() { depends="pgtcl" pkgdesc="PL/Tcl procedural language for PostgreSQL" |