diff --git a/pkgs/applications/misc/extract_url/default.nix b/pkgs/applications/misc/extract_url/default.nix new file mode 100644 index 000000000000..389ac7dfb1fc --- /dev/null +++ b/pkgs/applications/misc/extract_url/default.nix @@ -0,0 +1,42 @@ +{ stdenv, lib, fetchFromGitHub, makeWrapper, perl +, MIMEtools, HTMLParser +, cursesSupport ? true, CursesUI +, uriFindSupport ? true, URIFind +}: + +let + perlDeps = + [ MIMEtools HTMLParser ] + ++ lib.optional cursesSupport CursesUI + ++ lib.optional uriFindSupport URIFind; + +in stdenv.mkDerivation rec { + name = "extract_url-${version}"; + version = "1.6.2"; + + src = fetchFromGitHub { + owner = "m3m0ryh0l3"; + repo = "extracturl"; + rev = "v${version}"; + sha256 = "05589lp15jmcpbj4y9a3hmf6n2gsqrm4ybcyh3hd4j6pc7hmnhny"; + }; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = [ perl ] ++ perlDeps; + + makeFlags = [ "prefix=$(out)" ]; + installFlags = [ "INSTALL=install" ]; + + postFixup = '' + wrapProgram "$out/bin/extract_url" \ + --set PERL5LIB "${lib.makeFullPerlPath perlDeps}" + ''; + + meta = with lib; { + homepage = https://www.memoryhole.net/~kyle/extract_url/; + description = "Extracts URLs from MIME messages or plain text"; + license = licenses.bsd2; + maintainers = [ maintainers.qyliss ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 97bf41a107b0..81aab98dabe4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2395,6 +2395,10 @@ with pkgs; ext4magic = callPackage ../tools/filesystems/ext4magic { }; + extract_url = callPackage ../applications/misc/extract_url { + inherit (perlPackages) MIMEtools HTMLParser CursesUI URIFind; + }; + extundelete = callPackage ../tools/filesystems/extundelete { }; expect = callPackage ../tools/misc/expect { }; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 5add53c0dc24..2d35a573b72f 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -3186,6 +3186,19 @@ let }; }; + CursesUI = buildPerlPackage rec { + name = "Curses-UI-0.9609"; + src = fetchurl { + url = "mirror://cpan/authors/id/M/MD/MDXI/${name}.tar.gz"; + sha256 = "1bqf4h8z70f78nzqq5yj4ahvsbhxxal6bc2g301l9qdn2fjjgf0a"; + }; + meta = { + description = "curses based OO user interface framework"; + license = stdenv.lib.licenses.artistic1; + }; + propagatedBuildInputs = [ Curses TermReadKey ]; + }; + CryptX = buildPerlPackage rec { name = "CryptX-0.061"; src = fetchurl {