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

stdenv.mkDerivation {
  pname = "dclxvi";
  version = "unstable-2013-01-27";

  src = fetchFromGitHub {
    owner = "agl";
    repo = "dclxvi";
    rev = "74009d58f2305be3b95d88717619bde8ecbdd9a2";
    sha256 = "1kx4h8iv7yb30c6zjmj8zs9x12vxhi0jwkiwxsxj9swf6bww6p1g";
  };

  buildFlags = [ "libdclxvipairing.so" ];

  patchPhase = ''
    substituteInPlace Makefile \
      --replace "gcc" "cc"
  '' + lib.optionalString stdenv.isDarwin ''
    substituteInPlace Makefile \
      --replace "-soname=libdclxvipairing.so" "-install_name,libdclxvipairing.so"
  '';

  installPhase = ''
    mkdir -p $out/{include,lib}
    find . -name \*.h -exec cp {} $out/include \;
    find . -name \*.so -exec cp {} $out/lib \;
  '';

  meta = with lib; {
    homepage = "https://github.com/agl/dclxvi";
    description = "Naehrig, Niederhagen and Schwabe's pairings code, massaged into a shared library";
    platforms = platforms.x86_64;
    license = licenses.publicDomain;
  };
}