1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 python3,
6 libxslt,
7 docbook_xsl,
8 installShellFiles,
9 callPackage,
10}:
11stdenv.mkDerivation rec {
12 version = "1.6.2";
13 pname = "pastebinit";
14
15 src = fetchFromGitHub {
16 owner = "pastebinit";
17 repo = "pastebinit";
18 rev = version;
19 hash = "sha256-vuAWkHlQM6QTWarThpSbY0qrxzej0GvLU0jT2JOS/qc=";
20 };
21
22 patches = [
23 ./use-drv-etc.patch
24 ];
25
26 nativeBuildInputs = [
27 libxslt
28 installShellFiles
29 ];
30
31 buildInputs = [
32 (python3.withPackages (p: [ p.distro ]))
33 ];
34
35 buildPhase = ''
36 xsltproc --nonet ${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl pastebinit.xml
37 '';
38
39 installPhase = ''
40 mkdir -p $out/bin
41 mkdir -p $out/etc
42 cp -a pastebinit $out/bin
43 cp -a utils/* $out/bin
44 cp -a pastebin.d $out/etc
45 substituteInPlace $out/bin/pastebinit --subst-var-by "etc" "$out/etc"
46 installManPage pastebinit.1
47 '';
48
49 meta = with lib; {
50 homepage = "https://stgraber.org/category/pastebinit/";
51 description = "Software that lets you send anything you want directly to a pastebin from the command line";
52 maintainers = with maintainers; [
53 raboof
54 samuel-martineau
55 ];
56 license = licenses.gpl2Plus;
57 platforms = platforms.linux ++ lib.platforms.darwin;
58 };
59}