From 4990bd11957a09f488c851ccd1f22e4da2c425c5 Mon Sep 17 00:00:00 2001 From: Erin Shepherd Date: Mon, 21 Sep 2020 20:43:11 +0200 Subject: [PATCH 1/2] Dino: Enable on macOS/Darwin * Remove direct dependencies on some X11 libs. We still inherit them through Gtk+ but it's a start * Rename plugin files from .dylib to .so so Dino's plugin loader finds them The experience is still somewhat janky (no app icon, macOS thinks the app is called ".dino-wrapped", and the Cocoa menu bar is nonresponsive), but beyond this things mostly work fine --- .../instant-messengers/dino/default.nix | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/dino/default.nix b/pkgs/applications/networking/instant-messengers/dino/default.nix index 9c286d008320..70661fd94265 100644 --- a/pkgs/applications/networking/instant-messengers/dino/default.nix +++ b/pkgs/applications/networking/instant-messengers/dino/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub +{ lib, stdenv, fetchFromGitHub , vala, cmake, ninja, wrapGAppsHook, pkgconfig, gettext , gobject-introspection, gnome3, glib, gdk-pixbuf, gtk3, glib-networking , xorg, libXdmcp, libxkbcommon @@ -60,23 +60,39 @@ stdenv.mkDerivation rec { libgcrypt libsoup pcre - xorg.libxcb - xorg.libpthreadstubs - libXdmcp - libxkbcommon epoxy at-spi2-core dbus icu libsignal-protocol-c librsvg + ] ++ lib.optionals (!stdenv.isDarwin) [ + xorg.libxcb + xorg.libpthreadstubs + libXdmcp + libxkbcommon ]; + # Dino looks for plugins with a .so filename extension, even on macOS where + # .dylib is appropriate, and despite the fact that it builds said plugins with + # that as their filename extension + # + # Therefore, on macOS rename all of the plugins to use correct names that Dino + # will load + # + # See https://github.com/dino/dino/wiki/macOS + postFixup = lib.optionalString (stdenv.isDarwin) '' + cd "$out/lib/dino/plugins/" + for f in *.dylib; do + mv "$f" "$(basename "$f" .dylib).so" + done + ''; + meta = with stdenv.lib; { description = "Modern Jabber/XMPP Client using GTK/Vala"; homepage = "https://github.com/dino/dino"; license = licenses.gpl3; - platforms = platforms.linux; + platforms = [ platforms.linux platforms.darwin ]; maintainers = with maintainers; [ mic92 qyliss ]; }; } From 433503323e6189f36e33d9d6e919aed9d9ca30d8 Mon Sep 17 00:00:00 2001 From: Erin Date: Tue, 22 Sep 2020 01:42:35 +0200 Subject: [PATCH 2/2] Update pkgs/applications/networking/instant-messengers/dino/default.nix Co-authored-by: Vincent Laporte --- .../applications/networking/instant-messengers/dino/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/instant-messengers/dino/default.nix b/pkgs/applications/networking/instant-messengers/dino/default.nix index 70661fd94265..795f71a3cd01 100644 --- a/pkgs/applications/networking/instant-messengers/dino/default.nix +++ b/pkgs/applications/networking/instant-messengers/dino/default.nix @@ -92,7 +92,7 @@ stdenv.mkDerivation rec { description = "Modern Jabber/XMPP Client using GTK/Vala"; homepage = "https://github.com/dino/dino"; license = licenses.gpl3; - platforms = [ platforms.linux platforms.darwin ]; + platforms = platforms.linux ++ platforms.darwin; maintainers = with maintainers; [ mic92 qyliss ]; }; }