Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/xmake-io/xmake-repo into fix…
Browse files Browse the repository at this point in the history
…_wxwidgets_gtk3
  • Loading branch information
hahahahbenny committed Sep 25, 2024
2 parents d7b9a47 + e934ba4 commit 6967fbf
Show file tree
Hide file tree
Showing 51 changed files with 1,175 additions and 274 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/macos_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ jobs:
wget https://curl.haxx.se/ca/cacert.pem -O /tmp/cacert.pem
export CURL_CA_BUNDLE=/tmp/cacert.pem
sudo ln /opt/homebrew/bin/gfortran-14 /opt/homebrew/bin/gfortran
export PATH="$PATH:/opt/homebrew/Cellar/gcc/14.1.0_2/libexec/gcc/aarch64-apple-darwin23/14/"
find /opt/homebrew/Cellar/gcc/ -name f951
export PATH="$PATH:/opt/homebrew/Cellar/gcc/14.2.0/libexec/gcc/aarch64-apple-darwin23/14/"
xmake l ./scripts/test.lua -D -a ${{ matrix.arch }} -k ${{ matrix.kind }}
3 changes: 2 additions & 1 deletion .github/workflows/macos_x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ jobs:
wget https://curl.haxx.se/ca/cacert.pem -O /tmp/cacert.pem
export CURL_CA_BUNDLE=/tmp/cacert.pem
sudo ln /usr/local/bin/gfortran-14 /usr/local/bin/gfortran
export PATH="$PATH:/usr/local/Cellar/gcc/14.1.0_2/libexec/gcc/x86_64-apple-darwin21/14/"
find /usr/local/Cellar/gcc/ -name f951
export PATH="$PATH:/usr/local/Cellar/gcc/14.2.0/libexec/gcc/x86_64-apple-darwin21/14/"
xmake l ./scripts/test.lua -D -a ${{ matrix.arch }} -k ${{ matrix.kind }}
Empty file removed clang
Empty file.
33 changes: 33 additions & 0 deletions packages/a/amrex/patches/24.09/remove-symlink.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/Src/CMakeLists.txt b/Src/CMakeLists.txt
index 6e8af043..df5ca007 100644
--- a/Src/CMakeLists.txt
+++ b/Src/CMakeLists.txt
@@ -27,11 +27,7 @@ add_library(amrex ALIAS amrex_${AMReX_SPACEDIM_LAST}d)
add_library(AMReX::amrex ALIAS amrex_${AMReX_SPACEDIM_LAST}d)

# legacy symlink for build directory: libamrex.[so|a] / amrex.[dll.lib]
-add_custom_command(TARGET amrex_${AMReX_SPACEDIM_LAST}d POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E create_symlink
- $<TARGET_FILE_NAME:amrex_${AMReX_SPACEDIM_LAST}d>
- $<TARGET_FILE_DIR:amrex_${AMReX_SPACEDIM_LAST}d>/$<TARGET_FILE_PREFIX:amrex_${AMReX_SPACEDIM_LAST}d>amrex$<TARGET_FILE_SUFFIX:amrex_${AMReX_SPACEDIM_LAST}d>
-)
+


#
diff --git a/Tools/CMake/AMReXInstallHelpers.cmake b/Tools/CMake/AMReXInstallHelpers.cmake
index 7c832d3a..ea5ea535 100644
--- a/Tools/CMake/AMReXInstallHelpers.cmake
+++ b/Tools/CMake/AMReXInstallHelpers.cmake
@@ -72,11 +72,6 @@ function (install_amrex_targets)
# legacy symlink for: libamrex.[so|a] / amrex.[dll.lib]
# escape spaces for generated cmake_install.cmake file
file(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}/lib" ABS_INSTALL_LIB_DIR)
- install(CODE "file(CREATE_LINK
- $<TARGET_FILE_NAME:amrex_${AMReX_SPACEDIM_LAST}d>
- \"${ABS_INSTALL_LIB_DIR}/$<TARGET_FILE_PREFIX:amrex_${AMReX_SPACEDIM_LAST}d>amrex$<TARGET_FILE_SUFFIX:amrex_${AMReX_SPACEDIM_LAST}d>\"
- COPY_ON_ERROR SYMBOLIC)"
- )

