Skip to content

Commit 001bf1c

Browse files
craftyguyjirutka
authored andcommitted
community/tootle: fix build, re-enable
Both of the patches here are submitted upstream: bleakgrey/tootle#339 bleakgrey/tootle#336 fixes #13140
1 parent 17203a3 commit 001bf1c

File tree

3 files changed

+134
-4
lines changed

3 files changed

+134
-4
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
From 4722a5c710261b95fbf455d9ec7b7967ca8e5c75 Mon Sep 17 00:00:00 2001
2+
From: Clayton Craft <[email protected]>
3+
Date: Tue, 26 Oct 2021 15:03:25 -0700
4+
Subject: [PATCH 1/2] Adhere to GLib.Object naming conventions for properties
5+
6+
Vala now validates property names against GLib.Object conventions, this
7+
fixes a compilation error as a result of this enforcement:
8+
9+
../src/API/Status.vala:27.5-27.23: error: Name `_url' is not valid for a GLib.Object property
10+
public string? _url { get; set; }
11+
^^^^^^^^^^^^^^^^^^^
12+
13+
Relevant Vala change:
14+
https://gitlab.gnome.org/GNOME/vala/-/commit/38d61fbff037687ea4772e6df85c7e22a74b335e
15+
16+
fixes #337
17+
18+
Signed-off-by: Clayton Craft <[email protected]>
19+
---
20+
src/API/Attachment.vala | 6 +++---
21+
src/API/Status.vala | 8 ++++----
22+
2 files changed, 7 insertions(+), 7 deletions(-)
23+
24+
diff --git a/src/API/Attachment.vala b/src/API/Attachment.vala
25+
index 5c66e79..3749bd7 100644
26+
--- a/src/API/Attachment.vala
27+
+++ b/src/API/Attachment.vala
28+
@@ -32,10 +32,10 @@ public class Tootle.API.Attachment : Entity {
29+
public string kind { get; set; }
30+
public string url { get; set; }
31+
public string? description { get; set; }
32+
- public string? _preview_url { get; set; }
33+
+ private string? t_preview_url { get; set; }
34+
public string? preview_url {
35+
- set { this._preview_url = value; }
36+
- get { return (this._preview_url == null || this._preview_url == "") ? url : _preview_url; }
37+
+ set { this.t_preview_url = value; }
38+
+ get { return (this.t_preview_url == null || this.t_preview_url == "") ? url : t_preview_url; }
39+
}
40+
41+
public static Attachment from (Json.Node node) throws Error {
42+
diff --git a/src/API/Status.vala b/src/API/Status.vala
43+
index 4de9b9d..7ebb2e5 100644
44+
--- a/src/API/Status.vala
45+
+++ b/src/API/Status.vala
46+
@@ -24,16 +24,16 @@ public class Tootle.API.Status : Entity, Widgetizable {
47+
public ArrayList<API.Mention>? mentions { get; set; default = null; }
48+
public ArrayList<API.Attachment>? media_attachments { get; set; default = null; }
49+
50+
- public string? _url { get; set; }
51+
+ private string? t_url { get; set; }
52+
public string url {
53+
owned get { return this.get_modified_url (); }
54+
- set { this._url = value; }
55+
+ set { this.t_url = value; }
56+
}
57+
string get_modified_url () {
58+
- if (this._url == null) {
59+
+ if (this.t_url == null) {
60+
return this.uri.replace ("/activity", "");
61+
}
62+
- return this._url;
63+
+ return this.t_url;
64+
}
65+
66+
public Status formal {
67+
--
68+
2.33.1
69+
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
From 09737d32285f0bad5555be61effab8d512809433 Mon Sep 17 00:00:00 2001
2+
From: Clayton Craft <[email protected]>
3+
Date: Tue, 26 Oct 2021 15:21:22 -0700
4+
Subject: [PATCH 2/2] Use reason_phrase instead of get_phrase
5+
6+
Based on the patch here:
7+
https://github.com/bleakgrey/tootle/pull/336
8+
9+
Rebased on 1.0 branch
10+
---
11+
src/Services/Cache.vala | 2 +-
12+
src/Services/Network.vala | 7 +------
13+
2 files changed, 2 insertions(+), 7 deletions(-)
14+
15+
diff --git a/src/Services/Cache.vala b/src/Services/Cache.vala
16+
index 2251697..2ed314e 100644
17+
--- a/src/Services/Cache.vala
18+
+++ b/src/Services/Cache.vala
19+
@@ -88,7 +88,7 @@ public class Tootle.Cache : GLib.Object {
20+
try {
21+
var code = msg.status_code;
22+
if (code != Soup.Status.OK) {
23+
- var error = network.describe_error (code);
24+
+ var error = msg.reason_phrase;
25+
throw new Oopsie.INSTANCE (@"Server returned $error");
26+
}
27+
28+
diff --git a/src/Services/Network.vala b/src/Services/Network.vala
29+
index fa2839c..d0143b0 100644
30+
--- a/src/Services/Network.vala
31+
+++ b/src/Services/Network.vala
32+
@@ -56,7 +56,7 @@ public class Tootle.Network : GLib.Object {
33+
else if (status == Soup.Status.CANCELLED)
34+
debug ("Message is cancelled. Ignoring callback invocation.");
35+
else
36+
- ecb ((int32) status, describe_error ((int32) status));
37+
+ ecb ((int32) status, msg.reason_phrase);
38+
});
39+
}
40+
catch (Error e) {
41+
@@ -65,11 +65,6 @@ public class Tootle.Network : GLib.Object {
42+
}
43+
}
44+
45+
- public string describe_error (uint code) {
46+
- var reason = Soup.Status.get_phrase (code);
47+
- return @"$code: $reason";
48+
- }
49+
-
50+
public void on_error (int32 code, string message) {
51+
warning (message);
52+
app.toast (message);
53+
--
54+
2.33.1
55+

community/tootle/APKBUILD

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
# Maintainer: Clayton Craft <[email protected]>
33
pkgname=tootle
44
pkgver=1.0
5-
pkgrel=0
5+
pkgrel=1
66
pkgdesc="Simple Mastodon client for Linux"
77
url="https://github.com/bleakgrey/tootle"
88
# riscv64 disabled due to missing rust in recursive dependency
99
arch="all !s390x !mips !mips64 !riscv64" # no libhandy
10-
arch="" # See https://gitlab.alpinelinux.org/alpine/aports/-/issues/13140
1110
license="GPL-3.0-or-later"
1211
makedepends="
1312
glib-dev
@@ -20,7 +19,10 @@ makedepends="
2019
vala
2120
"
2221
subpackages="$pkgname-lang"
23-
source="$pkgname-$pkgver.tar.gz::https://github.com/bleakgrey/tootle/archive/$pkgver.tar.gz"
22+
source="$pkgname-$pkgver.tar.gz::https://github.com/bleakgrey/tootle/archive/$pkgver.tar.gz
23+
0001-Adhere-to-GLib.Object-naming-conventions-for-propert.patch
24+
0002-Use-reason_phrase-instead-of-get_phrase.patch
25+
"
2426
options="!check" # no tests
2527

2628
build() {
@@ -31,4 +33,8 @@ build() {
3133
package() {
3234
DESTDIR="$pkgdir" meson install -C output
3335
}
34-
sha512sums="31eadfcc27cff26e8c84ecc56209e8bc9e0f616a9ab32a63208a89875597ecc668ac856a6044533b718c90f4acd286b7f07ca1386d6bb8d259a793e339a3f79d tootle-1.0.tar.gz"
36+
sha512sums="
37+
31eadfcc27cff26e8c84ecc56209e8bc9e0f616a9ab32a63208a89875597ecc668ac856a6044533b718c90f4acd286b7f07ca1386d6bb8d259a793e339a3f79d tootle-1.0.tar.gz
38+
f2c98f02e07bc8d065bee2c959f6339deb82f26ab69ad41de87f7792f1b794d00a817d8e3b02ea2170935eb983c07853c37f9d93eb6b5d2c78cc18f2057d35ca 0001-Adhere-to-GLib.Object-naming-conventions-for-propert.patch
39+
23de63b96506f01dd8619c7c13c8c58e2919fbfe20de531f48714ce017905c4762c3920ec3f7ebae8b42b393f2a751801d09ceb8352656895d55bbe76dc49917 0002-Use-reason_phrase-instead-of-get_phrase.patch
40+
"

0 commit comments

Comments
 (0)