Compare commits

...

8 Commits

3 changed files with 101 additions and 7 deletions

View File

@ -2,3 +2,4 @@
Create D bindings from GObject introspection files.

View File

@ -0,0 +1,64 @@
From f4dfc8cfb130280291db458629ab11b6904e5191 Mon Sep 17 00:00:00 2001
From: Mike Wey <mike@mikewey.eu>
Date: Wed, 23 Mar 2022 23:26:51 +0100
Subject: [PATCH] Fix segfault with the latest Glib.
---
source/gtd/GirFunction.d | 27 ++++++++-------------------
1 file changed, 8 insertions(+), 19 deletions(-)
diff --git a/source/gtd/GirFunction.d b/source/gtd/GirFunction.d
index 49a663d..6a8c15b 100644
--- a/source/gtd/GirFunction.d
+++ b/source/gtd/GirFunction.d
@@ -398,7 +398,7 @@ final class GirFunction
if ( returnType.length > -1 && param == params[returnType.length] && params[returnType.length].direction != GirParamDirection.Default )
continue;
- if ( paramCount == 0 && strct.type == GirStructType.Record && isInstanceParam(param) )
+ if ( paramCount == 0 && strct.type == GirStructType.Record && isInstanceParam(param) && type != GirFunctionType.Constructor )
continue;
if ( paramCount++ > 0 )
@@ -444,26 +444,15 @@ final class GirFunction
if ( instanceParam || ( !params.empty && isInstanceParam(params[0])) )
{
- GirStruct dType;
-
- if ( instanceParam )
- {
- dType = strct.pack.getStruct(instanceParam.type.name);
-
- if ( dType.cType != instanceParam.type.cType.removePtr() && !instanceParam.type.cType.among("gpointer", "gconstpointer") )
- gtkCall ~= "cast("~ stringToGtkD(instanceParam.type.cType, wrapper.aliasses, localAliases()) ~")";
- }
- else
- {
- dType = strct.pack.getStruct(params[0].type.name);
+ GirParam instance = instanceParam ? instanceParam : params[0];
+ GirStruct dType = strct.pack.getStruct(instance.type.name);
- if ( dType.cType != params[0].type.cType.removePtr() && !params[0].type.cType.among("gpointer", "gconstpointer") )
- gtkCall ~= "cast("~ stringToGtkD(params[0].type.cType, wrapper.aliasses, localAliases()) ~")";
- }
+ if ( dType.cType != instance.type.cType.removePtr() && !instance.type.cType.among("gpointer", "gconstpointer") )
+ gtkCall ~= "cast("~ stringToGtkD(instance.type.cType, wrapper.aliasses, localAliases()) ~")";
- if ( instanceParam && instanceParam.type.name in strct.structWrap )
+ if ( instance && instance.type.name in strct.structWrap )
{
- GirStruct insType = strct.pack.getStruct(strct.structWrap[instanceParam.type.name]);
+ GirStruct insType = strct.pack.getStruct(strct.structWrap[instance.type.name]);
if ( insType )
dType = insType;
@@ -471,7 +460,7 @@ final class GirFunction
if ( type == GirFunctionType.Constructor || strct.isNamespace() || strct.noNamespace )
{
- string id = tokenToGtkD(instanceParam.name, wrapper.aliasses, localAliases());
+ string id = tokenToGtkD(instance.name, wrapper.aliasses, localAliases());
if ( dType && !(dType.isNamespace() || dType.noNamespace) )
gtkCall ~= "("~ id ~" is null) ? null : "~ id ~"."~ dType.getHandleFunc() ~"()";

View File

@ -1,35 +1,37 @@
Name: girtod
Version: 0.21.0
Version: 0.23.2
Release: 3mamba
Summary: Create D bindings from GObject introspection files
Group: Development/Tools
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/gtkd-developers/gir-to-d.git
URL: https://github.com/gtkd-developers/gir-to-d
Source: https://github.com/gtkd-developers/gir-to-d.git/v%{version}/gir-to-d-%{version}.tar.bz2
Patch0: girtod-0.21.0-gobject-introspection-1.66.patch
Patch1: girtod-0.22.0-fixsegfault.patch
License: LGPL
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: ldconfig
BuildRequires: libgcc
BuildRequires: libldc-devel
## AUTOBUILDREQ-END
BuildRequires: libldc-devel >= 0:1.40.0-1mamba
BuildRequires: ldc
BuildRequires: libldc-devel >= 1.23.0
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Create D bindings from GObject introspection files.
%debug_package
%prep
%setup -q -n gir-to-d-%{version}
%patch0 -p1
%build
export DC=ldc2
# Instanciate all templates. Fixes:
# undefined reference to `_D6object__T8opEqualsTxC3gtd11GirFunctionQnTxQwZQBkFxQBexQBiZb'
export DFLAGS="--allinst"
%meson
%meson_build
@ -47,6 +49,33 @@ Create D bindings from GObject introspection files.
%doc COPYING
%changelog
* Sat Feb 15 2025 Automatic Build System <autodist@mambasoft.it> 0.23.2-3mamba
- rebuilt by autoport with build requirements: libldc-devel>=0:1.40.0-1mamba
* Wed May 15 2024 Automatic Build System <autodist@mambasoft.it> 0.23.2-2mamba
- rebuilt by autoport with build requirements: libldc-devel>=1.38.0-1mamba
* Thu Mar 21 2024 Automatic Build System <autodist@openmamba.org> 0.23.2-1mamba
- automatic update by autodist
* Sun Nov 05 2023 Automatic Build System <autodist@mambasoft.it> 0.23.1-2mamba
- rebuilt by autoport with build requirements: libldc-devel>=1.35.0-1mamba
* Mon May 29 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 0.23.1-1mamba
- update to 0.23.1
* Mon May 29 2023 Sdk Build System <sdk@mambasoft.it> 0.22.0-4mamba
- rebuilt by autoport with build requirements: libldc-devel>=0:1.32.2-1mamba
* Mon Mar 13 2023 Silvan Calarco <silvan.calarco@mambasoft.it> 0.22.0-3mamba
- rebuilt with ldc 1.31.0
* Mon May 02 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 0.22.0-2mamba
- rebuilt with ldc 1.29.0
* Thu Oct 28 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 0.22.0-1mamba
- update to 0.22.0
* Thu Oct 22 2020 Silvan Calarco <silvan.calarco@mambasoft.it> 0.21.0-3mamba
- rebuilt with ldc 1.23.0
- adde dpatch to fix glibd build with gobject-introspection 1.66 (https://github.com/gtkd-developers/GlibD/issues/10)