Update mingw-w64-postgresql to 12.1; use pthreads from mingw

This commit is contained in:
Andreas Köpke 2020-02-12 12:51:35 +01:00 committed by Martchus
parent 6a8abd686c
commit c6845531ca
3 changed files with 58 additions and 27 deletions

View File

@ -1,18 +1,8 @@
From f2d760f71d3201219cc342913ecc535f9776946d Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Fri, 27 Jul 2018 12:50:17 +0200
Subject: [PATCH] Use *.dll.a as extension for import libraries
---
src/Makefile.shlib | 2 +-
src/backend/Makefile | 12 ++++++------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index d546ed1f31..b2c2bef2d7 100644
index 373d73c..f1941d4 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -85,7 +85,7 @@ else
@@ -86,7 +86,7 @@ else
# Naming convention for dynamically loadable modules
shlib = $(NAME)$(DLSUFFIX)
endif
@ -22,15 +12,30 @@ index d546ed1f31..b2c2bef2d7 100644
ifndef soname
# additional flags for backend modules
diff --git a/src/backend/Makefile b/src/backend/Makefile
index 2640834d5f..51f127f0c9 100644
index b03d5e5..e1b8755 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -80,11 +80,11 @@ ifeq ($(PORTNAME), win32)
@@ -69,11 +69,11 @@ endif
ifeq ($(PORTNAME), cygwin)
postgres: $(OBJS)
- $(CC) $(CFLAGS) $(call expand_subsys,$^) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) -Wl,--stack,$(WIN32_STACK_RLIMIT) -Wl,--export-all-symbols -Wl,--out-implib=libpostgres.a $(LIBS) -o $@
+ $(CC) $(CFLAGS) $(call expand_subsys,$^) $(LDFLAGS) $(LDFLAGS_EX) $(export_dynamic) -Wl,--stack,$(WIN32_STACK_RLIMIT) -Wl,--export-all-symbols -Wl,--out-implib=libpostgres.dll.a $(LIBS) -o $@
-# libpostgres.a is actually built in the preceding rule, but we need this to
+# libpostgres.dll.a is actually built in the preceding rule, but we need this to
# ensure it's newer than postgres; see notes in src/backend/parser/Makefile
-libpostgres.a: postgres
+libpostgres.dll.a: postgres
touch $@
endif # cygwin
@@ -82,11 +82,11 @@ ifeq ($(PORTNAME), win32)
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)
- $(CC) $(CFLAGS) $(call expand_subsys,$(OBJS)) $(WIN32RES) $(LDFLAGS) $(LDFLAGS_EX) -Wl,--stack=$(WIN32_STACK_RLIMIT) -Wl,--export-all-symbols -Wl,--out-implib=libpostgres.a $(LIBS) -o $@$(X)
+ $(CC) $(CFLAGS) $(call expand_subsys,$(OBJS)) $(WIN32RES) $(LDFLAGS) $(LDFLAGS_EX) -Wl,--stack=$(WIN32_STACK_RLIMIT) -Wl,--export-all-symbols -Wl,--out-implib=libpostgres.dll.a $(LIBS) -o $@$(X)
-# libpostgres.a is actually built in the preceding rule, but we need this to
+# libpostgres.dll.a is actually built in the preceding rule, but we need this to
@ -40,7 +45,13 @@ index 2640834d5f..51f127f0c9 100644
touch $@
endif # win32
@@ -241,7 +241,7 @@ endif
@@ -195,12 +195,12 @@ distprep:
install: all installdirs install-bin
ifeq ($(PORTNAME), cygwin)
ifeq ($(MAKE_DLL), true)
- $(INSTALL_DATA) libpostgres.a '$(DESTDIR)$(libdir)/libpostgres.a'
+ $(INSTALL_DATA) libpostgres.dll.a '$(DESTDIR)$(libdir)/libpostgres.dll.a'
endif
endif
ifeq ($(PORTNAME), win32)
ifeq ($(MAKE_DLL), true)
@ -49,7 +60,13 @@ index 2640834d5f..51f127f0c9 100644
endif
endif
$(MAKE) -C catalog install-data
@@ -299,7 +299,7 @@ endif
@@ -260,12 +260,12 @@ ifeq ($(MAKE_EXPORTS), true)
endif
ifeq ($(PORTNAME), cygwin)
ifeq ($(MAKE_DLL), true)
- rm -f '$(DESTDIR)$(libdir)/libpostgres.a'
+ rm -f '$(DESTDIR)$(libdir)/libpostgres.dll.a'
endif
endif
ifeq ($(PORTNAME), win32)
ifeq ($(MAKE_DLL), true)
@ -58,8 +75,12 @@ index 2640834d5f..51f127f0c9 100644
endif
endif
$(MAKE) -C catalog uninstall-data
@@ -324,7 +324,7 @@ ifeq ($(PORTNAME), cygwin)
rm -f postgres.dll libpostgres.a
@@ -284,10 +284,10 @@ endif
clean:
rm -f $(LOCALOBJS) postgres$(X) $(POSTGRES_IMP)
ifeq ($(PORTNAME), cygwin)
- rm -f postgres.dll libpostgres.a
+ rm -f postgres.dll libpostgres.dll.a
endif
ifeq ($(PORTNAME), win32)
- rm -f postgres.dll libpostgres.a $(WIN32RES)
@ -67,6 +88,3 @@ index 2640834d5f..51f127f0c9 100644
endif
distclean: clean
--
2.18.0

View File

@ -0,0 +1,10 @@
--- a/src/interfaces/libpq/Makefile 2020-01-07 12:50:48.446033775 +0100
+++ b/src/interfaces/libpq/Makefile 2020-01-07 12:51:15.381102946 +0100
@@ -69,7 +69,7 @@
$(WINDRES) -i $< -o $@
ifeq ($(enable_thread_safety), yes)
-OBJS += pthread-win32.o
+# OBJS += pthread-win32.o
endif
endif

View File

@ -2,7 +2,7 @@
# Contributor: ant32 <antreimer@gmail.com>
pkgname=mingw-w64-postgresql
pkgver=11.4
pkgver=12.1
pkgrel=1
pkgdesc='Sophisticated object-relational DBMS (mingw-w64)'
arch=('any')
@ -15,15 +15,18 @@ 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"
'0001-Use-.dll.a-as-extension-for-import-libraries.patch')
sha256sums=('02802ddffd1590805beddd1e464dd28a46a41a5f1e1df04bab4f46663195cc8b'
'10fdb0beeb4c282f3395bb9cc7b20234d6534067fc0834e781fc5feb264c2b78')
'0001-Use-.dll.a-as-extension-for-import-libraries.patch'
'0002-use-mingw-pthread.patch')
sha256sums=('a09bf3abbaf6763980d0f8acbb943b7629a8b20073de18d867aecdb7988483ed'
'1012ccd145b3191d7b3f3362961decc31f42c0dd349e9150e435ed464417d460'
'fadddea99386132cc81f5c38b51c36621ede4d3ccb66f4cc26a540c0c9b62bd6')
_architectures="i686-w64-mingw32 x86_64-w64-mingw32"
prepare() {
cd postgresql-$pkgver
patch -p1 -i ${srcdir}/0001-Use-.dll.a-as-extension-for-import-libraries.patch
patch -p1 -i ${srcdir}/0002-use-mingw-pthread.patch
}
build() {