diff --git a/mingw-w64-postgresql/PKGBUILD b/mingw-w64-postgresql/PKGBUILD index a9e8ccf651..770d3ad7b4 100644 --- a/mingw-w64-postgresql/PKGBUILD +++ b/mingw-w64-postgresql/PKGBUILD @@ -2,7 +2,7 @@ _realname=postgresql pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" -pkgver=9.4.0 +pkgver=9.4.1 pkgrel=1 pkgdesc="Libraries for use with PostgreSQL (mingw-w64)" arch=('any') @@ -15,7 +15,8 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" "${MINGW_PACKAGE_PREFIX}-gettext" "${MINGW_PACKAGE_PREFIX}-libxml2" "${MINGW_PACKAGE_PREFIX}-openssl" - "${MINGW_PACKAGE_PREFIX}-readline" + #"${MINGW_PACKAGE_PREFIX}-readline" + #"${MINGW_PACKAGE_PREFIX}-wineditline" "${MINGW_PACKAGE_PREFIX}-zlib" "${MINGW_PACKAGE_PREFIX}-tcl" "${MINGW_PACKAGE_PREFIX}-libxslt" @@ -23,16 +24,27 @@ depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs" "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 - postgresql-9.3.1-plpython-mingw.patch) -md5sums=('8cd6e33e1f8d4d2362c8c08bd0e8802b' - '6a11681fbd19a3ccf8d41f7fbc9b4392' - '90aabb839c09ef93a1521daf97b63935') + postgresql-9.4.1-mingw-link.patch + postgresql-9.4.1-pl-perl.patch + postgresql-9.4.1-pl-python.patch + postgresql-9.4.1-pl-tcl.patch + postgresql-9.4.1-mingw-enable-readline.patch) +md5sums=('2cf30f50099ff1109d0aa517408f8eff' + '1d1499234e555afa688f645ef3825450' + '572932c6f0fc795aba4d5bb91e1fe4ba' + '381c984fc2eb2c22c35aed62bedeb7fa' + 'f4ebd4e26f7633354eee543690f2feb4' + 'd93f0fd678bf16adfe10dc04e6d86789') prepare() { cd ${srcdir}/postgresql-$pkgver - #patch -p1 -i ${srcdir}/postgresql-9.2.4-plperl-mingw.patch - patch -p1 -i ${srcdir}/postgresql-9.3.1-plpython-mingw.patch + patch -p1 -i ${srcdir}/postgresql-9.4.1-mingw-link.patch + patch -p1 -i ${srcdir}/postgresql-9.4.1-pl-perl.patch + patch -p1 -i ${srcdir}/postgresql-9.4.1-pl-python.patch + patch -p1 -i ${srcdir}/postgresql-9.4.1-pl-tcl.patch + #patch -p1 -i ${srcdir}/postgresql-9.4.1-mingw-enable-readline.patch + + autoreconf -fiv } build() { @@ -54,6 +66,7 @@ build() { --without-perl \ --with-tcl \ --with-tclconfig=${MINGW_PREFIX}/lib + #--with-libedit-preferred # Make DLL definition file visible during each arch build ln -s "${srcdir}/postgresql-$pkgver/src/interfaces/libpq/libpqdll.def" src/interfaces/libpq/ @@ -82,12 +95,12 @@ package() { mv "${pkgdir}${MINGW_PREFIX}/lib/"*.dll "${pkgdir}${MINGW_PREFIX}/bin/" # Rename the .a files to .dll.a as they're actually import libraries and not static libraries - for implib in "${pkgdir}${MINGW_PREFIX}/lib/"*.a; do - mv $implib ${implib/.a/.dll.a} - done + #for implib in "${pkgdir}${MINGW_PREFIX}/lib/"*.a; do + # mv $implib ${implib/.a/.dll.a} + #done # these headers are needed by the not-so-public headers of the interfaces - mkdir -p "${pkgdir}${MINGW_PREFIX}"/include/{libpq,postgresql/internal/libpq} + mkdir -p "${pkgdir}${MINGW_PREFIX}"/include/{libpq,postgresql/internal/libpq} install -m644 ${srcdir}/postgresql-${pkgver}/src/include/c.h "${pkgdir}${MINGW_PREFIX}/include/postgresql/internal/" install -m644 ${srcdir}/postgresql-${pkgver}/src/include/port.h "${pkgdir}${MINGW_PREFIX}/include/postgresql/internal/" install -m644 ${srcdir}/postgresql-${pkgver}/src/include/postgres_fe.h "${pkgdir}${MINGW_PREFIX}/include/postgresql/internal/" diff --git a/mingw-w64-postgresql/postgresql-9.2.4-plperl-mingw.patch b/mingw-w64-postgresql/postgresql-9.2.4-plperl-mingw.patch deleted file mode 100644 index e697794fef..0000000000 --- a/mingw-w64-postgresql/postgresql-9.2.4-plperl-mingw.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- postgresql-9.2.4/src/pl/plperl/GNUMakefile.orig 2013-05-13 14:18:22 +0300 -+++ postgresql-9.2.4/src/pl/plperl/GNUMakefile 2013-05-13 14:18:57 +0300 -@@ -19,7 +19,7 @@ - ifeq ($(PORTNAME), win32) - perl_archlibexp := $(subst \,/,$(perl_archlibexp)) - perl_privlibexp := $(subst \,/,$(perl_privlibexp)) --perl_lib := $(basename $(notdir $(wildcard $(perl_archlibexp)/CORE/perl[5-9]*.lib))) -+perl_lib := $(subst lib,,$(basename $(notdir $(wildcard $(perl_archlibexp)/CORE/libperl[5-9]*.a)))) - perl_embed_ldflags = -L$(perl_archlibexp)/CORE -l$(perl_lib) - override CPPFLAGS += -DPLPERL_HAVE_UID_GID - # Perl on win32 contains /* within comment all over the header file, diff --git a/mingw-w64-postgresql/postgresql-9.3.1-plpython-mingw.patch b/mingw-w64-postgresql/postgresql-9.3.1-plpython-mingw.patch deleted file mode 100644 index f810e67051..0000000000 --- a/mingw-w64-postgresql/postgresql-9.3.1-plpython-mingw.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- postgresql-9.4.0/src/pl/plpython/Makefile.orig 2014-12-27 09:52:55.043200000 +0400 -+++ postgresql-9.4.0/src/pl/plpython/Makefile 2014-12-27 09:54:53.591200000 +0400 -@@ -63,11 +63,8 @@ - - OBJS += libpython${pytverstr}.a - --libpython${pytverstr}.a: python${pytverstr}.def -- dlltool --dllname python${pytverstr}.dll --def python${pytverstr}.def --output-lib libpython${pytverstr}.a -- --python${pytverstr}.def: -- pexports $(PYTHONDLL) > $@ -+libpython${pytverstr}.a: -+ cp -f $(python_libdir)/libpython${python_version}.dll.a libpython${pytverstr}.a - - endif # win32 - diff --git a/mingw-w64-postgresql/postgresql-9.4.1-mingw-enable-readline.patch b/mingw-w64-postgresql/postgresql-9.4.1-mingw-enable-readline.patch new file mode 100644 index 0000000000..4445e8ac68 --- /dev/null +++ b/mingw-w64-postgresql/postgresql-9.4.1-mingw-enable-readline.patch @@ -0,0 +1,19 @@ +--- postgresql-9.4.1/configure.in.orig 2015-02-10 21:59:27.222800000 +0300 ++++ postgresql-9.4.1/configure.in 2015-02-10 22:00:30.637800000 +0300 +@@ -691,16 +691,6 @@ + # + PGAC_ARG_BOOL(with, readline, yes, + [do not use GNU Readline nor BSD Libedit for editing]) +-# readline on MinGW has problems with backslashes in psql and other bugs. +-# This is particularly a problem with non-US code pages. +-# Therefore disable its use until we understand the cause. 2004-07-20 +-if test "$PORTNAME" = "win32"; then +- if test "$with_readline" = yes; then +- AC_MSG_WARN([*** Readline does not work on MinGW --- disabling]) +- with_readline=no +- fi +-fi +- + + # + # Prefer libedit diff --git a/mingw-w64-postgresql/postgresql-9.4.1-mingw-link.patch b/mingw-w64-postgresql/postgresql-9.4.1-mingw-link.patch new file mode 100644 index 0000000000..86b57c6a3f --- /dev/null +++ b/mingw-w64-postgresql/postgresql-9.4.1-mingw-link.patch @@ -0,0 +1,52 @@ +--- postgresql-9.4.1/src/Makefile.shlib.orig 2015-02-10 19:14:10.984800000 +0300 ++++ postgresql-9.4.1/src/Makefile.shlib 2015-02-10 19:14:16.554000000 +0300 +@@ -86,7 +86,7 @@ + # Naming convention for dynamically loadable modules + shlib = $(NAME)$(DLSUFFIX) + endif +-stlib = lib$(NAME).a ++stlib = lib$(NAME).dll.a + + ifndef soname + # additional flags for backend modules +--- postgresql-9.4.1/src/backend/Makefile.orig 2015-02-10 21:01:34.928800000 +0300 ++++ postgresql-9.4.1/src/backend/Makefile 2015-02-10 21:03:43.819000000 +0300 +@@ -79,9 +79,9 @@ + LIBS += -lsecur32 + + postgres: $(OBJS) $(WIN32RES) +- $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) -Wl,--stack=$(WIN32_STACK_RLIMIT) -Wl,--export-all-symbols -Wl,--out-implib=libpostgres.a $(call expand_subsys,$(OBJS)) $(WIN32RES) $(LIBS) -o $@$(X) ++ $(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_EX) -Wl,--stack=$(WIN32_STACK_RLIMIT) -Wl,--export-all-symbols -Wl,--out-implib=libpostgres.dll.a $(call expand_subsys,$(OBJS)) $(WIN32RES) $(LIBS) -o $@$(X) + +-libpostgres.a: postgres ; ++libpostgres.dll.a: postgres ; + + endif # win32 + +@@ -207,7 +207,7 @@ + endif + ifeq ($(PORTNAME), win32) + ifeq ($(MAKE_DLL), true) +- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a' ++ $(INSTALL_DATA) libpostgres.dll.a '$(DESTDIR)$(libdir)/libpostgres.dll.a' + endif + endif + $(MAKE) -C catalog install-data +@@ -265,7 +265,7 @@ + endif + ifeq ($(PORTNAME), win32) + ifeq ($(MAKE_DLL), true) +- rm -f '$(DESTDIR)$(libdir)/libpostgres.a' ++ rm -f '$(DESTDIR)$(libdir)/libpostgres.dll.a' + endif + endif + $(MAKE) -C catalog uninstall-data +@@ -288,7 +288,7 @@ + rm -f postgres.dll libpostgres.a + endif + ifeq ($(PORTNAME), win32) +- rm -f postgres.dll libpostgres.a $(WIN32RES) ++ rm -f postgres.dll libpostgres.dll.a $(WIN32RES) + endif + + distclean: clean diff --git a/mingw-w64-postgresql/postgresql-9.4.1-pl-perl.patch b/mingw-w64-postgresql/postgresql-9.4.1-pl-perl.patch new file mode 100644 index 0000000000..dd8c2314f4 --- /dev/null +++ b/mingw-w64-postgresql/postgresql-9.4.1-pl-perl.patch @@ -0,0 +1,40 @@ +--- postgresql-9.4.1/src/pl/plperl/GNUmakefile.orig 2015-02-10 21:34:31.287600000 +0300 ++++ postgresql-9.4.1/src/pl/plperl/GNUmakefile 2015-02-10 21:35:06.732800000 +0300 +@@ -36,27 +36,6 @@ + + PERLCHUNKS = plc_perlboot.pl plc_trusted.pl + +-# Perl on win32 ships with import libraries only for Microsoft Visual C++, +-# which are not compatible with mingw gcc. Therefore we need to build a +-# new import library to link with. +-ifeq ($(PORTNAME), win32) +- +-perlwithver := $(subst -l,,$(filter -l%, $(perl_embed_ldflags))) +-PERLDLL := $(dir $(subst ',,$(PERL)))$(perlwithver).dll +-# we no longer want to include the original -l spec in SHLIB_LINK +-override perl_embed_ldflags := +- +-OBJS += lib$(perlwithver).a +- +-lib$(perlwithver).a: $(perlwithver).def +- dlltool --dllname $(perlwithver).dll --def $(perlwithver).def --output-lib lib$(perlwithver).a +- +-$(perlwithver).def: $(PERLDLL) +- pexports $^ > $@ +- +-endif # win32 +- +- + SHLIB_LINK = $(perl_embed_ldflags) + + REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-extension=plperl --load-extension=plperlu +@@ -126,9 +105,6 @@ + clean distclean maintainer-clean: clean-lib + rm -f SPI.c Util.c $(OBJS) perlchunks.h plperl_opmask.h + rm -rf $(pg_regress_clean_files) +-ifeq ($(PORTNAME), win32) +- rm -f $(perlwithver).def +-endif + + else # can't build + diff --git a/mingw-w64-postgresql/postgresql-9.4.1-pl-python.patch b/mingw-w64-postgresql/postgresql-9.4.1-pl-python.patch new file mode 100644 index 0000000000..aa2aabda39 --- /dev/null +++ b/mingw-w64-postgresql/postgresql-9.4.1-pl-python.patch @@ -0,0 +1,48 @@ +--- postgresql-9.4.1/src/pl/plpython/Makefile.orig 2015-02-02 23:42:55.000000000 +0300 ++++ postgresql-9.4.1/src/pl/plpython/Makefile 2015-02-10 21:33:26.353400000 +0300 +@@ -27,8 +27,6 @@ + # and we have to remove -lpython from the link since we are building our own + ifeq ($(PORTNAME), win32) + shared_libpython = yes +-python_includespec := $(subst \,/,$(python_includespec)) +-override python_libspec = + endif + + # If we don't have a shared library, we have to skip it. +@@ -59,26 +57,6 @@ + DATA += plpythonu.control plpythonu--1.0.sql plpythonu--unpackaged--1.0.sql + endif + +- +-# Python on win32 ships with import libraries only for Microsoft Visual C++, +-# which are not compatible with mingw gcc. Therefore we need to build a +-# new import library to link with. +-ifeq ($(PORTNAME), win32) +- +-pytverstr=$(subst .,,${python_version}) +-PYTHONDLL=$(subst \,/,$(WINDIR))/system32/python${pytverstr}.dll +- +-OBJS += libpython${pytverstr}.a +- +-libpython${pytverstr}.a: python${pytverstr}.def +- dlltool --dllname python${pytverstr}.dll --def python${pytverstr}.def --output-lib libpython${pytverstr}.a +- +-python${pytverstr}.def: +- pexports $(PYTHONDLL) > $@ +- +-endif # win32 +- +- + SHLIB_LINK = $(python_libspec) $(python_additional_libs) $(filter -lintl,$(LIBS)) + + REGRESS_OPTS = --dbname=$(PL_TESTDB) +@@ -187,9 +165,6 @@ + clean distclean: clean-lib + rm -f $(OBJS) + rm -rf $(pg_regress_clean_files) +-ifeq ($(PORTNAME), win32) +- rm -f python${pytverstr}.def +-endif + + else # can't build + diff --git a/mingw-w64-postgresql/postgresql-9.4.1-pl-tcl.patch b/mingw-w64-postgresql/postgresql-9.4.1-pl-tcl.patch new file mode 100644 index 0000000000..99e62633a9 --- /dev/null +++ b/mingw-w64-postgresql/postgresql-9.4.1-pl-tcl.patch @@ -0,0 +1,48 @@ +--- postgresql-9.4.1/src/pl/tcl/Makefile.orig 2015-02-10 21:23:07.259800000 +0300 ++++ postgresql-9.4.1/src/pl/tcl/Makefile 2015-02-10 21:24:31.189800000 +0300 +@@ -29,9 +29,10 @@ + endif + + ++SHLIB_LINK = $(TCL_LIB_SPEC) $(TCL_LIBS) + # On Windows, we don't link directly with the Tcl library; see below + ifneq ($(PORTNAME), win32) +-SHLIB_LINK = $(TCL_LIB_SPEC) $(TCL_LIBS) -lc ++SHLIB_LINK += -lc + endif + + +@@ -47,25 +48,6 @@ + # where to find psql for running the tests + PSQLDIR = $(bindir) + +-# Tcl on win32 ships with import libraries only for Microsoft Visual C++, +-# which are not compatible with mingw gcc. Therefore we need to build a +-# new import library to link with. +-ifeq ($(PORTNAME), win32) +- +-tclwithver = $(subst -l,,$(filter -l%, $(TCL_LIB_SPEC))) +-TCLDLL = $(dir $(TCLSH))/$(tclwithver).dll +- +-OBJS += lib$(tclwithver).a +- +-lib$(tclwithver).a: $(tclwithver).def +- dlltool --dllname $(tclwithver).dll --def $(tclwithver).def --output-lib lib$(tclwithver).a +- +-$(tclwithver).def: $(TCLDLL) +- pexports $^ > $@ +- +-endif # win32 +- +- + include $(top_srcdir)/src/Makefile.shlib + + ifeq ($(TCL_SHARED_BUILD), 1) +@@ -116,7 +98,4 @@ + clean distclean maintainer-clean: clean-lib + rm -f $(OBJS) + rm -rf $(pg_regress_clean_files) +-ifeq ($(PORTNAME), win32) +- rm -f $(tclwithver).def +-endif + $(MAKE) -C modules $@