# Install fortran modules if Fortran is enabled
get_property(_lang GLOBAL PROPERTY ENABLED_LANGUAGES)
89 changes: 89 additions & 0 deletions packages/a/amrex/xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
package("amrex")
set_homepage("https://amrex-codes.github.io/amrex")
set_description("AMReX: Software Framework for Block Structured AMR")

add_urls("https://github.com/AMReX-Codes/amrex/releases/download/$(version)/amrex-$(version).tar.gz",
"https://github.com/AMReX-Codes/amrex.git")

add_versions("24.09", "a1435d16532d04a1facce9a9ae35d68a57f7cd21a5f22a6590bde3c265ea1449")

add_patches("24.09", "patches/24.09/remove-symlink.patch", "d71adb07252e488ee003f6f04fea756864d6af2232b43208c9e138e062eb6e4d")

add_configs("openmp", {description = "Enable OpenMP", default = false, type = "boolean"})
add_configs("mpi", {description = "Enable MPI", default = false, type = "boolean", readonly = true})
add_configs("cuda", {description = "Enable CUDA", default = false, type = "boolean"})
add_configs("hdf5", {description = "Enable HDF5-based I/O", default = false, type = "boolean"})
add_configs("fortran", {description = "Enable fortran", default = false, type = "boolean"})
add_configs("tools", {description = "Build tools", default = false, type = "boolean"})

if is_plat("linux", "bsd") then
add_syslinks("pthread")
end

add_deps("cmake")

if on_check then
on_check("windows", function (package)
import("core.base.semver")

local msvc = package:toolchain("msvc")
if msvc then
local vs_sdkver = msvc:config("vs_sdkver")
assert(vs_sdkver and semver.match(vs_sdkver):gt("10.0.19041"), "package(amrex) require vs_sdkver > 10.0.19041.0")
end
end)
end

on_load(function (package)
if package:config("openmp") then
package:add("deps", "openmp")
end
if package:config("cuda") then
package:add("deps", "cuda")
end
if package:config("hdf5") then
package:add("deps", "hdf5")
end
if package:config("fortran") and package:is_plat("linux", "macosx") then
package:add("deps", "gfortran", {kind = "binary"})
end
end)

on_install("windows", "macosx", "linux", "bsd", "mingw", function (package)
local configs = {"-DAMReX_ENABLE_TESTS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DAMReX_PIC=" .. (package:config("pic") and "ON" or "OFF"))

local configs_map = {
openmp = "OMP",
tools = "PLOTFILE_TOOLS",
}
for name, enabled in table.orderpairs(package:configs()) do
if not package:extraconf("configs", name, "builtin") then
local real = configs_map[name] or name:upper()
local enabled = (package:config(name) and "ON" or "OFF")
table.insert(configs, format("-DAMReX_%s=%s", real, enabled))
end
end

if package:is_plat("windows") then
os.mkdir(path.join(package:buildir(), "Src/pdb"))
end
import("package.tools.cmake").install(package, configs)
end)

on_test(function (package)
assert(package:check_cxxsnippets({test = [[
#include <AMReX.H>
#include <AMReX_Print.H>
void test(int argc, char* argv[]) {
amrex::Initialize(argc,argv);
{
amrex::Print() << "Hello world from AMReX version " << amrex::Version() << "\n";
}
amrex::Finalize();
}
]]}, {configs = {languages = "c++17"}}))
end)
1 change: 1 addition & 0 deletions packages/a/apr/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package("apr")

add_urls("https://github.com/apache/apr/archive/refs/tags/$(version).tar.gz",
"https://github.com/apache/apr.git")
add_versions("1.7.5", "6d0712c529503cd2457011d03164491bbc16d0050bc40ef89568b1ac491c6600")
add_versions("1.7.4", "060b6e5ca8b3251545a93777c9ef744ceff02d4a59bb60a7dd9b3da9da33673e")
add_versions("1.7.0", "a7e2c5e6d60f6c7b1611b31a2f914a3e58f44eded5b064f0bae43ff30b16a4e6")

