Selaa lähdekoodia

Patch liburing shared/static (#6286)

* Patch liburing shared/static

* Update xmake.lua

---------

Co-authored-by: ruki <[email protected]>
A2va 7 kuukautta sitten
vanhempi
commit
169ef2760e
1 muutettua tiedostoa jossa 9 lisäystä ja 4 poistoa
  1. 9 4
      packages/l/liburing/xmake.lua

+ 9 - 4
packages/l/liburing/xmake.lua

@@ -15,15 +15,20 @@ package("liburing")
     add_versions("2.2", "e092624af6aa244ade2d52181cc07751ac5caba2f3d63e9240790db9ed130bbc")
     add_versions("2.2", "e092624af6aa244ade2d52181cc07751ac5caba2f3d63e9240790db9ed130bbc")
     add_versions("2.1", "f1e0500cb3934b0b61c5020c3999a973c9c93b618faff1eba75aadc95bb03e07")
     add_versions("2.1", "f1e0500cb3934b0b61c5020c3999a973c9c93b618faff1eba75aadc95bb03e07")
 
 
-    -- liburing doesn't support building as a shared lib
-    add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
-
-    on_install("linux", function (package)
+    on_install("linux|native", function (package)
         local cflags
         local cflags
         if package:config("pic") ~= false then
         if package:config("pic") ~= false then
             cflags = "-fPIC"
             cflags = "-fPIC"
         end
         end
         import("package.tools.autoconf").install(package, {"--use-libc"}, {makeconfigs = {CFLAGS = cflags}})
         import("package.tools.autoconf").install(package, {"--use-libc"}, {makeconfigs = {CFLAGS = cflags}})
+
+        -- liburing build for static and shared by default without giving 
+        -- any option to choose between the two, so remove the wrong kind afterward
+        if package:config("shared") then
+            os.rm(path.join(package:installdir("lib"), "*.a"))
+        else
+            os.rm(path.join(package:installdir("lib"), "*.so*"))
+        end
     end)
     end)
 
 
     on_test(function (package)
     on_test(function (package)