|
| 1 | +set(warning_length 24) |
| 2 | +string(LENGTH "${CURRENT_BUILDTREES_DIR}" buildtrees_path_length) |
| 3 | +if(buildtrees_path_length GREATER warning_length AND CMAKE_HOST_WIN32) |
| 4 | + message(WARNING "${PORT}'s buildsystem uses very long paths and may fail on your system.\n" |
| 5 | + "We recommend moving vcpkg to a short path such as 'C:\\vcpkg' or using the subst command." |
| 6 | + ) |
| 7 | +endif() |
| 8 | + |
| 9 | +string(REGEX MATCH [[^[0-9][0-9]*\.[1-9][0-9]*]] VERSION_MAJOR_MINOR ${VERSION}) |
| 10 | +vcpkg_download_distfile(ARCHIVE |
| 11 | + URLS |
| 12 | + "https://download.gnome.org/sources/gtk/${VERSION_MAJOR_MINOR}/gtk-${VERSION}.tar.xz" |
| 13 | + "https://www.mirrorservice.org/sites/ftp.gnome.org/pub/GNOME/sources/gtk/${VERSION_MAJOR_MINOR}/gtk-${VERSION}.tar.xz" |
| 14 | + FILENAME "GNOME-gtk-${VERSION}.tar.xz" |
| 15 | + SHA512 f96ee1c586284af315709ec38e841bd1b2558d09e2162834a132ffc4bbcddca272a92a828550a3accaa3e4da1964ad32b3b48291e929a108a913bd18c61cd73b |
| 16 | +) |
| 17 | + |
| 18 | +vcpkg_extract_source_archive(SOURCE_PATH |
| 19 | + ARCHIVE "${ARCHIVE}" |
| 20 | + PATCHES |
| 21 | + 0001-build.patch |
| 22 | + cairo-cpp-linkage.patch |
| 23 | + egl-conditional.diff # https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/9067 |
| 24 | +) |
| 25 | + |
| 26 | +vcpkg_find_acquire_program(PKGCONFIG) |
| 27 | +get_filename_component(PKGCONFIG_DIR "${PKGCONFIG}" DIRECTORY ) |
| 28 | +vcpkg_add_to_path("${PKGCONFIG_DIR}") # Post install script runs pkg-config so it needs to be on PATH |
| 29 | +vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/tools/glib/") |
| 30 | +vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/tools/gdk-pixbuf") |
| 31 | +vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/tools/gettext/bin") |
| 32 | + |
| 33 | + |
| 34 | +if("introspection" IN_LIST FEATURES) |
| 35 | + list(APPEND OPTIONS_RELEASE -Dintrospection=true) |
| 36 | + vcpkg_get_gobject_introspection_programs(PYTHON3 GIR_COMPILER GIR_SCANNER) |
| 37 | +else() |
| 38 | + list(APPEND OPTIONS_RELEASE -Dintrospection=false) |
| 39 | +endif() |
| 40 | + |
| 41 | +list(APPEND OPTIONS -Dwayland_backend=false) |
| 42 | + |
| 43 | +vcpkg_configure_meson( |
| 44 | + SOURCE_PATH "${SOURCE_PATH}" |
| 45 | + OPTIONS |
| 46 | + ${OPTIONS} |
| 47 | + -Ddemos=false |
| 48 | + -Dexamples=false |
| 49 | + -Dtests=false |
| 50 | + -Dgtk_doc=false |
| 51 | + -Dman=false |
| 52 | + -Dxinerama=no # Enable support for the X11 Xinerama extension |
| 53 | + -Dcloudproviders=false # Enable the cloudproviders support |
| 54 | + -Dprofiler=false # include tracing support for sysprof |
| 55 | + -Dtracker3=false # Enable Tracker3 filechooser search |
| 56 | + -Dcolord=no # Build colord support for the CUPS printing backend |
| 57 | + OPTIONS_RELEASE |
| 58 | + ${OPTIONS_RELEASE} |
| 59 | + OPTIONS_DEBUG |
| 60 | + -Dintrospection=false |
| 61 | + ADDITIONAL_BINARIES |
| 62 | + "glib-genmarshal='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-genmarshal'" |
| 63 | + "glib-mkenums='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-mkenums'" |
| 64 | + "glib-compile-resources='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-compile-resources${VCPKG_HOST_EXECUTABLE_SUFFIX}'" |
| 65 | + "gdbus-codegen='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/gdbus-codegen'" |
| 66 | + "glib-compile-schemas='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-compile-schemas${VCPKG_HOST_EXECUTABLE_SUFFIX}'" |
| 67 | + "g-ir-compiler='${GIR_COMPILER}'" |
| 68 | + "g-ir-scanner='${GIR_SCANNER}'" |
| 69 | +) |
| 70 | + |
| 71 | +# Reduce command line lengths, in particular for static windows builds. |
| 72 | +foreach(dir IN ITEMS "${TARGET_TRIPLET}-dbg" "${TARGET_TRIPLET}-rel") |
| 73 | + if(EXISTS "${CURRENT_BUILDTREES_DIR}/${dir}/build.ninja") |
| 74 | + vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${dir}/build.ninja" "/${dir}/../src/" "/src/") |
| 75 | + endif() |
| 76 | +endforeach() |
| 77 | +vcpkg_install_meson(ADD_BIN_TO_PATH) |
| 78 | + |
| 79 | +vcpkg_copy_pdbs() |
| 80 | + |
| 81 | +vcpkg_fixup_pkgconfig() |
| 82 | + |
| 83 | +set(GTK_TOOLS |
| 84 | + gtk-builder-tool |
| 85 | + gtk-encode-symbolic-svg |
| 86 | + gtk-launch |
| 87 | + gtk-query-immodules-3.0 |
| 88 | + gtk-query-settings |
| 89 | + gtk-update-icon-cache |
| 90 | +) |
| 91 | +vcpkg_copy_tools(TOOL_NAMES ${GTK_TOOLS} AUTO_CLEAN) |
| 92 | + |
| 93 | +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/etc") |
| 94 | +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") |
| 95 | + |
| 96 | +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") |
0 commit comments