From 3774075d086f11173477aace21e4323e5d0d6e8a Mon Sep 17 00:00:00 2001 From: 0382 <18322825326@163.com> Date: Wed, 8 May 2024 11:50:36 +0800 Subject: [PATCH] add wigxjpf (#3977) * add wigxjpf * format code snippet * improve make * add shared * only cp *.a for static * Update xmake.lua * Update xmake.lua --------- Co-authored-by: ruki --- packages/w/wigxjpf/xmake.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 packages/w/wigxjpf/xmake.lua diff --git a/packages/w/wigxjpf/xmake.lua b/packages/w/wigxjpf/xmake.lua new file mode 100644 index 000000000..32961c087 --- /dev/null +++ b/packages/w/wigxjpf/xmake.lua @@ -0,0 +1,25 @@ +package("wigxjpf") + set_homepage("https://fy.chalmers.se/subatom/wigxjpf/") + set_description("WIGXJPF evaluates Wigner 3j, 6j and 9j symbols accurately using prime factorisation and multi-word integer arithmetic.") + set_license("GPL-3.0", "LGPL-3.0") + + set_urls("https://fy.chalmers.se/subatom/wigxjpf/wigxjpf-$(version).tar.gz") + add_versions("1.13", "90ab9bfd495978ad1fdcbb436e274d6f4586184ae290b99920e5c978d64b3e6a") + + on_install("linux", "macosx", function (package) + local configs = {} + if package:config("shared") then + table.insert(configs, "shared") + end + import("package.tools.make").build(package, configs) + os.cp("inc/*.h", package:installdir("include")) + if package:config("shared") then + os.cp("lib/*.so", package:installdir("lib")) + else + os.cp("lib/*.a", package:installdir("lib")) + end + end) + + on_test(function (package) + assert(package:has_cfuncs("wig3jj", {includes = "wigxjpf.h"})) + end)