mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-20 08:59:32 +03:00
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
57 lines
1.8 KiB
Nix
57 lines
1.8 KiB
Nix
{ lib, stdenv, fetchFromGitLab, meson, ninja, cmake
|
|
, wrapGAppsHook, pkgconfig, desktop-file-utils
|
|
, appstream-glib, pythonPackages, glib, gobject-introspection
|
|
, gtk3, webkitgtk, glib-networking, gnome3, gspell, texlive
|
|
, shared-mime-info, haskellPackages}:
|
|
|
|
let
|
|
pythonEnv = pythonPackages.python.withPackages(p: with p;
|
|
[ regex setuptools python-Levenshtein pyenchant pygobject3 pycairo pypandoc ]);
|
|
texliveDist = texlive.combined.scheme-medium;
|
|
|
|
in stdenv.mkDerivation rec {
|
|
pname = "apostrophe";
|
|
version = "2.2.0.3";
|
|
|
|
src = fetchFromGitLab {
|
|
owner = "somas";
|
|
repo = pname;
|
|
domain = "gitlab.gnome.org";
|
|
rev = "v${version}";
|
|
sha256 = "06bl1hc69ixk2vcb2ig74mwid14sl5zq6rfna7lx9na6j3l04879";
|
|
};
|
|
|
|
nativeBuildInputs = [ meson ninja cmake pkgconfig desktop-file-utils
|
|
appstream-glib wrapGAppsHook ];
|
|
|
|
buildInputs = [ glib pythonEnv gobject-introspection gtk3
|
|
gnome3.adwaita-icon-theme webkitgtk gspell texliveDist
|
|
glib-networking ];
|
|
|
|
postPatch = ''
|
|
patchShebangs --build build-aux/meson_post_install.py
|
|
|
|
substituteInPlace ${pname}/config.py --replace "/usr/share/${pname}" "$out/share/${pname}"
|
|
|
|
# get rid of unused distributed dependencies
|
|
rm -r ${pname}/pylocales
|
|
'';
|
|
|
|
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"
|
|
)
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://gitlab.gnome.org/somas/apostrophe";
|
|
description = "A distraction free Markdown editor for GNU/Linux";
|
|
license = licenses.gpl3;
|
|
platforms = platforms.linux;
|
|
maintainers = [ maintainers.sternenseemann ];
|
|
};
|
|
}
|