lol
1{ lib
2, stdenv
3, fetchurl
4, fetchpatch
5, python3
6}:
7stdenv.mkDerivation rec {
8 version = "1.5";
9 pname = "pastebinit";
10
11 src = fetchurl {
12 url = "https://launchpad.net/pastebinit/trunk/${version}/+download/${pname}-${version}.tar.bz2";
13 sha256 = "0mw48fgm9lyh9d3pw997fccmglzsjccf2y347gxjas74wx6aira2";
14 };
15
16 buildInputs = [
17 (python3.withPackages (p: [ p.distro ]))
18 ];
19
20 patchFlags = [ "-p0" ];
21
22 patches = [
23 # Required to allow pastebinit 1.5 to run on Python 3.8
24 ./use-distro-module.patch
25 # Required to remove the deprecation warning of FancyURLopener
26 ./use-urllib-request.patch
27 # Required because pastebin.com now redirects http requests to https
28 (fetchpatch {
29 name = "pastebin-com-https.patch";
30 url = "https://bazaar.launchpad.net/~arnouten/pastebinit/pastebin-com-https/diff/264?context=3";
31 sha256 = "0hxhhfcai0mll8qfyhdl3slmbf34ynb759b648x63274m9nd2kji";
32 })
33 ];
34
35 installPhase = ''
36 mkdir -p $out/bin
37 mkdir -p $out/etc
38 cp -a pastebinit $out/bin
39 cp -a pastebin.d $out/etc
40 substituteInPlace $out/bin/pastebinit --replace "'/etc/pastebin.d" "'$out/etc/pastebin.d"
41 '';
42
43 meta = with lib; {
44 homepage = "https://launchpad.net/pastebinit";
45 description = "A software that lets you send anything you want directly to a pastebin from the command line";
46 maintainers = with maintainers; [ raboof ];
47 license = licenses.gpl2;
48 platforms = platforms.linux ++ lib.platforms.darwin;
49 };
50}