Skip to content

Commit 4abe3b7

Browse files
authored
pixman: add support for Android and Windows ARM platforms (xmake-io#7523)
* pixman: remove invalid GitHub repository URL * pixman: update to version 0.46.2 * pixman: add support for Android and Windows ARM platforms * pixman: rename git_release alias to gitlab for clarity * pixman: fix git tag format for version checkout
1 parent a7145b8 commit 4abe3b7

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

packages/p/pixman/xmake.lua

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,21 @@ package("pixman")
55

66
add_urls("https://cairographics.org/releases/pixman-$(version).tar.gz", {alias = "home"})
77
add_urls("https://www.x.org/archive/individual/lib/pixman-$(version).tar.gz", {alias = "home"})
8-
add_urls("https://gitlab.freedesktop.org/pixman/pixman/-/archive/pixman-$(version)/pixman-pixman-$(version).tar.gz", {alias = "git_release"})
9-
add_urls("https://github.com/freedesktop/pixman/archive/refs/tags/pixman-$(version).tar.gz", {alias = "git_release"})
10-
add_urls("https://gitlab.freedesktop.org/pixman/pixman.git")
8+
add_urls("https://gitlab.freedesktop.org/pixman/pixman/-/archive/pixman-$(version)/pixman-pixman-$(version).tar.gz", {alias = "gitlab"})
9+
add_urls("https://gitlab.freedesktop.org/pixman/pixman.git", {alias = "git"})
1110

12-
add_versions("git_release:0.42.0", "45c6462f6d6441923d4c17d06fa50ce066f0ceff0fc84af8d342df63c1079151")
13-
add_versions("git_release:0.42.2", "4191a5084bae000a61e3513b06027b6f8f559d17d61769ed9de27dfb0cec8699")
14-
add_versions("git_release:0.43.4", "2af0acd451e22ae9d86d3c8aa45fcc19e4cc33e86bec311e5328cc2171ff1720")
11+
add_versions("gitlab:0.42.0", "45c6462f6d6441923d4c17d06fa50ce066f0ceff0fc84af8d342df63c1079151")
12+
add_versions("gitlab:0.42.2", "4191a5084bae000a61e3513b06027b6f8f559d17d61769ed9de27dfb0cec8699")
13+
add_versions("gitlab:0.43.4", "2af0acd451e22ae9d86d3c8aa45fcc19e4cc33e86bec311e5328cc2171ff1720")
14+
add_versions("gitlab:0.46.2", "b40c00a15cf514bab2ea89301037def830d590a8e649950059c45a9c1b819bd0")
1515

1616
add_versions("home:0.42.0", "07f74c8d95e4a43eb2b08578b37f40b7937e6c5b48597b3a0bb2c13a53f46c13")
1717
add_versions("home:0.42.2", "ea1480efada2fd948bc75366f7c349e1c96d3297d09a3fe62626e38e234a625e")
1818
add_versions("home:0.43.2", "ea79297e5418fb528d0466e8b5b91d1be88857fa3706f49777b2925a72ae9924")
1919
add_versions("home:0.43.4", "a0624db90180c7ddb79fc7a9151093dc37c646d8c38d3f232f767cf64b85a226")
20+
add_versions("home:0.46.2", "3e0de5ba6e356916946a3d958192f15505dcab85134771bfeab4ce4e29bbd733")
21+
22+
add_versions("git:0.46.2", "pixman-0.46.2")
2023

2124
if is_plat("wasm") then
2225
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
@@ -34,7 +37,7 @@ package("pixman")
3437
end)
3538
end
3639

37-
on_install("!android and !cross and (!windows or windows|!arm64)", function (package)
40+
on_install(function (package)
3841
if package:is_plat("windows") and package:config("shared") then
3942
package:add("defines", "PIXMAN_API=__declspec(dllimport)")
4043
end
@@ -45,6 +48,17 @@ package("pixman")
4548
"-Dgtk=disabled",
4649
}
4750
table.insert(configs, "-Ddefault_library=" .. (package:config("shared") and "shared" or "static"))
51+
if package:is_plat("android") then
52+
local ndk = package:toolchain("ndk"):config("ndk")
53+
if ndk then
54+
local cpu_features = path.join(ndk, "sources", "android", "cpufeatures")
55+
if os.isdir(cpu_features) then
56+
table.insert(configs, "-Dcpu-features-path=" .. path.unix(cpu_features))
57+
end
58+
end
59+
elseif package:is_plat("windows") and package:is_arch("arm.*") then
60+
table.join2(configs, {"-Darm-simd=disabled", "-Dneon=disabled", "-Da64-neon=disabled", "-Dmmx=disabled"})
61+
end
4862
io.replace("meson.build", "subdir('test')", "", {plain = true})
4963
io.replace("meson.build", "subdir('demos')", "", {plain = true})
5064
import("package.tools.meson").install(package, configs)

0 commit comments

Comments
 (0)