diff --git a/.gitignore b/.gitignore index a5e9bdd..5fd1102 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ __pycache__ +giteapc-config.make giteapc-config-*.make diff --git a/giteapc.make b/giteapc.make index 6f28424..7e8f23b 100644 --- a/giteapc.make +++ b/giteapc.make @@ -1,8 +1,6 @@ # giteapc: version=1 -ifneq ($(GITEAPC_CONFIG),) -include giteapc-config-$(GITEAPC_CONFIG).make -endif +-include giteapc-config.make configure: @ true diff --git a/giteapc/repo.py b/giteapc/repo.py index 61a1b81..5aec961 100644 --- a/giteapc/repo.py +++ b/giteapc/repo.py @@ -286,7 +286,8 @@ def build(*args, install=False, skip_configure=False): env = os.environ.copy() if s.config: - env["GITEAPC_CONFIG"] = config + env["GITEAPC_CONFIG"] = s.config + r.set_config(s.config) env["GITEAPC_PREFIX"] = PREFIX_FOLDER if not skip_configure: diff --git a/giteapc/repos.py b/giteapc/repos.py index a5f98cd..4c4f1d0 100644 --- a/giteapc/repos.py +++ b/giteapc/repos.py @@ -141,6 +141,14 @@ class LocalRepo: with ChangeDirectory(self.folder): return run(["make", "-f", "giteapc.make", target], env=env) + def set_config(self, config): + source = self.folder + f"/giteapc-config.make" + target = self.folder + f"/giteapc-config-{config}.make" + + if os.path.exists(source): + os.remove(source) + os.symlink(target, source) + # Metadata def metadata(self):