Skip to content

Commit

Permalink
Introspection support
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhon committed Jan 17, 2023
1 parent 877e3dc commit ea389e3
Show file tree
Hide file tree
Showing 22 changed files with 415 additions and 49 deletions.
26 changes: 24 additions & 2 deletions ports/atk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,37 @@ vcpkg_from_gitlab(
SHA512 f31951ecbdace6a18fb9f772616137cb8732163b37448fef4daf1af60ba8479c94d498dcdaf4880468c80012c77a446da585926a99704a9a940b80e546080cf3
)

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
-Dintrospection=false
${OPTIONS}
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'"
"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'"
)
vcpkg_install_meson()
vcpkg_install_meson(ADD_BIN_TO_PATH)

vcpkg_copy_pdbs()

Expand Down
19 changes: 17 additions & 2 deletions ports/atk/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "atk",
"version": "2.38.0",
"port-version": 4,
"port-version": 5,
"description": "GNOME Accessibility Toolkit",
"homepage": "https://developer.gnome.org/atk/",
"license": "GPL-2.0-only",
Expand All @@ -24,5 +24,20 @@
"name": "vcpkg-tool-meson",
"host": true
}
]
],
"features": {
"introspection": {
"description": "build with introspection",
"dependencies": [
{
"name": "gobject-introspection",
"host": true
},
{
"name": "gobject-introspection",
"platform": "windows & x86"
}
]
}
}
}
31 changes: 27 additions & 4 deletions ports/gdk-pixbuf/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ vcpkg_from_gitlab(
use-libtiff-4-pkgconfig.patch
)

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=disabled)
list(APPEND OPTIONS_RELEASE -Dintrospection=enabled)
else()
list(APPEND OPTIONS -Dintrospection=disabled)
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()

if(VCPKG_TARGET_IS_WINDOWS)
#list(APPEND OPTIONS -Dnative_windows_loaders=true) # Use Windows system components to handle BMP, EMF, GIF, ICO, JPEG, TIFF and WMF images, overriding jpeg and tiff. To build this into gdk-pixbuf, pass in windows" with the other loaders to build in or use "all" with the builtin_loaders option
endif()
Expand All @@ -24,16 +40,23 @@ vcpkg_configure_meson(
-Dpng=enabled # Enable PNG loader (requires libpng)
-Dtiff=enabled # Enable TIFF loader (requires libtiff), disabled on Windows if "native_windows_loaders" is used
-Djpeg=enabled # Enable JPEG loader (requires libjpeg), disabled on Windows if "native_windows_loaders" is used
-Dintrospection=disabled # Whether to generate the API introspection data (requires GObject-Introspection)
-Drelocatable=true # Whether to enable application bundle relocation support
-Dtests=false
-Dinstalled_tests=false
-Dgio_sniffing=false # Perform file type detection using GIO (Unused on MacOS and Windows)
-Dbuiltin_loaders=all # since it is unclear where loadable plugins should be located;
# Comma-separated list of loaders to build into gdk-pixbuf, or "none", or "all" to build all buildable loaders into gdk-pixbuf
ADDITIONAL_BINARIES glib-compile-resources='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-compile-resources'
glib-genmarshal='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-genmarshal'
glib-mkenums='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-mkenums'
${OPTIONS}
OPTIONS_DEBUG
${OPTIONS_DEBUG}
OPTIONS_RELEASE
${OPTIONS_RELEASE}
ADDITIONAL_BINARIES
glib-compile-resources='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-compile-resources'
glib-genmarshal='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-genmarshal'
glib-mkenums='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-mkenums'
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'
)
vcpkg_install_meson(ADD_BIN_TO_PATH)

Expand Down
19 changes: 17 additions & 2 deletions ports/gdk-pixbuf/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gdk-pixbuf",
"version": "2.42.9",
"port-version": 4,
"port-version": 5,
"description": "Image loading library.",
"homepage": "https://gitlab.gnome.org/GNOME/gdk-pixbuf",
"license": "LGPL-2.1-or-later",
Expand All @@ -22,5 +22,20 @@
"host": true
},
"zlib"
]
],
"features": {
"introspection": {
"description": "build with introspection",
"dependencies": [
{
"name": "gobject-introspection",
"host": true
},
{
"name": "gobject-introspection",
"platform": "windows & x86"
}
]
}
}
}
38 changes: 32 additions & 6 deletions ports/graphene/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,47 @@ vcpkg_extract_source_archive(
fix_clang-cl.patch
)

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=disabled)
list(APPEND OPTIONS_RELEASE -Dintrospection=enabled)
else()
list(APPEND OPTIONS -Dintrospection=disabled)
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
-Dgtk_doc=false #Enable generating the API reference (depends on GTK-Doc)
-Dgobject_types=true #Enable GObject types (depends on GObject)
-Dintrospection=disabled #Enable GObject Introspection (depends on GObject)'
-Dtests=false
-Dinstalled_tests=false
ADDITIONAL_NATIVE_BINARIES glib-genmarshal='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-genmarshal'
glib-mkenums='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-mkenums'
ADDITIONAL_CROSS_BINARIES glib-genmarshal='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-genmarshal'
glib-mkenums='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-mkenums'
${OPTIONS}
OPTIONS_DEBUG
${OPTIONS_DEBUG}
OPTIONS_RELEASE
${OPTIONS_RELEASE}
ADDITIONAL_NATIVE_BINARIES
glib-genmarshal='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-genmarshal'
glib-mkenums='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-mkenums'
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'
ADDITIONAL_CROSS_BINARIES
glib-genmarshal='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-genmarshal'
glib-mkenums='${CURRENT_HOST_INSTALLED_DIR}/tools/glib/glib-mkenums'
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'
)

