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