Github messages for voidlinux
 help / color / mirror / Atom feed
From: paper42 <paper42@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [RFC]: xbps-src: add make_check_pre
Date: Mon, 28 Feb 2022 15:25:49 +0100	[thread overview]
Message-ID: <20220228142549.sZw9_lMC6YLShFud9X0NbHe8nI_HlK--QQDFy-pVlhc@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-35888@inbox.vuxu.org>

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

There is an updated pull request by paper42 against master on the void-packages repository

https://github.com/paper42/void-packages make_check_pre
https://github.com/void-linux/void-packages/pull/35888

[RFC]: xbps-src: add make_check_pre
$make_check_pre can be used for wrapper commands like xvfb-run or
dbus-run-session which are common ways to make tests work. This way many
templates can avoid defining their own do_check function.

A patch file from https://github.com/void-linux/void-packages/pull/35888.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-make_check_pre-35888.patch --]
[-- Type: text/x-diff, Size: 8741 bytes --]

From b5f7d8cbf2b9112dfc67bdded08ab4ecf160378e Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Mon, 28 Feb 2022 14:40:07 +0100
Subject: [PATCH 1/2] xbps-src: add make_check_pre

$make_check_pre can be used for wrapper commands like xvfb-run or
dbus-run-session which are common ways to make tests work. This way many
templates can avoid defining their own do_check function.
---
 common/build-style/cargo.sh            | 2 +-
 common/build-style/cmake.sh            | 2 +-
 common/build-style/configure.sh        | 2 +-
 common/build-style/gnu-configure.sh    | 2 +-
 common/build-style/gnu-makefile.sh     | 2 +-
 common/build-style/meson.sh            | 2 +-
 common/build-style/perl-ModuleBuild.sh | 2 +-
 common/build-style/perl-module.sh      | 2 +-
 common/build-style/python-module.sh    | 2 +-
 common/build-style/python3-module.sh   | 4 ++--
 common/build-style/python3-pep517.sh   | 2 +-
 common/build-style/raku-dist.sh        | 2 +-
 common/environment/setup/sourcepkg.sh  | 2 +-
 13 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/common/build-style/cargo.sh b/common/build-style/cargo.sh
