Github messages for voidlinux
 help / color / mirror / Atom feed
From: Johnnynator <Johnnynator@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] Streamline workarounds for wxWidgets usage in cmake
Date: Mon, 28 Dec 2020 14:10:18 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-27496@inbox.vuxu.org> (raw)

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

There is a new pull request by Johnnynator against master on the void-packages repository

https://github.com/Johnnynator/void-packages cmake-wx
https://github.com/void-linux/void-packages/pull/27496

Streamline workarounds for wxWidgets usage in cmake


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

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

From fc319cf30021291540fd0737627124f37e2c4bf1 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Sun, 27 Dec 2020 00:24:26 +0100
Subject: [PATCH 1/6] build-style/cmake.sh: remove handeling of wxWidgets when
 cross compiing

This can be potentially broken, and the preffered way is to just set the WX_CONFIG env variable
---
 common/build-style/cmake.sh | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/common/build-style/cmake.sh b/common/build-style/cmake.sh
index 136312ed7b4..3135508b8b0 100644
--- a/common/build-style/cmake.sh
+++ b/common/build-style/cmake.sh
@@ -33,9 +33,6 @@ _EOF
 			ppc*) _CMAKE_SYSTEM_PROCESSOR=ppc ;;
 			*) _CMAKE_SYSTEM_PROCESSOR=generic ;;
 		esac
-		if [ -x "${XBPS_CROSS_BASE}/usr/bin/wx-config-gtk3" ]; then
-			wx_config=wx-config-gtk3
-		fi
 		cat > cross_${XBPS_CROSS_TRIPLET}.cmake <<_EOF
 SET(CMAKE_SYSTEM_NAME Linux)
 SET(CMAKE_SYSTEM_VERSION 1)
@@ -51,8 +48,6 @@ SET(CMAKE_FIND_ROOT_PATH  "${XBPS_CROSS_BASE}/usr;${XBPS_CROSS_BASE}")
 SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-
-SET(wxWidgets_CONFIG_EXECUTABLE ${XBPS_WRAPPERDIR}/${wx_config:=wx-config})
 _EOF
 		cmake_args+=" -DCMAKE_TOOLCHAIN_FILE=cross_${XBPS_CROSS_TRIPLET}.cmake"
 	fi

From ee013af6713a51da8492e6699a25785575269338 Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Sun, 27 Dec 2020 00:26:25 +0100
Subject: [PATCH 2/6] openbabel: export WX_CONFIG instead of
 wxWidgets_CONFIG_EXECUTABLE/symlink to wx-config

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

diff --git a/srcpkgs/openbabel/template b/srcpkgs/openbabel/template
index dde07d02341..54520f2b860 100644
--- a/srcpkgs/openbabel/template
+++ b/srcpkgs/openbabel/template
@@ -21,11 +21,9 @@ fi
 pre_configure() {
 	# workaround for cmake to find wx-config-gtk3
 	if [ "$CROSS_BUILD" ]; then
-		# cannot override wxWidgets_CONFIG_EXECUTABLE set in
-		# the cross toolchain file otherwise
-		ln -s ${XBPS_WRAPPERDIR}/wx-config{-gtk3,}
+		export WX_CONFIG=${XBPS_WRAPPERDIR}/wx-config-gtk3
 	else
-		sed -i "1i\SET(wxWidgets_CONFIG_EXECUTABLE wx-config-gtk3)" CMakeLists.txt
+		export WX_CONFIG=wx-config-gtk3
 	fi
 }
 

From 7f27da8640b17925a42039d2d02eb6e6772b951e Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Sun, 27 Dec 2020 00:27:52 +0100
Subject: [PATCH 3/6] codelite: export WX_CONFIG

---
 srcpkgs/codelite/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/codelite/template b/srcpkgs/codelite/template
index 2cb5d35bccb..ffa8a8628fd 100644
--- a/srcpkgs/codelite/template
+++ b/srcpkgs/codelite/template
@@ -28,7 +28,7 @@ desc_option_mysql="Enable mysql/mariadb support"
 desc_option_sftp="Enable Workspace Mirroring plugin"
 
 pre_configure() {
+	export WX_CONFIG=wx-config-gtk3
 	sed -i -e 's,wx-config,&-gtk3,g' \
-	 -e "1i\SET(wxWidgets_CONFIG_EXECUTABLE wx-config-gtk3)" \
 	 CMakeLists.txt
 }

