Github messages for voidlinux
 help / color / mirror / Atom feed
From: sgn <sgn@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] wrapper: bring valac and vapigen to current version
Date: Tue, 24 Nov 2020 15:11:07 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26676@inbox.vuxu.org> (raw)

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

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

https://github.com/sgn/void-packages wrapper-valac-update
https://github.com/void-linux/void-packages/pull/26676

wrapper: bring valac and vapigen to current version
Current wrappers hard-coded them at 0.42 which is very long ago.
Hence, those wrappers insert a versioned vapidir that no longer exists.
The build still work because valac will look into host's versioned vapidir
instead.

Let's check the version we're having and wrap that instead of changing
the hard-coded number from time to time.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-wrapper-valac-update-26676.patch --]
[-- Type: text/x-diff, Size: 2502 bytes --]

From ada2e727008d3d14a75ba246bc9e560a7aaa5643 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 24 Nov 2020 21:06:13 +0700
Subject: [PATCH] wrapper: bring valac and vapigen to current version

Current wrappers hard-coded them at 0.42 which is very long ago.
Hence, those wrappers insert a versioned vapidir that no longer exists.
The build still work because valac will look into host's versioned vapidir
instead.

Let's check the version we're having and wrap that instead of changing
the hard-coded number from time to time.
---
 .../hooks/pre-configure/02-script-wrapper.sh  | 20 +++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/common/hooks/pre-configure/02-script-wrapper.sh b/common/hooks/pre-configure/02-script-wrapper.sh
index 5e26abfe231..fe2000af11e 100644
--- a/common/hooks/pre-configure/02-script-wrapper.sh
+++ b/common/hooks/pre-configure/02-script-wrapper.sh
@@ -99,35 +99,47 @@ _EOF
 }
 
 vapigen_wrapper() {
+	local _vala_version _file
 	if [ ! -x /usr/bin/vapigen ]; then
 		return 0
 	fi
 	[ -x ${XBPS_WRAPPERDIR}/vapigen ] && return 0
+	for _file in /usr/bin/vapigen-*; do
+		if [ -x "${_file}" ]; then
+			_vala_version=${_file#*-}
+		fi
+	done
 	cat >>${XBPS_WRAPPERDIR}/vapigen<<_EOF
 #!/bin/sh
 exec /usr/bin/vapigen \\
 	 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala/vapi \\
-	 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala-0.42/vapi \\
+	 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala-${_vala_version}/vapi \\
 	 --girdir=${XBPS_CROSS_BASE}/usr/share/gir-1.0 "\$@"
 _EOF
 	chmod 755 ${XBPS_WRAPPERDIR}/vapigen
-	ln -sf vapigen ${XBPS_WRAPPERDIR}/vapigen-0.42
+	ln -sf vapigen ${XBPS_WRAPPERDIR}/vapigen-${_vala_version}
 }
 
 valac_wrapper() {
+	local _vala_version _file
 	if [ ! -x /usr/bin/valac ]; then
 		return 0
 	fi
 	[ -x ${XBPS_WRAPPERDIR}/valac ] && return 0
+	for _file in /usr/bin/valac-*; do
+		if [ -x "${_file}" ]; then
+			_vala_version=${_file#*-}
+		fi
+	done
 	cat >>${XBPS_WRAPPERDIR}/valac<<_EOF
 #!/bin/sh
 exec /usr/bin/valac \\
 	 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala/vapi \\
-	 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala-0.42/vapi \\
+	 --vapidir=${XBPS_CROSS_BASE}/usr/share/vala-${_vala_version}/vapi \\
 	 --girdir=${XBPS_CROSS_BASE}/usr/share/gir-1.0 "\$@"
 _EOF
 	chmod 755 ${XBPS_WRAPPERDIR}/valac
-	ln -sf valac ${XBPS_WRAPPERDIR}/valac-0.42
+	ln -sf valac ${XBPS_WRAPPERDIR}/valac-${_vala_version}
 }
 
 install_wrappers() {

                 reply	other threads:[~2020-11-24 14:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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-26676@inbox.vuxu.org \
    --to=sgn@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).