1{ lib
2, stdenv
3, fetchFromGitHub
4, cmake
5, pkg-config
6, boost
7, freetype
8, libuuid
9, ois
10, withOgre ? false
11, ogre
12, libGL
13, libGLU
14, libX11
15, Cocoa
16}:
17
18let
19 renderSystem = if withOgre then "3" else "4";
20in
21stdenv.mkDerivation rec {
22 pname = "mygui";
23 version = "3.4.2";
24
25 src = fetchFromGitHub {
26 owner = "MyGUI";
27 repo = "mygui";
28 rev = "MyGUI${version}";
29 hash = "sha256-yBV0ImOFJlqBPqqOjXYe4SFO2liSGZCEwvehED5Ubj4=";
30 };
31
32 patches = [
33 ./disable-framework.patch
34 ];
35
36 nativeBuildInputs = [
37 cmake
38 pkg-config
39 ];
40
41 buildInputs = [
42 boost
43 freetype
44 libuuid
45 ois
46 ] ++ lib.optionals withOgre [
47 ogre
48 ] ++ lib.optionals (!withOgre && stdenv.isLinux) [
49 libGL
50 libGLU
51 ] ++ lib.optionals stdenv.isLinux [
52 libX11
53 ] ++ lib.optionals stdenv.isDarwin [
54 Cocoa
55 ];
56
57 # Tools are disabled due to compilation failures.
58 cmakeFlags = [
59 "-DMYGUI_BUILD_TOOLS=OFF"
60 "-DMYGUI_BUILD_DEMOS=OFF"
61 "-DMYGUI_RENDERSYSTEM=${renderSystem}"
62 ];
63
64 meta = with lib; {
65 homepage = "http://mygui.info/";
66 description = "Library for creating GUIs for games and 3D applications";
67 license = licenses.mit;
68 platforms = platforms.unix;
69 };
70}