From 8b6ef5fa63b776407729b4abce780a0da7681e79 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Tue, 22 Apr 2025 17:41:37 +0300 Subject: [PATCH] Added compilation environment array to BPM config --- config/bpm.conf | 1 + src/bpmlib/compilation.go | 1 + src/bpmlib/config.go | 5 +++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config/bpm.conf b/config/bpm.conf index 3e8e4ae..2f2e876 100644 --- a/config/bpm.conf +++ b/config/bpm.conf @@ -1,4 +1,5 @@ ignore_packages: [] +compilation_env: [] repositories: - name: example-repository source: https://my-repo.xyz/ diff --git a/src/bpmlib/compilation.go b/src/bpmlib/compilation.go index be677e4..08f26d4 100644 --- a/src/bpmlib/compilation.go +++ b/src/bpmlib/compilation.go @@ -89,6 +89,7 @@ func CompileSourcePackage(archiveFilename, outputFilename string) (err error) { env = append(env, "BPM_PKG_VERSION="+bpmpkg.PkgInfo.Version) env = append(env, "BPM_PKG_REVISION="+strconv.Itoa(bpmpkg.PkgInfo.Revision)) env = append(env, "BPM_PKG_ARCH="+GetArch()) + env = append(env, BPMConfig.CompilationEnvironment...) // Execute prepare and build functions in source.sh script cmd := exec.Command("bash", "-c", diff --git a/src/bpmlib/config.go b/src/bpmlib/config.go index eee5d57..ebf0224 100644 --- a/src/bpmlib/config.go +++ b/src/bpmlib/config.go @@ -6,8 +6,9 @@ import ( ) type BPMConfigStruct struct { - IgnorePackages []string `yaml:"ignore_packages"` - Repositories []*Repository `yaml:"repositories"` + IgnorePackages []string `yaml:"ignore_packages"` + CompilationEnvironment []string `yaml:"compilation_env"` + Repositories []*Repository `yaml:"repositories"` } var BPMConfig BPMConfigStruct