valabind: rebuild for vala-0.48

This commit is contained in:
Daniel Kolesa 2020-08-18 06:37:47 +02:00
parent e989182258
commit 96e2ed5568
2 changed files with 45 additions and 1 deletions

View File

@ -0,0 +1,44 @@
From 9d4fb181e24346a8c5d570290fa9892ce10c8c3b Mon Sep 17 00:00:00 2001
From: Rico Tzschichholz <ricotz@ubuntu.com>
Date: Thu, 6 Feb 2020 09:45:17 +0100
Subject: [PATCH] Fix build with Vala 0.48
---
gowriter.vala | 4 ++++
nodeffiwriter.vala | 5 +++++
2 files changed, 9 insertions(+)
diff --git a/gowriter.vala b/gowriter.vala
index 56d9fbe..0fb09a6 100644
--- gowriter.vala
+++ gowriter.vala
@@ -214,7 +214,11 @@ public class GoNamer {
}
private string mangle_datatype(DataType d) {
+#if VALA_0_48
+ string ret = d.type_symbol.name; // i think should unify with get_type_declaration?
+#else
string ret = d.data_type.name; // i think should unify with get_type_declaration?
+#endif
if (d.get_type_arguments().size > 0) {
foreach(var dd in d.get_type_arguments()) {
ret += "_";
diff --git a/nodeffiwriter.vala b/nodeffiwriter.vala
index 84fede0..eba6329 100644
--- nodeffiwriter.vala
+++ nodeffiwriter.vala
@@ -85,8 +85,13 @@ public class NodeFFIWriter : ValabindWriter {
string _type = type.to_string ();
string local_ns_pfx = ns_pfx;
+#if VALA_0_48
+ if (type.type_symbol != null && type.type_symbol.parent_symbol is Namespace) {
+ Namespace local_ns = (Namespace)type.type_symbol.parent_symbol;
+#else
if (type.data_type != null && type.data_type.parent_symbol is Namespace) {
Namespace local_ns = (Namespace)type.data_type.parent_symbol;
+#endif
if (use_namespace(local_ns))
local_ns_pfx = local_ns.get_full_name()+".";
}

View File

@ -1,7 +1,7 @@
# Template file for 'valabind'
pkgname=valabind
version=1.7.1
revision=4
revision=5
build_style=meson
hostmakedepends="pkg-config vala-devel git"
makedepends="vala-devel glib-devel"