rebuilt with ldc 1.29.0 [release 0.22.0-2mamba;Mon May 02 2022]

This commit is contained in:
Silvan Calarco 2024-01-05 23:01:55 +01:00
parent ac145babb4
commit 1551e1ca18
2 changed files with 76 additions and 2 deletions

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,6 +1,6 @@
Name: girtod Name: girtod
Version: 0.22.0 Version: 0.22.0
Release: 1mamba Release: 2mamba
Summary: Create D bindings from GObject introspection files Summary: Create D bindings from GObject introspection files
Group: Development/Tools Group: Development/Tools
Vendor: openmamba Vendor: openmamba
@ -9,6 +9,7 @@ Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/gtkd-developers/gir-to-d 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 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 Patch0: girtod-0.21.0-gobject-introspection-1.66.patch
Patch1: girtod-0.22.0-fixsegfault.patch
License: LGPL License: LGPL
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
@ -16,7 +17,7 @@ BuildRequires: libgcc
BuildRequires: libldc-devel BuildRequires: libldc-devel
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
BuildRequires: ldc BuildRequires: ldc
BuildRequires: libldc-devel >= 1.28.0 BuildRequires: libldc-devel >= 1.29.0
%description %description
Create D bindings from GObject introspection files. Create D bindings from GObject introspection files.
@ -26,8 +27,14 @@ Create D bindings from GObject introspection files.
%prep %prep
%setup -q -n gir-to-d-%{version} %setup -q -n gir-to-d-%{version}
#%patch0 -p1 #%patch0 -p1
%patch1 -p1 -b .fixsegfault
%build %build
export DC=ldc2
# Instanciate all templates. Fixes:
# undefined reference to `_D6object__T8opEqualsTxC3gtd11GirFunctionQnTxQwZQBkFxQBexQBiZb'
export DFLAGS="--allinst"
%meson %meson
%meson_build %meson_build
@ -45,6 +52,9 @@ Create D bindings from GObject introspection files.
%doc COPYING %doc COPYING
%changelog %changelog
* 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 * Thu Oct 28 2021 Silvan Calarco <silvan.calarco@mambasoft.it> 0.22.0-1mamba
- update to 0.22.0 - update to 0.22.0