diff --git a/girtod-0.22.0-fixsegfault.patch b/girtod-0.22.0-fixsegfault.patch new file mode 100644 index 0000000..b3e0680 --- /dev/null +++ b/girtod-0.22.0-fixsegfault.patch @@ -0,0 +1,64 @@ +From f4dfc8cfb130280291db458629ab11b6904e5191 Mon Sep 17 00:00:00 2001 +From: Mike Wey +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() ~"()"; diff --git a/girtod.spec b/girtod.spec index 1f48d40..86902e3 100644 --- a/girtod.spec +++ b/girtod.spec @@ -1,6 +1,6 @@ Name: girtod Version: 0.22.0 -Release: 1mamba +Release: 2mamba Summary: Create D bindings from GObject introspection files Group: Development/Tools Vendor: openmamba @@ -9,6 +9,7 @@ Packager: Silvan Calarco 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 @@ -16,7 +17,7 @@ BuildRequires: libgcc BuildRequires: libldc-devel ## AUTOBUILDREQ-END BuildRequires: ldc -BuildRequires: libldc-devel >= 1.28.0 +BuildRequires: libldc-devel >= 1.29.0 %description Create D bindings from GObject introspection files. @@ -26,8 +27,14 @@ Create D bindings from GObject introspection files. %prep %setup -q -n gir-to-d-%{version} #%patch0 -p1 +%patch1 -p1 -b .fixsegfault %build +export DC=ldc2 +# Instanciate all templates. Fixes: +# undefined reference to `_D6object__T8opEqualsTxC3gtd11GirFunctionQnTxQwZQBkFxQBexQBiZb' +export DFLAGS="--allinst" + %meson %meson_build @@ -45,6 +52,9 @@ Create D bindings from GObject introspection files. %doc COPYING %changelog +* Mon May 02 2022 Silvan Calarco 0.22.0-2mamba +- rebuilt with ldc 1.29.0 + * Thu Oct 28 2021 Silvan Calarco 0.22.0-1mamba - update to 0.22.0