From ae8cb89ddb912310e5aa0cea2ce64eb1d3da0307 Mon Sep 17 00:00:00 2001 From: meator Date: Tue, 13 Jul 2021 08:46:44 +0200 Subject: [PATCH] j4-dmenu-desktop: add support for checks The current version errors out when /usr/share/applications does not exist. An alternative to the patch is to mkdir /usr/share/applications. See https://github.com/enkore/j4-dmenu-desktop/pull/123 --- ...c-handle-non-existent-usr-share-appl.patch | 33 +++++++++++++++++++ srcpkgs/j4-dmenu-desktop/template | 9 ++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/j4-dmenu-desktop/patches/0001-TestSearchPath.cc-handle-non-existent-usr-share-appl.patch diff --git a/srcpkgs/j4-dmenu-desktop/patches/0001-TestSearchPath.cc-handle-non-existent-usr-share-appl.patch b/srcpkgs/j4-dmenu-desktop/patches/0001-TestSearchPath.cc-handle-non-existent-usr-share-appl.patch new file mode 100644 index 000000000000..d9c1e55cdda4 --- /dev/null +++ b/srcpkgs/j4-dmenu-desktop/patches/0001-TestSearchPath.cc-handle-non-existent-usr-share-appl.patch @@ -0,0 +1,33 @@ +From 665b6f67538a210764b3fe381442ad47528ca6c5 Mon Sep 17 00:00:00 2001 +From: meator +Date: Mon, 12 Jul 2021 20:46:04 +0200 +Subject: [PATCH] TestSearchPath.cc: handle non-existent + /usr/share/applications/ + +--- + src/TestSearchPath.cc | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/src/TestSearchPath.cc b/src/TestSearchPath.cc +index 0003ab0..43e9564 100644 +--- a/src/TestSearchPath.cc ++++ b/src/TestSearchPath.cc +@@ -15,8 +15,13 @@ TEST_CASE("SearchPath/XDG_DATA_HOME", "Check SearchPath honors XDG_DATA_HOME") + SearchPath sp; + std::vector result(sp.begin(), sp.end()); + +- REQUIRE( result.size() == 1 ); +- REQUIRE( result[0] == "/usr/share/applications/" ); ++ struct stat dirdata; ++ if (stat("/usr/share/applications", &dirdata) == 0 && S_ISDIR(dirdata.st_mode)) { // test if /usr/share/applications is valid ++ REQUIRE( result.size() == 1 ); ++ REQUIRE( result.front() == "/usr/share/applications/" ); ++ } else { ++ REQUIRE( result.size() == 0 ); ++ } + } + + TEST_CASE("SearchPath/XDG_DATA_DIRS", "Check SearchPath honors XDG_DATA_DIRS") +-- +2.32.0 + diff --git a/srcpkgs/j4-dmenu-desktop/template b/srcpkgs/j4-dmenu-desktop/template index e4397c672781..07d0e0f42ef6 100644 --- a/srcpkgs/j4-dmenu-desktop/template +++ b/srcpkgs/j4-dmenu-desktop/template @@ -4,7 +4,14 @@ version=2.18 revision=1 wrksrc="${pkgname}-r${version}" build_style=cmake -configure_args="-DWITH_TESTS=OFF" +checkdepends="catch2" + +if [ "$XBPS_CHECK_PKGS" ]; then + configure_args="-DWITH_GIT_CATCH=OFF -DCATCH_INCLUDE_DIR=/usr/include/catch2" +else + configure_args="-DWITH_TESTS=OFF" +fi + depends="dmenu" short_desc="Fast desktop menu" maintainer="Diogo Leal "