Skip to content

Commit

Permalink
Merge pull request msys2#273 from KrullKorg/master
Browse files Browse the repository at this point in the history
postgresql: wrapped utilities inside winpty.
  • Loading branch information
Alexpux committed Oct 19, 2014
2 parents b62f65d + 610893c commit 1993aa8
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions mingw-w64-postgresql/PKGBUILD
Expand Up @@ -4,12 +4,14 @@ _realname=postgresql

pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=9.3.5
pkgrel=1
pkgrel=2
pkgdesc="Libraries for use with PostgreSQL (mingw-w64)"
arch=('any')
url="http://www.postgresql.org/"
license=('custom:PostgreSQL')
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-libxml2" "${MINGW_PACKAGE_PREFIX}-python2")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
"${MINGW_PACKAGE_PREFIX}-libxml2"
"${MINGW_PACKAGE_PREFIX}-python2")
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-gettext"
"${MINGW_PACKAGE_PREFIX}-libxml2"
Expand All @@ -18,7 +20,8 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-zlib"
"${MINGW_PACKAGE_PREFIX}-tcl"
"${MINGW_PACKAGE_PREFIX}-libxslt"
"${MINGW_PACKAGE_PREFIX}-python2")
"${MINGW_PACKAGE_PREFIX}-python2"
"winpty-git")
options=('staticlibs' 'strip')
source=("http://ftp.postgresql.org/pub/source/v${pkgver}/postgresql-${pkgver}.tar.bz2"
postgresql-9.2.4-plperl-mingw.patch
Expand Down Expand Up @@ -97,4 +100,14 @@ package() {
# install -m644 postgres_ext.h "${pkgdir}${MINGW_PREFIX}/include/"
# install -m644 libpq/libpq-fs.h "${pkgdir}${MINGW_PREFIX}/include/libpq/"
# install -m644 pg_config_manual.h "${pkgdir}${MINGW_PREFIX}/include/"

# Use winpty-git script to invoke utilities. Please don't move this into a patch as
# hopefully one day we won't need this hack.
for f in clusterdb createdb createlang createuser dropdb droplang dropuser initdb pg_basebackup pg_dump pg_dumpall pg_receivexlog pg_restore psql reindexdb vacuumdb; do
mv "${pkgdir}"${MINGW_PREFIX}/bin/${f}.exe "${pkgdir}"${MINGW_PREFIX}/bin/${f}_exe
_exename="${f}"
echo "#!/usr/bin/env bash" > "${pkgdir}${MINGW_PREFIX}/bin/${_exename}"
echo '/usr/bin/winpty "$( dirname ${BASH_SOURCE[0]} )/'${_exename}'.exe" "$@"' >> "${pkgdir}${MINGW_PREFIX}/bin/${_exename}"
mv "${pkgdir}"${MINGW_PREFIX}/bin/${f}_exe "${pkgdir}"${MINGW_PREFIX}/bin/${f}.exe
done
}

0 comments on commit 1993aa8

Please sign in to comment.