diff --git a/helpers.go b/helpers.go index d6c2ee6..d6fb086 100644 --- a/helpers.go +++ b/helpers.go @@ -146,6 +146,7 @@ var multiarchTupleMap = map[string]string{ "loong64": "loongarch64-linux-gnu", } +// Based on CMake's GNUInstallDirs func getLibPrefix(hc interp.HandlerContext) string { if dir, ok := os.LookupEnv("LURE_LIB_DIR"); ok { return dir @@ -153,15 +154,21 @@ func getLibPrefix(hc interp.HandlerContext) string { 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)) if wordSize == 8 { 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") { triple, ok := multiarchTupleMap[architecture] if ok {