2018-12-15 03:50:31 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, makeWrapper, perlPackages
|
|
|
|
, cursesSupport ? true
|
|
|
|
, uriFindSupport ? true
|
2018-08-30 15:10:00 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
perlDeps =
|
2021-03-16 17:09:21 +00:00
|
|
|
[ perlPackages.MIMETools perlPackages.HTMLParser ]
|
2018-12-15 03:50:31 +00:00
|
|
|
++ lib.optional cursesSupport perlPackages.CursesUI
|
|
|
|
++ lib.optional uriFindSupport perlPackages.URIFind;
|
2018-08-30 15:10:00 +00:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "extract_url";
|
2018-08-30 15:10:00 +00:00
|
|
|
version = "1.6.2";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "m3m0ryh0l3";
|
|
|
|
repo = "extracturl";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "05589lp15jmcpbj4y9a3hmf6n2gsqrm4ybcyh3hd4j6pc7hmnhny";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2018-12-15 03:50:31 +00:00
|
|
|
buildInputs = [ perlPackages.perl ] ++ perlDeps;
|
2018-08-30 15:10:00 +00:00
|
|
|
|
|
|
|
makeFlags = [ "prefix=$(out)" ];
|
|
|
|
installFlags = [ "INSTALL=install" ];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram "$out/bin/extract_url" \
|
2018-12-15 03:50:31 +00:00
|
|
|
--set PERL5LIB "${perlPackages.makeFullPerlPath perlDeps}"
|
2018-08-30 15:10:00 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://www.memoryhole.net/~kyle/extract_url/";
|
2018-08-30 15:10:00 +00:00
|
|
|
description = "Extracts URLs from MIME messages or plain text";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = [ maintainers.qyliss ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|