public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [PATCH 1/2] Filter newlines from BUILD_REQUIRES
@ 2022-12-03 16:14 Corinna Vinschen
  2022-12-03 16:14 ` [PATCH 2/2] Default to x86_64 build on non-Cygwin hosts Corinna Vinschen
  0 siblings, 1 reply; 3+ messages in thread
From: Corinna Vinschen @ 2022-12-03 16:14 UTC (permalink / raw)
  To: cygwin-apps

From: Corinna Vinschen <corinna@vinschen.de>

BUILD_REQUIRES is added verbatim to the build-depends: line in
the *-src.hint file.  If the cygport file defines BUILD_REQUIRES
with spaces, e. g.

  BUILD_REQUIRES="
    a
    b
  "

The -src.hint file is broken.  Avoid this by filtering out any
newline's from BUILD_REQUIRES before using it in the subsequent
expression building the -src.hint file.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
---
 lib/pkg_pkg.cygpart | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/pkg_pkg.cygpart b/lib/pkg_pkg.cygpart
index 82112e1cfc79..eb06a08dd562 100644
--- a/lib/pkg_pkg.cygpart
+++ b/lib/pkg_pkg.cygpart
@@ -544,6 +544,10 @@ __pkg_srcpkg() {
 		elif [ -n "${!pkg_category_var:-${CATEGORY}}" \
 			-a -n "${!pkg_summary_var:-${SUMMARY}}${!pkg_description_var:-${DESCRIPTION}}" ]
 		then
+			# BUILD_REQUIRES is added to the build-depends: line
+			# in the hint file written below.  Convert LFs to
+			# spaces to make sure it's actually a single line.
+			BUILD_REQUIRES=$(echo -n "$BUILD_REQUIRES" | tr '\n' ' ')
 			cat > ${distdir}/${PN}/${PN}-${PVR}-src.hint <<-_EOF
 category: ${!pkg_category_var:-${CATEGORY}}
 build-depends: cygport ${BUILD_REQUIRES}
-- 
2.38.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-03 18:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-03 16:14 [PATCH 1/2] Filter newlines from BUILD_REQUIRES Corinna Vinschen
2022-12-03 16:14 ` [PATCH 2/2] Default to x86_64 build on non-Cygwin hosts Corinna Vinschen
2022-12-03 18:08   ` Jon Turney

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 read-only IMAP folder(s) and NNTP newsgroup(s).