Expand Down
4 changes: 0 additions & 4 deletions packages/a/aravis/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ package("aravis")
if libusb and not libusb:is_system() then
io.replace("meson.build", "libusb-1.0", "libusb", {plain = true})
end
local libxml2 = package:dep("libxml2")
if not libxml2:is_system() then
io.replace("meson.build", "libxml-2.0", "libxml2", {plain = true})
end

local configs = {"-Dviewer=disabled", "-Dtests=false"}
table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))
Expand Down
1 change: 1 addition & 0 deletions packages/a/arduinojson/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package("arduinojson")
add_urls("https://github.com/bblanchon/ArduinoJson/archive/refs/tags/$(version).tar.gz",
"https://github.com/bblanchon/ArduinoJson.git")

add_versions("v7.2.0", "d20aefd14f12bd907c6851d1dfad173e4fcd2d993841fa8c91a1d8ab5a71188b")
add_versions("v7.1.0", "74bc745527a274bcab85c6498de77da749627113c4921ccbcaf83daa7ac35dee")
add_versions("v7.0.4", "98ca14d98e9f1e8978ce5ad3ca0eeda3d22419d17586c60f299f369078929917")
add_versions("v7.0.3", "6da2d069e0caa0c829444912ee13e78bdf9cc600be632428a164c92e69528000")
Expand Down
6 changes: 6 additions & 0 deletions packages/a/assimp/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ package("assimp")
if minizip and not minizip:is_system() then
packagedeps = table.join2(packagedeps or {}, "minizip")
end
-- fix ninja debug build
os.mkdir(path.join(package:buildir(), "code/pdb"))
-- MDd == _DEBUG + _MT + _DLL
if package:is_debug() and package:has_runtime("MD", "MT") then
io.replace("CMakeLists.txt", "/D_DEBUG", "", {plain = true})
end
end

local zlib = package:dep("zlib")
Expand Down
7 changes: 6 additions & 1 deletion packages/a/aws-c-common/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package("aws-c-common")
add_urls("https://github.com/awslabs/aws-c-common/archive/refs/tags/$(version).tar.gz",
"https://github.com/awslabs/aws-c-common.git")

add_versions("v0.9.28", "bf265e9e409d563b0eddcb66e1cb00ff6b371170db3e119348478d911d054317")
add_versions("v0.9.27", "0c0eecbd7aa04f85b1bdddf6342789bc8052737c6e9aa2ca35e26caed41d06ba")
add_versions("v0.9.25", "443f3268387715e6e2c417a87114a6b42873aeeebc793d3f6f631323e7c48a80")
add_versions("v0.9.24", "715a15399fe6dce2971c222ecabea4276e42ba3465a63c175724fc0c80d7a888")
Expand All @@ -32,7 +33,11 @@ package("aws-c-common")
add_deps("cmake")

