From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin-apps@cygwin.com
Subject: Re: [PATCH cygport] Add 'vars' command to output arbitrary .cygport variables
Date: Fri, 28 May 2021 10:06:20 -0600 [thread overview]
Message-ID: <3647e3d7-e04e-598c-4e62-c8098ac5a8a9@SystematicSw.ab.ca> (raw)
In-Reply-To: <20210526190637.30456-1-jon.turney@dronecode.org.uk>
On 2021-05-26 13:06, Jon Turney wrote:
> Since variables in a .cygport file can be computed from arbitrary shell
> expressions, perhaps containing variables that cygport itself defines,
> other programs can't determine their value just by parsing the .cygport
> file.
>
> Add 'vars' command to output arbitrary variables defined by the .cygport
> file.
>
> The idea is that the output from this should be eval-able in a shell to
> be further used, but it probably needs some additional escaping (of
> newlines?) to be completely right in all cases.
>
> e.g
>
>> $ cygport libX11.cygport vars PVR BUILD_REQUIRES
>> PVR='1.7.1-1'
>> BUILD_REQUIRES='xtrans xorgproto libxcb-devel xmlto xorg-sgml-doctools docbook-xml43'
>
>> eval $(cygport libX11.cygport vars BUILD_REQUIRES) ; for r in ${BUILD_REQUIRES} ; do echo $r; done
bash "declare -p NAME..." seems to do what you want and produce .source-able output:
$ ( . mingw64-x86_64-nghttp2/mingw64-x86_64-nghttp2.cygport; declare -p BUILD_REQUIRES DESCRIPTION; echo echo
\$BUILD_REQUIRES \$DESCRIPTION) | bash -svx
-bash: inherit: command not found
declare -- BUILD_REQUIRES="mingw64-x86_64-c-ares mingw64-x86_64-libevent mingw64-x86_64-win-iconv mingw64-x86_64-libxml2
mingw64-x86_64-openssl mingw64-x86_64-zlib libev-devel mingw64-x86_64-binutils mingw64-x86_64-CUnit
mingw64-x86_64-gcc-core mingw64-x86_64-gcc-g++ autoconf automake libtool pkg-config python3-sphinx"
+ declare -- 'BUILD_REQUIRES=mingw64-x86_64-c-ares mingw64-x86_64-libevent mingw64-x86_64-win-iconv
mingw64-x86_64-libxml2 mingw64-x86_64-openssl mingw64-x86_64-zlib libev-devel mingw64-x86_64-binutils
mingw64-x86_64-CUnit mingw64-x86_64-gcc-core mingw64-x86_64-gcc-g++ autoconf automake libtool pkg-config python3-sphinx'
declare -- DESCRIPTION="HTTP/2 and its header compression algorithm HPACK implementation.
The framing layer of HTTP/2 is implemented as a reusable library.
Also included are an HTTP/2 client, server, proxy, load test and
benchmarking tool, and Python modules.
Package provides Mingw MS VC RT-linked binaries, NOT Cygwin binaries,
for use with the mingw64-x86_64-gcc cross compiler, installed in
/usr/x86_64-w64-mingw32/sys-root/mingw/{bin,lib,include}/."
+ declare -- 'DESCRIPTION=HTTP/2 and its header compression algorithm HPACK implementation.
The framing layer of HTTP/2 is implemented as a reusable library.
Also included are an HTTP/2 client, server, proxy, load test and
benchmarking tool, and Python modules.
Package provides Mingw MS VC RT-linked binaries, NOT Cygwin binaries,
for use with the mingw64-x86_64-gcc cross compiler, installed in
/usr/x86_64-w64-mingw32/sys-root/mingw/{bin,lib,include}/.'
echo $BUILD_REQUIRES $DESCRIPTION
+ echo mingw64-x86_64-c-ares mingw64-x86_64-libevent mingw64-x86_64-win-iconv mingw64-x86_64-libxml2
mingw64-x86_64-openssl mingw64-x86_64-zlib libev-devel mingw64-x86_64-binutils mingw64-x86_64-CUnit
mingw64-x86_64-gcc-core mingw64-x86_64-gcc-g++ autoconf automake libtool pkg-config python3-sphinx HTTP/2 and its header
compression algorithm HPACK implementation. The framing layer of HTTP/2 is implemented as a reusable library. Also
included are an HTTP/2 client, server, proxy, load test and benchmarking tool, and Python modules. Package provides
Mingw MS VC RT-linked binaries, NOT Cygwin binaries, for use with the mingw64-x86_64-gcc cross compiler, installed in
'/usr/x86_64-w64-mingw32/sys-root/mingw/{bin,lib,include}/.'
mingw64-x86_64-c-ares mingw64-x86_64-libevent mingw64-x86_64-win-iconv mingw64-x86_64-libxml2 mingw64-x86_64-openssl
mingw64-x86_64-zlib libev-devel mingw64-x86_64-binutils mingw64-x86_64-CUnit mingw64-x86_64-gcc-core
mingw64-x86_64-gcc-g++ autoconf automake libtool pkg-config python3-sphinx HTTP/2 and its header compression algorithm
HPACK implementation. The framing layer of HTTP/2 is implemented as a reusable library. Also included are an HTTP/2
client, server, proxy, load test and benchmarking tool, and Python modules. Package provides Mingw MS VC RT-linked
binaries, NOT Cygwin binaries, for use with the mingw64-x86_64-gcc cross compiler, installed in
/usr/x86_64-w64-mingw32/sys-root/mingw/{bin,lib,include}/.
but eval dislikes the "declare --"!
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
[Data in binary units and prefixes, physical quantities in SI.]
next prev parent reply other threads:[~2021-05-28 16:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-26 19:06 Jon Turney
2021-05-28 16:06 ` Brian Inglis [this message]
2021-05-31 16:14 ` Jon Turney
2021-05-31 23:46 ` Brian Inglis
2021-06-04 12:56 ` Jon Turney
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=3647e3d7-e04e-598c-4e62-c8098ac5a8a9@SystematicSw.ab.ca \
--to=brian.inglis@systematicsw.ab.ca \
--cc=cygwin-apps@cygwin.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).