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.1 KiB
Nix
50 lines
1.1 KiB
Nix
{ stdenv, lib, makeWrapper, fetchFromGitHub
|
|
, bc, coreutils, file, gawk, ghostscript, gnused, imagemagick, zip }:
|
|
|
|
let
|
|
path = lib.makeBinPath [
|
|
bc
|
|
coreutils
|
|
file
|
|
gawk
|
|
ghostscript
|
|
gnused
|
|
imagemagick
|
|
zip
|
|
];
|
|
|
|
in stdenv.mkDerivation rec {
|
|
pname = "pdf2odt";
|
|
version = "20170207";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "gutschke";
|
|
repo = "pdf2odt";
|
|
rev = "4533bd14306c30c085001db59dbb8114ea09c360";
|
|
sha256 = "14f9r5f0g6jzanl54jv86ls0frvspka1p9c8dy3fnriqpm584j0r";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
patches = [ ./use_mktemp.patch ];
|
|
|
|
installPhase = ''
|
|
install -Dm0755 pdf2odt -t $out/bin
|
|
install -Dm0644 README.md LICENSE -t $out/share/doc/pdf2odt
|
|
|
|
ln -rs $out/bin/pdf2odt $out/bin/pdf2ods
|
|
|
|
wrapProgram $out/bin/pdf2odt \
|
|
--prefix PATH : ${path}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "PDF to ODT format converter";
|
|
homepage = "https://github.com/gutschke/pdf2odt";
|
|
license = licenses.mit;
|
|
platforms = platforms.all;
|
|
maintainers = with maintainers; [ peterhoeg ];
|
|
inherit version;
|
|
};
|
|
}
|