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

58 lines
1.7 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitLab, meson, ninja, cmake
, wrapGAppsHook, pkg-config, desktop-file-utils
2019-12-12 22:11:25 +00:00
, appstream-glib, pythonPackages, glib, gobject-introspection
, gtk3, webkitgtk, glib-networking, gnome3, gspell, texlive
2021-03-02 12:03:35 +00:00
, shared-mime-info, haskellPackages, libhandy
}:
2019-12-12 22:11:25 +00:00
let
2021-03-02 12:03:35 +00:00
pythonEnv = pythonPackages.python.withPackages(p: with p; [
regex setuptools python-Levenshtein pyenchant
pygobject3 pycairo pypandoc chardet
]);
2019-12-12 22:11:25 +00:00
texliveDist = texlive.combined.scheme-medium;
in stdenv.mkDerivation rec {
pname = "apostrophe";
2021-03-02 12:03:35 +00:00
version = "2.3";
2019-12-12 22:11:25 +00:00
src = fetchFromGitLab {
owner = "somas";
2019-12-12 22:11:25 +00:00
repo = pname;
domain = "gitlab.gnome.org";
rev = "v${version}";
2021-03-02 12:03:35 +00:00
sha256 = "1ggrbbnhbnf6p3hs72dww3c9m1rvr4znggmvwcpj6i8v1a3kycnb";
2019-12-12 22:11:25 +00:00
};
nativeBuildInputs = [ meson ninja cmake pkg-config desktop-file-utils
2019-12-12 22:11:25 +00:00
appstream-glib wrapGAppsHook ];
buildInputs = [ glib pythonEnv gobject-introspection gtk3
gnome3.adwaita-icon-theme webkitgtk gspell texliveDist
2021-03-02 12:03:35 +00:00
glib-networking libhandy ];
2019-12-12 22:11:25 +00:00
postPatch = ''
patchShebangs --build build-aux/meson_post_install.py
# get rid of unused distributed dependencies
rm -r ${pname}/pylocales
2019-12-12 22:11:25 +00:00
'';
preFixup = ''
gappsWrapperArgs+=(
--prefix PYTHONPATH : "$out/lib/python${pythonEnv.pythonVersion}/site-packages/"
--prefix PATH : "${texliveDist}/bin"
--prefix PATH : "${haskellPackages.pandoc-citeproc}/bin"
--prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
2019-12-12 22:11:25 +00:00
)
'';
meta = with lib; {
homepage = "https://gitlab.gnome.org/somas/apostrophe";
2019-12-12 22:11:25 +00:00
description = "A distraction free Markdown editor for GNU/Linux";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = [ maintainers.sternenseemann ];
};
}