1{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }:
2
3stdenv.mkDerivation rec {
4 pname = "libccd";
5 version = "2.1";
6
7 src = fetchFromGitHub {
8 owner = "danfis";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc";
12 };
13
14 patches = [
15 # Fix pkgconfig file with absolute CMAKE_INSTALL_*DIR
16 # https://github.com/danfis/libccd/pull/76
17 (fetchpatch {
18 url = "https://github.com/danfis/libccd/commit/cd16c4f168ae308e4c77db66ac97a2eaf47e059e.patch";
19 sha256 = "02wj21c185kwf8bn4qi4cnna0ypzqm481xw9rr8jy1i0cb1r9idg";
20 })
21 ];
22
23 nativeBuildInputs = [ cmake ];
24
25 meta = with lib; {
26 description = "Library for collision detection between two convex shapes";
27 homepage = "https://github.com/danfis/libccd";
28 license = licenses.bsd3;
29 maintainers = with maintainers; [ lopsided98 ];
30 platforms = platforms.unix;
31 };
32}