Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

godot_4: 4.2.2-stable -> 4.3-stable #334868

Merged
merged 4 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkgs/by-name/go/godot_4-export-templates/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ fetchzip {
pname = "export_templates";
extension = "zip";
url = "https://github.com/godotengine/godot/releases/download/${godot_4.version}/Godot_v${godot_4.version}_export_templates.tpz";
hash = "sha256-eomGLH9lbZhl7VtHTWjJ5mxVt0Yg8LfnAnpqoCksPgs=";
hash = "sha256-XRnKii+eexIkbGf7bqc42SR0NBULFvgMdOpSRNNk6kg=";
}
Original file line number Diff line number Diff line change
@@ -1,93 +1,68 @@
{ stdenv
, lib
, fetchFromGitHub
, pkg-config
, autoPatchelfHook
, installShellFiles
, scons
, vulkan-loader
, libGL
, libX11
, libXcursor
, libXinerama
, libXext
, libXrandr
, libXrender
, libXi
, libXfixes
, libxkbcommon
, alsa-lib
, libpulseaudio
, dbus
, speechd-minimal
, fontconfig
, udev
, withDebug ? false
, withPlatform ? "linuxbsd"
, withTarget ? "editor"
, withPrecision ? "single"
, withPulseaudio ? true
, withDbus ? true
, withSpeechd ? true
, withFontconfig ? true
, withUdev ? true
, withTouch ? true
{
alsa-lib,
autoPatchelfHook,
buildPackages,
dbus,
fetchFromGitHub,
fontconfig,
installShellFiles,
lib,
libGL,
libpulseaudio,
libX11,
libXcursor,
libXext,
libXfixes,
libXi,
libXinerama,
libxkbcommon,
libXrandr,
libXrender,
pkg-config,
scons,
speechd-minimal,
stdenv,
udev,
vulkan-loader,
withDbus ? true,
withDebug ? false,
withFontconfig ? true,
withPlatform ? "linuxbsd",
withPrecision ? "single",
withPulseaudio ? true,
withSpeechd ? true,
withTarget ? "editor",
withTouch ? true,
withUdev ? true,
}:

assert lib.asserts.assertOneOf "withPrecision" withPrecision [ "single" "double" ];
assert lib.asserts.assertOneOf "withPrecision" withPrecision [
"single"
"double"
];

let
mkSconsFlagsFromAttrSet = lib.mapAttrsToList (k: v:
if builtins.isString v
then "${k}=${v}"
else "${k}=${builtins.toJSON v}");
mkSconsFlagsFromAttrSet = lib.mapAttrsToList (
k: v: if builtins.isString v then "${k}=${v}" else "${k}=${builtins.toJSON v}"
);
in
stdenv.mkDerivation rec {
pname = "godot4";
version = "4.2.2-stable";
commitHash = "15073afe3856abd2aa1622492fe50026c7d63dc1";
version = "4.3-stable";
commitHash = "77dcf97d82cbfe4e4615475fa52ca03da645dbd8";

src = fetchFromGitHub {
owner = "godotengine";
repo = "godot";
rev = commitHash;
hash = "sha256-anJgPEeHIW2qIALMfPduBVgbYYyz1PWCmPsZZxS9oHI=";
hash = "sha256-v2lBD3GEL8CoIwBl3UoLam0dJxkLGX0oneH6DiWkEsM=";
};

nativeBuildInputs = [
pkg-config
autoPatchelfHook
installShellFiles
outputs = [
"out"
"man"
];

buildInputs = [
scons
];

runtimeDependencies = [
vulkan-loader
libGL
libX11
libXcursor
libXinerama
libXext
libXrandr
libXrender
libXi
libXfixes
libxkbcommon
alsa-lib
]
++ lib.optional withPulseaudio libpulseaudio
++ lib.optional withDbus dbus
++ lib.optional withDbus dbus.lib
++ lib.optional withSpeechd speechd-minimal
++ lib.optional withFontconfig fontconfig
++ lib.optional withFontconfig fontconfig.lib
++ lib.optional withUdev udev;

enableParallelBuilding = true;

# Set the build name which is part of the version. In official downloads, this
# is set to 'official'. When not specified explicitly, it is set to
# 'custom_build'. Other platforms packaging Godot (Gentoo, Arch, Flatpack
Expand All @@ -110,26 +85,68 @@ stdenv.mkDerivation rec {
echo ${commitHash} > .git/HEAD
'';

# From: https://github.com/godotengine/godot/blob/4.2.2-stable/SConstruct
sconsFlags = mkSconsFlagsFromAttrSet {
# Options from 'SConstruct'
precision = withPrecision; # Floating-point precision level
production = true; # Set defaults to build Godot for use in production
platform = withPlatform;
target = withTarget;
precision = withPrecision; # Floating-point precision level
debug_symbols = withDebug;

# Options from 'platform/linuxbsd/detect.py'
pulseaudio = withPulseaudio; # Use PulseAudio
dbus = withDbus; # Use D-Bus to handle screensaver and portal desktop settings
speechd = withSpeechd; # Use Speech Dispatcher for Text-to-Speech support
fontconfig = withFontconfig; # Use fontconfig for system fonts support
udev = withUdev; # Use udev for gamepad connection callbacks
pulseaudio = withPulseaudio; # Use PulseAudio
speechd = withSpeechd; # Use Speech Dispatcher for Text-to-Speech support
touch = withTouch; # Enable touch events
udev = withUdev; # Use udev for gamepad connection callbacks
};

dontStrip = withDebug;
enableParallelBuilding = true;

strictDeps = true;

outputs = [ "out" "man" ];
depsBuildBuild = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
buildPackages.stdenv.cc
pkg-config
];

nativeBuildInputs = [
autoPatchelfHook
installShellFiles
pkg-config
scons
];

runtimeDependencies =
[
alsa-lib
libGL
libX11
libXcursor
libXext
libXfixes
libXi
libXinerama
libxkbcommon
libXrandr
libXrender
vulkan-loader
]
++ lib.optionals withDbus [
dbus
dbus.lib
]
++ lib.optionals withFontconfig [
fontconfig
fontconfig.lib
]
++ lib.optionals withPulseaudio [ libpulseaudio ]
++ lib.optionals withSpeechd [ speechd-minimal ]
++ lib.optionals withUdev [ udev ];

dontStrip = withDebug;

installPhase = ''
runHook preInstall
Expand All @@ -151,11 +168,19 @@ stdenv.mkDerivation rec {
'';

meta = {
homepage = "https://godotengine.org";
changelog = "https://github.com/godotengine/godot/releases/tag/${version}";
description = "Free and Open Source 2D and 3D game engine";
homepage = "https://godotengine.org";
license = lib.licenses.mit;
platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" ];
maintainers = with lib.maintainers; [ shiryel superherointj ];
platforms = [
"i686-linux"
"x86_64-linux"
"aarch64-linux"
];
maintainers = with lib.maintainers; [
shiryel
superherointj
];
mainProgram = "godot4";
};
}
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8277,8 +8277,6 @@ with pkgs;

gocryptfs = callPackage ../tools/filesystems/gocryptfs { };

godot_4 = callPackage ../development/tools/godot/4 { };

godot3 = callPackage ../development/tools/godot/3 { };

godot3-export-templates = callPackage ../development/tools/godot/3/export-templates.nix { };
Expand Down