index 53c489772e7f..573a69003614 100644
--- a/common/build-style/cargo.sh
+++ b/common/build-style/cargo.sh
@@ -11,7 +11,7 @@ do_build() {
 do_check() {
 	: ${make_cmd:=cargo}
 
-	${make_cmd} test --release --target ${RUST_TARGET} ${configure_args} \
+	${make_check_pre} ${make_cmd} test --release --target ${RUST_TARGET} ${configure_args} \
 		${make_check_args}
 }
 
diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 33a556be0011..7d1d675c3aba 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -116,7 +116,7 @@ do_check() {
 
 	: ${make_check_target:=test}
 
-	${make_cmd} ${make_check_args} ${make_check_target}
+	${make_check_pre} ${make_cmd} ${make_check_args} ${make_check_target}
 }
 
 do_install() {
diff --git a/common/build-style/configure.sh b/common/build-style/configure.sh
index 0963fc347934..6f2c94ace694 100644
--- a/common/build-style/configure.sh
+++ b/common/build-style/configure.sh
@@ -29,7 +29,7 @@ do_check() {
 	: ${make_cmd:=make}
 	: ${make_check_target:=check}
 
-	${make_cmd} ${make_check_args} ${make_check_target}
+	${make_check_pre} ${make_cmd} ${make_check_args} ${make_check_target}
 }
 
 do_install() {
diff --git a/common/build-style/gnu-configure.sh b/common/build-style/gnu-configure.sh
index 8121136cd121..f66b081955e2 100644
--- a/common/build-style/gnu-configure.sh
+++ b/common/build-style/gnu-configure.sh
@@ -30,7 +30,7 @@ do_check() {
 	: ${make_cmd:=make}
 	: ${make_check_target:=check}
 
-	${make_cmd} ${make_check_args} ${make_check_target}
+	${make_check_pre} ${make_cmd} ${make_check_args} ${make_check_target}
 }
 
 do_install() {
diff --git a/common/build-style/gnu-makefile.sh b/common/build-style/gnu-makefile.sh
index d7ea148fc483..2492749bd84a 100644
--- a/common/build-style/gnu-makefile.sh
+++ b/common/build-style/gnu-makefile.sh
@@ -30,7 +30,7 @@ do_check() {
 	: ${make_cmd:=make}
 	: ${make_check_target:=check}
 
-	${make_cmd} ${make_check_args} ${make_check_target}
+	${make_check_pre} ${make_cmd} ${make_check_args} ${make_check_target}
 }
 
 do_install() {
diff --git a/common/build-style/meson.sh b/common/build-style/meson.sh
index ab9f2cacfd0a..a7bd901e9760 100644
--- a/common/build-style/meson.sh
+++ b/common/build-style/meson.sh
@@ -138,7 +138,7 @@ do_check() {
 	: ${make_check_target:=test}
 	: ${meson_builddir:=build}
 
-	${make_cmd} -C ${meson_builddir} ${makejobs} ${make_check_args} ${make_check_target}
+	${make_check_pre} ${make_cmd} -C ${meson_builddir} ${makejobs} ${make_check_args} ${make_check_target}
 }
 
 do_install() {
diff --git a/common/build-style/perl-ModuleBuild.sh b/common/build-style/perl-ModuleBuild.sh
index a84373b5b0bf..f21d2b0efb4c 100644
--- a/common/build-style/perl-ModuleBuild.sh
+++ b/common/build-style/perl-ModuleBuild.sh
@@ -41,7 +41,7 @@ do_check() {
 	if [ ! -x ./Build ]; then
 		msg_error "$pkgver: cannot find ./Build script!\n"
 	fi
-	./Build test
+	${make_check_pre} ./Build test
 }
 
 do_install() {
diff --git a/common/build-style/perl-module.sh b/common/build-style/perl-module.sh
index b9a01b13cfa9..9126091cb2cf 100644
--- a/common/build-style/perl-module.sh
+++ b/common/build-style/perl-module.sh
@@ -79,7 +79,7 @@ do_check() {
 	: ${make_cmd:=make}
 	: ${make_check_target:=test}
 
-	${make_cmd} ${make_check_args} ${make_check_target}
+	${make_check_pre} ${make_cmd} ${make_check_args} ${make_check_target}
 }
 
 do_install() {
diff --git a/common/build-style/python-module.sh b/common/build-style/python-module.sh
index 15cf7577adb2..b80801a67247 100644
--- a/common/build-style/python-module.sh
+++ b/common/build-style/python-module.sh
@@ -49,7 +49,7 @@ do_check() {
 			fi
 		fi
 
-		python${pyver} setup.py ${make_check_target:-test} ${make_check_args}
+		${make_check_pre} python${pyver} setup.py ${make_check_target:-test} ${make_check_args}
 		rm build
 	done
 }
diff --git a/common/build-style/python3-module.sh b/common/build-style/python3-module.sh
index 093bdae8a006..8daf40e69219 100644
--- a/common/build-style/python3-module.sh
+++ b/common/build-style/python3-module.sh
@@ -25,7 +25,7 @@ do_build() {
 
 do_check() {
 	if python3 -c 'import pytest' >/dev/null 2>&1; then
-		PYTHONPATH="$(cd build/lib* && pwd)" \
+		${make_check_pre} PYTHONPATH="$(cd build/lib* && pwd)" \
 			python3 -m pytest ${make_check_args} ${make_check_target}
 	else
 		# Fall back to deprecated setup.py test orchestration without pytest
@@ -37,7 +37,7 @@ do_check() {
 		fi
 
 		: ${make_check_target:=test}
-		python3 setup.py ${make_check_target} ${make_check_args}
+		${make_check_pre} python3 setup.py ${make_check_target} ${make_check_args}
 	fi
 }
 
diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index 075f954a1a69..a733a521fb3d 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -14,7 +14,7 @@ do_build() {
 
 do_check() {
 	if python3 -c 'import pytest' >/dev/null 2>&1; then
-		python3 -m pytest ${make_check_args} ${make_check_target}
+		${make_check_pre} python3 -m pytest ${make_check_args} ${make_check_target}
 	else
 		msg_warn "Unable to determine tests for PEP517 Python templates"
 		return 0
diff --git a/common/build-style/raku-dist.sh b/common/build-style/raku-dist.sh
index 3b1f28d6421b..bbbba96e7140 100644
--- a/common/build-style/raku-dist.sh
+++ b/common/build-style/raku-dist.sh
@@ -3,7 +3,7 @@
 #
 
 do_check() {
-	RAKULIB=lib prove -r -e raku t/
+	${make_check_pre} RAKULIB=lib prove -r -e raku t/
 }
 
 do_install() {
diff --git a/common/environment/setup/sourcepkg.sh b/common/environment/setup/sourcepkg.sh
index bc06f745b78a..e0e16d7915cb 100644
--- a/common/environment/setup/sourcepkg.sh
+++ b/common/environment/setup/sourcepkg.sh
@@ -7,7 +7,7 @@ unset -v archs distfiles checksum build_style build_helper nocross broken
 unset -v configure_script configure_args wrksrc build_wrksrc create_wrksrc
 unset -v make_build_args make_check_args make_install_args
 unset -v make_build_target make_check_target make_install_target
-unset -v make_cmd meson_cmd gem_cmd fetch_cmd
+unset -v make_cmd meson_cmd gem_cmd fetch_cmd make_check_pre
 unset -v python_version stackage
 unset -v cmake_builddir meson_builddir
 unset -v meson_crossfile

From 934789f7881269fa3d79f6595c2782e0a6c91de4 Mon Sep 17 00:00:00 2001
From: Michal Vasilek <michal@vasilek.cz>
Date: Mon, 28 Feb 2022 14:41:46 +0100
Subject: [PATCH 2/2] totem: fix tests

---
 srcpkgs/totem/template | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/totem/template b/srcpkgs/totem/template
index c3e8c0911ba3..bccea7f2a7c3 100644
--- a/srcpkgs/totem/template
+++ b/srcpkgs/totem/template
@@ -12,21 +12,19 @@ makedepends="clutter-gst3-devel clutter-gtk-devel dbus-glib-devel
  gst-plugins-ugly1 libSM-devel libXtst-devel libepc-devel libpeas-devel
  nautilus-devel zeitgeist-devel gst-plugins-base1-devel"
 depends="grilo-plugins gst-libav gst-plugins-good1 gst-plugins-ugly1 tracker3"
+checkdepends="xvfb-run"
 short_desc="GNOME integrated movie player based on Gstreamer"
 maintainer="Enno Boland <gottox@voidlinux.org>"
 license="LGPL-2.0-or-later, GPL-2.0-or-later"
 homepage="https://wiki.gnome.org/Apps/Videos"
 distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
 checksum=fce562e2b26cbcfc0c678538dcc81f9dc15ce60d5a89ee4358907bf634304c40
+make_check_pre="xvfb-run"
 
 # XXX xulrunner plugin.
 # XXX reenable python plugin if pylint pkg exists.
 #pycompile_dirs="usr/lib/totem/plugins"
 
-do_check() {
-	:
-}
-
 libtotem_package() {
 	short_desc+=" - runtime library"
 	pkg_install() {

  reply	other threads:[~2022-02-28 14:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 13:51 [PR PATCH] " paper42
2022-02-28 14:25 ` paper42 [this message]
2022-02-28 14:29 ` tibequadorian
2022-03-27 22:01 ` paper42
2022-04-06 17:42 ` paper42
2022-04-13 12:59 ` tibequadorian
2022-05-01 20:01 ` [PR PATCH] [Updated] " paper42
2022-05-04  8:46 ` [PR PATCH] [Merged]: " paper42
2022-05-08  1:16 ` sgn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220228142549.sZw9_lMC6YLShFud9X0NbHe8nI_HlK--QQDFy-pVlhc@z \
    --to=paper42@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).