Skip to content

Commit

Permalink
vcpkg: Use system GTK3
Browse files Browse the repository at this point in the history
  • Loading branch information
Exzap committed Apr 17, 2023
1 parent 41f2c27 commit e3e167b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 268 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: "Install system dependencies"
run: |
sudo apt update -qq
sudo apt install -y clang-12 cmake freeglut3-dev libgcrypt20-dev libglm-dev libx11-dev libgles2-mesa-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev libudev-dev nasm ninja-build
sudo apt install -y clang-12 cmake freeglut3-dev libgcrypt20-dev libglm-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev libudev-dev nasm ninja-build
- name: "Bootstrap vcpkg"
run: |
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
- name: "Install system dependencies"
run: |
sudo apt update -qq
sudo apt install -y clang-12 cmake freeglut3-dev libgcrypt20-dev libglm-dev libx11-dev libgles2-mesa-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev nasm ninja-build appstream
sudo apt install -y clang-12 cmake freeglut3-dev libgcrypt20-dev libglm-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev nasm ninja-build appstream
- name: "Build AppImage"
run: |
Expand Down
13 changes: 0 additions & 13 deletions dependencies/vcpkg_overlay_ports_linux/gtk3/0001-build.patch

This file was deleted.

This file was deleted.

99 changes: 1 addition & 98 deletions dependencies/vcpkg_overlay_ports_linux/gtk3/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,98 +1 @@
set(warning_length 24)
string(LENGTH "${CURRENT_BUILDTREES_DIR}" buildtrees_path_length)
if(buildtrees_path_length GREATER warning_length AND CMAKE_HOST_WIN32)
message(WARNING "${PORT}'s buildsystem uses very long paths and may fail on your system.\n"
"We recommend moving vcpkg to a short path such as 'C:\\vcpkg' or using the subst command."
)
endif()

vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
vcpkg_from_gitlab(
OUT_SOURCE_PATH SOURCE_PATH
GITLAB_URL https://gitlab.gnome.org
REPO GNOME/gtk
REF "${VERSION}"
SHA512 20a91e30a89070461af06b33829bc723b348806b4a785d0743af8bd4789b55dade24686e08bf1b2f0335240463aacc040134babb0605b809186b15de9cf261e4
PATCHES
0001-build.patch
cairo-cpp-linkage.patch
)

vcpkg_find_acquire_program(PKGCONFIG)
get_filename_component(PKGCONFIG_DIR "${PKGCONFIG}" DIRECTORY )
vcpkg_add_to_path("${PKGCONFIG_DIR}") # Post install script runs pkg-config so it needs to be on PATH
vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/tools/glib/")
vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/tools/gdk-pixbuf")
vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/tools/gettext/bin")

if("introspection" IN_LIST FEATURES)
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static")
message(FATAL_ERROR "Feature introspection currently only supports dynamic build.")
endif()
list(APPEND OPTIONS_DEBUG -Dintrospection=false)
list(APPEND OPTIONS_RELEASE -Dintrospection=true)
else()
list(APPEND OPTIONS -Dintrospection=false)
endif()

if(CMAKE_HOST_WIN32 AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(GIR_TOOL_DIR ${CURRENT_INSTALLED_DIR})
else()
set(GIR_TOOL_DIR ${CURRENT_HOST_INSTALLED_DIR})
endif()

vcpkg_configure_meson(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${OPTIONS}
-Dwayland_backend=true
-Ddemos=false
-Dexamples=false
-Dtests=false
-Dgtk_doc=false
-Dman=false
-Dxinerama=no # Enable support for the X11 Xinerama extension
-Dcloudproviders=false # Enable the cloudproviders support
-Dprofiler=false # include tracing support for sysprof
-Dtracker3=false # Enable Tracker3 filechooser search
-Dcolord=no # Build colord support for the CUPS printing backend
OPTIONS_DEBUG
${OPTIONS_DEBUG}
OPTIONS_RELEASE
${OPTIONS_RELEASE}
ADDITIONAL_BINARIES
"glib-genmarshal='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-genmarshal'"
"glib-mkenums='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-mkenums'"
"glib-compile-resources='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-compile-resources${VCPKG_HOST_EXECUTABLE_SUFFIX}'"
"gdbus-codegen='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/gdbus-codegen'"
"glib-compile-schemas='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-compile-schemas${VCPKG_HOST_EXECUTABLE_SUFFIX}'"
"g-ir-compiler='${CURRENT_HOST_INSTALLED_DIR}/tools/gobject-introspection/g-ir-compiler${VCPKG_HOST_EXECUTABLE_SUFFIX}'"
"g-ir-scanner='${GIR_TOOL_DIR}/tools/gobject-introspection/g-ir-scanner'"
)

# Reduce command line lengths, in particular for static windows builds.
foreach(dir IN ITEMS "${TARGET_TRIPLET}-dbg" "${TARGET_TRIPLET}-rel")
if(EXISTS "${CURRENT_BUILDTREES_DIR}/${dir}/build.ninja")
vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${dir}/build.ninja" "/${dir}/../src/" "/src/")
endif()
endforeach()
vcpkg_install_meson(ADD_BIN_TO_PATH)

vcpkg_copy_pdbs()

vcpkg_fixup_pkgconfig()

set(GTK_TOOLS
gtk-builder-tool
gtk-encode-symbolic-svg
gtk-launch
gtk-query-immodules-3.0
gtk-query-settings
gtk-update-icon-cache
)
vcpkg_copy_tools(TOOL_NAMES ${GTK_TOOLS} AUTO_CLEAN)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/etc")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
95 changes: 2 additions & 93 deletions dependencies/vcpkg_overlay_ports_linux/gtk3/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,99 +1,8 @@
{
"name": "gtk3",
"version": "3.24.34",
"port-version": 4,
"port-version": 5,
"description": "Portable library for creating graphical user interfaces.",
"homepage": "https://www.gtk.org/",
"license": null,
"dependencies": [
{
"name": "at-spi2-atk",
"platform": "linux"
},
"atk",
{
"name": "cairo",
"default-features": false,
"features": [
"gobject"
]
},
{
"name": "cairo",
"default-features": false,
"features": [
"x11"
],
"platform": "linux"
},
"gdk-pixbuf",
{
"name": "gdk-pixbuf",
"host": true
},
"gettext",
{
"name": "gettext",
"host": true,
"default-features": false,
"features": [
"tools"
]
},
"glib",
{
"name": "glib",
"host": true
},
"libepoxy",
"pango",
{
"name": "vcpkg-tool-meson",
"host": true
}
],
"features": {
"introspection": {
"description": "build with introspection",
"dependencies": [
{
"name": "atk",
"default-features": false,
"features": [
"introspection"
]
},
{
"name": "gdk-pixbuf",
"host": true,
"default-features": false,
"features": [
"introspection"
]
},
{
"name": "gdk-pixbuf",
"default-features": false,
"features": [
"introspection"
]
},
{
"name": "gobject-introspection",
"host": true
},
{
"name": "gobject-introspection",
"platform": "windows & x86"
},
{
"name": "pango",
"default-features": false,
"features": [
"introspection"
]
}
]
}
}
"license": null
}

0 comments on commit e3e167b

Please sign in to comment.