From fc618af20b0ac80abf52f36a8dda619c76c0c6fa Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Sun, 27 Dec 2020 00:28:20 +0100
Subject: [PATCH 4/6] hugin: export WX_CONFIG

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

diff --git a/srcpkgs/hugin/template b/srcpkgs/hugin/template
index a4f291b0217..ccb14c04833 100644
--- a/srcpkgs/hugin/template
+++ b/srcpkgs/hugin/template
@@ -29,10 +29,8 @@ pre_configure() {
 	# workaround for cmake to find wx-config-gtk3
 	# can be removed once there is only one 'wx-config'
 	if [ "$CROSS_BUILD" ]; then
-		# cannot override wxWidgets_CONFIG_EXECUTABLE set in
-		# the cross toolchain file otherwise
-		ln -s ${XBPS_WRAPPERDIR}/wx-config{-gtk3,}
+		export WX_CONFIG=${XBPS_WRAPPERDIR}/wx-config-gtk3
 	else
-		sed -i "1i\set(wxWidgets_CONFIG_EXECUTABLE wx-config-gtk3)" CMakeLists.txt
+		export WX_CONFIG=wx-config-gtk3
 	fi
 }

From bce926772d25bd08bb22a4bee0ca21349cfdfffd Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Sun, 27 Dec 2020 00:28:51 +0100
Subject: [PATCH 5/6] OpenCPN: export WX_CONFIG

---
 srcpkgs/OpenCPN/template | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/OpenCPN/template b/srcpkgs/OpenCPN/template
index 0b9c936b25b..dab1b22076c 100644
--- a/srcpkgs/OpenCPN/template
+++ b/srcpkgs/OpenCPN/template
@@ -32,12 +32,16 @@ case $XBPS_TARGET_MACHINE in
 	*) build_options_default+=" crashreport";;
 esac
 
-if [ -z "$CROSS_BUILD" ]; then
-	configure_args+=" -DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wx-config-gtk3"
-fi
-
 CFLAGS="-fcommon"
 
+pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		export WX_CONFIG=${XBPS_WRAPPERDIR}/wx-config-gtk3
+	else
+		export WX_CONFIG=wx-config-gtk3
+	fi
+}
+
 post_install() {
 	vlicense libs/glshim/LICENSE LICENSE.glshim
 	vlicense libs/SQLiteCpp/LICENSE.txt LICENSE.SQLiteCpp

From 8fb83643635821017ef8cf51258f5fe91bd2275f Mon Sep 17 00:00:00 2001
From: John <me@johnnynator.dev>
Date: Sun, 27 Dec 2020 00:29:49 +0100
Subject: [PATCH 6/6] SLADE: export WX_CONFIG

---
 srcpkgs/SLADE/template | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/SLADE/template b/srcpkgs/SLADE/template
index 21bac8fe31f..a39b921e06a 100644
--- a/srcpkgs/SLADE/template
+++ b/srcpkgs/SLADE/template
@@ -14,11 +14,12 @@ changelog="https://github.com/sirjuddington/SLADE/releases/tag/${version}"
 distfiles="https://github.com/sirjuddington/SLADE/archive/${version}.tar.gz"
 checksum=7dc8a0089855f6321d2ec185fa5c97fcb7cc54857033aa3adec9a5ec8226ed60
 
-if [ -z "$CROSS_BUILD" ]; then
-	configure_args+=" -DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wx-config-gtk3"
-fi
-
 pre_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		export WX_CONFIG=${XBPS_WRAPPERDIR}/wx-config-gtk3
+	else
+		export WX_CONFIG=wx-config-gtk3
+	fi
 	case $XBPS_TARGET_MACHINE in
 		x86_64* | i686*);;
 		*) vsed -e '/D_USE_SSE/d' -i src/CMakeLists.txt;;

             reply	other threads:[~2020-12-28 13:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28 13:10 Johnnynator [this message]
2020-12-29 10:17 ` fosslinux
2020-12-30 15:42 ` [PR PATCH] [Updated] " Johnnynator
2020-12-30 16:58 ` [PR PATCH] [Merged]: " Johnnynator

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=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-27496@inbox.vuxu.org \
    --to=johnnynator@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).