summary refs log tree commit diff
path: root/pkgs/applications/misc/urlview/default.nix
blob: ad29c8f94d8b916d09bede130066b76f7c587255 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ stdenv, fetchurl, ncurses, autoreconfHook }:

stdenv.mkDerivation rec {
  version    = "0.9";
  patchLevel = "19";

  name = "urlview-${version}-${patchLevel}";

  urlBase = "mirror://debian/pool/main/u/urlview/";

  src = fetchurl {
    url = urlBase + "urlview_${version}.orig.tar.gz";
    sha256 = "746ff540ccf601645f500ee7743f443caf987d6380e61e5249fc15f7a455ed42";
  };

  nativeBuildInputs = [ autoreconfHook ];
  buildInputs = [ ncurses ];

  preAutoreconf = ''
    touch NEWS
  '';

  preConfigure = ''
    mkdir -p $out/share/man/man1
  '';

  debianPatches = fetchurl {
    url = urlBase + "urlview_${version}-${patchLevel}.diff.gz";
    sha256 = "056883c17756f849fb9235596d274fbc5bc0d944fcc072bdbb13d1e828301585";
  };

  patches = debianPatches;

  postPatch = ''
    substituteInPlace urlview.c \
      --replace '/etc/urlview/url_handler.sh' "$out/etc/urlview/url_handler.sh"
  '';

  postInstall = ''
    install -Dm755 url_handler.sh $out/etc/urlview/url_handler.sh
    patchShebangs $out/etc/urlview
  '';

  meta = with stdenv.lib; {
    description = "Extract URLs from text";
    homepage = https://packages.qa.debian.org/u/urlview.html;
    license = licenses.gpl2;
    platforms = with platforms; linux ++ darwin;
    maintainers = with maintainers; [ ma27 ];
  };
}