Re: [gentoo-dev] Last-rites: sys-power/pm-utils, sys-power/pm-quirks, app-admin/cgmanager and sys-libs/libnih

2021-01-07 Thread Jaco Kroon
Hi,

On 2021/01/06 23:08, Andreas Sturmlechner wrote:

> # Andreas Sturmlechner  (2021-01-06)
> # Abandoned upstream, countless bugs. Removal in 30 days. Bug #659616.
> sys-power/pm-utils
> sys-power/pm-quirks

Would it be possible to point at alternatives?  pm-utils worked well for
me until now, and I'm fairly certain this won't be abandoned unless
there are other (better?) alternatives available.

Kind Regards,
Jaco




[gentoo-dev] [PATCH v3] eclass/lua-utils.eclass: Add support for test-runners

2021-01-07 Thread Conrad Kostecki
During migration of dev-lua/* ebuilds to slotted lua, I noticed, that
many ebuilds use 'dev-lua/busted' for running tests. This change adds
support for running a test-runner, at first only 'busted' for now.
Also a non-color and plaintext output will be used for the test-runner 'busted'.

This is basically a copy of the test-runner section, written by mgorny,
which already exists in 'distutils-r1', but modified and adapted to lua.

In order to use this feature, you can define 'lua_enable_tests busted'
to setup everything needed for tests and run them. By default,
'dev-lua/busted' assumes, that tests are in the 'spec' folder.

If this is not the case, you can add a second argument to specify a
different folder. For example, if the folder is called 'foo', you can
just run 'lua_enable_tests busted foo'.

More test-runners can be added in future, if needed.

PATCH v2 has two changes:
- removed EAPI condition, as lua-utils is EAPI=7 only.
- make test_directoy as a local variable and use eval in src_test to
  read it.

PATCH v3 has the right patch, as v2 was wrong.

Signed-off-by: Conrad Kostecki 
---
 eclass/lua-utils.eclass | 70 +
 1 file changed, 70 insertions(+)

diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
index 100be14cb08..0589318ef51 100644
--- a/eclass/lua-utils.eclass
+++ b/eclass/lua-utils.eclass
@@ -344,6 +344,76 @@ _lua_export() {
done
 }
 
+# @FUNCTION: lua_enable_tests
+# @USAGE:  
+# @DESCRIPTION:
+# Set up IUSE, RESTRICT, BDEPEND and src_test() for running tests
+# with the specified test runner.  Also copies the current value
+# of RDEPEND to test?-BDEPEND.  The test-runner argument must be one of:
+#
+# - busted: dev-lua/busted
+#
+# Additionally, a second argument can be passed after ,
+# so  will use that directory to search for tests.
+# If not passed, a default directory of  will be used.
+#
+# - busted: spec
+#
+# This function is meant as a helper for common use cases, and it only
+# takes care of basic setup.  You still need to list additional test
+# dependencies manually.  If you have uncommon use case, you should
+# not use it and instead enable tests manually.
+#
+# This function must be called in global scope, after RDEPEND has been
+# declared.  Take care not to overwrite the variables set by it.
+lua_enable_tests() {
+   debug-print-function ${FUNCNAME} "${@}"
+
+   [[ ${#} -ge 1 ]] || die "${FUNCNAME} takes at least one argument: 
test-runner (test-directory)"
+   local test_directory
+   local test_pkg
+   case ${1} in
+   busted)
+   test_directory="${2:-spec}"
+   test_pkg="dev-lua/busted"
+   if [[ ! ${_LUA_SINGLE_R0} ]]; then
+   eval "lua_src_test() {
+   busted --lua=\"\${ELUA}\" 
--output=\"plainTerminal\" \"${test_directory}\" || die \"Tests fail with 
\${ELUA}\"
+   }"
+   src_test() {
+   lua_foreach_impl lua_src_test
+   }
+   else
+   eval "src_test() {
+   busted --lua=\"\${ELUA}\" 
--output=\"plainTerminal\" \"${test_directory}\" || die \"Tests fail with 
\${ELUA}\"
+   }"
+   fi
+   ;;
+   *)
+   die "${FUNCNAME}: unsupported argument: ${1}"
+   esac
+
+   local test_deps=${RDEPEND}
+   if [[ -n ${test_pkg} ]]; then
+   if [[ ! ${_LUA_SINGLE_R0} ]]; then
+   test_deps+=" ${test_pkg}[${LUA_USEDEP}]"
+   else
+   test_deps+=" $(lua_gen_cond_dep "
+   ${test_pkg}[\${LUA_USEDEP}]
+   ")"
+   fi
+   fi
+   if [[ -n ${test_deps} ]]; then
+   IUSE+=" test"
+   RESTRICT+=" !test? ( test )"
+   BDEPEND+=" test? ( ${test_deps} )"
+   fi
+
+   # we need to ensure successful return in case we're called last,
+   # otherwise Portage may wrongly assume sourcing failed
+   return 0
+}
+
 # @FUNCTION: lua_get_CFLAGS
 # @USAGE: []
 # @DESCRIPTION:
-- 
2.30.0




[gentoo-dev] [PATCH v2] eclass/lua-utils.eclass: Add support for test-runners

2021-01-07 Thread Conrad Kostecki
During migration of dev-lua/* ebuilds to slotted lua, I noticed, that
many ebuilds use 'dev-lua/busted' for running tests. This change adds
support for running a test-runner, at first only 'busted' for now.
Also a non-color and plaintext output will be used for the test-runner 'busted'.

This is basically a copy of the test-runner section, written by mgorny,
which already exists in 'distutils-r1', but modified and adapted to lua.

In order to use this feature, you can define 'lua_enable_tests busted'
to setup everything needed for tests and run them. By default,
'dev-lua/busted' assumes, that tests are in the 'spec' folder.

If this is not the case, you can add a second argument to specify a
different folder. For example, if the folder is called 'foo', you can
just run 'lua_enable_tests busted foo'.

More test-runners can be added in future, if needed.

PATCH v2 has two changes:
- removed EAPI condition, as lua-utils is EAPI=7 only.
- make test_directoy as a local variable and use eval in src_test to
  read it.

Signed-off-by: Conrad Kostecki 
---
 eclass/lua-utils.eclass |  69 ++
 lua-utils.eclass| 532 
 2 files changed, 601 insertions(+)
 create mode 100644 lua-utils.eclass

diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
index 100be14cb08..2200aa50391 100644
--- a/eclass/lua-utils.eclass
+++ b/eclass/lua-utils.eclass
@@ -344,6 +344,75 @@ _lua_export() {
done
 }
 
+# @FUNCTION: lua_enable_tests
+# @USAGE:  
+# @DESCRIPTION:
+# Set up IUSE, RESTRICT, BDEPEND and src_test() for running tests
+# with the specified test runner.  Also copies the current value
+# of RDEPEND to test?-BDEPEND.  The test-runner argument must be one of:
+#
+# - busted: dev-lua/busted
+#
+# Additionally, a second argument can be passed after ,
+# so  will use that directory to search for tests.
+# If not passed, a default directory of  will be used.
+#
+# - busted: spec
+#
+# This function is meant as a helper for common use cases, and it only
+# takes care of basic setup.  You still need to list additional test
+# dependencies manually.  If you have uncommon use case, you should
+# not use it and instead enable tests manually.
+#
+# This function must be called in global scope, after RDEPEND has been
+# declared.  Take care not to overwrite the variables set by it.
+lua_enable_tests() {
+   debug-print-function ${FUNCNAME} "${@}"
+
+   [[ ${#} -ge 1 ]] || die "${FUNCNAME} takes at least one argument: 
test-runner (test-directory)"
+   local test_pkg
+   case ${1} in
+   busted)
+   test_directory="${2:-spec}"
+   test_pkg="dev-lua/busted"
+   if [[ ! ${_LUA_SINGLE_R0} ]]; then
+   lua_src_test() {
+   busted --lua="${ELUA}" 
--output="plainTerminal" "${test_directory}" || die "Tests fail with ${ELUA}"
+   }
+   src_test() {
+   lua_foreach_impl lua_src_test
+   }
+   else
+   src_test() {
+   busted --lua="${ELUA}" 
--output="plainTerminal" "${test_directory}" || die "Tests fail with ${ELUA}"
+   }
+   fi
+   ;;
+   *)
+   die "${FUNCNAME}: unsupported argument: ${1}"
+   esac
+
+   local test_deps=${RDEPEND}
+   if [[ -n ${test_pkg} ]]; then
+   if [[ ! ${_LUA_SINGLE_R0} ]]; then
+   test_deps+=" ${test_pkg}[${LUA_USEDEP}]"
+   else
+   test_deps+=" $(lua_gen_cond_dep "
+   ${test_pkg}[\${LUA_USEDEP}]
+   ")"
+   fi
+   fi
+   if [[ -n ${test_deps} ]]; then
+   IUSE+=" test"
+   RESTRICT+=" !test? ( test )"
+   BDEPEND+=" test? ( ${test_deps} )"
+   fi
+
+   # we need to ensure successful return in case we're called last,
+   # otherwise Portage may wrongly assume sourcing failed
+   return 0
+}
+
 # @FUNCTION: lua_get_CFLAGS
 # @USAGE: []
 # @DESCRIPTION:
diff --git a/lua-utils.eclass b/lua-utils.eclass
new file mode 100644
index 000..0589318ef51
--- /dev/null
+++ b/lua-utils.eclass
@@ -0,0 +1,532 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# @ECLASS: lua-utils.eclass
+# @MAINTAINER:
+# William Hubbs 
+# Marek Szuba 
+# @AUTHOR:
+# Marek Szuba 
+# Based on python-utils-r1.eclass by Michał Górny  et al.
+# @SUPPORTED_EAPIS: 7
+# @BLURB: Utility functions for packages with Lua parts
+# @DESCRIPTION:
+# A utility eclass providing functions to query Lua implementations,
+# install Lua modules and scripts.
+#
+# This eclass neither sets any 

Re: [gentoo-dev] [PATCH] eclass/lua.eclass: remove EPREFIX from exported paths

2021-01-07 Thread James Le Cuirot
On Thu,  7 Jan 2021 17:13:09 -0600
William Hubbs  wrote:

> Bug: https://bugs.gentoo.org/762769
> Signed-off-by: William Hubbs 
> ---
>  eclass/lua-utils.eclass | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
> index 100be14cb08..1e552da0848 100644
> --- a/eclass/lua-utils.eclass
> +++ b/eclass/lua-utils.eclass
> @@ -212,8 +212,10 @@ _lua_get_library_file() {
>   die "Invalid implementation: ${impl}"
>   ;;
>   esac
> - libdir=$($(tc-getPKG_CONFIG) --variable libdir ${impl}) || die
>  
> + libdir=$($(tc-getPKG_CONFIG) --variable libdir ${impl}) || die
> + libdir="${libdir#${ESYSROOT#${SYSROOT}}}"
> + 
>   debug-print "${FUNCNAME}: libdir = ${libdir}, libname = ${libname}"
>   echo "${libdir}/${libname}"
>  }
> @@ -274,6 +276,7 @@ _lua_export() {
>   local val
>  
>   val=$($(tc-getPKG_CONFIG) --variable 
> INSTALL_CMOD ${impl}) || die
> + val="${val#${ESYSROOT#${SYSROOT}}}"
>  
>   export LUA_CMOD_DIR=${val}
>   debug-print "${FUNCNAME}: LUA_CMOD_DIR = 
> ${LUA_CMOD_DIR}"
> @@ -282,6 +285,7 @@ _lua_export() {
>   local val
>  
>   val=$($(tc-getPKG_CONFIG) --variable includedir 
> ${impl}) || die
> + val="${val#${ESYSROOT#${SYSROOT}}}"
>  
>   export LUA_INCLUDE_DIR=${val}
>   debug-print "${FUNCNAME}: LUA_INCLUDE_DIR = 
> ${LUA_INCLUDE_DIR}"
> @@ -298,6 +302,7 @@ _lua_export() {
>   local val
>  
>   val=$($(tc-getPKG_CONFIG) --variable 
> INSTALL_LMOD ${impl}) || die
> + val="${val#${ESYSROOT#${SYSROOT}}}"
>  
>   export LUA_LMOD_DIR=${val}
>   debug-print "${FUNCNAME}: LUA_LMOD_DIR = 
> ${LUA_LMOD_DIR}"

NACK.

The _lua_get_library_file() result is used for lua_get_shared_lib() and
this appears to be always used when building, not when installing. In
that case, you want it to return the prefixed (and sysrooted) path or
callers should always prepend ${ESYSROOT}.

Similarly, lua_get_include_dir() is often used for building but is
sometimes used for installing too. luaexpat uses it for both! If this
is returned unprefixed then luaexpat and similar should prepend
${ESYSROOT} when building and ${ED} when installing. 

I did suggest that you explicitly whether the paths are prefixed or not
in the function descriptions so please do that.

As discussed, I'll get back to you on the other sysroot issue.

-- 
James Le Cuirot (chewi)
Gentoo Linux Developer


pgp2lt1tHBLfK.pgp
Description: OpenPGP digital signature


Re: [gentoo-dev] [PATCH] eclass/lua.eclass: remove EPREFIX from exported paths

2021-01-07 Thread William Hubbs
I'll fix the subject before I commit.

William

On Thu, Jan 07, 2021 at 05:13:09PM -0600, William Hubbs wrote:
> Bug: https://bugs.gentoo.org/762769
> Signed-off-by: William Hubbs 
> ---
>  eclass/lua-utils.eclass | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
> index 100be14cb08..1e552da0848 100644
> --- a/eclass/lua-utils.eclass
> +++ b/eclass/lua-utils.eclass
> @@ -212,8 +212,10 @@ _lua_get_library_file() {
>   die "Invalid implementation: ${impl}"
>   ;;
>   esac
> - libdir=$($(tc-getPKG_CONFIG) --variable libdir ${impl}) || die
>  
> + libdir=$($(tc-getPKG_CONFIG) --variable libdir ${impl}) || die
> + libdir="${libdir#${ESYSROOT#${SYSROOT}}}"
> + 
>   debug-print "${FUNCNAME}: libdir = ${libdir}, libname = ${libname}"
>   echo "${libdir}/${libname}"
>  }
> @@ -274,6 +276,7 @@ _lua_export() {
>   local val
>  
>   val=$($(tc-getPKG_CONFIG) --variable 
> INSTALL_CMOD ${impl}) || die
> + val="${val#${ESYSROOT#${SYSROOT}}}"
>  
>   export LUA_CMOD_DIR=${val}
>   debug-print "${FUNCNAME}: LUA_CMOD_DIR = 
> ${LUA_CMOD_DIR}"
> @@ -282,6 +285,7 @@ _lua_export() {
>   local val
>  
>   val=$($(tc-getPKG_CONFIG) --variable includedir 
> ${impl}) || die
> + val="${val#${ESYSROOT#${SYSROOT}}}"
>  
>   export LUA_INCLUDE_DIR=${val}
>   debug-print "${FUNCNAME}: LUA_INCLUDE_DIR = 
> ${LUA_INCLUDE_DIR}"
> @@ -298,6 +302,7 @@ _lua_export() {
>   local val
>  
>   val=$($(tc-getPKG_CONFIG) --variable 
> INSTALL_LMOD ${impl}) || die
> + val="${val#${ESYSROOT#${SYSROOT}}}"
>  
>   export LUA_LMOD_DIR=${val}
>   debug-print "${FUNCNAME}: LUA_LMOD_DIR = 
> ${LUA_LMOD_DIR}"
> -- 
> 2.26.2
> 
> 


signature.asc
Description: PGP signature


[gentoo-dev] [PATCH] eclass/lua.eclass: remove EPREFIX from exported paths

2021-01-07 Thread William Hubbs
Bug: https://bugs.gentoo.org/762769
Signed-off-by: William Hubbs 
---
 eclass/lua-utils.eclass | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/eclass/lua-utils.eclass b/eclass/lua-utils.eclass
index 100be14cb08..1e552da0848 100644
--- a/eclass/lua-utils.eclass
+++ b/eclass/lua-utils.eclass
@@ -212,8 +212,10 @@ _lua_get_library_file() {
die "Invalid implementation: ${impl}"
;;
esac
-   libdir=$($(tc-getPKG_CONFIG) --variable libdir ${impl}) || die
 
+   libdir=$($(tc-getPKG_CONFIG) --variable libdir ${impl}) || die
+   libdir="${libdir#${ESYSROOT#${SYSROOT}}}"
+   
debug-print "${FUNCNAME}: libdir = ${libdir}, libname = ${libname}"
echo "${libdir}/${libname}"
 }
@@ -274,6 +276,7 @@ _lua_export() {
local val
 
val=$($(tc-getPKG_CONFIG) --variable 
INSTALL_CMOD ${impl}) || die
+   val="${val#${ESYSROOT#${SYSROOT}}}"
 
export LUA_CMOD_DIR=${val}
debug-print "${FUNCNAME}: LUA_CMOD_DIR = 
${LUA_CMOD_DIR}"
@@ -282,6 +285,7 @@ _lua_export() {
local val
 
val=$($(tc-getPKG_CONFIG) --variable includedir 
${impl}) || die
+   val="${val#${ESYSROOT#${SYSROOT}}}"
 
export LUA_INCLUDE_DIR=${val}
debug-print "${FUNCNAME}: LUA_INCLUDE_DIR = 
${LUA_INCLUDE_DIR}"
@@ -298,6 +302,7 @@ _lua_export() {
local val
 
val=$($(tc-getPKG_CONFIG) --variable 
INSTALL_LMOD ${impl}) || die
+   val="${val#${ESYSROOT#${SYSROOT}}}"
 
export LUA_LMOD_DIR=${val}
debug-print "${FUNCNAME}: LUA_LMOD_DIR = 
${LUA_LMOD_DIR}"
-- 
2.26.2




[gentoo-dev] Last-rites: x11-term/{eterm,pangoterm}

2021-01-07 Thread Joonas Niilola
pangoterm:
# Doesn't compile, no maintainer, EAPI-5. Last version bump 3 years
# ago. Use any of the available alternatives,
# https://packages.gentoo.org/categories/x11-terms
# Removal in ~30 days. Bug: #764353

eterm:
# Eterm's development stopped 2014 and upstream brought to life
# its successor, terminology. Eterm is unmaintained in Gentoo with
# multiple bugs open for a long time. Switch to any available
# alternative, https://packages.gentoo.org/categories/x11-terms
# For Esetroot replacement, use feh from media-gfx/feh or wmsetbg
# from x11-wm/windowmaker.
# Removal in ~30 days. Bug: #764359



Re: [gentoo-dev] Non-maintainer commits and CI

2021-01-07 Thread Joonas Niilola



On 1/7/21 4:28 PM, Agostino Sarubbo wrote:
> Hello,
>
> it happens frequently that CI discovers failure(s) in non-maintainer commits.
>
> The most striking examples are maintainer-needed, proxy-maint and general 
> pull 
> request where who made the change has no visibility on the new bug.
>
> Do you think that is a good idea to CC everyone involved in the commit?
>
>
> Agostino
>
>
>
Overall yes, I think this is a good idea. One should be held responsible
to one's commits even for m-n packages.

But then again I wouldn't wish to be reminded about
CFLAGS/LDFLAGS/cc/ar/etc after fixing some bug unrelated to these. If
there's a CFLAGS/LDFLAGS/etc bug open for 1.2.3 do you usually report a
new one for 1.2.3-r1 or 1.2.4?

-- juippis



Re: [gentoo-dev] Non-maintainer commits and CI

2021-01-07 Thread Sam James

> On 7 Jan 2021, at 14:28, Agostino Sarubbo  wrote:
> 
> Hello,
> 
> it happens frequently that CI discovers failure(s) in non-maintainer commits.
> 
> The most striking examples are maintainer-needed, proxy-maint and general pull
> request where who made the change has no visibility on the new bug.
> 
> Do you think that is a good idea to CC everyone involved in the commit?
> 

Yes please, that’d be extremely helpful and I don’t see any reason not to from 
my POV.

I keep an eye on recently changed/new bugs out of habit, but this is a great
way to help avoid things being lost.


> 
> Agostino
> 
> 
> 



signature.asc
Description: Message signed with OpenPGP


[gentoo-dev] Non-maintainer commits and CI

2021-01-07 Thread Agostino Sarubbo
Hello,

it happens frequently that CI discovers failure(s) in non-maintainer commits.

The most striking examples are maintainer-needed, proxy-maint and general pull 
request where who made the change has no visibility on the new bug.

Do you think that is a good idea to CC everyone involved in the commit?


Agostino





Re: [gentoo-dev] [PATCH] vala.eclass: make has_version aware of ROOT for EAPI 7

2021-01-07 Thread Mart Raudsepp
Ühel kenal päeval, K, 06.01.2021 kell 19:27, kirjutas Matt Turner:
> From: David Michael 
> 
> The vala dependencies are declared in BDEPEND since EAPI 7 so that
> the valac command is natively executable.  With no arguments, the
> has_version function would look for a cross-compiled vala package
> in the target ROOT and always fail.

I'm not exactly convinced that vapi stuff is arch independent and
belongs in BDEPEND over DEPEND. Vala ships a lot of .vapi files along
with valac that get used on compilation. Though the difference might be
only when different endianness or size_of int


Mart

> Signed-off-by: David Michael 
> Signed-off-by: Matt Turner 
> ---
>  eclass/vala.eclass | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/eclass/vala.eclass b/eclass/vala.eclass
> index 52899f163dc..88c5231286a 100644
> --- a/eclass/vala.eclass
> +++ b/eclass/vala.eclass
> @@ -102,7 +102,7 @@ vala_best_api_version() {
> u=$(_vala_use_depend)
>  
> for v in $(vala_api_versions); do
> -   has_version "dev-lang/vala:${v}${u}" && echo "${v}"
> && return
> +   has_version $([[ $EAPI == [1-6] ]] || echo -b) "dev-
> lang/vala:${v}${u}" && echo "${v}" && return
> done
>  }
>  
> @@ -136,7 +136,7 @@ vala_src_prepare() {
> fi
>  
> if [[ ${version} ]]; then
> -   has_version "dev-lang/vala:${version}" || die "No
> installed vala:${version}"
> +   has_version $([[ $EAPI == [1-6] ]] || echo -b) "dev-
> lang/vala:${version}" || die "No installed vala:${version}"
> else
> version=$(vala_best_api_version)
> [[ ${version} ]] || die "No installed vala in
> $(vala_depend)"



signature.asc
Description: This is a digitally signed message part