public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 0/2] xdg-utils && gnome2-utils EAPI 7 work
@ 2018-06-18  0:47 Marty E. Plummer
  2018-06-18  0:47 ` [gentoo-dev] [PATCH 2/2] xdg-utils.eclass: make EAPI 7 ready Marty E. Plummer
  2018-06-18  0:47 ` [gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: " Marty E. Plummer
  0 siblings, 2 replies; 7+ messages in thread
From: Marty E. Plummer @ 2018-06-18  0:47 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

Just some simple changes to the eclasses to handle the fact that
${EROOT} no longer comes with a trailing / on EAPI 7 and use BDEPEND
where applicable. Better ideas and suggestions are greatly appreciated.

Marty E. Plummer (2):
  xdg-utils.eclass: make EAPI 7 ready
  gnome2-utils.eclass: make EAPI 7 ready

 eclass/xdg-utils.eclass    | 10 ++++-----
 eclass/gnome2-utils.eclass | 43 +++++++++++++++++++-------------------
 2 files changed, 27 insertions(+), 26 deletions(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gentoo-dev] [PATCH 2/2] xdg-utils.eclass: make EAPI 7 ready
  2018-06-18  0:47 [gentoo-dev] [PATCH 0/2] xdg-utils && gnome2-utils EAPI 7 work Marty E. Plummer
@ 2018-06-18  0:47 ` Marty E. Plummer
  2018-06-18  0:47 ` [gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: " Marty E. Plummer
  1 sibling, 0 replies; 7+ messages in thread
From: Marty E. Plummer @ 2018-06-18  0:47 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

Use ${EROOT%/} whereever possible, as the tools and directories which
are used with it are already prefixed with a /

Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/xdg-utils.eclass | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/eclass/xdg-utils.eclass b/eclass/xdg-utils.eclass
index ac075185d8e..8dba5ed6861 100644
--- a/eclass/xdg-utils.eclass
+++ b/eclass/xdg-utils.eclass
@@ -15,7 +15,7 @@
 #  * XDG mime information database management
 
 case "${EAPI:-0}" in
-	0|1|2|3|4|5|6) ;;
+	0|1|2|3|4|5|6|7) ;;
 	*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -66,7 +66,7 @@ xdg_environment_reset() {
 # Updates the .desktop files database.
 # Generates a list of mimetypes linked to applications that can handle them
 xdg_desktop_database_update() {
-	local updater="${EROOT}${DESKTOP_DATABASE_UPDATE_BIN}"
+	local updater="${EROOT%/}${DESKTOP_DATABASE_UPDATE_BIN}"
 
 	if [[ ${EBUILD_PHASE} != post* ]] ; then
 		die "xdg_desktop_database_update must be used in pkg_post* phases."
@@ -78,7 +78,7 @@ xdg_desktop_database_update() {
 	fi
 
 	ebegin "Updating .desktop files database"
-	"${updater}" -q "${EROOT}${DESKTOP_DATABASE_DIR}"
+	"${updater}" -q "${EROOT%/}${DESKTOP_DATABASE_DIR}"
 	eend $?
 }
 
@@ -87,7 +87,7 @@ xdg_desktop_database_update() {
 # Update the mime database.
 # Creates a general list of mime types from several sources
 xdg_mimeinfo_database_update() {
-	local updater="${EROOT}${MIMEINFO_DATABASE_UPDATE_BIN}"
+	local updater="${EROOT%/}${MIMEINFO_DATABASE_UPDATE_BIN}"
 
 	if [[ ${EBUILD_PHASE} != post* ]] ; then
 		die "xdg_mimeinfo_database_update must be used in pkg_post* phases."
@@ -99,6 +99,6 @@ xdg_mimeinfo_database_update() {
 	fi
 
 	ebegin "Updating shared mime info database"
-	"${updater}" "${EROOT}${MIMEINFO_DATABASE_DIR}"
+	"${updater}" "${EROOT%/}${MIMEINFO_DATABASE_DIR}"
 	eend $?
 }
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: make EAPI 7 ready
  2018-06-18  0:47 [gentoo-dev] [PATCH 0/2] xdg-utils && gnome2-utils EAPI 7 work Marty E. Plummer
  2018-06-18  0:47 ` [gentoo-dev] [PATCH 2/2] xdg-utils.eclass: make EAPI 7 ready Marty E. Plummer
@ 2018-06-18  0:47 ` Marty E. Plummer
  2018-06-18  6:01   ` Ulrich Mueller
  2018-06-18 18:10   ` Pacho Ramos
  1 sibling, 2 replies; 7+ messages in thread
From: Marty E. Plummer @ 2018-06-18  0:47 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

Use ${EROOT%/} whereever possible, as most of the directories and files
used in conjunction with it have a leading /; add missing leading /
where apropriate. Put sys-apps/sed into BDEPEND if EAPI 7, as it need to
be executable on CBUILD.

Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
Package-Manager: Portage-2.3.40, Repoman-2.3.9
---
 eclass/gnome2-utils.eclass | 43 +++++++++++++++++++-------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 65076ae2d61..4204dac2956 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -18,7 +18,7 @@
 inherit eutils xdg-utils
 
 case "${EAPI:-0}" in
-	0|1|2|3|4|5|6) ;;
+	0|1|2|3|4|5|6|7) ;;
 	*) die "EAPI=${EAPI} is not supported" ;;
 esac
 
@@ -82,8 +82,9 @@ esac
 # @DESCRIPTION:
 # List of gdk-pixbuf loaders provided by the package
 
-DEPEND=">=sys-apps/sed-4"
-
+# sed needs to be executable on the build system
+BDEPEND=">=sys-apps/sed-4"
+[[ ${EAPI:-0} == [0123456] ]] && DEPEND="${BDEPEND}"
 
 # @FUNCTION: gnome2_environment_reset
 # @DESCRIPTION:
@@ -101,7 +102,7 @@ gnome2_environment_reset() {
 	# Ensure we don't rely on dconf/gconf while building, bug #511946
 	export GSETTINGS_BACKEND="memory"
 
-	if has ${EAPI:-0} 6; then
+	if has ${EAPI:-0} 6 7; then
 		# Try to cover the packages honoring this variable, bug #508124
 		export GST_INSPECT="$(type -P true)"
 
@@ -129,7 +130,7 @@ gnome2_gconf_savelist() {
 # This function should be called from pkg_postinst.
 gnome2_gconf_install() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}${GCONFTOOL_BIN}"
+	local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
 	if [[ ! -x "${updater}" ]]; then
 		debug-print "${updater} is not executable"
@@ -149,9 +150,9 @@ gnome2_gconf_install() {
 
 	local F
 	for F in ${GNOME2_ECLASS_SCHEMAS}; do
-		if [[ -e "${EROOT}${F}" ]]; then
+		if [[ -e "${EROOT%/}${F}" ]]; then
 			debug-print "Installing schema: ${F}"
-			"${updater}" --makefile-install-rule "${EROOT}${F}" 1>/dev/null
+			"${updater}" --makefile-install-rule "${EROOT%/}${F}" 1>/dev/null
 		fi
 	done
 
@@ -170,7 +171,7 @@ gnome2_gconf_install() {
 # database.
 gnome2_gconf_uninstall() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}${GCONFTOOL_BIN}"
+	local updater="${EROOT%/}${GCONFTOOL_BIN}"
 
 	if [[ ! -x "${updater}" ]]; then
 		debug-print "${updater} is not executable"
@@ -189,9 +190,9 @@ gnome2_gconf_uninstall() {
 
 	local F
 	for F in ${GNOME2_ECLASS_SCHEMAS}; do
-		if [[ -e "${EROOT}${F}" ]]; then
+		if [[ -e "${EROOT%/}${F}" ]]; then
 			debug-print "Uninstalling gconf schema: ${F}"
-			"${updater}" --makefile-uninstall-rule "${EROOT}${F}" 1>/dev/null
+			"${updater}" --makefile-uninstall-rule "${EROOT%/}${F}" 1>/dev/null
 		fi
 	done
 
@@ -224,7 +225,7 @@ gnome2_icon_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_icon_cache_update() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}${GTK_UPDATE_ICON_CACHE}"
+	local updater="${EROOT%/}${GTK_UPDATE_ICON_CACHE}"
 
 	if [[ ! -x "${updater}" ]] ; then
 		debug-print "${updater} is not executable"
@@ -339,7 +340,7 @@ gnome2_scrollkeeper_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_scrollkeeper_update() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}${SCROLLKEEPER_UPDATE_BIN}"
+	local updater="${EROOT%/}${SCROLLKEEPER_UPDATE_BIN}"
 
 	if [[ ! -x "${updater}" ]] ; then
 		debug-print "${updater} is not executable"
@@ -352,7 +353,7 @@ gnome2_scrollkeeper_update() {
 	fi
 
 	ebegin "Updating scrollkeeper database ..."
-	"${updater}" -q -p "${EROOT}${SCROLLKEEPER_DIR}"
+	"${updater}" -q -p "${EROOT%/}${SCROLLKEEPER_DIR}"
 	eend $?
 }
 
@@ -376,7 +377,7 @@ gnome2_schemas_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_schemas_update() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}${GLIB_COMPILE_SCHEMAS}"
+	local updater="${EROOT%/}${GLIB_COMPILE_SCHEMAS}"
 
 	if [[ ! -x ${updater} ]]; then
 		debug-print "${updater} is not executable"
@@ -407,10 +408,10 @@ gnome2_gdk_pixbuf_savelist() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_gdk_pixbuf_update() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
+	local updater="${EROOT%/}/usr/bin/${CHOST}-gdk-pixbuf-query-loaders"
 
 	if [[ ! -x ${updater} ]]; then
-		updater="${EROOT}/usr/bin/gdk-pixbuf-query-loaders"
+		updater="${EROOT%/}/usr/bin/gdk-pixbuf-query-loaders"
 	fi
 
 	if [[ ! -x ${updater} ]]; then
@@ -427,7 +428,7 @@ gnome2_gdk_pixbuf_update() {
 	local tmp_file=$(emktemp)
 	${updater} 1> "${tmp_file}" &&
 	chmod 0644 "${tmp_file}" &&
-	cp -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
+	cp -f "${tmp_file}" "${EROOT%/}/usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
 	rm "${tmp_file}" # don't replace this with mv, required for SELinux support
 	eend $?
 }
@@ -441,7 +442,7 @@ gnome2_query_immodules_gtk2() {
 	[[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0
 
 	ebegin "Updating gtk2 input method module cache"
-	GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
+	GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-2.0/2.10.0/immodules.cache" \
 		"${updater}" --update-cache
 	eend $?
 }
@@ -455,7 +456,7 @@ gnome2_query_immodules_gtk3() {
 	[[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-3.0
 
 	ebegin "Updating gtk3 input method module cache"
-	GTK_IM_MODULE_FILE="${EROOT}usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
+	GTK_IM_MODULE_FILE="${EROOT%/}/usr/$(get_libdir)/gtk-3.0/3.0.0/immodules.cache" \
 		"${updater}" --update-cache
 	eend $?
 }
@@ -467,10 +468,10 @@ gnome2_query_immodules_gtk3() {
 # This function should be called from pkg_postinst and pkg_postrm.
 gnome2_giomodule_cache_update() {
 	has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
-	local updater="${EROOT}/usr/bin/${CHOST}-gio-querymodules"
+	local updater="${EROOT%/}/usr/bin/${CHOST}-gio-querymodules"
 
 	if [[ ! -x ${updater} ]]; then
-		updater="${EROOT}/usr/bin/gio-querymodules"
+		updater="${EROOT%/}/usr/bin/gio-querymodules"
 	fi
 
 	if [[ ! -x ${updater} ]]; then
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: make EAPI 7 ready
  2018-06-18  0:47 ` [gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: " Marty E. Plummer
@ 2018-06-18  6:01   ` Ulrich Mueller
  2018-06-18 13:05     ` Mart Raudsepp
  2018-06-18 18:10   ` Pacho Ramos
  1 sibling, 1 reply; 7+ messages in thread
From: Ulrich Mueller @ 2018-06-18  6:01 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

[-- Attachment #1: Type: text/plain, Size: 571 bytes --]

>>>>> On Sun, 17 Jun 2018, Marty E Plummer wrote:

> Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>

Please don't yet use Signed-off-by. Our policy on this (GLEP 76) is
still a draft and subject to change.
 
> -DEPEND=">=sys-apps/sed-4"
> -
> +# sed needs to be executable on the build system
> +BDEPEND=">=sys-apps/sed-4"
> +[[ ${EAPI:-0} == [0123456] ]] && DEPEND="${BDEPEND}"

These >=sed-4 dependencies are a relic from the time when there was a
sed-3. It left the tree in 2003 though.

So I suggest to remove this build-time dependency altogether.

Ulrich

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: make EAPI 7 ready
  2018-06-18  6:01   ` Ulrich Mueller
@ 2018-06-18 13:05     ` Mart Raudsepp
  2018-06-18 14:14       ` Ulrich Mueller
  0 siblings, 1 reply; 7+ messages in thread
From: Mart Raudsepp @ 2018-06-18 13:05 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

[-- Attachment #1: Type: text/plain, Size: 1924 bytes --]

Ühel kenal päeval, E, 18.06.2018 kell 08:01, kirjutas Ulrich Mueller:
> > > > > > On Sun, 17 Jun 2018, Marty E Plummer wrote:
> > Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
> 
> Please don't yet use Signed-off-by. Our policy on this (GLEP 76) is
> still a draft and subject to change.
>  
> > -DEPEND=">=sys-apps/sed-4"
> > -
> > +# sed needs to be executable on the build system
> > +BDEPEND=">=sys-apps/sed-4"
> > +[[ ${EAPI:-0} == [0123456] ]] && DEPEND="${BDEPEND}"
> 
> These >=sed-4 dependencies are a relic from the time when there was a
> sed-3. It left the tree in 2003 though.
> 
> So I suggest to remove this build-time dependency altogether.

I prefer being explicit, but that's probably a lost "battle" for sed,
so, OK, we can remove it instead.

Otherwise as a generic question for EAPI-7 support in other eclasses:
Doesn't this case leak a BDEPEND variable to ebuilds for lower EAPIs,
as there's no "unset BDEPEND" for the lower EAPIs. And is that OK?


I have various changes still in my TODO queue to both these eclasses,
and I need to get to those soon. So I suggest to wait with any pushing
of these to be done together, so metadata is invalidated only once.
I also would welcome help making these changes, to reduce the time
delta where these EAPI-7 support wouldn't be pushed due to this. If it
becomes unreasonably delayed, so ebuilds want to start using EAPI-7 for
these cases, then I guess it can be pushed once fixed up. But yeah, I
need the other changes within 1-2 weeks to start moving GNOME 3.26 to
tree.
That's about putting icon cache stuff to xdg-utils and xdg instead of
gnome* (Qt uses it too), some magic to avoid double calls if possible,
and some other changes that come out of gnome overlay gnome-
meson.eclass review (with the goal of perhaps not needing it in most
cases when combining with "inherit meson xdg" instead)


Mart

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: make EAPI 7 ready
  2018-06-18 13:05     ` Mart Raudsepp
@ 2018-06-18 14:14       ` Ulrich Mueller
  0 siblings, 0 replies; 7+ messages in thread
From: Ulrich Mueller @ 2018-06-18 14:14 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer

[-- Attachment #1: Type: text/plain, Size: 1936 bytes --]

>>>>> On Mon, 18 Jun 2018, Mart Raudsepp wrote:

> Ühel kenal päeval, E, 18.06.2018 kell 08:01, kirjutas Ulrich Mueller:
>> > > > > > On Sun, 17 Jun 2018, Marty E Plummer wrote:
>> > Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
>> 
>> Please don't yet use Signed-off-by. Our policy on this (GLEP 76) is
>> still a draft and subject to change.
>> 
>> > -DEPEND=">=sys-apps/sed-4"
>> > -
>> > +# sed needs to be executable on the build system
>> > +BDEPEND=">=sys-apps/sed-4"
>> > +[[ ${EAPI:-0} == [0123456] ]] && DEPEND="${BDEPEND}"
>> 
>> These >=sed-4 dependencies are a relic from the time when there
>> was a sed-3. It left the tree in 2003 though.
>> 
>> So I suggest to remove this build-time dependency altogether.

> I prefer being explicit, but that's probably a lost "battle" for sed,
> so, OK, we can remove it instead.

sed is guaranteed to be available in the ebuild environment (as well
as bash, patch, and find):
https://projects.gentoo.org/pms/7/pms.html#x1-11800012.1.1

So in this special case the dependency is entirely redundant.

> Otherwise as a generic question for EAPI-7 support in other eclasses:
> Doesn't this case leak a BDEPEND variable to ebuilds for lower EAPIs,
> as there's no "unset BDEPEND" for the lower EAPIs. And is that OK?

IMHO it is not OK. Also "unset BDEPEND" in global scope is not
entirely clean, because BDEPEND is just a normal variable in older
EAPIs, and could be used by an ebuild.

For the eclasses that I have updated, I have done something along
these lines:

    DEPEND="cat-foo/bar"
    case ${EAPI:-0} in
        0|1|2|3|4|5|6) ;;
        *) BDEPEND="${DEPEND}"; DEPEND="" ;;
    esac

It simply assigns DEPEND in older EAPIs, and in EAPI 7 it assigns
BDEPEND. The additional DEPEND="" assignment should not harm, because
DEPEND is treated specially by the package manager and accumulated
across eclasses.

Ulrich

[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: make EAPI 7 ready
  2018-06-18  0:47 ` [gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: " Marty E. Plummer
  2018-06-18  6:01   ` Ulrich Mueller
@ 2018-06-18 18:10   ` Pacho Ramos
  1 sibling, 0 replies; 7+ messages in thread
From: Pacho Ramos @ 2018-06-18 18:10 UTC (permalink / raw
  To: gentoo-dev; +Cc: Marty E. Plummer, gnome

El dom, 17-06-2018 a las 19:47 -0500, Marty E. Plummer escribió:
> Use ${EROOT%/} whereever possible, as most of the directories and files
> used in conjunction with it have a leading /; add missing leading /
> where apropriate. Put sys-apps/sed into BDEPEND if EAPI 7, as it need to
> be executable on CBUILD.
> 
> Signed-off-by: Marty E. Plummer <hanetzer@startmail.com>
> Package-Manager: Portage-2.3.40, Repoman-2.3.9
> ---
>  eclass/gnome2-utils.eclass | 43 +++++++++++++++++++-------------------
>  1 file changed, 22 insertions(+), 21 deletions(-)
> 

We would need to handle:
https://bugs.gentoo.org/615144#c12

to not need to workaround it in gimp ebuild (or any other using their customized
"DEPRECATED" macros) forever

I have also just seen this bug about needing to use EROOT in some tools:
https://bugs.gentoo.org/611030


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-06-18 18:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-18  0:47 [gentoo-dev] [PATCH 0/2] xdg-utils && gnome2-utils EAPI 7 work Marty E. Plummer
2018-06-18  0:47 ` [gentoo-dev] [PATCH 2/2] xdg-utils.eclass: make EAPI 7 ready Marty E. Plummer
2018-06-18  0:47 ` [gentoo-dev] [PATCH 1/2] gnome2-utils.eclass: " Marty E. Plummer
2018-06-18  6:01   ` Ulrich Mueller
2018-06-18 13:05     ` Mart Raudsepp
2018-06-18 14:14       ` Ulrich Mueller
2018-06-18 18:10   ` Pacho Ramos

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox