3 Commits

Author SHA1 Message Date
RubenKelevra
20ea64acdc remove cpu tune flag
Signed-off-by: RubenKelevra <rubenkelevra@git.harting.dev>
2022-06-14 10:20:51 +02:00
be46f92cbe add patching for rust flags 2022-05-18 14:33:43 +02:00
65d6e7e135 make findpkgfiles fallback to srcinfo 2022-05-18 14:27:54 +02:00
2 changed files with 14 additions and 4 deletions

View File

@@ -698,14 +698,20 @@ func (p *ProtoPackage) findPkgFiles() error {
return err
}
if p.DbPackage == nil {
return fmt.Errorf("unable to find Pkgfiles without dbpakg present")
if p.DbPackage == nil && p.Srcinfo == nil {
return fmt.Errorf("unable to find pkgfiles without dbpkg or srcinfo present")
}
var realPkgs []string
if p.DbPackage != nil {
for _, realPkg := range p.DbPackage.Packages {
realPkgs = append(realPkgs, realPkg)
}
} else {
for _, realPkg := range p.Srcinfo.Packages {
realPkgs = append(realPkgs, realPkg.Pkgname)
}
}
var fPkg []string
for _, file := range pkgs {

View File

@@ -731,6 +731,10 @@ func setupMakepkg(march string) error {
makepkgStr = strings.ReplaceAll(makepkgStr, "#MAKEFLAGS=\"-j2\"", "MAKEFLAGS=\"-j"+strconv.Itoa(conf.Build.Makej)+"\"")
makepkgStr = reMarch.ReplaceAllString(makepkgStr, "${1}"+march)
makepkgStr = strings.ReplaceAll(makepkgStr, "#PACKAGER=\"John Doe <john@doe.com>\"", "PACKAGER=\"ALHP "+march+" <alhp@harting.dev>\"")
// enable rust flags and patch them
makepkgStr = strings.ReplaceAll(makepkgStr, "#RUSTFLAGS=", "RUSTFLAGS=")
makepkgStr = strings.ReplaceAll(makepkgStr, "-C opt-level=2", "-C opt-level=3")
makepkgStr = strings.ReplaceAll(makepkgStr, "-C opt-level=3", "-C opt-level=3 -C target-cpu="+march+" -C lto=fat -C codegen-units=1 -C strip=symbols -C linker-plugin-lto")
// write makepkg
err = os.WriteFile(lMakepkg, []byte(makepkgStr), 0644)