unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#52842] gnu: tootle: Fix build.
@ 2021-12-28  5:00 Taiju HIGASHI
  2021-12-28  5:03 ` [bug#52842] [PATCH] " Taiju HIGASHI
  0 siblings, 1 reply; 3+ messages in thread
From: Taiju HIGASHI @ 2021-12-28  5:00 UTC (permalink / raw)
  To: 52842

Hi,

When I installed tootle, it failed to build, so I wrote a patch for it.
This patch is implemented based on the build process of Arch Linux and Alpine
Linux.

Reference:
  Arch:
    https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=tootle&id=983f732380a292968682572239e10fca42358054
  Alpine:
    https://gitlab.alpinelinux.org/alpine/aports/-/blob/899841f0052fb5768afac44ec410f850507c0282/community/tootle/APKBUILD

----------------------------------------------------------------
Taiju HIGASHI (1):
      gnu: tootle: Fix build.

 gnu/packages/mastodon.scm                          | 28 +++++----
 ...-Adhere-to-GLib.Object-naming-conventions.patch | 66 ++++++++++++++++++++++
 ...e-Use-reason_phrase-instead-of-get_phrase.patch | 48 ++++++++++++++++
 3 files changed, 132 insertions(+), 10 deletions(-)
 create mode 100644 gnu/packages/patches/tootle-Adhere-to-GLib.Object-naming-conventions.patch
 create mode 100644 gnu/packages/patches/tootle-Use-reason_phrase-instead-of-get_phrase.patch




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#52842] [PATCH] gnu: tootle: Fix build.
  2021-12-28  5:00 [bug#52842] gnu: tootle: Fix build Taiju HIGASHI
@ 2021-12-28  5:03 ` Taiju HIGASHI
  2022-01-05 22:07   ` bug#52842: " Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Taiju HIGASHI @ 2021-12-28  5:03 UTC (permalink / raw)
  To: 52842; +Cc: Taiju HIGASHI

---
 gnu/packages/mastodon.scm                     | 28 +++++---
 ...re-to-GLib.Object-naming-conventions.patch | 66 +++++++++++++++++++
 ...-reason_phrase-instead-of-get_phrase.patch | 48 ++++++++++++++
 3 files changed, 132 insertions(+), 10 deletions(-)
 create mode 100644 gnu/packages/patches/tootle-Adhere-to-GLib.Object-naming-conventions.patch
 create mode 100644 gnu/packages/patches/tootle-Use-reason_phrase-instead-of-get_phrase.patch

diff --git a/gnu/packages/mastodon.scm b/gnu/packages/mastodon.scm
index 8a8e2e7786..7ac02c3cf0 100644
--- a/gnu/packages/mastodon.scm
+++ b/gnu/packages/mastodon.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2021 Taiju HIGASHI <higashi@taiju.info>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,6 +25,7 @@ (define-module (gnu packages mastodon)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (gnu packages)
   #:use-module (gnu packages check)
   #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gettext)
@@ -79,15 +81,21 @@ (define-public tootle
     (name "tootle")
     (version "1.0")
     (source
-      (origin
-        (method git-fetch)
-        (uri (git-reference
-               (url "https://github.com/bleakgrey/tootle")
-               (commit version)))
-        (file-name (git-file-name name version))
-        (sha256
-         (base32
-          "1nm57239mhdq462an6bnhdlijpijxmjs9mqbyirwxwa048d3n4rm"))))
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/bleakgrey/tootle")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1nm57239mhdq462an6bnhdlijpijxmjs9mqbyirwxwa048d3n4rm"))
+       (patches
+        (search-patches
+         ;; https://github.com/bleakgrey/tootle/pull/339
+         "tootle-Adhere-to-GLib.Object-naming-conventions.patch"
+         ;; https://github.com/bleakgrey/tootle/pull/322
+         "tootle-Use-reason_phrase-instead-of-get_phrase.patch"))))
     (build-system meson-build-system)
     (arguments
      `(#:glib-or-gtk? #t
@@ -125,7 +133,7 @@ (define-public tootle
            json-glib
            libgee
            libhandy
-           libsoup
+           libsoup-minimal-2
            vala
            xdg-utils))
     (home-page "https://github.com/bleakgrey/tootle")