vcpkg_install_meson()
vcpkg_install_meson(ADD_BIN_TO_PATH)

vcpkg_copy_pdbs()

Expand Down
18 changes: 17 additions & 1 deletion ports/graphene/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "graphene",
"version": "1.10.8",
"port-version": 1,
"description": "A thin layer of types for graphic libraries.",
"homepage": "https://www.gtk.org/",
"license": "MIT",
Expand All @@ -16,5 +17,20 @@
"name": "vcpkg-tool-meson",
"host": true
}
]
],
"features": {
"introspection": {
"description": "build with introspection",
"dependencies": [
{
"name": "gobject-introspection",
"host": true
},
{
"name": "gobject-introspection",
"platform": "windows & x86"
}
]
}
}
}
53 changes: 39 additions & 14 deletions ports/gtk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ list(APPEND OPTIONS -Dbroadway-backend=false) #Enable the broadway (HTML5) gdk b
list(APPEND OPTIONS -Dwin32-backend=${win32}) #Enable the Windows gdk backend (only when building on Windows)
list(APPEND OPTIONS -Dmacos-backend=${osx}) #Enable the macOS gdk backend (only when building on macOS)

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=disabled)
list(APPEND OPTIONS_RELEASE -Dintrospection=enabled)
else()
list(APPEND OPTIONS -Dintrospection=disabled)
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
Expand All @@ -44,7 +60,6 @@ vcpkg_configure_meson(
-Dinstall-tests=false
-Dgtk_doc=false
-Dman-pages=false
-Dintrospection=disabled
-Dmedia-ffmpeg=disabled # Build the ffmpeg media backend
-Dmedia-gstreamer=disabled # Build the gstreamer media backend
-Dprint-cups=disabled # Build the cups print backend
Expand All @@ -53,21 +68,31 @@ vcpkg_configure_meson(
-Dsysprof=disabled # include tracing support for sysprof
-Dtracker=disabled # Enable Tracker3 filechooser search
-Dcolord=disabled # Build colord support for the CUPS printing backend
ADDITIONAL_NATIVE_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}'
sassc='${CURRENT_HOST_INSTALLED_DIR}/tools/sassc/bin/sassc${VCPKG_HOST_EXECUTABLE_SUFFIX}'
ADDITIONAL_CROSS_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}'
sassc='${CURRENT_HOST_INSTALLED_DIR}/tools/sassc/bin/sassc${VCPKG_HOST_EXECUTABLE_SUFFIX}'
OPTIONS_DEBUG
${OPTIONS_DEBUG}
OPTIONS_RELEASE
${OPTIONS_RELEASE}
ADDITIONAL_NATIVE_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}'
sassc='${CURRENT_HOST_INSTALLED_DIR}/tools/sassc/bin/sassc${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'
ADDITIONAL_CROSS_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}'
sassc='${CURRENT_HOST_INSTALLED_DIR}/tools/sassc/bin/sassc${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'
)

vcpkg_install_meson()
vcpkg_install_meson(ADD_BIN_TO_PATH)

# If somebody finds out how to access and forward env variables to
# the meson install script be my guest. Nevertheless the script still
Expand Down
46 changes: 45 additions & 1 deletion ports/gtk/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "gtk",
"version": "4.6.8",
"port-version": 1,
"description": "Portable library for creating graphical user interfaces.",
"homepage": "https://www.gtk.org/",
"license": "LGPL-2.0-only",
Expand Down Expand Up @@ -47,5 +48,48 @@
"name": "vcpkg-tool-meson",
"host": true
}
]
],
"features": {
"introspection": {
"description": "build with introspection",
"dependencies": [
{
"name": "atk",
"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": "graphene",
"default-features": false,
"features": [
"introspection"
]
},
{
"name": "pango",
"default-features": false,
"features": [
"introspection"
]
}
]
}
}
}
Loading

0 comments on commit ea389e3

Please sign in to comment.