* [PR PATCH] ghdl: broken if no backend available
@ 2021-01-30 0:37 sgn
2021-01-30 1:32 ` q66
2021-01-30 1:32 ` [PR PATCH] [Closed]: " q66
0 siblings, 2 replies; 3+ messages in thread
From: sgn @ 2021-01-30 0:37 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 578 bytes --]
There is a new pull request by sgn against master on the void-packages repository
https://github.com/sgn/void-packages ghdl
https://github.com/void-linux/void-packages/pull/28311
ghdl: broken if no backend available
While we're at it, let xbps-src figure out which subpackages will be
built. I don't like `unset`.
---
@q66 feel free to revert the `subpackages` calculation part. Beside my dislike to unset, I think conditional definition of subpackages can reduce one warning :-p
A patch file from https://github.com/void-linux/void-packages/pull/28311.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ghdl-28311.patch --]
[-- Type: text/x-diff, Size: 2580 bytes --]
From f270aecbfc0f43739b2b6e0fb4b1989c15f2be57 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: Sat, 30 Jan 2021 07:23:24 +0700
Subject: [PATCH] ghdl: broken if no backend available
While we're at it, let xbps-src figure out which subpackages will be
built. I don't like `unset`.
---
srcpkgs/ghdl/template | 53 ++++++++++++++++++++++---------------------
1 file changed, 27 insertions(+), 26 deletions(-)
diff --git a/srcpkgs/ghdl/template b/srcpkgs/ghdl/template
index 4229ca3d563..1a72f0812f3 100644
--- a/srcpkgs/ghdl/template
+++ b/srcpkgs/ghdl/template
@@ -20,18 +20,23 @@ checksum=3008616201cc3b0b596872e4ad59d8bc36e6ee3ff798bdce066828fbdad041e4
nocross=yes
patch_args="-Np1"
+if [ "$build_option_mcode" ]; then
+ depends="ghdl-mcode>=${version}_${revision}"
+elif [ "$build_option_llvm" ]; then
+ depends="ghdl-llvm>=${version}_${revision}"
+elif [ "$build_options_default" ]; then
+ # We don't want to see the broken message on the first pass.
+ # On the second pass, when build_options_default is set
+ # and no build_options have been set, mark broken.
+ broken="need a backend"
+fi
+
build_options="llvm mcode"
build_options_default="llvm"
desc_option_llvm="Build the portable LLVM backend"
desc_option_mcode="Build the x86-only mcode backend"
-if [ "$build_option_mcode" ]; then
- depends=" ghdl-mcode>=${version}_${revision}"
-elif [ "$build_option_llvm" ]; then
- depends=" ghdl-llvm>=${version}_${revision}"
-fi
-
case "$XBPS_TARGET_MACHINE" in
i686*|x86_64*)
build_options_default+=" mcode"
@@ -42,15 +47,7 @@ case "$XBPS_TARGET_MACHINE" in
fi
esac
-# get around xbps-src's broken 2-pass option eval
-unset subpackages
-
-if [ "$build_option_mcode" ]; then
- subpackages+=" ghdl-mcode"
-fi
-
if [ "$build_option_llvm" ]; then
- subpackages+=" ghdl-llvm"
makedepends+=" llvm11"
fi
@@ -123,18 +120,22 @@ do_check() {
done
}
-ghdl-mcode_package() {
- short_desc+=" - mcode backend"
- pkg_install() {
- vmove usr/bin/ghdl-mcode
- vmove usr/lib/ghdl/mcode
+if [ "$build_option_mcode" ]; then
+ ghdl-mcode_package() {
+ short_desc+=" - mcode backend"
+ pkg_install() {
+ vmove usr/bin/ghdl-mcode
+ vmove usr/lib/ghdl/mcode
+ }
}
-}
+fi
-ghdl-llvm_package() {
- short_desc+=" - LLVM backend"
- pkg_install() {
- vmove usr/bin/ghdl-llvm
- vmove usr/lib/ghdl/llvm
+if [ "$build_option_llvm" ]; then
+ ghdl-llvm_package() {
+ short_desc+=" - LLVM backend"
+ pkg_install() {
+ vmove usr/bin/ghdl-llvm
+ vmove usr/lib/ghdl/llvm
+ }
}
-}
+fi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ghdl: broken if no backend available
2021-01-30 0:37 [PR PATCH] ghdl: broken if no backend available sgn
@ 2021-01-30 1:32 ` q66
2021-01-30 1:32 ` [PR PATCH] [Closed]: " q66
1 sibling, 0 replies; 3+ messages in thread
From: q66 @ 2021-01-30 1:32 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 475 bytes --]
New comment by q66 on void-packages repository
https://github.com/void-linux/void-packages/pull/28311#issuecomment-770132189
Comment:
you should never conditionally define `_package` functions, and the "no backend" situation is irrelevant, since the llvm backend is available pretty much always, and even in case you did compile without a backend, you'd still get a "working" package (it would contain `/usr/bin/ghdl` which would tell you about no backend being available)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PR PATCH] [Closed]: ghdl: broken if no backend available
2021-01-30 0:37 [PR PATCH] ghdl: broken if no backend available sgn
2021-01-30 1:32 ` q66
@ 2021-01-30 1:32 ` q66
1 sibling, 0 replies; 3+ messages in thread
From: q66 @ 2021-01-30 1:32 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 438 bytes --]
There's a closed pull request on the void-packages repository
ghdl: broken if no backend available
https://github.com/void-linux/void-packages/pull/28311
Description:
While we're at it, let xbps-src figure out which subpackages will be
built. I don't like `unset`.
---
@q66 feel free to revert the `subpackages` calculation part. Beside my dislike to unset, I think conditional definition of subpackages can reduce one warning :-p
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-30 1:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-30 0:37 [PR PATCH] ghdl: broken if no backend available sgn
2021-01-30 1:32 ` q66
2021-01-30 1:32 ` [PR PATCH] [Closed]: " q66
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).