newsflash: format with nixfmt-rfc-style
[NixPkgs.git] / pkgs / applications / networking / feedreaders / newsflash / default.nix
blobf8fcea67a4896b07d78924e65ab9553a295c3686
2   lib,
3   stdenv,
4   rustPlatform,
5   fetchFromGitLab,
6   substituteAll,
7   cargo,
8   meson,
9   ninja,
10   pkg-config,
11   rustc,
12   blueprint-compiler,
13   wrapGAppsHook4,
14   gdk-pixbuf,
15   glib,
16   clapper,
17   gtk4,
18   libadwaita,
19   libxml2,
20   openssl,
21   sqlite,
22   webkitgtk,
23   glib-networking,
24   librsvg,
25   gst_all_1,
26   gitUpdater,
29 stdenv.mkDerivation (finalAttrs: {
30   pname = "newsflash";
31   version = "3.3.0";
33   src = fetchFromGitLab {
34     owner = "news-flash";
35     repo = "news_flash_gtk";
36     rev = "refs/tags/v.${finalAttrs.version}";
37     hash = "sha256-s8h/OIJJzMmsCsaQJ0SOjCAVXfYQbjOupdDtLOqM9d0=";
38   };
40   cargoDeps = rustPlatform.importCargoLock {
41     lockFile = ./Cargo.lock;
42     outputHashes = {
43       "clapper-0.1.0" = "sha256-xQ7l6luO5E4PMjtN9elg0bkJa7IhWzA7KuYDJ+m/VY0=";
44       "news-flash-2.3.0-alpha.0" = "sha256-ZgX6tQmPDMSpLcYD04u2ReQXdzeGzQTwGaUy/y4z4do=";
45       "newsblur_api-0.3.0" = "sha256-m2178zdJzeskl3BQpZr6tlxTAADehxz8uYcZzi15nhQ=";
46     };
47   };
49   patches = [
50     # Post install tries to generate an icon cache & update the
51     # desktop database. The gtk setup hook drop-icon-theme-cache.sh
52     # would strip out the icon cache and the desktop database wouldn't
53     # be included in $out. They will generated by xdg.mime.enable &
54     # gtk.iconCache.enable instead.
55     ./no-post-install.patch
57     # Replace placeholder "0.0.0" project version with nixpkgs version
58     (substituteAll {
59       src = ./hardcode-version.patch;
60       inherit (finalAttrs) version;
61     })
62   ];
64   postPatch = ''
65     patchShebangs build-aux/cargo.sh
66   '';
68   strictDeps = true;
70   nativeBuildInputs = [
71     meson
72     ninja
73     pkg-config
74     wrapGAppsHook4
76     # Provides setup hook to fix "Unrecognized image file format"
77     gdk-pixbuf
79     # Provides glib-compile-resources to compile gresources
80     glib
81     rustPlatform.cargoSetupHook
82     cargo
83     rustc
84     blueprint-compiler
85   ];
87   buildInputs =
88     [
89       clapper
90       gtk4
91       libadwaita
92       libxml2
93       openssl
94       sqlite
95       webkitgtk
97       # TLS support for loading external content in webkitgtk WebView
98       glib-networking
100       # SVG support for gdk-pixbuf
101       librsvg
102     ]
103     ++ (with gst_all_1; [
104       # Audio & video support for webkitgtk WebView
105       gstreamer
106       gst-plugins-base
107       gst-plugins-good
108       gst-plugins-bad
109     ]);
111   passthru.updateScript = gitUpdater { rev-prefix = "v."; };
113   meta = with lib; {
114     description = "A modern feed reader designed for the GNOME desktop";
115     homepage = "https://gitlab.com/news-flash/news_flash_gtk";
116     license = licenses.gpl3Plus;
117     maintainers = with maintainers; [
118       kira-bruneau
119       stunkymonkey
120     ];
121     platforms = platforms.unix;
122     mainProgram = "io.gitlab.news_flash.NewsFlash";
123   };