Files
libtensorflow1-freebsd-port/Makefile.local
Paul Armstrong 0564016721 Pull requirements from WORKSPACE, move GH_TUPLE to own Makefile
Move GH_TUPLE to Makefile.gh_tuple to make regeneration easier.
Include WORKSPACE in the list of files to pull dependencies from

This bug discusses possibly using local_repository instead:
https://github.com/bazelbuild/bazel/issues/4996

Setup for io_bazel_rules_closuer describes entries in WORKSPACE,
which is how I got the idea to add it
https://github.com/bazelbuild/rules_closure
2022-06-16 06:01:25 +00:00

29 lines
1.2 KiB
Makefile

generate-gh-tuples:
@make DISTFILES=$$(make -VDISTFILES:Mtensorflow-tensorflow\*) extract
@printf %s 'GH_TUPLE='
@IFS=: ;\
sed -nEe '/\/\/github.com/s/.*\/([^\/]*)\/([^\/]*)\/archive\/([^"]*)")?,.*/\1:\2:\3/p' \
$$(make -VWRKSRC)/WORKSPACE \
$$(make -VWRKSRC)/tensorflow/workspace.bzl \
| sort -u | \
while read name acct tarball; do \
tag=$$(printf %s "$$tarball" | sed -E 's,(.tar.gz|.tar.xz|.zip),,'); \
label=$$( \
printf %s "$$name" | sed 's,[^[:alpha:][:digit:]],_,g')_$$( \
printf %s "$$acct" | sed 's,[^[:alpha:][:digit:]],_,g')_$$( \
printf %s "$$tag" | sed 's,[^[:alpha:][:digit:]],_,g'); \
printf ' \\\n %s' "$$name:$$acct:$$tag:$$label"; \
done; \
sed -nEe '/\/\/github.com/s/.*\/([^\/]*)\/([^\/]*)\/releases\/download\/([^\/]+)\/([^"]*)")?,.*/\1:\2:\3/p' \
$$(make -VWRKSRC)/WORKSPACE \
$$(make -VWRKSRC)/tensorflow/workspace.bzl \
| sort -u | \
while read name acct tag; do \
label=$$( \
printf %s "$$name" | sed 's,[^[:alpha:][:digit:]],_,g')_$$( \
printf %s "$$acct" | sed 's,[^[:alpha:][:digit:]],_,g')_$$( \
printf %s "$$tag" | sed 's,[^[:alpha:][:digit:]],_,g'); \
printf ' \\\n %s' "$$name:$$acct:$$tag:$$label"; \
done; \
printf '\n'