nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5
6 # nativeBuildInputs
7 cmake,
8 pkg-config,
9
10 # buildInputs
11 glfw3,
12 libGLU,
13 libX11,
14 libXcursor,
15 libXi,
16 libXinerama,
17 libXrandr,
18 libglut,
19 xorgproto,
20
21 nix-update-script,
22}:
23
24let
25 inherit (lib) cmakeBool;
26
27in
28stdenv.mkDerivation (finalAttrs: {
29 pname = "box2d";
30 version = "2.4.2";
31
32 src = fetchFromGitHub {
33 owner = "erincatto";
34 repo = "box2d";
35 tag = "v${finalAttrs.version}";
36 hash = "sha256-yvhpgiZpjTPeSY7Ma1bh4LwIokUUKB10v2WHlamL9D8=";
37 };
38
39 nativeBuildInputs = [
40 cmake
41 pkg-config
42 ];
43
44 buildInputs = [
45 glfw3
46 libGLU
47 libX11
48 libXcursor
49 libXi
50 libXinerama
51 libXrandr
52 libglut
53 xorgproto
54 ];
55
56 cmakeFlags = [
57 (cmakeBool "BOX2D_BUILD_UNIT_TESTS" finalAttrs.finalPackage.doCheck)
58 ];
59
60 meta = {
61 description = "2D physics engine";
62 homepage = "https://box2d.org/";
63 changelog = "https://github.com/erincatto/box2d/releases/tag/v${finalAttrs.version}";
64 maintainers = with lib.maintainers; [ raskin ];
65 platforms = lib.platforms.unix;
66 license = lib.licenses.zlib;
67 };
68})