summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoscha <joscha@plugh.de>2023-02-10 15:39:58 +0100
committerJoscha <joscha@plugh.de>2023-07-19 22:15:11 +0200
commitf37c9c60d2c831e1b1998bd3bd31fab7833ff7ad (patch)
tree8f58fcd3cefaeab55fb0be417d7fd4e1292358be
parent39ecbaa495b2b7f0591d53de71d1c1cc5c865b52 (diff)
downloadnixpkgs-f37c9c60d2c831e1b1998bd3bd31fab7833ff7ad.tar
nixpkgs-f37c9c60d2c831e1b1998bd3bd31fab7833ff7ad.tar.gz
nixpkgs-f37c9c60d2c831e1b1998bd3bd31fab7833ff7ad.tar.bz2
nixpkgs-f37c9c60d2c831e1b1998bd3bd31fab7833ff7ad.tar.lz
nixpkgs-f37c9c60d2c831e1b1998bd3bd31fab7833ff7ad.tar.xz
nixpkgs-f37c9c60d2c831e1b1998bd3bd31fab7833ff7ad.tar.zst
nixpkgs-f37c9c60d2c831e1b1998bd3bd31fab7833ff7ad.zip
godot_4: provide better version information
-rw-r--r--pkgs/development/tools/godot/4/default.nix25
1 files changed, 24 insertions, 1 deletions
diff --git a/pkgs/development/tools/godot/4/default.nix b/pkgs/development/tools/godot/4/default.nix
index 3269c7796bd..a39c8e9f501 100644
--- a/pkgs/development/tools/godot/4/default.nix
+++ b/pkgs/development/tools/godot/4/default.nix
@@ -44,11 +44,12 @@ in
 stdenv.mkDerivation rec {
   pname = "godot";
   version = "4.1-stable";
+  commitHash = "970459615f6b2b4151742ec6d7ef8559f87fd5c5";
 
   src = fetchFromGitHub {
     owner = "godotengine";
     repo = "godot";
-    rev = version;
+    rev = commitHash;
     hash = "sha256-v9qKrPYQz4c+xkSu/2ru7ZE5EzKVyXhmrxyHZQkng2U=";
   };
 
@@ -86,6 +87,28 @@ stdenv.mkDerivation rec {
 
   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
+  # etc.) usually set this to their name as well.
+  #
+  # See also 'methods.py' in the Godot repo and 'build' in
+  # https://docs.godotengine.org/en/stable/classes/class_engine.html#class-engine-method-get-version-info
+  BUILD_NAME = "nixpkgs";
+
+  # Required for the commit hash to be included in the version number.
+  #
+  # `methods.py` reads the commit hash from `.git/HEAD` and manually follows
+  # refs. Since we just write the hash directly, there is no need to emulate any
+  # other parts of the .git directory.
+  #
+  # See also 'hash' in
+  # https://docs.godotengine.org/en/stable/classes/class_engine.html#class-engine-method-get-version-info
+  preConfigure = ''
+    mkdir -p .git
+    echo ${commitHash} > .git/HEAD
+  '';
+
   sconsFlags = mkSconsFlagsFromAttrSet {
     # Options from 'SConstruct'
     production = true; # Set defaults to build Godot for use in production