nixpkgs/pkgs/applications/editors/apostrophe/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
2 KiB
Nix
Raw Normal View History

2021-09-24 00:15:04 +02:00
{ lib, stdenv, fetchFromGitLab, meson, ninja
, wrapGAppsHook, pkg-config, desktop-file-utils
2019-12-12 23:11:25 +01:00
, appstream-glib, pythonPackages, glib, gobject-introspection
, gtk3, webkitgtk, glib-networking, gnome, gspell, texlive
2021-09-24 00:15:04 +02:00
, shared-mime-info, libhandy, fira, sassc
2021-03-02 13:03:35 +01:00
}:
2019-12-12 23:11:25 +01:00
let
2021-03-02 13:03:35 +01:00
pythonEnv = pythonPackages.python.withPackages(p: with p; [
regex setuptools python-Levenshtein pyenchant
pygobject3 pycairo pypandoc chardet
]);
2019-12-12 23:11:25 +01:00
in stdenv.mkDerivation rec {
pname = "apostrophe";
2022-05-25 04:40:15 +02:00
version = "2.6.3";
2019-12-12 23:11:25 +01:00
src = fetchFromGitLab {
2021-09-24 00:15:04 +02:00
owner = "World";
2019-12-12 23:11:25 +01:00
repo = pname;
domain = "gitlab.gnome.org";
rev = "v${version}";
2022-05-25 04:40:15 +02:00
sha256 = "sha256-RBrrG1TO810LidIelYGNaK7PjDq84D0cA8VcMojAW3M=";
2019-12-12 23:11:25 +01:00
};
2021-09-24 00:15:04 +02:00
nativeBuildInputs = [ meson ninja pkg-config desktop-file-utils
appstream-glib wrapGAppsHook sassc ];
2019-12-12 23:11:25 +01:00
buildInputs = [ glib pythonEnv gobject-introspection gtk3
gnome.adwaita-icon-theme webkitgtk gspell texlive
2021-03-02 13:03:35 +01:00
glib-networking libhandy ];
2019-12-12 23:11:25 +01:00
postPatch = ''
substituteInPlace data/media/css/web/base.css \
--replace 'url("/app/share/fonts/FiraSans-Regular.ttf") format("ttf")' \
'url("${fira}/share/fonts/opentype/FiraSans-Regular.otf") format("otf")' \
--replace 'url("/app/share/fonts/FiraMono-Regular.ttf") format("ttf")' \
'url("${fira}/share/fonts/opentype/FiraMono-Regular.otf") format("otf")'
2019-12-12 23:11:25 +01:00
patchShebangs --build build-aux/meson_post_install.py
'';
preFixup = ''
gappsWrapperArgs+=(
--prefix PYTHONPATH : "$out/lib/python${pythonEnv.pythonVersion}/site-packages/"
--prefix PATH : "${texlive}/bin"
--prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
2019-12-12 23:11:25 +01:00
)
'';
meta = with lib; {
2021-09-24 00:15:04 +02:00
homepage = "https://gitlab.gnome.org/World/apostrophe";
2019-12-12 23:11:25 +01:00
description = "A distraction free Markdown editor for GNU/Linux";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = [ maintainers.sternenseemann ];
};
}