anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / applications / networking / instant-messengers / dino / default.nix
blobdd5f8f54c7455df761ffac8d87c9878ad7ab87ce
1 { lib, stdenv, fetchFromGitHub
2 , buildPackages
3 , vala, cmake, ninja, wrapGAppsHook4, pkg-config, gettext
4 , gobject-introspection, glib, gdk-pixbuf, gtk4, glib-networking
5 , libadwaita
6 , libnotify, libsoup, libgee
7 , libsignal-protocol-c
8 , libgcrypt
9 , sqlite
10 , gpgme
11 , pcre2
12 , qrencode
13 , icu
14 , gspell
15 , srtp
16 , libnice
17 , gnutls
18 , gstreamer
19 , gst-plugins-base
20 , gst-plugins-good
21 , gst-plugins-bad
22 , gst-vaapi
23 , webrtc-audio-processing
26 stdenv.mkDerivation (finalAttrs: {
27   pname = "dino";
28   version = "0.4.4";
30   src = fetchFromGitHub {
31     owner = "dino";
32     repo = "dino";
33     rev = "v${finalAttrs.version}";
34     sha256 = "sha256-I0ASeEjdXyxhz52QisU0q8mIBTKMfjaspJbxRIyOhD4=";
35   };
37   postPatch = ''
38     # don't overwrite manually set version information
39     substituteInPlace CMakeLists.txt \
40       --replace "include(ComputeVersion)" ""
41   '';
43   nativeBuildInputs = [
44     vala
45     cmake
46     ninja # https://github.com/dino/dino/issues/230
47     pkg-config
48     wrapGAppsHook4
49     gettext
50     gobject-introspection
51   ];
53   buildInputs = [
54     qrencode
55     glib
56     glib-networking # required for TLS support
57     libadwaita
58     libgee
59     sqlite
60     gdk-pixbuf
61     gtk4
62     libnotify
63     gpgme
64     libgcrypt
65     libsoup
66     pcre2
67     icu
68     libsignal-protocol-c
69     gspell
70     srtp
71     libnice
72     gnutls
73     gstreamer
74     gst-plugins-base
75     gst-plugins-good # contains rtpbin, required for VP9
76     gst-plugins-bad # required for H264, MSDK
77     gst-vaapi # required for VAAPI
78     webrtc-audio-processing
79   ];
81   cmakeFlags = [
82     "-DBUILD_TESTS=true"
83     "-DRTP_ENABLE_H264=true"
84     "-DRTP_ENABLE_MSDK=true"
85     "-DRTP_ENABLE_VAAPI=true"
86     "-DRTP_ENABLE_VP9=true"
87     "-DVERSION_FOUND=true"
88     "-DVERSION_IS_RELEASE=true"
89     "-DVERSION_FULL=${finalAttrs.version}"
90     "-DXGETTEXT_EXECUTABLE=${lib.getBin buildPackages.gettext}/bin/xgettext"
91     "-DMSGFMT_EXECUTABLE=${lib.getBin buildPackages.gettext}/bin/msgfmt"
92     "-DGLIB_COMPILE_RESOURCES_EXECUTABLE=${lib.getDev buildPackages.glib}/bin/glib-compile-resources"
93     "-DSOUP_VERSION=${lib.versions.major libsoup.version}"
94   ];
96   # Undefined symbols for architecture arm64: "_gpg_strerror"
97   NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-lgpg-error";
99   doCheck = true;
100   checkPhase = ''
101     runHook preCheck
102     ./xmpp-vala-test
103     ./signal-protocol-vala-test
104     runHook postCheck
105   '';
107   # Dino looks for plugins with a .so filename extension, even on macOS where
108   # .dylib is appropriate, and despite the fact that it builds said plugins with
109   # that as their filename extension
110   #
111   # Therefore, on macOS rename all of the plugins to use correct names that Dino
112   # will load
113   #
114   # See https://github.com/dino/dino/wiki/macOS
115   postFixup = lib.optionalString (stdenv.hostPlatform.isDarwin) ''
116     cd "$out/lib/dino/plugins/"
117     for f in *.dylib; do
118       mv "$f" "$(basename "$f" .dylib).so"
119     done
120   '';
122   meta = with lib; {
123     description = "Modern Jabber/XMPP Client using GTK/Vala";
124     mainProgram = "dino";
125     homepage = "https://github.com/dino/dino";
126     license = licenses.gpl3Plus;
127     platforms = platforms.linux ++ platforms.darwin;
128     maintainers = with maintainers; [ qyliss tomfitzhenry ];
129   };