Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new port pffft #6058

Merged
merged 13 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions packages/p/pffft/port/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
add_rules("mode.debug", "mode.release")

option("simd", {default = true, description = "Build with simd"})

target("pffft")
set_kind("$(kind)")
if not has_config("simd") then
luadebug marked this conversation as resolved.
Show resolved Hide resolved
add_defines("PFFFT_SIMD_DISABLE")
end
if is_kind("shared") and is_plat("windows") then
add_rules("utils.symbols.export_all")
end
add_files("fftpack.c", "pffft.c")
add_headerfiles("fftpack.h", "pffft.h")
if not is_plat("windows") then
add_syslinks("m")
else
add_defines("_USE_MATH_DEFINES", {public = true})
end
31 changes: 31 additions & 0 deletions packages/p/pffft/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package("pffft")

set_homepage("https://bitbucket.org/jpommier/pffft/")
set_description("PFFFT, a pretty fast Fourier Transform.")
set_license("BSD-like (FFTPACK license)")
luadebug marked this conversation as resolved.
Show resolved Hide resolved

add_urls("https://bitbucket.org/jpommier/pffft/$(version)", {version = function (version)
local hash = "02fe7715a5bf8bfd914681c53429600f94e0f536"
if version:le("2024.11.29") then
hash = "02fe7715a5bf8bfd914681c53429600f94e0f536"
end
return "get/" .. hash .. ".tar.gz"
end})
add_versions("2024.11.29", "9adeb18ac7bb52e9fb921c31c0c6a4e9ae150cc6fcb20a899d4b3a2275176ded")

add_configs("simd", {description = "Build with SIMD support.", default = true, type = "boolean"})

if not is_plat("windows") then
add_syslinks("m")
end

on_install(function (package)
os.cp(path.join(package:scriptdir(), "port", "xmake.lua"), "xmake.lua")
local configs = {}
configs.simd = package:config("simd")
import("package.tools.xmake").install(package, configs)
end)

on_test(function (package)
assert(package:has_cfuncs("pffft_simd_size", {includes = "pffft.h"}))
end)
Loading