Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] wrapper: bring valac and vapigen to current version
@ 2020-11-24 14:11 sgn
  0 siblings, 0 replies; only message in thread
From: sgn @ 2020-11-24 14:11 UTC (permalink / raw)
  To: ml

[-- 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() {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-24 14:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-24 14:11 [PR PATCH] wrapper: bring valac and vapigen to current version sgn

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).