* [gentoo-dev] [PATCH 1/3] postgres.eclass: die if no matching postgresql impl found
@ 2023-04-13 2:59 Sam James
2023-04-13 2:59 ` [gentoo-dev] [PATCH 2/3] postgres.eclass: document PG_SLOT, PG_CONFIG Sam James
2023-04-13 2:59 ` [gentoo-dev] [PATCH 3/3] postgres.eclass: add EAPI 8 Sam James
0 siblings, 2 replies; 3+ messages in thread
From: Sam James @ 2023-04-13 2:59 UTC (permalink / raw
To: gentoo-dev; +Cc: PostgreSQL, Sam James
This matches what we do in other eclasses like for python and ruby.
It leads to a nicer error if e.g. manually using ebuild(1) rather
than emerge(1) and deps aren't satisfied, or forgot to set POSTGRES_TARGETS
locally, etc.
Signed-off-by: Sam James <sam@gentoo.org>
---
eclass/postgres.eclass | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/eclass/postgres.eclass b/eclass/postgres.eclass
index e94ab56a40ae0..c3dc24e9db526 100644
--- a/eclass/postgres.eclass
+++ b/eclass/postgres.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# @ECLASS: postgres.eclass
@@ -150,6 +150,10 @@ postgres_pkg_setup() {
export PG_SLOT=${best_slot}
export PG_CONFIG=$(type -P pg_config${best_slot//./})
+ if [[ -z ${PG_CONFIG} ]] ; then
+ die "Could not find pg_config for ${PG_SLOT}. Is dev-db/postgresql:${PG_SLOT} installed?"
+ fi
+
local pg_pkg_config_path="$(${PG_CONFIG} --libdir)/pkgconfig"
if [[ -n "${PKG_CONFIG_PATH}" ]]; then
export PKG_CONFIG_PATH="${pg_pkg_config_path}:${PKG_CONFIG_PATH}"
--
2.40.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-dev] [PATCH 2/3] postgres.eclass: document PG_SLOT, PG_CONFIG
2023-04-13 2:59 [gentoo-dev] [PATCH 1/3] postgres.eclass: die if no matching postgresql impl found Sam James
@ 2023-04-13 2:59 ` Sam James
2023-04-13 2:59 ` [gentoo-dev] [PATCH 3/3] postgres.eclass: add EAPI 8 Sam James
1 sibling, 0 replies; 3+ messages in thread
From: Sam James @ 2023-04-13 2:59 UTC (permalink / raw
To: gentoo-dev; +Cc: PostgreSQL, Sam James
These variables are exported by pkg_setup and are intended for
use by ebuilds, as the docs for postgres_pkg_setup say.
Signed-off-by: Sam James <sam@gentoo.org>
---
eclass/postgres.eclass | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/eclass/postgres.eclass b/eclass/postgres.eclass
index c3dc24e9db526..1597f2a9aafb7 100644
--- a/eclass/postgres.eclass
+++ b/eclass/postgres.eclass
@@ -65,6 +65,17 @@ declare -p POSTGRES_USEDEP &>/dev/null && POSTGRES_DEP+="[${POSTGRES_USEDEP}]"
# required if the package must build against one of the PostgreSQL slots
# declared in POSTGRES_COMPAT.
+# @ECLASS_VARIABLE: PG_SLOT
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# PG_SLOT is the chosen PostgreSQL slot that is used for the build.
+
+# @ECLASS_VARIABLE: PG_CONFIG
+# @DEFAULT_UNSET
+# @DESCRIPTION:
+# PG_CONFIG is the path to pg_config for the chosen PostgreSQL slot.
+# For example, PG_CONFIG="pg_config15"
+
# @ECLASS_VARIABLE: _POSTGRES_COMPAT
# @INTERNAL
# @DESCRIPTION:
--
2.40.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-dev] [PATCH 3/3] postgres.eclass: add EAPI 8
2023-04-13 2:59 [gentoo-dev] [PATCH 1/3] postgres.eclass: die if no matching postgresql impl found Sam James
2023-04-13 2:59 ` [gentoo-dev] [PATCH 2/3] postgres.eclass: document PG_SLOT, PG_CONFIG Sam James
@ 2023-04-13 2:59 ` Sam James
1 sibling, 0 replies; 3+ messages in thread
From: Sam James @ 2023-04-13 2:59 UTC (permalink / raw
To: gentoo-dev; +Cc: PostgreSQL, Sam James
Closes: https://bugs.gentoo.org/836781
Signed-off-by: Sam James <sam@gentoo.org>
---
eclass/postgres.eclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/eclass/postgres.eclass b/eclass/postgres.eclass
index 1597f2a9aafb7..95ed168d40a1c 100644
--- a/eclass/postgres.eclass
+++ b/eclass/postgres.eclass
@@ -6,7 +6,7 @@
# PostgreSQL <pgsql-bugs@gentoo.org>
# @AUTHOR:
# Aaron W. Swenson <titanofold@gentoo.org>
-# @SUPPORTED_EAPIS: 7
+# @SUPPORTED_EAPIS: 7 8
# @BLURB: An eclass for PostgreSQL-related packages
# @DESCRIPTION:
# This eclass provides common utility functions that many
@@ -15,7 +15,7 @@
# user to the postgres system group, and generating dependencies.
case ${EAPI} in
- 7) ;;
+ 7|8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
esac
--
2.40.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-04-13 3:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-13 2:59 [gentoo-dev] [PATCH 1/3] postgres.eclass: die if no matching postgresql impl found Sam James
2023-04-13 2:59 ` [gentoo-dev] [PATCH 2/3] postgres.eclass: document PG_SLOT, PG_CONFIG Sam James
2023-04-13 2:59 ` [gentoo-dev] [PATCH 3/3] postgres.eclass: add EAPI 8 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox