Use /usr/lib for libraries on Arch, Alpine, and Void linux
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
f30f4c7081
commit
001e33dd2f
15
helpers.go
15
helpers.go
|
@ -146,6 +146,7 @@ var multiarchTupleMap = map[string]string{
|
||||||
"loong64": "loongarch64-linux-gnu",
|
"loong64": "loongarch64-linux-gnu",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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 {
|
||||||
return dir
|
return dir
|
||||||
|
@ -153,15 +154,21 @@ 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
|
||||||
|
distroLike := strings.Split(hc.Env.Get("DISTRO_ID_LIKE").Str, " ")
|
||||||
|
|
||||||
|
if distroID == "arch" || slices.Contains(distroLike, "arch") ||
|
||||||
|
distroID == "alpine" || slices.Contains(distroLike, "alpine") ||
|
||||||
|
distroID == "void" || slices.Contains(distroLike, "void") {
|
||||||
|
return out
|
||||||
|
}
|
||||||
|
|
||||||
wordSize := unsafe.Sizeof(uintptr(0))
|
wordSize := unsafe.Sizeof(uintptr(0))
|
||||||
if wordSize == 8 {
|
if wordSize == 8 {
|
||||||
out = "/usr/lib64"
|
out = "/usr/lib64"
|
||||||
}
|
}
|
||||||
|
|
||||||
architecture := hc.Env.Get("ARCH").Str
|
|
||||||
distroID := hc.Env.Get("DISTRO_ID").Str
|
|
||||||
distroLike := strings.Split(hc.Env.Get("DISTRO_ID_LIKE").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