1{ lib
2, stdenv
3, fetchFromGitHub
4, writeShellScript
5, cmake
6, ogre
7, freetype
8, boost
9, expat
10, darwin
11, libiconv
12, unstableGitUpdater
13}:
14
15stdenv.mkDerivation {
16 pname = "cegui";
17 version = "0-unstable-2023-03-18";
18
19 src = fetchFromGitHub {
20 owner = "paroj";
21 repo = "cegui";
22 rev = "186ce900e293b98f2721c11930248a8de54aa338";
23 hash = "sha256-RJ4MnxklcuxC+ZYEbfma5RDc2aeJ95LuTwNk+FnEhdo=";
24 };
25
26 strictDeps = true;
27
28 nativeBuildInputs = [
29 cmake
30 ];
31
32 buildInputs = [
33 ogre
34 freetype
35 boost
36 expat
37 ] ++ lib.optionals stdenv.isDarwin [
38 darwin.apple_sdk.frameworks.Cocoa
39 darwin.apple_sdk.frameworks.Foundation
40 libiconv
41 ];
42
43 cmakeFlags = [
44 "-DCEGUI_OPTION_DEFAULT_IMAGECODEC=OgreRenderer-0"
45 ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
46 "-DCMAKE_OSX_ARCHITECTURES=${stdenv.hostPlatform.darwinArch}"
47 ];
48
49 passthru.updateScript = unstableGitUpdater {
50 branch = "v0";
51 # The above branch is separate from the branch with the latest tags, so the updater doesn't pick them up
52 # This is what would be used to handle upstream's format, if it was able to see the tags
53 # tagConverter = writeShellScript "cegui-tag-converter.sh" ''
54 # sed -e 's/^v//g' -e 's/-/./g'
55 # '';
56 hardcodeZeroVersion = true;
57 };
58
59 meta = with lib; {
60 homepage = "http://cegui.org.uk/";
61 description = "C++ Library for creating GUIs";
62 mainProgram = "CEGUISampleFramework-0.9999";
63 license = licenses.mit;
64 platforms = platforms.unix;
65 };
66}