* [PR PATCH] postgresql: fix pg_config --*flags
@ 2020-04-09 9:23 sgn
2020-04-09 9:28 ` [PR PATCH] [Updated] " sgn
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: sgn @ 2020-04-09 9:23 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 715 bytes --]
There is a new pull request by sgn against master on the void-packages repository
https://github.com/sgn/void-packages postgresql-fix-pg-config
https://github.com/void-linux/void-packages/pull/20783
postgresql: fix pg_config --*flags
Current `pg_config` reports flags included `$SYSROOT`,
$ pg_config --cppflags
-D_GNU_SOURCE -I/usr/aarch64-linux-musl/usr/include/libxml2
Fix the build system to remove it from $CPPFLAGS $CFLAGS $LDFLAGS.
Also ship a new pg_config.sh for cross-compiling other packages that
depends on postgresql.
That script was mostly translated from C code.
(Partial?) fix for #19642
A patch file from https://github.com/void-linux/void-packages/pull/20783.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-postgresql-fix-pg-config-20783.patch --]
[-- Type: text/x-diff, Size: 9845 bytes --]
From afae6528a82f423067a0ea654b590200df120720 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
<congdanhqx+sgn@gmail.com>
Date: Thu, 9 Apr 2020 15:40:35 +0700
Subject: [PATCH] postgresql: fix pg_config --*flags
Current `pg_config` reports flags included `$SYSROOT`,
$ pg_config --cppflags
-D_GNU_SOURCE -I/usr/aarch64-linux-musl/usr/include/libxml2
Fix the build system to remove it from $CPPFLAGS $CFLAGS $LDFLAGS.
Also ship a new pg_config.sh for cross-compiling other packages that
depends on postgresql.
That script was mostly translated from C code.
---
srcpkgs/postgresql/files/pg_config.sh.in | 139 ++++++++++++++++++
.../patches/pg_config-cross-value.patch | 46 ++++++
srcpkgs/postgresql/template | 11 +-
3 files changed, 195 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/postgresql/files/pg_config.sh.in
create mode 100644 srcpkgs/postgresql/patches/pg_config-cross-value.patch
diff --git a/srcpkgs/postgresql/files/pg_config.sh.in b/srcpkgs/postgresql/files/pg_config.sh.in
new file mode 100644
index 00000000000..5e6a0d37773
--- /dev/null
+++ b/srcpkgs/postgresql/files/pg_config.sh.in
@@ -0,0 +1,139 @@
+#!/bin/sh
+# Released to Public Domain by Doan Tran Cong Danh
+
+sysroot="$(cd "${0%/*}" && cd ../.. && pwd)"
+
+BINDIR="$sysroot/usr/bin"
+DOCDIR="$sysroot/usr/share/doc/postgresql"
+HTMLDIR="$sysroot/usr/share/doc/postgresql"
+INCLUDEDIR="$sysroot/usr/include"
+PKGINCLUDEDIR="$sysroot/usr/include/postgresql"
+INCLUDEDIR_SERVER="$sysroot/usr/include/postgresql/server"
+LIBDIR="$sysroot/usr/lib"
+PKGLIBDIR="$sysroot/usr/lib/postgresql"
+LOCALEDIR="$sysroot/usr/share/locale"
+MANDIR="$sysroot/usr/share/man"
+SHAREDIR="$sysroot/usr/share/postgresql"
+SYSCONFDIR="$sysroot/etc/postgresql"
+PGXS="$sysroot/usr/lib/postgresql/pgxs/src/makefiles/pgxs.mk"
+
+CONFIGURE="@configure_args@"
+CC="@CC@"
+CPPFLAGS="@CPPFLAGS@"
+CFLAGS="@CFLAGS@"
+CFLAGS_SL="@CFLAGS_SL@"
+LDFLAGS="@LDFLAGS@"
+LDFLAGS_EX="@LDFLAGS_EX@"
+LDFLAGS_SL="@LDFLAGS_SL@"
+LIBS="@LIBS@"
+VERSION="PostgreSQL @VERSION@"
+
+if [ "$sysroot" != "/" ]; then
+ CPPFLAGS="$(echo "$CPPFLAGS" | sed "s,-I *\\(/usr/include\\),-I$sysroot\\1,g")"
+ CFLAGS="$(echo "$CFLAGS" | sed "s,-I *\\(/usr/include\\),-I$sysroot\\1,g")"
+ LDFLAGS="$(echo "$LDFLAGS" | sed "s,-L *\\(/usr/lib\\),-L$sysroot\\1,g")"
+fi
+
+usage() {
+ cat <<-EOF
+ $0 provides information about the installed version of PostgreSQL.
+
+ Usage:
+ $0 [OPTION]...
+
+ Options:
+ --bindir show location of user executables
+ --docdir show location of documentation files
+ --htmldir show location of HTML documentation files
+ --includedir show location of C header files of the client interfaces
+ --pkgincludedir show location of other C header files
+ --includedir-server show location of C header files for the server
+ --libdir show location of object code libraries
+ --pkglibdir show location of dynamically loadable modules
+ --localedir show location of locale support files
+ --mandir show location of manual pages
+ --sharedir show location of architecture-independent support files
+ --sysconfdir show location of system-wide configuration files
+ --pgxs show location of extension makefile
+ --configure show options given to PostgreSQL was built
+ --cc show CC value used when PostgreSQL was built
+ --cppflags show CPPFLAGS value used when PostgreSQL was built
+ --cflags show CFLAGS value used when PostgreSQL was built
+ --cflags_sl show CFLAGS_SL value used when PostgreSQL was built
+ --ldflags show LDFLAGS value used when PostgreSQL was built
+ --ldflags_ex show LDFLAGS_EX value used when PostgreSQL was built
+ --ldflags_sl show LDFLAGS_SL value used when PostgreSQL was built
+ --libs show LIBS value used when PostgreSQL was built
+ --version show the PostgreSQL version
+ -?, --help show this help, then exit
+
+ With no arguments, all known items are shown.
+
+ Report bugs to <pgsql-bugs@postgresql.org>.
+ EOF
+}
+
+if test $# -eq 0; then
+ cat <<-EOF
+ BINDIR = $BINDIR
+ DOCDIR = $DOCDIR
+ HTMLDIR = $HTMLDIR
+ INCLUDEDIR = $INCLUDEDIR
+ PKGINCLUDEDIR = $PKGINCLUDEDIR
+ INCLUDEDIR-SERVER = $INCLUDEDIR_SERVER
+ LIBDIR = $LIBDIR
+ PKGLIBDIR = $PKGLIBDIR
+ LOCALEDIR = $LOCALEDIR
+ MANDIR = $MANDIR
+ SHAREDIR = $SHAREDIR
+ SYSCONFDIR = $SYSCONFDIR
+ PGXS = $PGXS
+ CONFIGURE = $CONFIGURE
+ CC = $CC
+ CPPFLAGS = $CPPFLAGS
+ CFLAGS = $CFLAGS
+ CFLAGS_SL = $CFLAGS_SL
+ LDFLAGS = $LDFLAGS
+ LDFLAGS_EX = $LDFLAGS_EX
+ LDFLAGS_SL = $LDFLAGS_SL
+ LIBS = $LIBS
+ VERSION = $VERSION
+ EOF
+fi
+
+for arg
+do
+ if test "x$arg" = "x--help" || test "x$arg" = "x-?"; then
+ usage
+ exit 0
+ fi
+done
+
+for arg
+do
+ case "$arg" in
+ --bindir) echo "$BINDIR" ;;
+ --docdir) echo "$DOCDIR" ;;
+ --htmldir) echo "$HTMLDIR" ;;
+ --includedir) echo "$INCLUDEDIR" ;;
+ --pkgincludedir) echo "$PKGINCLUDEDIR" ;;
+ --includedir-server) echo "$INCLUDEDIR_SERVER" ;;
+ --libdir) echo "$LIBDIR" ;;
+ --pkglibdir) echo "$PKGLIBDIR" ;;
+ --localedir) echo "$LOCALEDIR" ;;
+ --mandir) echo "$MANDIR" ;;
+ --sharedir) echo "$SHAREDIR" ;;
+ --sysconfdir) echo "$SYSCONFDIR" ;;
+ --pgxs) echo "$PGXS" ;;
+ --configure) echo "$CONFIGURE" ;;
+ --cc) echo "$CC" ;;
+ --cppflags) echo "$CPPFLAGS" ;;
+ --cflags) echo "$CFLAGS" ;;
+ --cflags_sl) echo "$CFLAGS_SL" ;;
+ --ldflags) echo "$LDFLAGS" ;;
+ --ldflags_ex) echo "$LDFLAGS_EX" ;;
+ --ldflags_sl) echo "$LDFLAGS_SL" ;;
+ --libs) echo "$LIBS" ;;
+ --version) echo "$VERSION" ;;
+ esac
+done
diff --git a/srcpkgs/postgresql/patches/pg_config-cross-value.patch b/srcpkgs/postgresql/patches/pg_config-cross-value.patch
new file mode 100644
index 00000000000..67e3aabde0e
--- /dev/null
+++ b/srcpkgs/postgresql/patches/pg_config-cross-value.patch
@@ -0,0 +1,46 @@
+Sources: Doan Tran Cong Danh
+Upstream: No
+ - First part needs to be rework in configure script to be usable
+ upstream
+ - Second part would un-usable for Windows
+diff --git src/common/Makefile src/common/Makefile
+index ec04710..2af845f 100644
+--- src/common/Makefile
++++ src/common/Makefile
+@@ -22,11 +22,14 @@ include $(top_builddir)/src/Makefile.global
+
+ # don't include subdirectory-path-dependent -I and -L switches
+ STD_CPPFLAGS := $(filter-out -I$(top_srcdir)/src/include -I$(top_builddir)/src/include,$(CPPFLAGS))
++STD_CPPFLAGS := $(subst @XBPS_SYSROOT@,,$(STD_CPPFLAGS))
++STD_CFLAGS := $(subst @XBPS_SYSROOT@,,$(CFLAGS))
+ STD_LDFLAGS := $(filter-out -L$(top_builddir)/src/common -L$(top_builddir)/src/port,$(LDFLAGS))
++STD_LDFLAGS := $(subst @XBPS_SYSROOT@,,$(STD_LDFLAGS))
+ override CPPFLAGS += -DVAL_CONFIGURE="\"$(configure_args)\""
+ override CPPFLAGS += -DVAL_CC="\"$(CC)\""
+ override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""
+-override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\""
++override CPPFLAGS += -DVAL_CFLAGS="\"$(STD_CFLAGS)\""
+ override CPPFLAGS += -DVAL_CFLAGS_SL="\"$(CFLAGS_SL)\""
+ override CPPFLAGS += -DVAL_LDFLAGS="\"$(STD_LDFLAGS)\""
+ override CPPFLAGS += -DVAL_LDFLAGS_EX="\"$(LDFLAGS_EX)\""
+@@ -44,7 +47,19 @@ OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o restricted_token.o
+
+ OBJS_SRV = $(OBJS_COMMON:%.o=%_srv.o)
+
+-all: libpgcommon.a libpgcommon_srv.a
++all: libpgcommon.a libpgcommon_srv.a pg_config.sh
++
++pg_config.sh: pg_config.sh.in
++ sed -e "s/@configure_args@/$(subst /,\\/,$(configure_args))/" \
++ -e "s/@CC@/$(subst /,\\/,$(CC))/" \
++ -e "s/@CPPFLAGS@/$(subst /,\\/,$(STD_CPPFLAGS))/" \
++ -e "s/@CFLAGS@/$(subst /,\\/,$(STD_CFLAGS))/" \
++ -e "s/@CFLAGS_SL@/$(subst /,\\/,$(CFLAGS_SL))/" \
++ -e "s/@LDFLAGS@/$(subst /,\\/,$(STD_LDFLAGS))/" \
++ -e "s/@LDFLAGS_EX@/$(subst /,\\/,$(LDFLAGS_EX))/" \
++ -e "s/@LDFLAGS_SL@/$(subst /,\\/,$(LDFLAGS_SL))/" \
++ -e "s/@LIBS@/$(subst /,\\/,$(LIBS))/" \
++ $< >$@
+
+ # libpgcommon is needed by some contrib
+ install: all installdirs
diff --git a/srcpkgs/postgresql/template b/srcpkgs/postgresql/template
index 2fdb80c6556..6186d45c885 100644
--- a/srcpkgs/postgresql/template
+++ b/srcpkgs/postgresql/template
@@ -1,9 +1,10 @@
# Template file for 'postgresql'
pkgname=postgresql
version=9.6.17
-revision=1
+revision=2
build_style=gnu-configure
make_build_target=world
+make_build_args="V=1"
configure_args="--with-openssl --with-python
--with-pam --datadir=/usr/share/postgresql --enable-thread-safety
--with-perl --with-tcl --without-ldap --without-gssapi --without-krb5
@@ -35,6 +36,12 @@ if [ "$CROSS_BUILD" ]; then
configure_args+=" --without-perl --without-python --without-tcl"
fi
+post_patch() {
+ sed -e "s/@VERSION@/$version/" \
+ "$FILESDIR"/pg_config.sh.in >src/common/pg_config.sh.in
+ vsed -i -e "s,@XBPS_SYSROOT@,${XBPS_CROSS_BASE%/}," src/common/Makefile
+}
+
pre_build() {
# http://www.postgresql.org/docs/9.3/static/docguide-toolsets.html
export SGML_CATALOG_FILES="/usr/share/sgml/openjade/catalog:/usr/share/sgml/iso8879/catalog:/usr/share/sgml/docbook/dsssl/modular/catalog:/usr/share/sgml/docbook/4.2/catalog"
@@ -58,6 +65,7 @@ post_install() {
vinstall ${FILESDIR}/${pkgname}.pam 644 etc/pam.d ${pkgname}
vinstall ${DESTDIR}/usr/share/${pkgname}/${pkgname}.conf.sample \
644 etc/${pkgname} ${pkgname}.conf
+ vbin src/common/pg_config.sh
sed -i 's/install_bin = .*/install_bin = install/g' \
${DESTDIR}/usr/lib/postgresql/pgxs/src/Makefile.global
@@ -91,6 +99,7 @@ postgresql-libs-devel_package() {
vmove usr/bin/${f}
vmove "usr/share/man/man1/$(basename ${f})*"
done
+ vmove usr/bin/pg_config.sh
vmove usr/include
vmove "usr/lib/*.a"
vmove "usr/lib/pkgconfig/*"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PR PATCH] [Updated] postgresql: fix pg_config --*flags
2020-04-09 9:23 [PR PATCH] postgresql: fix pg_config --*flags sgn
@ 2020-04-09 9:28 ` sgn
2020-04-09 14:39 ` [PR PATCH] [Merged]: " pullmoll
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: sgn @ 2020-04-09 9:28 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 720 bytes --]
There is an updated pull request by sgn against master on the void-packages repository
https://github.com/sgn/void-packages postgresql-fix-pg-config
https://github.com/void-linux/void-packages/pull/20783
postgresql: fix pg_config --*flags
Current `pg_config` reports flags included `$SYSROOT`,
$ pg_config --cppflags
-D_GNU_SOURCE -I/usr/aarch64-linux-musl/usr/include/libxml2
Fix the build system to remove it from $CPPFLAGS $CFLAGS $LDFLAGS.
Also ship a new pg_config.sh for cross-compiling other packages that
depends on postgresql.
That script was mostly translated from C code.
(Partial?) fix for #19642
A patch file from https://github.com/void-linux/void-packages/pull/20783.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-postgresql-fix-pg-config-20783.patch --]
[-- Type: text/x-diff, Size: 9681 bytes --]
From e90053ed5c85bcfa6790e3c5addfbf83a7ac8522 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
<congdanhqx+sgn@gmail.com>
Date: Thu, 9 Apr 2020 15:40:35 +0700
Subject: [PATCH] postgresql: fix pg_config --*flags
Current `pg_config` reports flags included `$SYSROOT`,
$ pg_config --cppflags
-D_GNU_SOURCE -I/usr/aarch64-linux-musl/usr/include/libxml2
Fix the build system to remove it from $CPPFLAGS $CFLAGS $LDFLAGS.
Also ship a new pg_config.sh for cross-compiling other packages that
depends on postgresql.
That script was mostly translated from C code.
---
srcpkgs/postgresql/files/pg_config.sh.in | 139 ++++++++++++++++++
.../patches/pg_config-cross-value.patch | 46 ++++++
srcpkgs/postgresql/template | 10 +-
3 files changed, 194 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/postgresql/files/pg_config.sh.in
create mode 100644 srcpkgs/postgresql/patches/pg_config-cross-value.patch
diff --git a/srcpkgs/postgresql/files/pg_config.sh.in b/srcpkgs/postgresql/files/pg_config.sh.in
new file mode 100644
index 00000000000..5e6a0d37773
--- /dev/null
+++ b/srcpkgs/postgresql/files/pg_config.sh.in
@@ -0,0 +1,139 @@
+#!/bin/sh
+# Released to Public Domain by Doan Tran Cong Danh
+
+sysroot="$(cd "${0%/*}" && cd ../.. && pwd)"
+
+BINDIR="$sysroot/usr/bin"
+DOCDIR="$sysroot/usr/share/doc/postgresql"
+HTMLDIR="$sysroot/usr/share/doc/postgresql"
+INCLUDEDIR="$sysroot/usr/include"
+PKGINCLUDEDIR="$sysroot/usr/include/postgresql"
+INCLUDEDIR_SERVER="$sysroot/usr/include/postgresql/server"
+LIBDIR="$sysroot/usr/lib"
+PKGLIBDIR="$sysroot/usr/lib/postgresql"
+LOCALEDIR="$sysroot/usr/share/locale"
+MANDIR="$sysroot/usr/share/man"
+SHAREDIR="$sysroot/usr/share/postgresql"
+SYSCONFDIR="$sysroot/etc/postgresql"
+PGXS="$sysroot/usr/lib/postgresql/pgxs/src/makefiles/pgxs.mk"
+
+CONFIGURE="@configure_args@"
+CC="@CC@"
+CPPFLAGS="@CPPFLAGS@"
+CFLAGS="@CFLAGS@"
+CFLAGS_SL="@CFLAGS_SL@"
+LDFLAGS="@LDFLAGS@"
+LDFLAGS_EX="@LDFLAGS_EX@"
+LDFLAGS_SL="@LDFLAGS_SL@"
+LIBS="@LIBS@"
+VERSION="PostgreSQL @VERSION@"
+
+if [ "$sysroot" != "/" ]; then
+ CPPFLAGS="$(echo "$CPPFLAGS" | sed "s,-I *\\(/usr/include\\),-I$sysroot\\1,g")"
+ CFLAGS="$(echo "$CFLAGS" | sed "s,-I *\\(/usr/include\\),-I$sysroot\\1,g")"
+ LDFLAGS="$(echo "$LDFLAGS" | sed "s,-L *\\(/usr/lib\\),-L$sysroot\\1,g")"
+fi
+
+usage() {
+ cat <<-EOF
+ $0 provides information about the installed version of PostgreSQL.
+
+ Usage:
+ $0 [OPTION]...
+
+ Options:
+ --bindir show location of user executables
+ --docdir show location of documentation files
+ --htmldir show location of HTML documentation files
+ --includedir show location of C header files of the client interfaces
+ --pkgincludedir show location of other C header files
+ --includedir-server show location of C header files for the server
+ --libdir show location of object code libraries
+ --pkglibdir show location of dynamically loadable modules
+ --localedir show location of locale support files
+ --mandir show location of manual pages
+ --sharedir show location of architecture-independent support files
+ --sysconfdir show location of system-wide configuration files
+ --pgxs show location of extension makefile
+ --configure show options given to PostgreSQL was built
+ --cc show CC value used when PostgreSQL was built
+ --cppflags show CPPFLAGS value used when PostgreSQL was built
+ --cflags show CFLAGS value used when PostgreSQL was built
+ --cflags_sl show CFLAGS_SL value used when PostgreSQL was built
+ --ldflags show LDFLAGS value used when PostgreSQL was built
+ --ldflags_ex show LDFLAGS_EX value used when PostgreSQL was built
+ --ldflags_sl show LDFLAGS_SL value used when PostgreSQL was built
+ --libs show LIBS value used when PostgreSQL was built
+ --version show the PostgreSQL version
+ -?, --help show this help, then exit
+
+ With no arguments, all known items are shown.
+
+ Report bugs to <pgsql-bugs@postgresql.org>.
+ EOF
+}
+
+if test $# -eq 0; then
+ cat <<-EOF
+ BINDIR = $BINDIR
+ DOCDIR = $DOCDIR
+ HTMLDIR = $HTMLDIR
+ INCLUDEDIR = $INCLUDEDIR
+ PKGINCLUDEDIR = $PKGINCLUDEDIR
+ INCLUDEDIR-SERVER = $INCLUDEDIR_SERVER
+ LIBDIR = $LIBDIR
+ PKGLIBDIR = $PKGLIBDIR
+ LOCALEDIR = $LOCALEDIR
+ MANDIR = $MANDIR
+ SHAREDIR = $SHAREDIR
+ SYSCONFDIR = $SYSCONFDIR
+ PGXS = $PGXS
+ CONFIGURE = $CONFIGURE
+ CC = $CC
+ CPPFLAGS = $CPPFLAGS
+ CFLAGS = $CFLAGS
+ CFLAGS_SL = $CFLAGS_SL
+ LDFLAGS = $LDFLAGS
+ LDFLAGS_EX = $LDFLAGS_EX
+ LDFLAGS_SL = $LDFLAGS_SL
+ LIBS = $LIBS
+ VERSION = $VERSION
+ EOF
+fi
+
+for arg
+do
+ if test "x$arg" = "x--help" || test "x$arg" = "x-?"; then
+ usage
+ exit 0
+ fi
+done
+
+for arg
+do
+ case "$arg" in
+ --bindir) echo "$BINDIR" ;;
+ --docdir) echo "$DOCDIR" ;;
+ --htmldir) echo "$HTMLDIR" ;;
+ --includedir) echo "$INCLUDEDIR" ;;
+ --pkgincludedir) echo "$PKGINCLUDEDIR" ;;
+ --includedir-server) echo "$INCLUDEDIR_SERVER" ;;
+ --libdir) echo "$LIBDIR" ;;
+ --pkglibdir) echo "$PKGLIBDIR" ;;
+ --localedir) echo "$LOCALEDIR" ;;
+ --mandir) echo "$MANDIR" ;;
+ --sharedir) echo "$SHAREDIR" ;;
+ --sysconfdir) echo "$SYSCONFDIR" ;;
+ --pgxs) echo "$PGXS" ;;
+ --configure) echo "$CONFIGURE" ;;
+ --cc) echo "$CC" ;;
+ --cppflags) echo "$CPPFLAGS" ;;
+ --cflags) echo "$CFLAGS" ;;
+ --cflags_sl) echo "$CFLAGS_SL" ;;
+ --ldflags) echo "$LDFLAGS" ;;
+ --ldflags_ex) echo "$LDFLAGS_EX" ;;
+ --ldflags_sl) echo "$LDFLAGS_SL" ;;
+ --libs) echo "$LIBS" ;;
+ --version) echo "$VERSION" ;;
+ esac
+done
diff --git a/srcpkgs/postgresql/patches/pg_config-cross-value.patch b/srcpkgs/postgresql/patches/pg_config-cross-value.patch
new file mode 100644
index 00000000000..67e3aabde0e
--- /dev/null
+++ b/srcpkgs/postgresql/patches/pg_config-cross-value.patch
@@ -0,0 +1,46 @@
+Sources: Doan Tran Cong Danh
+Upstream: No
+ - First part needs to be rework in configure script to be usable
+ upstream
+ - Second part would un-usable for Windows
+diff --git src/common/Makefile src/common/Makefile
+index ec04710..2af845f 100644
+--- src/common/Makefile
++++ src/common/Makefile
+@@ -22,11 +22,14 @@ include $(top_builddir)/src/Makefile.global
+
+ # don't include subdirectory-path-dependent -I and -L switches
+ STD_CPPFLAGS := $(filter-out -I$(top_srcdir)/src/include -I$(top_builddir)/src/include,$(CPPFLAGS))
++STD_CPPFLAGS := $(subst @XBPS_SYSROOT@,,$(STD_CPPFLAGS))
++STD_CFLAGS := $(subst @XBPS_SYSROOT@,,$(CFLAGS))
+ STD_LDFLAGS := $(filter-out -L$(top_builddir)/src/common -L$(top_builddir)/src/port,$(LDFLAGS))
++STD_LDFLAGS := $(subst @XBPS_SYSROOT@,,$(STD_LDFLAGS))
+ override CPPFLAGS += -DVAL_CONFIGURE="\"$(configure_args)\""
+ override CPPFLAGS += -DVAL_CC="\"$(CC)\""
+ override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""
+-override CPPFLAGS += -DVAL_CFLAGS="\"$(CFLAGS)\""
++override CPPFLAGS += -DVAL_CFLAGS="\"$(STD_CFLAGS)\""
+ override CPPFLAGS += -DVAL_CFLAGS_SL="\"$(CFLAGS_SL)\""
+ override CPPFLAGS += -DVAL_LDFLAGS="\"$(STD_LDFLAGS)\""
+ override CPPFLAGS += -DVAL_LDFLAGS_EX="\"$(LDFLAGS_EX)\""
+@@ -44,7 +47,19 @@ OBJS_FRONTEND = $(OBJS_COMMON) fe_memutils.o restricted_token.o
+
+ OBJS_SRV = $(OBJS_COMMON:%.o=%_srv.o)
+
+-all: libpgcommon.a libpgcommon_srv.a
++all: libpgcommon.a libpgcommon_srv.a pg_config.sh
++
++pg_config.sh: pg_config.sh.in
++ sed -e "s/@configure_args@/$(subst /,\\/,$(configure_args))/" \
++ -e "s/@CC@/$(subst /,\\/,$(CC))/" \
++ -e "s/@CPPFLAGS@/$(subst /,\\/,$(STD_CPPFLAGS))/" \
++ -e "s/@CFLAGS@/$(subst /,\\/,$(STD_CFLAGS))/" \
++ -e "s/@CFLAGS_SL@/$(subst /,\\/,$(CFLAGS_SL))/" \
++ -e "s/@LDFLAGS@/$(subst /,\\/,$(STD_LDFLAGS))/" \
++ -e "s/@LDFLAGS_EX@/$(subst /,\\/,$(LDFLAGS_EX))/" \
++ -e "s/@LDFLAGS_SL@/$(subst /,\\/,$(LDFLAGS_SL))/" \
++ -e "s/@LIBS@/$(subst /,\\/,$(LIBS))/" \
++ $< >$@
+
+ # libpgcommon is needed by some contrib
+ install: all installdirs
diff --git a/srcpkgs/postgresql/template b/srcpkgs/postgresql/template
index 2fdb80c6556..084ae5bb70f 100644
--- a/srcpkgs/postgresql/template
+++ b/srcpkgs/postgresql/template
@@ -1,7 +1,7 @@
# Template file for 'postgresql'
pkgname=postgresql
version=9.6.17
-revision=1
+revision=2
build_style=gnu-configure
make_build_target=world
configure_args="--with-openssl --with-python
@@ -35,6 +35,12 @@ if [ "$CROSS_BUILD" ]; then
configure_args+=" --without-perl --without-python --without-tcl"
fi
+post_patch() {
+ sed -e "s/@VERSION@/$version/" \
+ "$FILESDIR"/pg_config.sh.in >src/common/pg_config.sh.in
+ vsed -i -e "s,@XBPS_SYSROOT@,${XBPS_CROSS_BASE%/}," src/common/Makefile
+}
+
pre_build() {
# http://www.postgresql.org/docs/9.3/static/docguide-toolsets.html
export SGML_CATALOG_FILES="/usr/share/sgml/openjade/catalog:/usr/share/sgml/iso8879/catalog:/usr/share/sgml/docbook/dsssl/modular/catalog:/usr/share/sgml/docbook/4.2/catalog"
@@ -58,6 +64,7 @@ post_install() {
vinstall ${FILESDIR}/${pkgname}.pam 644 etc/pam.d ${pkgname}
vinstall ${DESTDIR}/usr/share/${pkgname}/${pkgname}.conf.sample \
644 etc/${pkgname} ${pkgname}.conf
+ vbin src/common/pg_config.sh
sed -i 's/install_bin = .*/install_bin = install/g' \
${DESTDIR}/usr/lib/postgresql/pgxs/src/Makefile.global
@@ -91,6 +98,7 @@ postgresql-libs-devel_package() {
vmove usr/bin/${f}
vmove "usr/share/man/man1/$(basename ${f})*"
done
+ vmove usr/bin/pg_config.sh
vmove usr/include
vmove "usr/lib/*.a"
vmove "usr/lib/pkgconfig/*"
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PR PATCH] [Merged]: postgresql: fix pg_config --*flags
2020-04-09 9:23 [PR PATCH] postgresql: fix pg_config --*flags sgn
2020-04-09 9:28 ` [PR PATCH] [Updated] " sgn
@ 2020-04-09 14:39 ` pullmoll
2020-04-09 14:53 ` sgn
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pullmoll @ 2020-04-09 14:39 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 555 bytes --]
There's a merged pull request on the void-packages repository
postgresql: fix pg_config --*flags
https://github.com/void-linux/void-packages/pull/20783
Description:
Current `pg_config` reports flags included `$SYSROOT`,
$ pg_config --cppflags
-D_GNU_SOURCE -I/usr/aarch64-linux-musl/usr/include/libxml2
Fix the build system to remove it from $CPPFLAGS $CFLAGS $LDFLAGS.
Also ship a new pg_config.sh for cross-compiling other packages that
depends on postgresql.
That script was mostly translated from C code.
(Partial?) fix for #19642
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: postgresql: fix pg_config --*flags
2020-04-09 9:23 [PR PATCH] postgresql: fix pg_config --*flags sgn
2020-04-09 9:28 ` [PR PATCH] [Updated] " sgn
2020-04-09 14:39 ` [PR PATCH] [Merged]: " pullmoll
@ 2020-04-09 14:53 ` sgn
2020-04-09 14:55 ` xtraeme
2020-04-09 14:56 ` xtraeme
4 siblings, 0 replies; 6+ messages in thread
From: sgn @ 2020-04-09 14:53 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 307 bytes --]
New comment by sgn on void-packages repository
https://github.com/void-linux/void-packages/pull/20783#issuecomment-611571867
Comment:
@pullmoll Sorry, I've recognised a bug in `pg_config.sh.in`
We should use `printf "%s\n"` instead of `echo` because of `-` in those values.
Can you help to push it?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: postgresql: fix pg_config --*flags
2020-04-09 9:23 [PR PATCH] postgresql: fix pg_config --*flags sgn
` (2 preceding siblings ...)
2020-04-09 14:53 ` sgn
@ 2020-04-09 14:55 ` xtraeme
2020-04-09 14:56 ` xtraeme
4 siblings, 0 replies; 6+ messages in thread
From: xtraeme @ 2020-04-09 14:55 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 179 bytes --]
New comment by xtraeme on void-packages repository
https://github.com/void-linux/void-packages/pull/20783#issuecomment-611573012
Comment:
@pullmoll looks like you were too fast
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: postgresql: fix pg_config --*flags
2020-04-09 9:23 [PR PATCH] postgresql: fix pg_config --*flags sgn
` (3 preceding siblings ...)
2020-04-09 14:55 ` xtraeme
@ 2020-04-09 14:56 ` xtraeme
4 siblings, 0 replies; 6+ messages in thread
From: xtraeme @ 2020-04-09 14:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 196 bytes --]
New comment by xtraeme on void-packages repository
https://github.com/void-linux/void-packages/pull/20783#issuecomment-611573444
Comment:
@sgn go ahead. Pullmoll will merge your changes. Thanks
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-04-09 14:56 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 9:23 [PR PATCH] postgresql: fix pg_config --*flags sgn
2020-04-09 9:28 ` [PR PATCH] [Updated] " sgn
2020-04-09 14:39 ` [PR PATCH] [Merged]: " pullmoll
2020-04-09 14:53 ` sgn
2020-04-09 14:55 ` xtraeme
2020-04-09 14:56 ` xtraeme
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).