-
-
Notifications
You must be signed in to change notification settings - Fork 542
Add package randx 1.4.2 #10481
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
Add package randx 1.4.2 #10481
Changes from 2 commits
1229bd0
9941bf8
d3e9656
5a9ac24
25d4a18
2e789ef
036e223
2c2146d
b979453
adeeada
36f4a40
0e8b00e
00e791d
87d1833
1e837ad
76a3513
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| package("randx") | ||
| set_homepage("https://github.com/lidaixingchen/RandX") | ||
| set_description("Modern, fast, and header-only C++ pseudo-random number generator and distribution library (C++17/C++23).") | ||
| set_license("MIT") | ||
|
|
||
| add_urls("https://github.com/lidaixingchen/RandX/archive/refs/tags/v$(version).tar.gz") | ||
|
|
||
| add_versions("1.4.0", "ecf611c6f340986df2abf3191def2222a3287f5e20ec4280c88996770a95eec7") | ||
| add_versions("1.3.1", "f271bbcb26bea7747ee292646df895c2305b696bb0d58d69b54e84fe96fab3c1") | ||
|
|
||
| on_load(function (package) | ||
| package:set("kind", "library", {headeronly = true}) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 就这么几行配置,没必要放 on_load ,直接描述域 直接配置 |
||
|
|
||
| -- 跨平台 OS 熵源链接(ChaCha20 CSPRNG 需要) | ||
| -- Windows: BCryptGenRandom → bcrypt | ||
| -- macOS: SecRandomCopyBytes → Security framework | ||
| -- Linux: getrandom → libc 内置,无需额外链接 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 注释删了 |
||
| if package:is_plat("windows", "mingw") then | ||
| package:add("syslinks", "bcrypt") | ||
| elseif package:is_plat("macosx") then | ||
| package:add("syslinks", "Security") | ||
| end | ||
|
luadebug marked this conversation as resolved.
Outdated
|
||
| end) | ||
|
|
||
| on_install(function (package) | ||
| -- 仅安装两个头文件到 include/ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 删了中文注释 |
||
| os.cp("RandX.hpp", package:installdir("include")) | ||
| os.cp("RandX_Cpp17.hpp", package:installdir("include")) | ||
| end) | ||
|
|
||
| on_test(function (package) | ||
| assert(package:check_cxxsnippets({test = [[ | ||
| #include <RandX.hpp> | ||
| #include <cstdint> | ||
| static void test() { | ||
| std::uint64_t v = RandX::RandInt<std::uint64_t>(0, 1000); | ||
| (void)v; | ||
| } | ||
| ]]}, {configs = {languages = "c++23"}})) | ||
|
luadebug marked this conversation as resolved.
Outdated
|
||
| end) | ||
Uh oh!
There was an error while loading. Please reload this page.