gurobi: 12.0.0 -> 12.0.1 (#377852)
[NixPkgs.git] / pkgs / by-name / ap / apostrophe / package.nix
blob955113945be4932f220bd596543580c69c94a303
2   lib,
3   fetchFromGitLab,
4   gtksourceview5,
5   libspelling,
6   fetchFromGitHub,
7   python3Packages,
8   nodePackages,
9   meson,
10   ninja,
11   pkg-config,
12   wrapGAppsHook4,
13   desktop-file-utils,
14   gobject-introspection,
15   libadwaita,
16   webkitgtk_6_0,
17   texliveMedium,
18   shared-mime-info,
19   nix-update-script,
22 let
23   version = "3.2";
25   src = fetchFromGitLab {
26     owner = "World";
27     repo = "apostrophe";
28     domain = "gitlab.gnome.org";
29     rev = "refs/tags/v${version}";
30     hash = "sha256-NPpBu6Wmd8z99vzVQ394CyHRV2RQBtkbuqcaFqKqlkQ=";
31   };
33   reveal-js = fetchFromGitHub {
34     owner = "hakimel";
35     repo = "reveal.js";
37     # keep in sync with upstream shipped version
38     # in build-aux/flatpak/org.gnome.gitlab.somas.Apostrophe.json
39     rev = "refs/tags/5.1.0";
40     hash = "sha256-L6KVBw20K67lHT07Ws+ZC2DwdURahqyuyjAaK0kTgN0=";
41   };
43 python3Packages.buildPythonApplication {
44   inherit version src;
45   pname = "apostrophe";
46   pyproject = false;
48   postPatch =
49     ''
50       substituteInPlace build-aux/meson_post_install.py \
51         --replace-fail 'gtk-update-icon-cache' 'gtk4-update-icon-cache'
53       patchShebangs --build build-aux/meson_post_install.py
54     ''
55     # Use mathjax from nixpkgs to avoid loading from CDN
56     + ''
57       substituteInPlace apostrophe/preview_converter.py \
58         --replace-fail "--mathjax" "--mathjax=file://${nodePackages.mathjax}/lib/node_modules/mathjax/es5/tex-chtml-full.js"
59     '';
61   # Should be done in postInstall, but meson checks this eagerly before build
62   preConfigure = ''
63     install -d $out/share/apostrophe/libs
64     cp -r ${reveal-js} $out/share/apostrophe/libs/reveal.js
65   '';
67   nativeBuildInputs = [
68     meson
69     ninja
70     pkg-config
71     wrapGAppsHook4
72     desktop-file-utils
73     gobject-introspection
74   ];
76   buildInputs = [
77     libadwaita
78     gtksourceview5
79     libspelling
80     webkitgtk_6_0
81   ];
83   propagatedBuildInputs = with python3Packages; [
84     pygobject3
85     pypandoc
86     chardet
87     levenshtein
88   ];
90   dontWrapGApps = true;
92   preFixup = ''
93     makeWrapperArgs+=(
94       ''${gappsWrapperArgs[@]}
95       --prefix PATH : "${texliveMedium}/bin"
96       --prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
97     )
98   '';
100   passthru = {
101     inherit reveal-js;
102     updateScript = nix-update-script { };
103   };
105   meta = {
106     homepage = "https://gitlab.gnome.org/World/apostrophe";
107     description = "Distraction free Markdown editor for GNU/Linux";
108     license = lib.licenses.gpl3Plus;
109     platforms = lib.platforms.linux;
110     maintainers =
111       with lib.maintainers;
112       [
113         sternenseemann
114       ]
115       ++ lib.teams.gnome-circle.members;
116     mainProgram = "apostrophe";
117   };