2023-11-19 01:19:29 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-11-13 15:25:01 +00:00
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, python3
|
|
|
|
}:
|
2014-11-15 09:57:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2018-02-27 17:32:04 +00:00
|
|
|
version = "1.5";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "pastebinit";
|
2014-04-03 14:39:46 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "https://launchpad.net/pastebinit/trunk/${version}/+download/${pname}-${version}.tar.bz2";
|
2018-02-27 17:32:04 +00:00
|
|
|
sha256 = "0mw48fgm9lyh9d3pw997fccmglzsjccf2y347gxjas74wx6aira2";
|
2014-04-03 14:39:46 +00:00
|
|
|
};
|
|
|
|
|
2020-11-13 15:25:01 +00:00
|
|
|
buildInputs = [
|
|
|
|
(python3.withPackages (p: [ p.distro ]))
|
|
|
|
];
|
|
|
|
|
|
|
|
patchFlags = [ "-p0" ];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Required to allow pastebinit 1.5 to run on Python 3.8
|
2023-11-19 01:19:29 +00:00
|
|
|
./use-distro-module.patch
|
|
|
|
# Required to remove the deprecation warning of FancyURLopener
|
|
|
|
./use-urllib-request.patch
|
2020-11-13 15:25:01 +00:00
|
|
|
# Required because pastebin.com now redirects http requests to https
|
|
|
|
(fetchpatch {
|
|
|
|
name = "pastebin-com-https.patch";
|
|
|
|
url = "https://bazaar.launchpad.net/~arnouten/pastebinit/pastebin-com-https/diff/264?context=3";
|
|
|
|
sha256 = "0hxhhfcai0mll8qfyhdl3slmbf34ynb759b648x63274m9nd2kji";
|
|
|
|
})
|
|
|
|
];
|
2014-04-03 14:39:46 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/etc
|
|
|
|
cp -a pastebinit $out/bin
|
|
|
|
cp -a pastebin.d $out/etc
|
|
|
|
substituteInPlace $out/bin/pastebinit --replace "'/etc/pastebin.d" "'$out/etc/pastebin.d"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://launchpad.net/pastebinit";
|
2014-04-03 14:39:46 +00:00
|
|
|
description = "A software that lets you send anything you want directly to a pastebin from the command line";
|
2021-05-07 13:35:21 +00:00
|
|
|
maintainers = with maintainers; [ raboof ];
|
2014-04-03 14:39:46 +00:00
|
|
|
license = licenses.gpl2;
|
2023-11-19 01:19:29 +00:00
|
|
|
platforms = platforms.linux ++ lib.platforms.darwin;
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "pastebinit";
|
2014-04-03 14:39:46 +00:00
|
|
|
};
|
|
|
|
}
|