package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
################################################################################
|
|
|
|
#
|
|
|
|
# gobject-introspection
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
2021-05-01 21:56:20 +02:00
|
|
|
GOBJECT_INTROSPECTION_VERSION_MAJOR = 1.68
|
|
|
|
GOBJECT_INTROSPECTION_VERSION = $(GOBJECT_INTROSPECTION_VERSION_MAJOR).0
|
package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
GOBJECT_INTROSPECTION_SITE = http://ftp.gnome.org/pub/GNOME/sources/gobject-introspection/$(GOBJECT_INTROSPECTION_VERSION_MAJOR)
|
|
|
|
GOBJECT_INTROSPECTION_SOURCE = gobject-introspection-$(GOBJECT_INTROSPECTION_VERSION).tar.xz
|
|
|
|
GOBJECT_INTROSPECTION_INSTALL_STAGING = YES
|
|
|
|
GOBJECT_INTROSPECTION_AUTORECONF = YES
|
|
|
|
GOBJECT_INTROSPECTION_LICENSE = LGPL-2.0+, GPL-2.0+, BSD-2-Clause
|
|
|
|
GOBJECT_INTROSPECTION_LICENSE_FILES = COPYING.LGPL COPYING.GPL giscanner/scannerlexer.l
|
|
|
|
|
|
|
|
GOBJECT_INTROSPECTION_DEPENDENCIES = \
|
|
|
|
host-autoconf-archive \
|
|
|
|
host-gobject-introspection \
|
|
|
|
host-prelink-cross \
|
|
|
|
host-qemu \
|
|
|
|
libffi \
|
|
|
|
libglib2 \
|
|
|
|
python3 \
|
|
|
|
zlib
|
|
|
|
|
|
|
|
HOST_GOBJECT_INTROSPECTION_DEPENDENCIES = \
|
|
|
|
host-bison \
|
|
|
|
host-flex \
|
|
|
|
host-libglib2 \
|
|
|
|
host-python3
|
|
|
|
|
|
|
|
# g-ir-scanner will default to /usr/bin/ld for linking if this is not set.
|
|
|
|
GOBJECT_INTROSPECTION_NINJA_ENV += \
|
|
|
|
CC="$(TARGET_CC)"
|
|
|
|
|
package/gobject-introspection: fix host-linking
When building, gobject-introspection uses tools/g-ir-scanner to build
several .gir and .typelib files. To that goal, it internally builds and
runs a few small executables linked to libglib2. However, it does not
pass them any LDFLAGS that we could pass the buildsystem. So, it either
ends up trying to link with the system's libglib2, which may not be
instaleld (build breaks), or is installed to an other version (build may
break); in either cases, this is not good...
g-ir-scanner can use the argument --lib-dirs-envvar to pass a list of
library directories to search for. However, during the build process,
this is not possible due to the build process calling g-ir-scanner
directly without letting the user (us) pass any option.
When discussing with upstream, they explained that the only solution in
that case was to set and export LD_LIBRARY_PATH to point to the location
where the correct libglib2 was installed.
Ergo, that's what we do.
This fix has the added benefit of allowing the host gobject-introspection
to build the host .gir, .rnc, and .typelib files, which some packages
may require.
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-15 16:33:19 +01:00
|
|
|
# When building, gobject-introspection uses tools/g-ir-scanner to build several
|
|
|
|
# .gir and .typelib files. g-ir-scanner does not use LDFLAGS, and by default,
|
|
|
|
# links to the system-installed libglib2 path. To remedy this issue, defining
|
|
|
|
# LD_LIBRARY_PATH forces g-ir-scanner to use our host installed libglib2 files.
|
|
|
|
HOST_GOBJECT_INTROSPECTION_NINJA_ENV += \
|
|
|
|
LD_LIBRARY_PATH="$(if $(LD_LIBRARY_PATH),$(LD_LIBRARY_PATH):)$(HOST_DIR)/lib"
|
package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
|
|
|
|
# Use the host gi-scanner to prevent the scanner from generating incorrect
|
|
|
|
# elf classes.
|
|
|
|
GOBJECT_INTROSPECTION_CONF_OPTS = \
|
2021-05-01 21:56:20 +02:00
|
|
|
-Dgi_cross_use_prebuilt_gi=true \
|
2020-03-12 20:42:55 +01:00
|
|
|
-Dgi_cross_binary_wrapper="$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper" \
|
|
|
|
-Dgi_cross_ldd_wrapper="$(STAGING_DIR)/usr/bin/g-ir-scanner-lddwrapper" \
|
|
|
|
-Dbuild_introspection_data=true \
|
|
|
|
-Ddoctool=disabled
|
package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_CAIRO),y)
|
|
|
|
GOBJECT_INTROSPECTION_DEPENDENCIES += cairo
|
2020-03-12 20:42:55 +01:00
|
|
|
GOBJECT_INTROSPECTION_CONF_OPTS += -Dcairo=enabled
|
|
|
|
else
|
|
|
|
GOBJECT_INTROSPECTION_CONF_OPTS += -Dcairo=disabled
|
package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
# GI_SCANNER_DISABLE_CACHE=1 prevents g-ir-scanner from writing cache data to ${HOME}
|
|
|
|
GOBJECT_INTROSPECTION_CONF_ENV = \
|
|
|
|
GI_SCANNER_DISABLE_CACHE=1
|
|
|
|
|
|
|
|
HOST_GOBJECT_INTROSPECTION_CONF_ENV = \
|
|
|
|
GI_SCANNER_DISABLE_CACHE=1
|
|
|
|
|
|
|
|
# Make sure g-ir-tool-template uses the host python.
|
2021-05-01 21:56:20 +02:00
|
|
|
define GOBJECT_INTROSPECTION_FIX_TOOLS_PYTHON_PATH
|
|
|
|
$(SED) '1s%#!.*%#!$(HOST_DIR)/bin/python3%' $(@D)/tools/g-ir-tool-template.in
|
package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
endef
|
|
|
|
HOST_GOBJECT_INTROSPECTION_PRE_CONFIGURE_HOOKS += GOBJECT_INTROSPECTION_FIX_TOOLTEMPLATE_PYTHON_PATH
|
|
|
|
|
|
|
|
# Perform the following:
|
|
|
|
# - Just as above, Ensure that g-ir-tool-template.in uses the host python.
|
|
|
|
# - Install all of the wrappers needed to build gobject-introspection.
|
|
|
|
# - Create a safe modules directory which does not exist so we don't load random things
|
|
|
|
# which may then get deleted (or their dependencies) and potentially segfault
|
|
|
|
define GOBJECT_INTROSPECTION_INSTALL_PRE_WRAPPERS
|
2021-05-01 21:56:20 +02:00
|
|
|
$(SED) '1s%#!.*%#!$(HOST_DIR)/bin/python3%' $(@D)/tools/g-ir-tool-template.in
|
package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
|
|
|
|
$(INSTALL) -D -m 755 $(GOBJECT_INTROSPECTION_PKGDIR)/g-ir-scanner-lddwrapper.in \
|
|
|
|
$(STAGING_DIR)/usr/bin/g-ir-scanner-lddwrapper
|
|
|
|
|
|
|
|
$(INSTALL) -D -m 755 $(GOBJECT_INTROSPECTION_PKGDIR)/g-ir-scanner-qemuwrapper.in \
|
|
|
|
$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper
|
|
|
|
$(SED) "s%@QEMU_USER@%$(QEMU_USER)%g" \
|
|
|
|
$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper
|
|
|
|
$(SED) "s%@TOOLCHAIN_HEADERS_VERSION@%$(BR2_TOOLCHAIN_HEADERS_AT_LEAST)%g" \
|
|
|
|
$(STAGING_DIR)/usr/bin/g-ir-scanner-qemuwrapper
|
|
|
|
|
|
|
|
# Use a modules directory which does not exist so we don't load random things
|
|
|
|
# which may then get deleted (or their dependencies) and potentially segfault
|
|
|
|
mkdir -p $(STAGING_DIR)/usr/lib/gio/modules-dummy
|
|
|
|
endef
|
|
|
|
GOBJECT_INTROSPECTION_PRE_CONFIGURE_HOOKS += GOBJECT_INTROSPECTION_INSTALL_PRE_WRAPPERS
|
|
|
|
|
|
|
|
# Move the real compiler and scanner to .real, and replace them with the wrappers.
|
|
|
|
# Using .real has the following advantages:
|
|
|
|
# - There is no need to change the logic for other packages.
|
|
|
|
# - The wrappers call the .real files using qemu.
|
|
|
|
define GOBJECT_INTROSPECTION_INSTALL_WRAPPERS
|
|
|
|
# Move the real binaries to their names.real, then replace them with
|
|
|
|
# the wrappers.
|
|
|
|
$(foreach w,g-ir-compiler g-ir-scanner,
|
|
|
|
mv $(STAGING_DIR)/usr/bin/$(w) $(STAGING_DIR)/usr/bin/$(w).real
|
|
|
|
$(INSTALL) -D -m 755 \
|
|
|
|
$(GOBJECT_INTROSPECTION_PKGDIR)/$(w).in $(STAGING_DIR)/usr/bin/$(w)
|
|
|
|
)
|
package/gobject-introspection: export variables in g-ir-scanner
When building .gir .typelib files, the g-ir-scanner wrapper calls the host
g-ir-scanner. g-ir-scanner calls ccompiler.py, which searches for the following
environment variables:
CPP, CC, CXX, CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS
These environment variables are empty by default, and as such ccompiler.py
defaults to either using the system tools (CC, CXX, and CPP) or leaving
the variables blank (LDFLAGS, CFLAGS, and CPPFLAGS.)
For autotools packages, this issue does not occur because autotools uses
Makefile.introspection found on the staging directory in
usr/share/gobject-introspection-1.0/ which automatically exports the above
variables.
However, for meson, the above variables are not exported when meson calls
g-ir-scanner to build .gir and .typelib files, which results in linking errors.
Exporting these variables in the g-ir-scanner wrapper fixes these issues and
ensures all build systems can generate .gir and .typelib files properly.
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Tested-by: Adam Duskett <aduskett@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-03-15 16:33:20 +01:00
|
|
|
$(SED) "s%@BASENAME_TARGET_CPP@%$(notdir $(TARGET_CPP))%g" \
|
|
|
|
-e "s%@BASENAME_TARGET_CC@%$(notdir $(TARGET_CC))%g" \
|
|
|
|
-e "s%@BASENAME_TARGET_CXX@%$(notdir $(TARGET_CXX))%g" \
|
|
|
|
-e "s%@TARGET_CPPFLAGS@%$(TARGET_CPPFLAGS)%g" \
|
|
|
|
-e "s%@TARGET_CFLAGS@%$(TARGET_CFLAGS)%g" \
|
|
|
|
-e "s%@TARGET_CXXFLAGS@%$(TARGET_CXXFLAGS)%g" \
|
|
|
|
-e "s%@TARGET_LDFLAGS@%$(TARGET_LDFLAGS)%g" \
|
|
|
|
$(STAGING_DIR)/usr/bin/g-ir-scanner
|
|
|
|
|
package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
# Gobject-introspection installs Makefile.introspection in
|
|
|
|
# $(STAGING_DIR)/usr/share which is needed for autotools-based programs to
|
2021-08-08 12:16:50 +02:00
|
|
|
# build .gir and .typelib files. Unfortunately, gobject-introspection-1.0.pc
|
package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
# uses $(prefix)/share as the directory, which
|
|
|
|
# causes the host /usr/share being used instead of $(STAGING_DIR)/usr/share.
|
2021-08-08 12:16:50 +02:00
|
|
|
# Change datadir to $(libdir)/../share which will prefix $(STAGING_DIR)
|
package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
# to the correct location.
|
2021-08-10 00:42:14 +02:00
|
|
|
$(SED) "s%^datadir=.*%datadir=\$${libdir}/../share%g" \
|
package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
$(STAGING_DIR)/usr/lib/pkgconfig/gobject-introspection-1.0.pc
|
|
|
|
|
|
|
|
# By default, girdir and typelibdir use datadir and libdir as their prefix,
|
|
|
|
# of which pkg-config appends the sysroot directory. This results in files
|
|
|
|
# being installed in $(STAGING_DIR)/$(STAGING_DIR)/path/to/files.
|
2021-08-10 00:35:47 +02:00
|
|
|
# Changing the prefix to prefix prevents this error.
|
|
|
|
$(SED) "s%girdir=.*%girdir=\$${prefix}/share/gir-1.0%g" \
|
package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
$(STAGING_DIR)/usr/lib/pkgconfig/gobject-introspection-1.0.pc
|
|
|
|
|
2021-08-10 00:35:47 +02:00
|
|
|
$(SED) "s%typelibdir=.*%typelibdir=\$${prefix}/lib/girepository-1.0%g" \
|
package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
$(STAGING_DIR)/usr/lib/pkgconfig/gobject-introspection-1.0.pc
|
2021-09-01 21:13:06 +02:00
|
|
|
|
|
|
|
# Set includedir to $(STAGING_DIR)/usr/share/gir-1.0 instead of . or
|
|
|
|
# g-ir-compiler won't find .gir files resulting in a build failure for
|
|
|
|
# autotools-based based programs
|
|
|
|
$(SED) "s%includedir=.%includedir=$(STAGING_DIR)/usr/share/gir-1.0%g" \
|
|
|
|
$(STAGING_DIR)/usr/share/gobject-introspection-1.0/Makefile.introspection
|
package/gobject-introspection: new package
GObject introspection is a middleware layer between C
libraries (using GObject) and language bindings. The C library
can be scanned at compile time and generate a metadata file,
in addition to the actual native C library. Then at runtime,
language bindings can read this metadata and automatically
provide bindings to call into the C library.
There's an XML format called GIR used by GObject-Introspection.
The purpose of it is to provide a standard structure to access the complete
available API that a library or other unit of code exports. It's
language-agnostic using namespaces to separate core, language, or
library-specific functionality.
Cross-compiling gobject-introspection is not an easy task. The main issue is
that in the process of creating the XML files, gobject-introspection must first
run and scan the binary, which, if the binary is cross-compiled, would not
typically be possible from the host system.
Because of this limitation, we use several wrappers to call instead first out
qemu, which runs the native scanner to create the binaries.
There are seven total patches and four different wrapper files needed to
successfully cross-compile and run this package, many of them are from
open-embedded, but one of them is of my own doing.
1) Revert a previous, incomplete attempt at adding cross-compiling support.
2) Add support for cross-compiling with meson.
3) Disable tests.
4) Add an option to use a binary wrapper; this patch will force giscanner to
use a wrapper executable to run binaries it's producing, instead of
attempting to run them from the host.
5) Add an option to use an LDD wrapper, again, useful for cross-compiled
environments.
6) Add a --lib-dirs-envar option to pass to giscanner. (See patch for details.)
7) Add rpath-links to ccompiler: when passing the PACKAGE_GIR_EXTRA_LIBS_PATH
to the ccompiler.py script, ccompiler.py needs to add -Wl,-rpath-link to the
environment for the package to correctly link against the passed on paths.
8) Ignore error return codes from ldd-wrapper because prelink-rtld returns 127
when it can't find a library, which breaks subprocess.check_output().
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
Tested-by: Yegor Yefremov <yegorslists@googlemail.com>
Tested-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
[yann.morin.1998@free.fr:
- host-prelink-cross has no Kconfig entry
- reorder dependencies for arch deps first
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-02-11 17:34:04 +01:00
|
|
|
endef
|
|
|
|
GOBJECT_INTROSPECTION_POST_INSTALL_STAGING_HOOKS += GOBJECT_INTROSPECTION_INSTALL_WRAPPERS
|
|
|
|
|
|
|
|
# Only .typelib files are needed to run.
|
|
|
|
define GOBJECT_INTROSPECTION_REMOVE_DEVELOPMENT_FILES
|
|
|
|
find $(TARGET_DIR)/usr/share \( -iname "*.gir" -o -iname \*.rnc \) -delete
|
|
|
|
endef
|
|
|
|
GOBJECT_INTROSPECTION_TARGET_FINALIZE_HOOKS += GOBJECT_INTROSPECTION_REMOVE_DEVELOPMENT_FILES
|
|
|
|
|
|
|
|
$(eval $(meson-package))
|
|
|
|
$(eval $(host-meson-package))
|