vcpkg's port of cairo 1.18.4: how the cairo DLL in RDKit's Windows wheel was built
==================================================================================

Collected by HABER Solutions on 2026-10-21 for the RXViewer source mirror
(https://releases.habersolutions.com/sources/cairo-1.18.4/). Nothing in the
port files below was changed; they are vcpkg's own, under vcpkg's MIT licence
(vcpkg-LICENSE.txt, from https://github.com/microsoft/vcpkg/blob/master/LICENSE.txt).

What ships
----------
RXViewer's Windows builds ship rdkit 2025.9.4's rdkit.libs/cairo-2-*.dll
(cairo_version_string() reports 1.18.4) as a separate, replaceable DLL.

How it was built
----------------
The rdkit wheels are built by https://github.com/kuelumbus/rdkit-pypi. At its
tag 2025.09.4, .github/workflows/wheels.yml runs "vcpkg --triplet x64-windows
install" on the GitHub windows-2022 runner, and its vcpkg.json names the ports
"cairo" and "freetype" without a version baseline, so the runner image's vcpkg
checkout chose the port. vcpkg has two ports of cairo 1.18.4
(versions/c-/cairo.json):

  port-version 0  git tree 46db143e87befd1eea4d5225e886d2378d5d259f
                  (vcpkg commit bf340b9bf211, 2025-05-29)
  port-version 1  git tree 7d69b7a716a929457771c9045ba862f26cf5768c
                  (vcpkg commit 4cc89db96fc6, 2025-10-13)

Both are here. They differ only in vcpkg.json (port-version 1 adds the X11
libraries to the "x11" feature, which is not supported on Windows); their
portfile.cmake and both patches are byte-identical. Git blob ids, checked
against vcpkg's trees:

  fix_clang-cl_build.patch  133afb7eb50baab044ba796286a66f7817a5642e
  msvc-convenience.diff     664d320bdd2bc2722b484affdf0c7e1b11a653f2
  portfile.cmake            4da4f24857d7d379254a82a5b20e785dcd928217
  vcpkg.json (0)            91c9d3df873260c774bca84fb14553ddf2b389ae
  vcpkg.json (1)            4d45978b5192d5adfd41e9b5eb48d76b0fadc588

The source
----------
portfile.cmake downloads https://gitlab.freedesktop.org/cairo/cairo/-/archive/1.18.4/cairo-1.18.4.tar.gz
and checks its SHA-512
663e6edf2718e8205e30ba309ac609ced9e88e6e1ec857fc48b345dfce82b044d58ec6b4a2d2b281fba30a659a368625ea7501f8b43fe26c137a7ebffdbaac91.
That archive (downloaded 2026-10-21, same SHA-512) holds the same 4931 files
as cairo's release tarball cairo-1.18.4.tar.xz beside this archive, byte for
byte, except .gitlab-ci.yml (cairo's CI configuration, not built).

The changes vcpkg makes to cairo's source
-----------------------------------------
Both patches are applied on Windows (x64-windows):

- msvc-convenience.diff: src/win32/cairo-win32-private.h asks the MSVC linker
  for MSImg32.lib (#pragma comment(lib, "MSImg32.Lib")).
- fix_clang-cl_build.patch (Windows, not MinGW): meson.build checks the
  compiler's argument syntax instead of its id before adding GCC warning
  flags, and drops the __uint128_t type check;
  util/cairo-script/cairo-script-objects.c loses one "inline" keyword.

The build options are in portfile.cmake (meson; zlib and png on, tests off;
fontconfig and freetype as the port's default features).
