Merge branch 'dev' of https://github.com/TabNahida/xmake-repo into dev
commit
fa16e20349
2 changed files with 87 additions and 0 deletions
@ -0,0 +1,51 @@ |
|||||||
|
package("hyprwayland-scanner") |
||||||
|
set_kind("binary") |
||||||
|
set_homepage("https://github.com/hyprwm/hyprwayland-scanner") |
||||||
|
set_description("A Hyprland implementation of wayland-scanner, in and for C++.") |
||||||
|
set_license("BSD-3-Clause") |
||||||
|
|
||||||
|
add_urls("https://github.com/hyprwm/hyprwayland-scanner/archive/refs/tags/$(version).tar.gz", |
||||||
|
"https://github.com/hyprwm/hyprwayland-scanner.git") |
||||||
|
|
||||||
|
add_versions("v0.4.4", "ac73f626019f8d819ff79a5fca06ce4768ce8a3bded6f48c404445f3afaa25ac") |
||||||
|
|
||||||
|
if is_plat("linux") then |
||||||
|
add_extsources("pacman::hyprwayland-scanner", "apt::hyprwayland-scanner") |
||||||
|
end |
||||||
|
|
||||||
|
add_deps("pugixml") |
||||||
|
|
||||||
|
if on_check then |
||||||
|
on_check(function (package) |
||||||
|
assert(package:check_cxxsnippets({test = [[ |
||||||
|
#include <format> |
||||||
|
void test() { |
||||||
|
auto f = std::format("Hello, {}!", "world"); |
||||||
|
} |
||||||
|
]]}, {configs = {languages = "c++23"}}), "package(hyprwayland-scanner) requires c++23") |
||||||
|
end) |
||||||
|
end |
||||||
|
|
||||||
|
on_install(function (package) |
||||||
|
local version = try { function() return io.readfile("VERSION"):trim() end } |
||||||
|
version = version or (package:version() and package:version_str():gsub("^v", "")) |
||||||
|
version = version or "0.0.0" |
||||||
|
io.replace("src/main.cpp", "SCANNER_VERSION", '"' .. version .. '"', {plain = true}) |
||||||
|
if package:is_debug() then |
||||||
|
io.replace("src/main.cpp", "HYPRLAND_DEBUG", "1", {plain = true}) |
||||||
|
end |
||||||
|
io.writefile("xmake.lua", [[ |
||||||
|
add_rules("mode.debug", "mode.release") |
||||||
|
add_requires("pugixml") |
||||||
|
set_languages("c++23") |
||||||
|
target("hyprwayland-scanner") |
||||||
|
set_kind("binary") |
||||||
|
add_files("src/main.cpp") |
||||||
|
add_packages("pugixml") |
||||||
|
]]) |
||||||
|
import("package.tools.xmake").install(package) |
||||||
|
end) |
||||||
|
|
||||||
|
on_test(function (package) |
||||||
|
os.vrunv("hyprwayland-scanner" .. (package:is_plat("windows") and ".exe" or ""), {"--version"}) |
||||||
|
end) |
@ -0,0 +1,36 @@ |
|||||||
|
package("leancrypto") |
||||||
|
set_homepage("https://leancrypto.org") |
||||||
|
set_description("Lean cryptographic library usable for bare-metal environments") |
||||||
|
|
||||||
|
add_urls("https://github.com/smuellerDD/leancrypto/archive/refs/tags/$(version).tar.gz", |
||||||
|
"https://github.com/smuellerDD/leancrypto.git") |
||||||
|
|
||||||
|
add_versions("v1.2.0", "247481cac4cedbf4b9e1c689b7726592015352a11cd22625013185d01cda2c15") |
||||||
|
|
||||||
|
if is_plat("linux") then |
||||||
|
add_extsources("pacman::leancrypto") |
||||||
|
end |
||||||
|
|
||||||
|
add_deps("meson", "ninja") |
||||||
|
|
||||||
|
on_install("linux", "cross", "mingw", "macosx", function (package) |
||||||
|
io.replace("meson.build", "cc.has_argument('-flto')", "false", {plain = true}) |
||||||
|
io.replace("meson.build", "cc.has_argument('-ffat-lto-objects')", "false", {plain = true}) |
||||||
|
local configs = {} |
||||||
|
table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static")) |
||||||
|
import("package.tools.meson").install(package, configs) |
||||||
|
end) |
||||||
|
|
||||||
|
on_test(function (package) |
||||||
|
assert(package:check_csnippets({test = [[ |
||||||
|
void test(void) { |
||||||
|
static const uint8_t msg_256[] = {0x06, 0x3A, 0x53}; |
||||||
|
uint8_t act[LC_SHA256_SIZE_DIGEST]; |
||||||
|
LC_SHA256_CTX_ON_STACK(sha256_stack); |
||||||
|
lc_hash_init(sha256_stack); |
||||||
|
lc_hash_update(sha256_stack, msg_256, sizeof(msg_256)); |
||||||
|
lc_hash_final(sha256_stack, act); |
||||||
|
lc_hash_zero(sha256_stack); |
||||||
|
} |
||||||
|
]]}, {includes = "leancrypto/lc_sha256.h"})) |
||||||
|
end) |
Loading…
Reference in new issue