[cairo] Fix static cairo builds (#18103)

* fix static cairo builds

* remove outdated patch

* version stuff

* try getting cairo back into static CI builds
This commit is contained in:
Alexander Neumann 2021-07-16 01:01:16 +02:00 committed by GitHub
parent ab8067a86b
commit 226990bf0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 104 additions and 15 deletions

View File

@ -0,0 +1,92 @@
diff --git a/util/cairo-fdr/meson.build b/util/cairo-fdr/meson.build
index 3cb66c678..b12b90036 100644
--- a/util/cairo-fdr/meson.build
+++ b/util/cairo-fdr/meson.build
@@ -4,7 +4,7 @@ cairo_fdr_sources = [
libcairofdr = library('cairo-fdr', cairo_fdr_sources,
include_directories: [incbase, incsrc],
- c_args: ['-DHAVE_CONFIG_H'],
+ c_args: ['-DHAVE_CONFIG_H'] + static_definition,
dependencies: deps,
install: true,
install_dir: join_paths(get_option('prefix'), get_option('libdir'), 'cairo'),
diff --git a/util/cairo-script/meson.build b/util/cairo-script/meson.build
index a782ec63f..7e21f6c04 100644
--- a/util/cairo-script/meson.build
+++ b/util/cairo-script/meson.build
@@ -26,7 +26,7 @@ csi_trace_sources = [
libcairoscript = library('cairo-script-interpreter',
cairoscript_interpreter_sources,
- c_args: ['-DHAVE_CONFIG_H'],
+ c_args: ['-DHAVE_CONFIG_H'] + static_definition,
include_directories: [incbase, incsrc],
dependencies: deps,
link_with: [libcairo],
@@ -41,14 +41,14 @@ libcairoscript_dep = declare_dependency(link_with: libcairoscript,
include_directories: [incbase, inccairoscript])
csi_replay_exe = executable('csi-replay', csi_replay_sources,
- c_args: ['-DHAVE_CONFIG_H'],
+ c_args: ['-DHAVE_CONFIG_H'] + static_definition,
include_directories: [incbase, incsrc],
link_with: [libcairo, libcairoscript],
dependencies: deps,
)
csi_exec_exe = executable('csi-exec', csi_exec_sources,
- c_args: ['-DHAVE_CONFIG_H'],
+ c_args: ['-DHAVE_CONFIG_H'] + static_definition,
include_directories: [incbase, incsrc],
link_with: [libcairo, libcairoscript],
dependencies: deps,
@@ -56,7 +56,7 @@ csi_exec_exe = executable('csi-exec', csi_exec_sources,
if feature_conf.get('CAIRO_HAS_SCRIPT_SURFACE', 0) == 1 and conf.get('HAVE_LIBGEN_H', 0) == 1
csi_trace_exe = executable('csi-trace', csi_trace_sources,
- c_args: ['-DHAVE_CONFIG_H'],
+ c_args: ['-DHAVE_CONFIG_H'] + static_definition,
include_directories: [incbase, incsrc],
link_with: [libcairo, libcairoscript],
dependencies: deps,
diff --git a/util/cairo-trace/meson.build b/util/cairo-trace/meson.build
index e836f98cf..76ee372a2 100644
--- a/util/cairo-trace/meson.build
+++ b/util/cairo-trace/meson.build
@@ -12,7 +12,7 @@ libcairotrace = library('cairo-trace', cairo_trace_sources,
include_directories: [incbase, incsrc],
dependencies: deps,
link_args: extra_link_args,
- c_args: ['-DSHARED_LIB_EXT="@0@"'.format(shared_lib_ext), '-DHAVE_CONFIG_H'] + pthread_c_args,
+ c_args: ['-DSHARED_LIB_EXT="@0@"'.format(shared_lib_ext), '-DHAVE_CONFIG_H'] + pthread_c_args + static_definition,
install: true,
install_dir: join_paths(get_option('prefix'), get_option('libdir'), 'cairo'),
)
diff --git a/util/meson.build b/util/meson.build
index 016955cea..a90363115 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -2,6 +2,14 @@ subdir('cairo-missing')
cairo_utils = []
+static_definition=[]
+if host_machine.system() == 'windows'
+ lib_default = get_option('default_library')
+ if lib_default == 'static'
+ static_definition=['-DCAIRO_WIN32_STATIC_BUILD']
+ endif
+endif
+
if feature_conf.get('CAIRO_HAS_GOBJECT_FUNCTIONS', 0) == 1
subdir('cairo-gobject')
endif
@@ -55,6 +63,7 @@ foreach util : cairo_utils
include_directories: [incbase, incsrc, inccairoscript],
dependencies: deps + util_deps,
link_with: [libcairo, libcairoscript],
+ c_args: static_definition
)
endforeach

View File

@ -8,6 +8,7 @@ vcpkg_from_gitlab(
SHA512 2c516ad3ffe56cf646b2435d6ef3cf25e8c05aeb13d95dd18a7d0510d134d9990cba1b376063352ff99483cfc4e5d2af849afd2f9538f9136f22d44d34be362c
HEAD_REF master
PATCHES 0001-meson-fix-macOS-build-and-add-macOS-ci.patch
cairo_static_fix.patch
)
if("fontconfig" IN_LIST FEATURES)

View File

@ -1,7 +1,7 @@
{
"name": "cairo",
"version": "1.17.4",
"port-version": 1,
"port-version": 2,
"description": "Cairo is a 2D graphics library with support for multiple output devices. Currently supported output targets include the X Window System (via both Xlib and XCB), Quartz, Win32, image buffers, PostScript, PDF, and SVG file output. Experimental backends include OpenGL, BeOS, OS/2, and DirectFB.",
"homepage": "https://cairographics.org",
"dependencies": [

View File

@ -1,13 +0,0 @@
diff --git a/src/Makefile.am b/src/Makefile.am
index df6de0136..b8de9669c 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -72,7 +72,7 @@ cairo.def: cairo-features.h $(enabled_cairo_headers)
$(EGREP) '^cairo_.* \(' | \
sed -e 's/[ ].*//' | \
sort; \
- echo LIBRARY libcairo-$(CAIRO_VERSION_SONUM).dll; \
+ echo LIBRARY cairo-$(CAIRO_VERSION_SONUM).dll; \
) >$@
@ ! grep -q cairo_ERROR $@ || ($(RM) $@; false)

View File

@ -425,6 +425,8 @@ graphqlparser:arm-uwp=fail
graphqlparser:x64-uwp=fail
gsl:arm-uwp=fail
gsl:x64-uwp=fail
gtk:x64-windows-static=fail
gtk:x64-windows-static-md=fail
gts:x64-osx=fail
guetzli:x64-osx=fail
h3:arm64-windows=fail
@ -1194,6 +1196,8 @@ orocos-kdl:arm-uwp=fail
orocos-kdl:x64-uwp=fail
paho-mqtt:arm-uwp=fail
paho-mqtt:x64-uwp=fail
pango:x64-windows-static=fail
pango:x64-windows-static-md=fail
pangomm:arm64-windows=fail
pdal:x64-linux=fail
pdal:x64-osx=fail

View File

@ -1110,7 +1110,7 @@
},
"cairo": {
"baseline": "1.17.4",
"port-version": 1
"port-version": 2
},
"cairomm": {
"baseline": "1.16.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "96aa6adbfefae2d4f2e3d79e012876b1d4a40b93",
"version": "1.17.4",
"port-version": 2
},
{
"git-tree": "a2fa5a9972a7b796f56fdda01f644b5c40d93580",
"version": "1.17.4",