diff --git a/gnu/packages/patches/tootle-Adhere-to-GLib.Object-naming-conventions.patch b/gnu/packages/patches/tootle-Adhere-to-GLib.Object-naming-conventions.patch
new file mode 100644
index 0000000000..08ee23dd8f
--- /dev/null
+++ b/gnu/packages/patches/tootle-Adhere-to-GLib.Object-naming-conventions.patch
@@ -0,0 +1,66 @@
+From 0816105028c26965e37c9afc7c598854f3fecde1 Mon Sep 17 00:00:00 2001
+From: Clayton Craft <clayton@craftyguy.net>
+Date: Tue, 26 Oct 2021 15:03:25 -0700
+Subject: [PATCH] Adhere to GLib.Object naming conventions for properties
+
+Vala now validates property names against GLib.Object conventions, this
+fixes a compilation error as a result of this enforcement:
+
+../src/API/Status.vala:27.5-27.23: error: Name `_url' is not valid for a GLib.Object property
+    public string? _url { get; set; }
+    ^^^^^^^^^^^^^^^^^^^
+
+Relevant Vala change:
+https://gitlab.gnome.org/GNOME/vala/-/commit/38d61fbff037687ea4772e6df85c7e22a74b335e
+
+fixes #337
+
+Signed-off-by: Clayton Craft <clayton@craftyguy.net>
+---
+ src/API/Attachment.vala | 6 +++---
+ src/API/Status.vala     | 8 ++++----
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/src/API/Attachment.vala b/src/API/Attachment.vala
+index 88bc5bb..35c4018 100644
+--- a/src/API/Attachment.vala
++++ b/src/API/Attachment.vala
+@@ -4,10 +4,10 @@ public class Tootle.API.Attachment : Entity, Widgetizable {
+ 	public string kind { get; set; default = "unknown"; }
+ 	public string url { get; set; }
+ 	public string? description { get; set; }
+-	public string? _preview_url { get; set; }
++	private string? t_preview_url { get; set; }
+ 	public string? preview_url {
+-		set { this._preview_url = value; }
+-		get { return (this._preview_url == null || this._preview_url == "") ? url : _preview_url; }
++		set { this.t_preview_url = value; }
++		get { return (this.t_preview_url == null || this.t_preview_url == "") ? url : t_preview_url; }
+ 	}
+ 
+ 	public File? source_file { get; set; }
+diff --git a/src/API/Status.vala b/src/API/Status.vala
+index 4f92cdb..00e8a9f 100644
+--- a/src/API/Status.vala
++++ b/src/API/Status.vala
+@@ -28,16 +28,16 @@ public class Tootle.API.Status : Entity, Widgetizable {
+     public ArrayList<API.Mention>? mentions { get; set; default = null; }
+     public ArrayList<API.Attachment>? media_attachments { get; set; default = null; }
+ 
+-    public string? _url { get; set; }
++    private string? t_url { get; set; }
+     public string url {
+         owned get { return this.get_modified_url (); }
+-        set { this._url = value; }
++        set { this.t_url = value; }
+     }
+     string get_modified_url () {
+-        if (this._url == null) {
++        if (this.t_url == null) {
+             return this.uri.replace ("/activity", "");
+         }
+-        return this._url;
++        return this.t_url;
+     }
+ 
+     public Status formal {
diff --git a/gnu/packages/patches/tootle-Use-reason_phrase-instead-of-get_phrase.patch b/gnu/packages/patches/tootle-Use-reason_phrase-instead-of-get_phrase.patch
new file mode 100644
index 0000000000..72a1d1ecfa
--- /dev/null
+++ b/gnu/packages/patches/tootle-Use-reason_phrase-instead-of-get_phrase.patch
@@ -0,0 +1,48 @@
+From 858ee78fbebe161a4cdd707a469dc0f045211a51 Mon Sep 17 00:00:00 2001
+From: Max Harmathy <harmathy@mailbox.org>
+Date: Wed, 25 Aug 2021 13:05:58 +0200
+Subject: [PATCH] Use reason_phrase instead of get_phrase
+
+---
+ src/Services/Cache.vala   | 2 +-
+ src/Services/Network.vala | 7 +------
+ 2 files changed, 2 insertions(+), 7 deletions(-)
+
+diff --git a/src/Services/Cache.vala b/src/Services/Cache.vala
+index 2251697..2ed314e 100644
+--- a/src/Services/Cache.vala
++++ b/src/Services/Cache.vala
+@@ -88,7 +88,7 @@ public class Tootle.Cache : GLib.Object {
+                 try {
+                     var code = msg.status_code;
+ 					if (code != Soup.Status.OK) {
+-					    var error = network.describe_error (code);
++					    var error = msg.reason_phrase;
+ 					    throw new Oopsie.INSTANCE (@"Server returned $error");
+ 					}
+ 
+diff --git a/src/Services/Network.vala b/src/Services/Network.vala
+index fa2839c..d0143b0 100644
+--- a/src/Services/Network.vala
++++ b/src/Services/Network.vala
+@@ -56,7 +56,7 @@ public class Tootle.Network : GLib.Object {
+                 else if (status == Soup.Status.CANCELLED)
+                     debug ("Message is cancelled. Ignoring callback invocation.");
+                 else
+-                    ecb ((int32) status, describe_error ((int32) status));
++                    ecb ((int32) status, msg.reason_phrase);
+             });
+         }
+         catch (Error e) {
+@@ -65,11 +65,6 @@ public class Tootle.Network : GLib.Object {
+         }
+     }
+ 
+-	public string describe_error (uint code) {
+-	    var reason = Soup.Status.get_phrase (code);
+-		return @"$code: $reason";
+-	}
+-
+     public void on_error (int32 code, string message) {
+         warning (message);
+         app.toast (message);
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#52842: gnu: tootle: Fix build.
  2021-12-28  5:03 ` [bug#52842] [PATCH] " Taiju HIGASHI
@ 2022-01-05 22:07   ` Ludovic Courtès
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2022-01-05 22:07 UTC (permalink / raw)
  To: Taiju HIGASHI; +Cc: 52842-done

Hi,

Taiju HIGASHI <higashi@taiju.info> skribis:

> ---
>  gnu/packages/mastodon.scm                     | 28 +++++---
>  ...re-to-GLib.Object-naming-conventions.patch | 66 +++++++++++++++++++
>  ...-reason_phrase-instead-of-get_phrase.patch | 48 ++++++++++++++
>  3 files changed, 132 insertions(+), 10 deletions(-)
>  create mode 100644 gnu/packages/patches/tootle-Adhere-to-GLib.Object-naming-conventions.patch
>  create mode 100644 gnu/packages/patches/tootle-Use-reason_phrase-instead-of-get_phrase.patch

I shortened the patch file names, added a commit log, and committed.

Thanks!

Ludo’.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-05 22:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-28  5:00 [bug#52842] gnu: tootle: Fix build Taiju HIGASHI
2021-12-28  5:03 ` [bug#52842] [PATCH] " Taiju HIGASHI
2022-01-05 22:07   ` bug#52842: " Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).