diff options
Diffstat (limited to 'pkgs/development/tools/godot')
-rw-r--r-- | pkgs/development/tools/godot/default.nix | 27 | ||||
-rw-r--r-- | pkgs/development/tools/godot/dont_clobber_environment.patch | 17 | ||||
-rw-r--r-- | pkgs/development/tools/godot/export-templates.nix | 17 | ||||
-rw-r--r-- | pkgs/development/tools/godot/headless.nix | 4 | ||||
-rw-r--r-- | pkgs/development/tools/godot/pkg_config_additions.patch | 23 | ||||
-rw-r--r-- | pkgs/development/tools/godot/server.nix | 4 |
6 files changed, 60 insertions, 32 deletions
diff --git a/pkgs/development/tools/godot/default.nix b/pkgs/development/tools/godot/default.nix index 0d35ce253b1..5e457227c8d 100644 --- a/pkgs/development/tools/godot/default.nix +++ b/pkgs/development/tools/godot/default.nix @@ -1,28 +1,31 @@ -{ stdenv, lib, fetchFromGitHub, scons, pkgconfig, libX11, libXcursor -, libXinerama, libXrandr, libXrender, libpulseaudio ? null -, libXi ? null, libXext, libXfixes, freetype, openssl -, alsaLib, libGLU, zlib, yasm ? null }: +{ stdenv, lib, fetchFromGitHub, scons, pkg-config, udev, libX11 +, libXcursor , libXinerama, libXrandr, libXrender, libpulseaudio +, libXi, libXext, libXfixes, freetype, openssl +, alsa-lib, libGLU, zlib, yasm +, withUdev ? true +}: let options = { touch = libXi != null; pulseaudio = false; + udev = withUdev; }; in stdenv.mkDerivation rec { pname = "godot"; - version = "3.2.2"; + version = "3.3.2"; src = fetchFromGitHub { owner = "godotengine"; repo = "godot"; rev = "${version}-stable"; - sha256 = "1libz83mbyrkbbsmmi8z2rydv3ls0w9r4vb5v6diqqwn7ka8z804"; + sha256 = "0rfm6sbbwzvsn76a8aqagd7cqdzmk8qxphgl89k7y982l9a5sz50"; }; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ pkg-config ]; buildInputs = [ - scons libX11 libXcursor libXinerama libXrandr libXrender - libXi libXext libXfixes freetype openssl alsaLib libpulseaudio + scons udev libX11 libXcursor libXinerama libXrandr libXrender + libXi libXext libXfixes freetype openssl alsa-lib libpulseaudio libGLU zlib yasm ]; @@ -58,11 +61,11 @@ in stdenv.mkDerivation rec { --replace "Exec=godot" "Exec=$out/bin/godot" ''; - meta = { + meta = with lib; { homepage = "https://godotengine.org"; description = "Free and Open Source 2D and 3D game engine"; - license = stdenv.lib.licenses.mit; + license = licenses.mit; platforms = [ "i686-linux" "x86_64-linux" ]; - maintainers = [ stdenv.lib.maintainers.twey ]; + maintainers = with maintainers; [ twey ]; }; } diff --git a/pkgs/development/tools/godot/dont_clobber_environment.patch b/pkgs/development/tools/godot/dont_clobber_environment.patch index b7c1d3d6233..74e1241513b 100644 --- a/pkgs/development/tools/godot/dont_clobber_environment.patch +++ b/pkgs/development/tools/godot/dont_clobber_environment.patch @@ -1,18 +1,19 @@ diff --git a/SConstruct b/SConstruct -index b3d033dc90..04b8dcc832 100644 +index d138c7b250..c925bf908e 100644 --- a/SConstruct +++ b/SConstruct -@@ -62,10 +62,9 @@ elif platform_arg == "javascript": - custom_tools = ["cc", "c++", "ar", "link", "textfile", "zip"] - +@@ -65,10 +65,10 @@ elif platform_arg == "javascript": + # want to have to pull in manually. + # Then we prepend PATH to make it take precedence, while preserving SCons' own entries. env_base = Environment(tools=custom_tools) --if "TERM" in os.environ: +-env_base.PrependENVPath("PATH", os.getenv("PATH")) +-env_base.PrependENVPath("PKG_CONFIG_PATH", os.getenv("PKG_CONFIG_PATH")) +-if "TERM" in os.environ: # Used for colored output. - env_base["ENV"]["TERM"] = os.environ["TERM"] --env_base.AppendENVPath("PATH", os.getenv("PATH")) --env_base.AppendENVPath("PKG_CONFIG_PATH", os.getenv("PKG_CONFIG_PATH")) +for k in ("TERM", "PATH", "PKG_CONFIG_PATH"): + if (k in os.environ): + env_base["ENV"][k] = os.environ[k] ++ + env_base.disabled_modules = [] env_base.use_ptrcall = False - env_base.module_version_string = "" diff --git a/pkgs/development/tools/godot/export-templates.nix b/pkgs/development/tools/godot/export-templates.nix new file mode 100644 index 00000000000..bfcf3e3b3dc --- /dev/null +++ b/pkgs/development/tools/godot/export-templates.nix @@ -0,0 +1,17 @@ +{ godot, lib }: + +# https://docs.godotengine.org/en/stable/development/compiling/compiling_for_x11.html#building-export-templates +godot.overrideAttrs (oldAttrs: rec { + pname = "godot-export-templates"; + sconsFlags = "target=release platform=x11 tools=no"; + installPhase = '' + # The godot export command expects the export templates at + # .../share/godot/templates/3.2.3.stable with 3.2.3 being the godot version. + mkdir -p "$out/share/godot/templates/${oldAttrs.version}.stable" + cp bin/godot.x11.opt.64 $out/share/godot/templates/${oldAttrs.version}.stable/linux_x11_64_release + ''; + outputs = [ "out" ]; + meta.description = + "Free and Open Source 2D and 3D game engine (export templates)"; + meta.maintainers = with lib.maintainers; [ twey jojosch ]; +}) diff --git a/pkgs/development/tools/godot/headless.nix b/pkgs/development/tools/godot/headless.nix index 0ae28b774fb..a8d640eba1a 100644 --- a/pkgs/development/tools/godot/headless.nix +++ b/pkgs/development/tools/godot/headless.nix @@ -1,4 +1,4 @@ -{ godot, stdenv }: +{ godot, lib }: godot.overrideAttrs (oldAttrs: rec { pname = "godot-headless"; sconsFlags = "target=release_debug platform=server tools=yes"; @@ -14,5 +14,5 @@ godot.overrideAttrs (oldAttrs: rec { ''; meta.description = "Free and Open Source 2D and 3D game engine (headless build)"; - meta.maintainers = with stdenv.lib.maintainers; [ twey yusdacra ]; + meta.maintainers = with lib.maintainers; [ twey yusdacra ]; }) diff --git a/pkgs/development/tools/godot/pkg_config_additions.patch b/pkgs/development/tools/godot/pkg_config_additions.patch index 9e2e5c3536d..f5ab667f180 100644 --- a/pkgs/development/tools/godot/pkg_config_additions.patch +++ b/pkgs/development/tools/godot/pkg_config_additions.patch @@ -1,11 +1,11 @@ diff --git a/platform/x11/detect.py b/platform/x11/detect.py -index 5674e78350..7051d8e73c 100644 +index 91652aad55..d12389f9f2 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py -@@ -201,6 +201,11 @@ def configure(env): +@@ -218,6 +218,11 @@ def configure(env): env.ParseConfig("pkg-config xrender --cflags --libs") env.ParseConfig("pkg-config xi --cflags --libs") - + + env.ParseConfig("pkg-config xext --cflags --libs") + env.ParseConfig("pkg-config xfixes --cflags --libs") + env.ParseConfig("pkg-config glu --cflags --libs") @@ -13,13 +13,20 @@ index 5674e78350..7051d8e73c 100644 + if env["touch"]: env.Append(CPPDEFINES=["TOUCH_ENABLED"]) - -@@ -299,7 +304,7 @@ def configure(env): + +@@ -323,6 +328,7 @@ def configure(env): print("Enabling ALSA") + env["alsa"] = True env.Append(CPPDEFINES=["ALSA_ENABLED", "ALSAMIDI_ENABLED"]) - # Don't parse --cflags, we don't need to add /usr/include/alsa to include path -- env.ParseConfig("pkg-config alsa --libs") + env.ParseConfig("pkg-config alsa --cflags --libs") else: print("ALSA libraries not found, disabling driver") - + +@@ -340,6 +346,7 @@ def configure(env): + if os.system("pkg-config --exists libudev") == 0: # 0 means found + print("Enabling udev support") + env.Append(CPPDEFINES=["UDEV_ENABLED"]) ++ env.ParseConfig("pkg-config libudev --cflags --libs") + else: + print("libudev development libraries not found, disabling udev support") + else: diff --git a/pkgs/development/tools/godot/server.nix b/pkgs/development/tools/godot/server.nix index 48f21b796c3..4254dc746b6 100644 --- a/pkgs/development/tools/godot/server.nix +++ b/pkgs/development/tools/godot/server.nix @@ -1,4 +1,4 @@ -{ godot, stdenv }: +{ godot, lib }: godot.overrideAttrs (oldAttrs: rec { pname = "godot-server"; sconsFlags = "target=release platform=server tools=no"; @@ -14,5 +14,5 @@ godot.overrideAttrs (oldAttrs: rec { ''; meta.description = "Free and Open Source 2D and 3D game engine (server build)"; - meta.maintainers = with stdenv.lib.maintainers; [ twey yusdacra ]; + meta.maintainers = with lib.maintainers; [ twey yusdacra ]; }) |