aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/pixman
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/pixman
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/pixman')
-rw-r--r--vcpkg/ports/pixman/missing_intrin_include.patch15
-rw-r--r--vcpkg/ports/pixman/no-host-cpu-checks.patch108
-rw-r--r--vcpkg/ports/pixman/portfile.cmake72
-rw-r--r--vcpkg/ports/pixman/vcpkg.json14
4 files changed, 209 insertions, 0 deletions
diff --git a/vcpkg/ports/pixman/missing_intrin_include.patch b/vcpkg/ports/pixman/missing_intrin_include.patch
new file mode 100644
index 0000000..76f74af
--- /dev/null
+++ b/vcpkg/ports/pixman/missing_intrin_include.patch
@@ -0,0 +1,15 @@
+diff --git a/pixman/pixman-x86.c b/pixman/pixman-x86.c
+index 0130b7bfa..d3d0fe1d9 100644
+--- a/pixman/pixman-x86.c
++++ b/pixman/pixman-x86.c
+@@ -24,7 +24,10 @@
+ #endif
+
+ #include "pixman-private.h"
++#ifdef _MSC_VER
++#include <intrin.h>
++#endif
+
+ #if defined(USE_X86_MMX) || defined (USE_SSE2) || defined (USE_SSSE3)
+
+ /* The CPU detection code needs to be in a file not compiled with
diff --git a/vcpkg/ports/pixman/no-host-cpu-checks.patch b/vcpkg/ports/pixman/no-host-cpu-checks.patch
new file mode 100644
index 0000000..f70c54a
--- /dev/null
+++ b/vcpkg/ports/pixman/no-host-cpu-checks.patch
@@ -0,0 +1,108 @@
+diff --git a/meson.build b/meson.build
+index 1cec227..1b07ca8 100644
+--- a/meson.build
++++ b/meson.build
+@@ -95,44 +95,7 @@ else
+ mmx_flags = ['-mmmx', '-Winline']
+ endif
+ if not use_mmx.disabled()
+- if host_machine.cpu_family() == 'x86_64' or cc.get_id() == 'msvc'
+- have_mmx = true
+- elif host_machine.cpu_family() == 'x86' and cc.compiles('''
+- #include <mmintrin.h>
+- #include <stdint.h>
+-
+- /* Check support for block expressions */
+- #define _mm_shuffle_pi16(A, N) \
+- ({ \
+- __m64 ret; \
+- \
+- /* Some versions of clang will choke on K */ \
+- asm ("pshufw %2, %1, %0\n\t" \
+- : "=y" (ret) \
+- : "y" (A), "K" ((const int8_t)N) \
+- ); \
+- \
+- ret; \
+- })
+-
+- int main () {
+- __m64 v = _mm_cvtsi32_si64 (1);
+- __m64 w;
+-
+- w = _mm_shuffle_pi16(v, 5);
+-
+- /* Some versions of clang will choke on this */
+- asm ("pmulhuw %1, %0\n\t"
+- : "+y" (w)
+- : "y" (v)
+- );
+-
+- return _mm_cvtsi64_si32 (v);
+- }''',
+- args : mmx_flags,
+- name : 'MMX Intrinsic Support')
+- have_mmx = true
+- endif
++ have_mmx = true
+ endif
+
+ if have_mmx
+@@ -154,29 +117,7 @@ elif cc.get_id() != 'msvc'
+ sse2_flags = ['-msse2', '-Winline']
+ endif
+ if not use_sse2.disabled()
+- if host_machine.cpu_family() == 'x86'
+- if cc.compiles('''
+- #if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2))
+- # if !defined(__amd64__) && !defined(__x86_64__)
+- # error "Need GCC >= 4.2 for SSE2 intrinsics on x86"
+- # endif
+- #endif
+- #include <mmintrin.h>
+- #include <xmmintrin.h>
+- #include <emmintrin.h>
+- int param;
+- int main () {
+- __m128i a = _mm_set1_epi32 (param), b = _mm_set1_epi32 (param + 1), c;
+- c = _mm_xor_si128 (a, b);
+- return _mm_cvtsi128_si32(c);
+- }''',
+- args : sse2_flags,
+- name : 'SSE2 Intrinsic Support')
+- have_sse2 = true
+- endif
+- elif host_machine.cpu_family() == 'x86_64'
+- have_sse2 = true
+- endif
++ have_sse2 = true
+ endif
+
+ if have_sse2
+@@ -192,24 +133,8 @@ if cc.get_id() != 'msvc'
+ ssse3_flags = ['-mssse3', '-Winline']
+ endif
+
+-# x64 pre-2010 MSVC compilers crashes when building the ssse3 code
+-if not use_ssse3.disabled() and not (cc.get_id() == 'msvc' and cc.version().version_compare('<16') and host_machine.cpu_family() == 'x86_64')
+- if host_machine.cpu_family().startswith('x86')
+- if cc.compiles('''
+- #include <mmintrin.h>
+- #include <xmmintrin.h>
+- #include <emmintrin.h>
+- int param;
+- int main () {
+- __m128i a = _mm_set1_epi32 (param), b = _mm_set1_epi32 (param + 1), c;
+- c = _mm_xor_si128 (a, b);
+- return _mm_cvtsi128_si32(c);
+- }''',
+- args : ssse3_flags,
+- name : 'SSSE3 Intrinsic Support')
+- have_ssse3 = true
+- endif
+- endif
++if use_ssse3.enabled()
++ have_ssse3 = true
+ endif
+
+ if have_ssse3
diff --git a/vcpkg/ports/pixman/portfile.cmake b/vcpkg/ports/pixman/portfile.cmake
new file mode 100644
index 0000000..4ab5205
--- /dev/null
+++ b/vcpkg/ports/pixman/portfile.cmake
@@ -0,0 +1,72 @@
+vcpkg_from_gitlab(
+ OUT_SOURCE_PATH SOURCE_PATH
+ GITLAB_URL https://gitlab.freedesktop.org
+ REPO pixman/pixman
+ REF "pixman-${VERSION}"
+ SHA512 a878d866fbd4d609fabac6a5acac4d0a5ffd0226d926c09d3557261b770f1ad85b2f2d90a48b7621ad20654e52ecccbca9f1a57a36bd5e58ecbe59cca9e3f25d
+ PATCHES
+ no-host-cpu-checks.patch
+ missing_intrin_include.patch
+)
+
+set(x86_architectures x86 x64)
+if(VCPKG_TARGET_ARCHITECTURE IN_LIST x86_architectures AND NOT VCPKG_TARGET_IS_UWP)
+ list(APPEND OPTIONS
+ -Dmmx=enabled
+ -Dsse2=enabled
+ -Dssse3=enabled
+ )
+else()
+ list(APPEND OPTIONS
+ -Dmmx=disabled
+ -Dsse2=disabled
+ -Dssse3=disabled
+ )
+ if(VCPKG_TARGET_IS_ANDROID)
+ vcpkg_cmake_get_vars(cmake_vars_file)
+ include("${cmake_vars_file}")
+ find_path(cpu_features_dir
+ NAMES cpu-features.c
+ PATHS "${VCPKG_DETECTED_CMAKE_ANDROID_NDK}"
+ PATH_SUFFIXES
+ "sources/android/cpufeatures" # NDK r27c
+ NO_DEFAULT_PATH
+ )
+ if(VCPKG_DETECTED_CMAKE_ANDROID_ARM_NEON AND cpu_features_dir)
+ list(APPEND OPTIONS
+ "-Dcpu-features-path=${cpu_features_dir}"
+ )
+ endif()
+ endif()
+ if(VCPKG_TARGET_IS_WINDOWS)
+ # -Darm-simd=enabled does not work with arm64-windows
+ list(APPEND OPTIONS
+ -Da64-neon=disabled
+ -Darm-simd=disabled
+ -Dneon=disabled
+ )
+ endif()
+endif()
+
+vcpkg_configure_meson(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS ${OPTIONS}
+ -Ddemos=disabled
+ -Dgtk=disabled
+ -Dlibpng=enabled
+ -Dtests=disabled
+)
+vcpkg_install_meson()
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+
+set(licenses "${SOURCE_PATH}/COPYING")
+if(VCPKG_DETECTED_CMAKE_ANDROID_ARM_NEON AND cpu_features_dir)
+ file(READ "${cpu_features_dir}/cpu-features.c" cpu_features_c)
+ string(REGEX REPLACE "[*]/.*" "*/\n" cpu_features_license "${cpu_features_c}")
+ file(WRITE "${CURRENT_PACKAGES_DIR}/${TARGET_TRIPLET}-rel/cpu-features (BSD-2-Clause)" "${cpu_features_license}")
+ list(APPEND licenses "${CURRENT_PACKAGES_DIR}/${TARGET_TRIPLET}-rel/cpu-features (BSD-2-Clause)")
+endif()
+vcpkg_install_copyright(FILE_LIST ${licenses})
diff --git a/vcpkg/ports/pixman/vcpkg.json b/vcpkg/ports/pixman/vcpkg.json
new file mode 100644
index 0000000..37d9649
--- /dev/null
+++ b/vcpkg/ports/pixman/vcpkg.json
@@ -0,0 +1,14 @@
+{
+ "name": "pixman",
+ "version": "0.44.2",
+ "description": "Pixman is a low-level software library for pixel manipulation, providing features such as image compositing and trapezoid rasterization.",
+ "homepage": "https://www.cairographics.org/releases",
+ "license": "MIT AND BSD-2-Clause",
+ "dependencies": [
+ "libpng",
+ {
+ "name": "vcpkg-tool-meson",
+ "host": true
+ }
+ ]
+}