Skip to content

Commit

Permalink
[XMake] fix libKTX compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthapz committed Nov 2, 2024
1 parent 598a269 commit 2f2955a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ jobs:
- name: Install LLVM and Clang
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: clang libc++-dev libc++1 libc++abi-dev libc++abi1 mold llvm-runtime llvm libxkbcommon-x11-dev libxkbcommon-x11 libktx-dev libktx xutils-dev x11proto-dev libxau-dev libxdmcp-dev libxcb1-dev libxcb-damage0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-xrm-dev libxcb-xinput-dev libxcb-dpms0-dev libxcb-xvmc0-dev libxcb-xv0-dev libxcb-xtest0-dev libxcb-xfreedri0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-shape0-dev libxcb-present-dev libxcb-xkb-dev libxcb-xfixes0-dev libxcb-xevie0-dev libxcb-shm0-dev libxcb-dri2-0-dev libxcb-sync0-dev libxcb-composite0-dev libxcb-xinerama0-dev libxcb-screensaver-dev libxcb-record0-dev libxau-dev build-essential cmake libzstd-dev ninja-build doxygen graphviz opencl-c-headers mesa-opencl-icd
packages: clang libc++-dev libc++1 libc++abi-dev libc++abi1 mold llvm-runtime llvm libxkbcommon-x11-dev libxkbcommon-x11 libktx-dev libktx xutils-dev x11proto-dev libxau6 libxdmcp-dev libxcb1-dev libxcb-damage0-dev libxcb-render0-dev libxcb-randr0-dev libxcb-xrm-dev libxcb-xinput-dev libxcb-dpms0-dev libxcb-xvmc0-dev libxcb-xv0-dev libxcb-xtest0-dev libxcb-xfreedri0-dev libxcb-dri3-dev libxcb-glx0-dev libxcb-shape0-dev libxcb-present-dev libxcb-xkb-dev libxcb-xfixes0-dev libxcb-xevie0-dev libxcb-shm0-dev libxcb-dri2-0-dev libxcb-sync0-dev libxcb-composite0-dev libxcb-xinerama0-dev libxcb-screensaver-dev libxcb-record0-dev libxau-dev build-essential cmake libzstd-dev ninja-build doxygen graphviz opencl-c-headers mesa-opencl-icd

- name: Configure & Build
id: build
run: |
xmake f -v -a ${{ (matrix.arch == 'x64') && 'x86_64' || (matrix.arch == 'arm64') && 'aarch64' || matrix.arch }} --yes -m ${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }} -k ${{ matrix.kind }} --sanitizers=${{ matrix.mode == 'debug' && 'y' || 'n' }} --examples=y --tests=y --toolchain=llvm --mold=y --runtimes="c++_shared"
xmake f -vD -a ${{ (matrix.arch == 'x64') && 'x86_64' || (matrix.arch == 'arm64') && 'aarch64' || matrix.arch }} --yes -m ${{ (matrix.mode == 'release' || matrix.mode == 'debug') && matrix.mode || 'releasedbg' }} -k ${{ matrix.kind }} --sanitizers=${{ matrix.mode == 'debug' && 'y' || 'n' }} --examples=y --tests=y --toolchain=llvm --mold=y --runtimes="c++_shared"
xmake b -v
- name: Tests
Expand Down
2 changes: 1 addition & 1 deletion xmake/ktx.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ package("libktx", function()
table.insert(configs, "-DKTX_FEATURE_GL_UPLOAD=" .. (package:config("opengl") and "ON" or "OFF"))
table.insert(configs, "-DKTX_FEATURE_TESTS=OFF")
table.insert(configs, "-DKTX_FEATURE_TOOLS=OFF")
io.replace(" $<${is_gnu_fe}:-ffp-contract=off>", "", "CMakeLists.txt")
io.replace("CMakeLists.txt", "$<${is_gnu_fe}:-ffp-contract=off>", "")
import("package.tools.cmake").install(package, configs)
end)

Expand Down
33 changes: 33 additions & 0 deletions xmake/libxau.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package("libxau")

set_homepage("https://www.x.org/")
set_description("X.Org: A Sample Authorization Protocol for X")

set_urls("https://www.x.org/archive/individual/lib/libXau-$(version).tar.gz")
add_versions("1.0.10", "51a54da42475d4572a0b59979ec107c27dacf6c687c2b7b04e5cf989a7c7e60c")
add_versions("1.0.11", "3a321aaceb803577a4776a5efe78836eb095a9e44bbc7a465d29463e1a14f189")

if is_plat("linux") then
add_extsources("apt::libxau-dev", "pacman::libxau", "pkgconfig::xau")
end

if is_plat("macosx", "linux", "bsd") then
add_deps("pkg-config", "util-macros", "xorgproto")
end

on_install("macosx", "linux", "bsd", function (package)
local configs = {"--sysconfdir=" .. package:installdir("etc"),
"--localstatedir=" .. package:installdir("var"),
"--disable-dependency-tracking",
"--disable-silent-rules"}
table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
if package:config("pic") then
table.insert(configs, "--with-pic")
end
import("package.tools.autoconf").install(package, configs)
end)

on_test(function (package)
assert(package:has_ctypes("Xauth", {includes = "X11/Xauth.h"}))
end)

0 comments on commit 2f2955a

Please sign in to comment.