Skip to content

Commit

Permalink
soundtouch: add package
Browse files Browse the repository at this point in the history
  • Loading branch information
star-hengxing committed Jul 27, 2023
1 parent cdfbf64 commit a862401
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions packages/s/soundtouch/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package("soundtouch")
set_homepage("https://modplug-xmms.sourceforge.net")
set_description("SoundTouch Audio Processing Library")
set_license("LGPL-2.1")

add_urls("https://www.surina.net/soundtouch/soundtouch-$(version).tar.gz",
"https://codeberg.org/soundtouch/soundtouch.git")
add_versions("2.3.2", "3bde8ddbbc3661f04e151f72cf21ca9d8f8c88e265833b65935b8962d12d6b08")

add_configs("integers_samples", {description = "Use integers instead of floats for samples", default = false, type = "boolean"})
if is_arch("arm.*") then
add_configs("neon", {description = "Use ARM Neon SIMD instructions if in ARM CPU", default = true, type = "boolean"})
end
add_configs("openmp", {description = "Use parallel multicore calculation through OpenMP", default = false, type = "boolean"})
add_configs("dll", {description = "Build SoundTouchDLL C wrapper library", default = false, type = "boolean"})

add_deps("cmake")

on_install(function (package)
local configs = {"-DSOUNDSTRETCH=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DINTEGER_SAMPLES=" .. (package:config("integers_samples") and "ON" or "OFF"))
table.insert(configs, "-DSOUNDTOUCH_DLL=" .. (package:config("dll") and "ON" or "OFF"))
table.insert(configs, "-DOPENMP=" .. (package:config("openmp") and "ON" or "OFF"))
if package:is_arch("arm.*") then
table.insert(configs, "-DNEON=" .. (package:config("neon") and "ON" or "OFF"))
end
import("package.tools.cmake").install(package, configs)
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <soundtouch/SoundTouch.h>
void test() {
soundtouch::SoundTouch sound{};
}
]]}))
end)

0 comments on commit a862401

Please sign in to comment.