![Profpatsch](/assets/img/avatar_default.png)
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
50 lines
1.6 KiB
Nix
50 lines
1.6 KiB
Nix
{ stdenv, fetchurl, fetchpatch, pkgconfig, gnome-doc-utils, intltool, lib
|
|
, mono, gtk-sharp-2_0, gnome-sharp, hyena
|
|
, which, makeWrapper, glib, gnome2, poppler, wrapGAppsHook
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "pdfmod";
|
|
version = "0.9.1";
|
|
|
|
src = fetchurl {
|
|
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
|
|
sha256 = "eb7c987514a053106ddf03f26544766c751c801d87762909b36415d46bc425c9";
|
|
};
|
|
|
|
patches = [ (fetchpatch {
|
|
url = "https://raw.githubusercontent.com/City-busz/Arch-Linux-Repository"
|
|
+ "/master/gnome/pdfmod/pdfmod/pdfmod-mono-2.10.patch";
|
|
sha256 = "0fpz9ifr6476lqhd5rkb94dm68vlrwdq5w1aaxzgyjgdax9hxx81";
|
|
}) ];
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
buildInputs = [
|
|
gnome-doc-utils intltool mono gtk-sharp-2_0 gnome-sharp
|
|
hyena which makeWrapper wrapGAppsHook
|
|
];
|
|
|
|
preConfigure = ''
|
|
substituteInPlace lib/poppler-sharp/poppler-sharp/poppler-sharp.dll.config \
|
|
--replace libpoppler-glib.so.4 libpoppler-glib.so
|
|
'';
|
|
|
|
postInstall = ''
|
|
makeWrapper "${mono}/bin/mono" "$out/bin/pdfmod" \
|
|
--add-flags "$out/lib/pdfmod/PdfMod.exe" \
|
|
--prefix MONO_GAC_PREFIX : ${gtk-sharp-2_0} \
|
|
--prefix MONO_GAC_PREFIX : ${gnome-sharp} \
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ glib gnome-sharp gnome2.GConf gtk-sharp-2_0 gtk-sharp-2_0.gtk poppler ]}
|
|
'';
|
|
|
|
dontStrip = true;
|
|
|
|
meta = with lib; {
|
|
homepage = "https://wiki.gnome.org/Attic/PdfMod";
|
|
description = "A simple application for modifying PDF documents";
|
|
platforms = platforms.all;
|
|
maintainers = with maintainers; [ obadz ];
|
|
license = licenses.gpl2Plus;
|
|
};
|
|
}
|