on_install("!mingw or mingw|!i386", function (package)
local configs = {"-DBUILD_TESTING=OFF"}
if package:is_plat("windows") and package:config("shared") then
package:add("defines", "AWS_COMMON_USE_IMPORT_EXPORT")
end

local configs = {"-DBUILD_TESTING=OFF", "-DCMAKE_POLICY_DEFAULT_CMP0057=NEW"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF"))
Expand Down
28 changes: 20 additions & 8 deletions packages/a/aws-checksums/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,47 @@ package("aws-checksums")
add_urls("https://github.com/awslabs/aws-checksums/archive/refs/tags/$(version).tar.gz",
"https://github.com/awslabs/aws-checksums.git")

add_versions("v0.1.20", "12f80085993662b6d2cbd2d090b49b4350d19396b1d218d52323712cc8dee252")
add_versions("v0.1.19", "844e5a4f659f454112c559d4f4043b7accfbb134e47a55f4c55f79d9c71bdab1")
add_versions("v0.1.18", "bdba9d0a8b8330a89c6b8cbc00b9aa14f403d3449b37ff2e0d96d62a7301b2ee")
add_versions("v0.1.17", "83c1fbae826631361a529e9565e64a942c412baaec6b705ae5da3f056b97b958")

add_configs("asan", {description = "Enable Address Sanitize.", default = false, type = "boolean"})
if is_plat("wasm") then
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
end

add_deps("cmake", "aws-c-common")

if on_check then
on_check(function (package)
if package:version():ge("0.1.19") then
if package:is_plat("windows") and package:has_tool("cxx", "clang_cl") then
raise("package(aws-checksums >=0.1.19) unsupported clang-cl toolchain")
end
end
if package:version():eq("0.1.19") then
if package:is_plat("windows") then
if package:has_tool("cxx", "clang_cl") then
raise("package(aws-checksums 0.1.19) unsupported clang-cl toolchain")
end
elseif package:has_tool("cxx", "clang") then
if not package:is_plat("windows") and package:has_tool("cxx", "clang") then
raise("package(aws-checksums 0.1.19) unsupported clang toolchain")
end
end
end)
end

on_install("!mingw or mingw|!i386", function (package)
local cmakedir = package:dep("aws-c-common"):installdir("lib", "cmake")
if package:is_plat("windows") and package:config("shared") then
package:add("defines", "AWS_CHECKSUMS_USE_IMPORT_EXPORT")
end

local cmakedir = package:dep("aws-c-common"):installdir("lib/cmake")
if is_host("windows") then
cmakedir = cmakedir:gsub("\\", "/")
end

local configs = {"-DBUILD_TESTING=OFF", "-DCMAKE_MODULE_PATH=" .. cmakedir}
local configs = {
"-DBUILD_TESTING=OFF",
"-DCMAKE_POLICY_DEFAULT_CMP0057=NEW",
"-DCMAKE_MODULE_PATH=" .. cmakedir,
}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DENABLE_SANITIZERS=" .. (package:config("asan") and "ON" or "OFF"))
Expand Down
1 change: 1 addition & 0 deletions packages/a/aws-crt-cpp/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package("aws-crt-cpp")
add_urls("https://github.com/awslabs/aws-crt-cpp/archive/refs/tags/$(version).tar.gz",
"https://github.com/awslabs/aws-crt-cpp.git")

add_versions("v0.28.3", "0d0255eb1983ff3b6f7a7e98a54f65e2e8b40a7c7d6118a96a9c656ada7afb5f")
add_versions("v0.28.2", "7f27df9d2028008e665bab4b2e094365eac696610610e52182c679a43dbeaf6f")
add_versions("v0.27.5", "cc69252ee132f5cc76b1fcf1ebec574e88f7080b05caa8125aab5684b26a37b9")
add_versions("v0.27.4", "0554776a4cbbea016075f4a28698ff22818c5b948296171e1f76d0a787576f83")
Expand Down
93 changes: 56 additions & 37 deletions packages/b/box2d/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,27 +1,38 @@
package("box2d")

set_homepage("https://box2d.org")
set_description("A 2D Physics Engine for Games")
set_license("MIT")

set_urls("https://github.com/erincatto/box2d/archive/v$(version).zip")
add_versions("2.4.0", "6aebbc54c93e367c97e382a57ba12546731dcde51526964c2ab97dec2050f8b9")
add_versions("2.4.1", "0cb512dfa5be79ca227cd881b279adee61249c85c8b51caf5aa036b71e943002")
add_versions("2.4.2", "593f165015fdd07ea521a851105f1c86ae313c5af0a15968ed95f864417fa8a7")
if is_arch("x64", "x86_64", "arm64.*") then
add_versions("3.0.0", "c2983a30a95037c46c19e42f398de6bc375d6ae87f30e0d0bbabb059ec60f8c0")
end
set_urls("https://github.com/erincatto/box2d/archive/refs/tags/$(version).tar.gz",
"https://github.com/erincatto/box2d.git")

add_versions("v3.0.0", "64ad759006cd2377c99367f51fb36942b57f0e9ad690ed41548dd620e6f6c8b1")
add_versions("v2.4.2", "85b9b104d256c985e6e244b4227d447897fac429071cc114e5cc819dae848852")

if is_arch("x64", "x86_64") then
add_configs("avx2", {description = "Enable AVX2.", default = false, type = "boolean"})
add_configs("avx2", {description = "Enable AVX2.", default = false, type = "boolean"})

if is_plat("linux", "bsd") then
add_syslinks("pthread")
end

add_deps("cmake")

if on_check then
on_check("windows", function (package)
on_check(function (package)
if package:version():ge("3.0.0") then
assert(not package:is_arch("arm64.*"), "package(box2d =>3.0.0) Unsupported architecture.")
if package:check_sizeof("void*") == "4" then
raise("package(box2d >=3.0.0) unsupported 32-bit")
end

if package:is_plat("windows") then
assert(not package:is_arch("arm64.*"), "package(box2d/arm >=3.0.0) Unsupported architecture.")
end

if package:is_plat("android") then
local ndk = package:toolchain("ndk")
local ndk_sdkver = ndk:config("ndk_sdkver")
assert(ndk_sdkver and tonumber(ndk_sdkver) >= 28, "package(box2d >=3.0.0) requires ndk api level >= 28")
end

local configs = {languages = "c11"}
if package:has_tool("cc", "cl") then
Expand All @@ -33,37 +44,45 @@ package("box2d")
end)
end

on_install("windows", "linux", "macosx", "mingw", function (package)
local configs = {}
if package:version():ge("3.0.0") then
table.insert(configs, "--compile-no-warning-as-error")
table.insert(configs, "-DBOX2D_SANITIZE=OFF")
table.insert(configs, "-DBOX2D_SAMPLES=OFF")
table.insert(configs, "-DBOX2D_BENCHMARKS=OFF")
table.insert(configs, "-DBOX2D_DOCS=OFF")
table.insert(configs, "-DBOX2D_PROFILE=OFF")
table.insert(configs, "-DBOX2D_VALIDATE=OFF")
table.insert(configs, "-DBOX2D_UNIT_TESTS=OFF")
table.insert(configs, "-DBOX2D_AVX2=" .. (package:config("avx2") and "ON" or "OFF"))
else
table.insert(configs, "-DBOX2D_BUILD_UNIT_TESTS=OFF")
table.insert(configs, "-DBOX2D_BUILD_TESTBED=OFF")
table.insert(configs, "-DBOX2D_BUILD_DOCS=OFF")
on_install("!bsd", function (package)
if package:config("shared") then
package:add("defines", "B2_SHARED")
end
if package:is_plat("windows") and package:is_debug() then
package:add("defines", "B2_ENABLE_ASSERT")
end

io.replace("CMakeLists.txt", [[set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")]], "", {plain = true})

local configs = {
"-DBOX2D_BUILD_UNIT_TESTS=OFF",
"-DBOX2D_BUILD_TESTBED=OFF",

"-DBOX2D_SAMPLES=OFF",
"-DBOX2D_UNIT_TESTS=OFF",
"-DBOX2D_VALIDATE=OFF",
"--compile-no-warning-as-error",
}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DBOX2D_SANITIZE=" .. (package:config("asan") and "ON" or "OFF"))
table.insert(configs, "-DBOX2D_AVX2=" .. (package:config("avx2") and "ON" or "OFF"))

os.mkdir(path.join(package:buildir(), "src/pdb"))
import("package.tools.cmake").install(package, configs)

if package:gitref() or package:version():ge("3.0.0") then
os.cp("include", package:installdir())
end
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
import("package.tools.cmake").build(package, configs, {buildir = "build"})
if package:is_plat("windows") then
os.trycp(path.join("build", "src", "*", "*.lib"), package:installdir("lib"))
os.trycp(path.join("build", "bin", "*", "*.lib"), package:installdir("lib"))
if package:config("shared") then
os.trycp(path.join(package:buildir(), "bin/box2d.pdb"), package:installdir("bin"))
else
os.trycp("build/src/*.a", package:installdir("lib"))
os.trycp("build/bin/*.a", package:installdir("lib"))
os.trycp(path.join(package:buildir(), "bin/box2d.pdb"), package:installdir("lib"))
end
os.cp("include", package:installdir())
end)

on_test(function (package)
if package:version():ge("3.0.0") then
if package:gitref() or package:version():ge("3.0.0") then
assert(package:check_csnippets({test = [[
void test(int argc, char** argv) {
b2WorldDef worldDef = b2DefaultWorldDef();
Expand Down
Loading

0 comments on commit 6967fbf

Please sign in to comment.