2017-03-23 16:33:23 +01:00
|
|
|
# Maintainer: Martchus <martchus@gmx.net>
|
|
|
|
# Contributor: ant32 <antreimer@gmail.com>
|
|
|
|
|
|
|
|
pkgname=mingw-w64-postgresql
|
2022-11-05 16:50:36 +01:00
|
|
|
pkgver=15.0
|
2017-03-23 16:33:23 +01:00
|
|
|
pkgrel=1
|
2018-07-27 12:59:40 +02:00
|
|
|
pkgdesc='Sophisticated object-relational DBMS (mingw-w64)'
|
2017-03-23 16:33:23 +01:00
|
|
|
arch=('any')
|
|
|
|
url='https://www.postgresql.org'
|
|
|
|
license=('custom:PostgreSQL')
|
|
|
|
makedepends=('mingw-w64-configure' 'libxml2')
|
|
|
|
depends=('mingw-w64-gettext' 'mingw-w64-openssl>=1.0.0' 'mingw-w64-libxml2' 'mingw-w64-readline')
|
|
|
|
options=(staticlibs !strip !buildflags)
|
|
|
|
provides=('mingw-w64-postgresql-libs')
|
|
|
|
conflicts=('mingw-w64-postgresql-libs')
|
|
|
|
replaces=('mingw-w64-postgresql-libs')
|
|
|
|
source=("http://ftp.postgresql.org/pub/source/v${pkgver}/postgresql-${pkgver}.tar.bz2"
|
2020-02-12 12:51:35 +01:00
|
|
|
'0001-Use-.dll.a-as-extension-for-import-libraries.patch'
|
2021-03-07 18:30:55 +01:00
|
|
|
'0002-Use-pthread-library-from-MinGW.patch')
|
2022-11-05 16:50:36 +01:00
|
|
|
sha256sums=('72ec74f4a7c16e684f43ea42e215497fcd4c55d028a68fb72e99e61ff40da4d6'
|
2021-03-07 18:30:55 +01:00
|
|
|
'6119ad2418ce9995acf13b0f095ffa521250bae18cd387083c04e92b6ff22814'
|
|
|
|
'55c636400087482f896530e80f07706fff6c5c5b5654955d71944f035940e6a5')
|
2017-03-23 16:33:23 +01:00
|
|
|
|
|
|
|
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
cd postgresql-$pkgver
|
2018-07-27 12:59:40 +02:00
|
|
|
patch -p1 -i ${srcdir}/0001-Use-.dll.a-as-extension-for-import-libraries.patch
|
2021-03-07 18:30:55 +01:00
|
|
|
patch -p1 -i ${srcdir}/0002-Use-pthread-library-from-MinGW.patch
|
2017-03-23 16:33:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd postgresql-$pkgver
|
|
|
|
for _arch in ${_architectures}; do
|
|
|
|
mkdir -p build-${_arch} && pushd build-${_arch}
|
2017-06-04 10:01:48 +02:00
|
|
|
PATH=/usr/${_arch}/bin:$PATH ${_arch}-configure \
|
2017-03-23 16:33:23 +01:00
|
|
|
--enable-thread-safety \
|
|
|
|
--enable-nls \
|
|
|
|
--with-libxml \
|
2018-08-13 17:07:24 +02:00
|
|
|
--with-openssl \
|
|
|
|
--disable-rpath
|
2017-03-23 16:33:23 +01:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# Build static lib
|
|
|
|
${_arch}-ar rvs -o libpq.a src/interfaces/libpq/*.o
|
|
|
|
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 libpq.a "${pkgdir}/usr/${_arch}/lib/"
|
|
|
|
mv "$pkgdir/usr/${_arch}/lib/"*.dll "$pkgdir/usr/${_arch}/bin/"
|
|
|
|
|
|
|
|
find "${pkgdir}/usr/${_arch}" -name "*.exe" -exec ${_arch}-strip --strip-all {} \;
|
|
|
|
find "${pkgdir}/usr/${_arch}" -name "*.dll" -exec ${_arch}-strip --strip-unneeded {} \;
|
|
|
|
find "${pkgdir}/usr/${_arch}" -name "*.a" -exec ${_arch}-strip -g {} \;
|
|
|
|
|
|
|
|
# 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
|
|
|
|
}
|