about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/ogre/default.nix
blob: 6bac6c5a425b8fdf7e579e888bc5d89ca805d4e9 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{ lib
, stdenv
, fetchFromGitHub
, cmake
, pkg-config
, unzip
, SDL2
, boost
, freeimage
, freetype
, libpng
, ois
, pugixml
, zziplib
  # linux
, freeglut
, libGL
, libGLU
, libICE
, libSM
, libX11
, libXaw
, libXmu
, libXrandr
, libXrender
, libXt
, libXxf86vm
, xorgproto
  # darwin
, darwin
  # optional
, withNvidiaCg ? false
, nvidia_cg_toolkit
, withSamples ? false
}:

let
  common = { version, hash }: stdenv.mkDerivation {
    pname = "ogre";
    inherit version;

    src = fetchFromGitHub {
      owner = "OGRECave";
      repo = "ogre";
      rev = "v${version}";
      inherit hash;
    };

    nativeBuildInputs = [
      cmake
      pkg-config
      unzip
    ];

    buildInputs = [
      SDL2
      boost
      freeimage
      freetype
      libpng
      ois
      pugixml
      zziplib
    ] ++ lib.optionals stdenv.isLinux [
      freeglut
      libGL
      libGLU
      libICE
      libSM
      libX11
      libXaw
      libXmu
      libXrandr
      libXrender
      libXt
      libXxf86vm
      xorgproto
    ] ++ lib.optionals stdenv.isDarwin [
      darwin.apple_sdk.frameworks.Cocoa
    ] ++ lib.optionals withNvidiaCg [
      nvidia_cg_toolkit
    ];

    cmakeFlags = [
      "-DOGRE_BUILD_COMPONENT_OVERLAY_IMGUI=FALSE"
      "-DOGRE_BUILD_DEPENDENCIES=OFF"
      "-DOGRE_BUILD_SAMPLES=${toString withSamples}"
    ] ++ lib.optionals stdenv.isDarwin [
      "-DOGRE_BUILD_LIBS_AS_FRAMEWORKS=FALSE"
    ];

    meta = {
      description = "3D Object-Oriented Graphics Rendering Engine";
      homepage = "https://www.ogre3d.org/";
      maintainers = with lib.maintainers; [ raskin wegank ];
      platforms = lib.platforms.unix;
      license = lib.licenses.mit;
    };
  };
in
{
  ogre_14 = common {
    version = "14.0.1";
    hash = "sha256-jtUm0jy0GsxkGlFdODGodPsuSaQgiE77BORnA6SFViU=";
  };

  ogre_13 = common {
    version = "13.6.5";
    hash = "sha256-8VQqePrvf/fleHijVIqWWfwOusGjVR40IIJ13o+HwaE=";
  };
}