blob: a56cddf7307913982e4ea5dce9b300157c083c78 (
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
|
# Contributor: ant32 <antreimer@gmail.com>
pkgname=mingw-w64-postgresql-libs
pkgver=9.5.4
pkgrel=1
pkgdesc="Libraries for use with PostgreSQL (mingw-w64)"
arch=(any)
url="http://www.postgresql.org"
license=("custom:PostgreSQL")
makedepends=(mingw-w64-configure libxml2)
depends=(mingw-w64-gettext "mingw-w64-openssl>=1.0.0" mingw-w64-libxml2)
options=(staticlibs !strip !buildflags)
source=("http://ftp.postgresql.org/pub/source/v${pkgver}/postgresql-${pkgver}.tar.bz2"
"postgresql-9.4.1-mingw-link.patch")
sha256sums=('cf5e571164ad66028ecd7dd8819e3765470d45bcd440d258b686be7e69c76ed0'
'0f2b5c7edb48dd106900854c9323ca2d483054595c4cf8a5b796a1d536d22aad')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
prepare() {
cd postgresql-$pkgver
patch -p1 -i ${srcdir}/postgresql-9.4.1-mingw-link.patch
}
build() {
cd postgresql-$pkgver
for _arch in ${_architectures}; do
mkdir -p build-${_arch} && pushd build-${_arch}
${_arch}-configure \
--with-openssl \
--enable-thread-safety \
--enable-nls \
--with-libxml \
--with-openssl
# Make DLL definition file visible during each arch build
ln -s "${srcdir}/postgresql-$pkgver/src/interfaces/libpq/libpqdll.def" src/interfaces/libpq/
ln -s "${srcdir}/postgresql-$pkgver/src/interfaces/ecpg/ecpglib/libecpgdll.def" src/interfaces/ecpg/ecpglib/
ln -s "${srcdir}/postgresql-$pkgver/src/interfaces/ecpg/pgtypeslib/libpgtypesdll.def" src/interfaces/ecpg/pgtypeslib/
ln -s "${srcdir}/postgresql-$pkgver/src/interfaces/ecpg/compatlib/libecpg_compatdll.def" src/interfaces/ecpg/compatlib/
make
popd
done
}
package() {
for _arch in ${_architectures}; do
cd "$srcdir/postgresql-$pkgver/build-${_arch}"
mkdir -p "${pkgdir}/usr/${_arch}/"{bin,include,lib}
make DESTDIR=$pkgdir install
mv "$pkgdir/usr/${_arch}/lib/"*.dll "$pkgdir/usr/${_arch}/bin/"
find "$pkgdir/usr/${_arch}" -name '*.exe' -exec rm {} \;
find "$pkgdir/usr/${_arch}" -name '*.dll' -exec ${_arch}-strip --strip-unneeded {} \;
find "$pkgdir/usr/${_arch}" -name '*.a' -o -name '*.dll' | xargs ${_arch}-strip -g
rm -r "$pkgdir/usr/${_arch}/share"
# these headers are needed by the not-so-public headers of the interfaces
cd "${srcdir}/postgresql-$pkgver/src/include"
mkdir -p "${pkgdir}"/usr/${_arch}/include/{libpq,postgresql/internal/libpq}
install -m644 c.h "${pkgdir}/usr/${_arch}/include/postgresql/internal/"
install -m644 port.h "${pkgdir}/usr/${_arch}/include/postgresql/internal/"
install -m644 postgres_fe.h "${pkgdir}/usr/${_arch}/include/postgresql/internal/"
install -m644 libpq/pqcomm.h "${pkgdir}/usr/${_arch}/include/postgresql/internal/libpq/"
done
}
|