From: Mikko Rasa Date: Thu, 21 Sep 2023 15:38:30 +0000 (+0300) Subject: Pass the package path to the stage1 binary X-Git-Url: https://git.tdb.fi/?a=commitdiff_plain;h=7f792346d87ec05ebc67f035f92796cc69bab3a2;p=builder.git Pass the package path to the stage1 binary --- diff --git a/bootstrap.sh b/bootstrap.sh index b647568..bffa9e4 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -156,4 +156,4 @@ fi if [ "$CUSTOM_COMPILER" = "yes" ]; then ARGS="$ARGS --compiler=$COMPILER" fi -eval "./builder-stage1 $ARGS" +eval "./builder-stage1 --package-dir '$LIBPATH' $ARGS" diff --git a/source/bootstrap/bootstrap.cpp b/source/bootstrap/bootstrap.cpp index c57a793..26fefaa 100644 --- a/source/bootstrap/bootstrap.cpp +++ b/source/bootstrap/bootstrap.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "plugins/base/baseplugin.h" #include "plugins/gnu/gnuplugin.h" @@ -12,16 +13,21 @@ Bootstrap::Bootstrap(int argc, char **argv) { string compiler; string prefix; + vector package_path; GetOpt getopt; getopt.add_option("compiler", compiler, GetOpt::REQUIRED_ARG).set_help("Use CMD instead of gcc as compiler.", "CMD"); getopt.add_option("prefix", prefix, GetOpt::REQUIRED_ARG).set_help("Install things to DIR.", "DIR"); + getopt.add_option("package-dir", package_path, GetOpt::REQUIRED_ARG).set_help("Look for source packages in DIR.", "DIR"); getopt(argc, argv); logger.enable_channel("tasks"); builder.set_logger(&logger); builder.load_plugins(); + for(const string &p: package_path) + builder.get_package_manager().append_package_path(p); + if(!prefix.empty()) builder.set_prefix(FS::getcwd()/prefix);