Skip to content

Commit eeea02d

Browse files
authored
godot_4{_3,_4}{,-mono}: add source build of export template (#400897)
2 parents 08ed87c + 1a8f4e4 commit eeea02d

File tree

12 files changed

+675
-444
lines changed

12 files changed

+675
-444
lines changed

doc/release-notes/rl-2505.section.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,8 @@
424424
- [`lib.packagesFromDirectoryRecursive`] now rejects unknown arguments.
425425
[`lib.packagesFromDirectoryRecursive`]: https://nixos.org/manual/nixpkgs/stable/#function-library-lib.filesystem.packagesFromDirectoryRecursive
426426

427+
- The `godot-export-templates` package now has its content at `share/godot/export_templates/$version` instead of the output root. This makes it more convenient for for symlinking into `~/.local`, but scripts expecting the old layout will need to be changed.
428+
427429
### Deprecations {#sec-nixpkgs-release-25.05-lib-deprecations}
428430

429431
- `functor` is an implementation detail and should not be relied upon, but since its status wasn't clear and it has had some use cases without alternatives, changes are being handled as gracefully as possible. Deprecations within functor:

pkgs/by-name/op/opengamepadui/package.nix

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
alsa-lib,
3-
autoPatchelfHook,
43
cargo,
54
dbus,
65
fetchFromGitHub,
@@ -43,34 +42,12 @@ stdenv.mkDerivation (finalAttrs: {
4342
cargoRoot = "extensions";
4443

4544
nativeBuildInputs = [
46-
autoPatchelfHook
4745
cargo
4846
godot_4_4
49-
godot_4_4.export-templates-bin
5047
pkg-config
5148
rustPlatform.cargoSetupHook
5249
];
5350

54-
runtimeDependencies = [
55-
alsa-lib
56-
dbus
57-
gamescope
58-
hwdata
59-
libGL
60-
libpulseaudio
61-
mesa-demos
62-
udev
63-
upower
64-
vulkan-loader
65-
xorg.libX11
66-
xorg.libXcursor
67-
xorg.libXext
68-
xorg.libXi
69-
xorg.libXrandr
70-
xorg.libXres
71-
xorg.libXtst
72-
];
73-
7451
dontStrip = withDebug;
7552

7653
env =
@@ -81,7 +58,7 @@ stdenv.mkDerivation (finalAttrs: {
8158
GODOT = lib.getExe godot_4_4;
8259
GODOT_VERSION = lib.elemAt versionAndRelease 0;
8360
GODOT_RELEASE = lib.elemAt versionAndRelease 1;
84-
EXPORT_TEMPLATE = "${godot_4_4.export-templates-bin}";
61+
EXPORT_TEMPLATE = "${godot_4_4.export-template}/share/godot/export_templates";
8562
BUILD_TYPE = "${finalAttrs.buildType}";
8663
};
8764

@@ -92,15 +69,26 @@ stdenv.mkDerivation (finalAttrs: {
9269
preBuild = ''
9370
# Godot looks for export templates in HOME
9471
export HOME=$(mktemp -d)
95-
mkdir -p $HOME/.local/share/godot/export_templates
96-
ln -s "${godot_4_4.export-templates-bin}" "$HOME/.local/share/godot/export_templates/$GODOT_VERSION.$GODOT_RELEASE"
72+
mkdir -p $HOME/.local/share/godot/
73+
ln -s "$EXPORT_TEMPLATE" "$HOME"/.local/share/godot/
9774
'';
9875

99-
postInstall = ''
100-
# The Godot binary looks in "../lib" for gdextensions
101-
mkdir -p $out/share/lib
102-
mv $out/share/opengamepadui/*.so $out/share/lib
103-
'';
76+
postInstall =
77+
let
78+
runtimeDependencies = [
79+
gamescope
80+
hwdata
81+
mesa-demos
82+
udev
83+
upower
84+
];
85+
in
86+
''
87+
# The Godot binary looks in "../lib" for gdextensions
88+
mkdir -p $out/share/lib
89+
mv $out/share/opengamepadui/*.so $out/share/lib
90+
patchelf --add-rpath ${lib.makeLibraryPath runtimeDependencies} $out/share/lib/*.so
91+
'';
10492

10593
passthru.updateScript = nix-update-script { };
10694

pkgs/by-name/pi/pixelorama/package.nix

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
{
22
lib,
33
stdenv,
4-
alsa-lib,
5-
autoPatchelfHook,
64
fetchFromGitHub,
75
godot_4_3,
8-
libGL,
9-
libpulseaudio,
10-
libX11,
11-
libXcursor,
12-
libXext,
13-
libXi,
14-
libXrandr,
156
nix-update-script,
16-
udev,
17-
vulkan-loader,
187
}:
198

209
let
@@ -28,7 +17,6 @@ let
2817
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
2918

3019
godot = godot_4_3;
31-
godot_version_folder = lib.replaceStrings [ "-" ] [ "." ] godot.version;
3220
in
3321
stdenv.mkDerivation (finalAttrs: {
3422
pname = "pixelorama";
@@ -44,29 +32,15 @@ stdenv.mkDerivation (finalAttrs: {
4432
strictDeps = true;
4533

4634
nativeBuildInputs = [
47-
autoPatchelfHook
4835
godot
4936
];
5037

51-
runtimeDependencies = map lib.getLib [
52-
alsa-lib
53-
libGL
54-
libpulseaudio
55-
libX11
56-
libXcursor
57-
libXext
58-
libXi
59-
libXrandr
60-
udev
61-
vulkan-loader
62-
];
63-
6438
buildPhase = ''
6539
runHook preBuild
6640
6741
export HOME=$(mktemp -d)
68-
mkdir -p $HOME/.local/share/godot/export_templates
69-
ln -s "${godot.export-templates-bin}" "$HOME/.local/share/godot/export_templates/${godot_version_folder}"
42+
mkdir -p $HOME/.local/share/godot/
43+
ln -s "${godot.export-template}"/share/godot/export_templates "$HOME"/.local/share/godot/
7044
mkdir -p build
7145
godot4 --headless --export-release "${preset}" ./build/pixelorama
7246
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
version = "4.3-stable";
33
hash = "sha256-MzElflwXHWLgPtoOIhPLA00xX8eEdQsexZaGIEOzbj0=";
4-
exportTemplatesHash = "sha256-XRnKii+eexIkbGf7bqc42SR0NBULFvgMdOpSRNNk6kg=";
5-
nugetDeps = ./deps.json;
4+
default = {
5+
exportTemplatesHash = "sha256-9fENuvVqeQg0nmS5TqjCyTwswR+xAUyVZbaKK7Q3uSI=";
6+
};
7+
mono = {
8+
exportTemplatesHash = "sha256-pkDZfkJHiDtY05TGERwTNDES88SbuFfZVYb5hln6O+U=";
9+
nugetDeps = ./deps.json;
10+
};
611
}
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
version = "4.4.1-stable";
33
hash = "sha256-O4TdPYu1K2zWKMBP/7xd0UPLDb7/4dBnkGM7QydD3Yo=";
4-
exportTemplatesHash = "sha256-KV4sDBZPiMf7IORaNFR2uEK1midnyyjCUfG9hl6AwHY=";
5-
nugetDeps = ./deps.json;
4+
default = {
5+
exportTemplatesHash = "sha256-eo0UreSJ/U0i8XgZMCH+iodqnlEGjtTd4m2sOuTFmog=";
6+
};
7+
mono = {
8+
exportTemplatesHash = "sha256-tk0WS5axndcXWhuj86blg+nU3FB7PRMzVj8ka1gRgj4=";
9+
nugetDeps = ./deps.json;
10+
};
611
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From 42f89dd50dde0896d6c55282c82db9af41cd12d8 Mon Sep 17 00:00:00 2001
2+
From: David McFarland <[email protected]>
3+
Date: Wed, 26 Mar 2025 09:52:17 -0300
4+
Subject: [PATCH] CSharpLanguage: fix crash in reload_assemblies after editor
5+
shutdown
6+
7+
---
8+
modules/mono/csharp_script.cpp | 6 ++++--
9+
1 file changed, 4 insertions(+), 2 deletions(-)
10+
11+
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
12+
index 36c8a40ed9..2b161fb69b 100644
13+
--- a/modules/mono/csharp_script.cpp
14+
+++ b/modules/mono/csharp_script.cpp
15+
@@ -1001,8 +1001,10 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) {
16+
#ifdef TOOLS_ENABLED
17+
// FIXME: Hack to refresh editor in order to display new properties and signals. See if there is a better alternative.
18+
if (Engine::get_singleton()->is_editor_hint()) {
19+
- InspectorDock::get_inspector_singleton()->update_tree();
20+
- NodeDock::get_singleton()->update_lists();
21+
+ if (InspectorDock::get_singleton())
22+
+ InspectorDock::get_inspector_singleton()->update_tree();
23+
+ if (NodeDock::get_singleton())
24+
+ NodeDock::get_singleton()->update_lists();
25+
}
26+
#endif
27+
}
28+
--
29+
2.48.1
30+

0 commit comments

Comments
 (0)