about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libnatpmp/default.nix
blob: 11b8d66b4a8f44e8f0e24cf1adc31e66bbe917ae (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
{ lib, stdenv, fetchurl }:

stdenv.mkDerivation rec {
  pname = "libnatpmp";
  version = "20150609";

  src = fetchurl {
    name = "${pname}-${version}.tar.gz";
    url = "http://miniupnp.free.fr/files/download.php?file=${pname}-${version}.tar.gz";
    sha256 = "1c1n8n7mp0amsd6vkz32n8zj3vnsckv308bb7na0dg0r8969rap1";
  };

  postPatch = ''
    substituteInPlace Makefile \
      --replace "gcc" "${stdenv.cc.targetPrefix}cc" \
      --replace "ar" "${stdenv.cc.targetPrefix}ar"
  '';

  makeFlags = [ "INSTALLPREFIX=$(out)" ];

  meta = with lib; {
    homepage = "http://miniupnp.free.fr/libnatpmp.html";
    description = "NAT-PMP client";
    license = licenses.bsd3;
    maintainers = with maintainers; [ orivej ];
    platforms = platforms.all;
  };
}