Use slice for list of distros excluded from /usr/lib64
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
001e33dd2f
commit
3ca052fea7
20
helpers.go
20
helpers.go
|
@ -146,6 +146,15 @@ var multiarchTupleMap = map[string]string{
|
||||||
"loong64": "loongarch64-linux-gnu",
|
"loong64": "loongarch64-linux-gnu",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// usrLibDistros is a list of distros that don't support
|
||||||
|
// /usr/lib64, and must use /usr/lib
|
||||||
|
var usrLibDistros = []string{
|
||||||
|
"arch",
|
||||||
|
"alpine",
|
||||||
|
"void",
|
||||||
|
"chimera",
|
||||||
|
}
|
||||||
|
|
||||||
// Based on CMake's GNUInstallDirs
|
// Based on CMake's GNUInstallDirs
|
||||||
func getLibPrefix(hc interp.HandlerContext) string {
|
func getLibPrefix(hc interp.HandlerContext) string {
|
||||||
if dir, ok := os.LookupEnv("LURE_LIB_DIR"); ok {
|
if dir, ok := os.LookupEnv("LURE_LIB_DIR"); ok {
|
||||||
|
@ -154,14 +163,13 @@ func getLibPrefix(hc interp.HandlerContext) string {
|
||||||
|
|
||||||
out := "/usr/lib"
|
out := "/usr/lib"
|
||||||
|
|
||||||
architecture := hc.Env.Get("ARCH").Str
|
|
||||||
distroID := hc.Env.Get("DISTRO_ID").Str
|
distroID := hc.Env.Get("DISTRO_ID").Str
|
||||||
distroLike := strings.Split(hc.Env.Get("DISTRO_ID_LIKE").Str, " ")
|
distroLike := strings.Split(hc.Env.Get("DISTRO_ID_LIKE").Str, " ")
|
||||||
|
|
||||||
if distroID == "arch" || slices.Contains(distroLike, "arch") ||
|
for _, usrLibDistro := range usrLibDistros {
|
||||||
distroID == "alpine" || slices.Contains(distroLike, "alpine") ||
|
if distroID == usrLibDistro || slices.Contains(distroLike, usrLibDistro) {
|
||||||
distroID == "void" || slices.Contains(distroLike, "void") {
|
return out
|
||||||
return out
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wordSize := unsafe.Sizeof(uintptr(0))
|
wordSize := unsafe.Sizeof(uintptr(0))
|
||||||
|
@ -169,6 +177,8 @@ func getLibPrefix(hc interp.HandlerContext) string {
|
||||||
out = "/usr/lib64"
|
out = "/usr/lib64"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
architecture := hc.Env.Get("ARCH").Str
|
||||||
|
|
||||||
if distroID == "debian" || slices.Contains(distroLike, "debian") {
|
if distroID == "debian" || slices.Contains(distroLike, "debian") {
|
||||||
triple, ok := multiarchTupleMap[architecture]
|
triple, ok := multiarchTupleMap[architecture]
|
||||||
if ok {
|
if ok {
|
||||||
|
|
Loading…
Reference in New Issue