浏览代码

add libsndio (#2581)

* add libsndio

* add deps

* pass deps

* fix deps

* fix deps

* fix deps

* fix install

* fix alsa-lib
ruki 2 年之前
父节点
当前提交
fd64637ab5
共有 2 个文件被更改,包括 27 次插入1 次删除
  1. 1 1
      packages/a/alsa-lib/xmake.lua
  2. 26 0
      packages/l/libsndio/xmake.lua

+ 1 - 1
packages/a/alsa-lib/xmake.lua

@@ -7,7 +7,7 @@ package("alsa-lib")
     add_versions("1.2.10", "c86a45a846331b1b0aa6e6be100be2a7aef92efd405cf6bac7eef8174baa920e")
     add_versions("1.2.10", "c86a45a846331b1b0aa6e6be100be2a7aef92efd405cf6bac7eef8174baa920e")
 
 
     on_install("linux", function (package)
     on_install("linux", function (package)
-        local configs = {}
+        local configs = {"--without-versioned"}
         table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
         table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
         table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
         table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
         if package:is_debug() then
         if package:is_debug() then

+ 26 - 0
packages/l/libsndio/xmake.lua

@@ -0,0 +1,26 @@
+package("libsndio")
+    set_homepage("https://sndio.org")
+    set_description("Sndio is a small audio and MIDI framework part of the OpenBSD project and ported to FreeBSD, Linux and NetBSD")
+
+    set_urls("https://sndio.org/sndio-$(version).tar.gz")
+
+    add_versions("1.9.0", "f30826fc9c07e369d3924d5fcedf6a0a53c0df4ae1f5ab50fe9cf280540f699a")
+
+    add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true})
+
+    if is_plat("linux") then
+        add_deps("alsa-lib")
+    end
+
+    on_install("linux", "bsd", "macosx", function (package)
+        import("package.tools.autoconf")
+        local configs = {}
+        local buildenvs = autoconf.buildenvs(package, {packagedeps = "alsa-lib"})
+        autoconf.configure(package, configs, {envs = buildenvs})
+        os.vrunv("make", {}, {envs = buildenvs})
+        os.vrunv("make", {"install"}, {envs = buildenvs})
+    end)
+
+    on_test(function (package)
+        assert(package:has_cfuncs("sio_open", {includes = "sndio.h"}))
+    end)