[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lbwww-build][PATCH v1 5/5] configure.ac: Add --with-untitled-path=PATH
From: |
Denis 'GNUtoo' Carikli |
Subject: |
[lbwww-build][PATCH v1 5/5] configure.ac: Add --with-untitled-path=PATH |
Date: |
Mon, 3 Apr 2023 17:21:08 +0200 |
This allows to use a local untitled repository.
It is also now possible to build offline by cloning the lbwww,
lbwww-img and untitled repositories locally and passing them to
configure with --with-*-path.
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
---
Makefile.am | 5 +++++
build.sh | 23 ++++++++++++++++-------
configure.ac | 19 ++++++++++++++++++-
3 files changed, 39 insertions(+), 8 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 925aa94..df1f0b7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -31,6 +31,11 @@ BUILD_OPTIONS += --with-lbwww-img-path $(LBWWW_IMG_PATH)
GUIX_SHARE_OPTIONS += --share=`realpath $(LBWWW_IMG_PATH)`
endif
+if WANT_UNTITLED_PATH
+BUILD_OPTIONS += --with-untitled-path $(UNTITLED_PATH)
+GUIX_SHARE_OPTIONS += --share=`realpath $(UNTITLED_PATH)`
+endif
+
build:
guix time-machine \
--commit=07f19ef04b5a8f4d7a12a8940333e67db8da81c0 \
diff --git a/build.sh b/build.sh
index bc56d41..1d13245 100755
--- a/build.sh
+++ b/build.sh
@@ -23,6 +23,9 @@ lbwww_path=""
lbwww_img_uri="https://git.sr.ht/~libreboot/lbwww-img"
lbwww_img_path=""
+untitled_uri="https://git.sr.ht/~libreboot/untitled"
+untitled_path=""
+
help()
{
echo "Usage: $0 [options]"
@@ -38,6 +41,10 @@ help()
echo -e "\t\tUse a local lbwww-img directory from PATH\n" \
"\t\tinstead of downloading the latest version from\n" \
"\t\t${lbwww_img_uri}"
+ echo -e "\t--with-untitled-path PATH"
+ echo -e "\t\tUse a local untitled directory from PATH\n" \
+ "\t\tinstead of downloading the latest version from\n" \
+ "\t\t${untitled_uri}"
}
sync_repo()
@@ -92,6 +99,14 @@ while [ $i -le $# ] ; do
lbwww_img_path="$(eval echo \$$(expr $i + 1))"
i="$(expr $i + 1)"
;;
+ --with-untitled-path)
+ if [ $i -ge $# ] ; then
+ help_missing_arg "--with-untitled-path"
+ exit ${EX_USAGE}
+ fi
+ untitled_path="$(eval echo \$$(expr $i + 1))"
+ i="$(expr $i + 1)"
+ ;;
*)
help
exit ${EX_USAGE}
@@ -103,13 +118,7 @@ done
set -e
-if [ ! -d untitled ] ; then
- git clone https://git.sr.ht/~libreboot/untitled
-else
- git -C untitled clean -dfx
- git -C untitled pull --rebase
-fi
-
+sync_repo "untitled" "${untitled_uri}" "${untitled_path}"
sync_repo "untitled/www/lbwww" "${lbwww_uri}" "${lbwww_path}"
sync_repo "untitled/www/lbwww-img" "${lbwww_img_uri}" "${lbwww_img_path}"
diff --git a/configure.ac b/configure.ac
index cd5da0d..06844cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,6 +21,8 @@ AC_SUBST([LBWWW_PATH], [])
AC_SUBST([LBWWW_GIT_FOUND], [])
AC_SUBST([LBWWW_IMG_PATH], [])
AC_SUBST([LBWWW_IMG_GIT_FOUND], [])
+AC_SUBST([UNTITLED_PATH], [])
+AC_SUBST([UNTITLED_GIT_FOUND], [])
# Check dependencies
AC_CHECK_PROG([CAT], [cat], [cat])
@@ -52,9 +54,21 @@ AC_ARG_WITH([lbwww-img-path],
AM_CONDITIONAL( [WANT_LBWWW_IMG_PATH], [test x"$LBWWW_IMG_PATH" != x""])
+# --with-untitled-path
+AC_ARG_WITH([untitled-path],
+ [AS_HELP_STRING([--with-untitled-path=PATH],
+ [Use a local untitled directory from PATH instead of
downloading
+ the latest version from
https://git.sr.ht/~libreboot/untitled])],
+ [UNTITLED_PATH=$withval],
+ [])
+
+AM_CONDITIONAL( [WANT_UNTITLED_PATH], [test x"$UNTITLED_PATH" != x""])
+
AC_OUTPUT
-AS_IF([test x"$LBWWW_PATH" != x"" || test x"$LBWWW_IMG_PATH" != x""],
+AS_IF([test x"$LBWWW_PATH" != x"" ||
+ test x"$LBWWW_IMG_PATH" != x"" ||
+ test x"$UNTITLED_PATH" != x""],
[AS_ECHO(["Configuration options:"])
AS_ECHO([])])
@@ -63,3 +77,6 @@ AS_IF([test x"$LBWWW_PATH" != x""],
AS_IF([test x"$LBWWW_IMG_PATH" != x""],
[AS_ECHO([" LBWWW_IMG_PATH: $LBWWW_IMG_PATH"])])
+
+AS_IF([test x"$UNTITLED_PATH" != x""],
+ [AS_ECHO([" UNTITLED_PATH: $UNTITLED_PATH"])])
--
2.39.1