Infinidoge / funkinpkgs

Friday Night Funkin and related software packaged for Nix
MIT License
0 stars 0 forks source link

Bump funkin version #1

Open Familex opened 1 week ago

Familex commented 1 week ago

Recently fnf received new weekend update. I tried bump version yourself, but was unable to install the haxe dependencies. Here is my attempt (says Could not find haxelib "grig.audio"):

diff --git a/pkgs/funkin/default.nix b/pkgs/funkin/default.nix
index 4aa47ed..7cd029a 100644
--- a/pkgs/funkin/default.nix
+++ b/pkgs/funkin/default.nix
@@ -1,7 +1,6 @@
 { stdenv
 , lib
 , fetchFromGitHub
-, fetchpatch
 , haxe
 , haxePackages
 , neko
@@ -30,38 +29,32 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "funkin";
-  version = "unstable-2023-01-31";
+  version = "unstable-2024-06-06";

   src = fetchFromGitHub {
-    owner = "ninjamuffin99";
+    owner = "FunkinCrew";
     repo = "Funkin";
-    rev = "b644b6f8fe21699a486b3a6ce9fad7e4abfdc1b9";
-    sha256 = "sha256-UlPWVx0zBzCVIZ5nGmLVRgOfWz/9thnCwJsjlQAvQuI=";
+    rev = "7e6bbe9bb62f3460b4689144aaf8847dc7602a91";
+    sha256 = "sha256-uV3Euk/rQ2n9w/cGZlzfsUJnizX3OChFHY/vmQq7TFc=";
+    fetchSubmodules = true;
   };

-  postPatch = ''
-    # Real API keys are stripped from repo
-    cat >source/APIStuff.hx <<EOF
-    package;
-
-    class APIStuff
-    {
-      inline public static var API:String = "51348:TtzK0rZ8";
-      inline public static var EncKey:String = "5NqKsSVSNKHbF9fPgZPqPg==";
-      inline public static var SESSION:String = null;
-    }
-    EOF
-  '';
-
   nativeBuildInputs = [ haxe neko makeWrapper imagemagick ]
     ++ (with haxePackages; [
     hxcpp
     hscript
     openfl
     lime
+    hxCodec
+    funkVis
     flixel
     flixel-addons
     flixel-ui
+    flixel-text-input
+    flxanimate
+    haxeui-core
+    haxeui-flixel
+    grigAudio
     newgrounds
     polymod
     discord_rpc
@@ -74,7 +67,7 @@ stdenv.mkDerivation rec {
   buildPhase = ''
     runHook preBuild
     export HOME=$PWD
-    haxelib run lime build linux -final
+    haxelib run lime build linux -release
     runHook postBuild
   '';

diff --git a/pkgs/haxelibs/default.nix b/pkgs/haxelibs/default.nix
index ebb5e99..93e3116 100644
--- a/pkgs/haxelibs/default.nix
+++ b/pkgs/haxelibs/default.nix
@@ -3,6 +3,7 @@
 , lib
 , fetchzip
 , fetchFromGitHub
+, fetchFromGitLab
 , writeText
 , haxe
 , neko
@@ -11,14 +12,6 @@
 let
   withCommas = lib.replaceStrings [ "." ] [ "," ];

-  # simulate "haxelib dev $libname ."
-  simulateHaxelibDev = libname: ''
-    devrepo=$(mktemp -d)
-    mkdir -p "$devrepo/${withCommas libname}"
-    echo $(pwd) > "$devrepo/${withCommas libname}/.dev"
-    export HAXELIB_PATH="$HAXELIB_PATH:$devrepo"
-  '';
-
   installLibHaxe = { libname, version, files ? "*" }: ''
     mkdir -p "$out/lib/haxe/${withCommas libname}/${withCommas version}"
     echo -n "${version}" > $out/lib/haxe/${withCommas libname}/.current
@@ -87,6 +80,97 @@ rec {
     meta.description = "Runtime support library for the Haxe C++ backend";
   };

+  haxeui-core = buildHaxeLib {
+    libname = "haxeui-core";
+    version = "git";
+    src = fetchFromGitHub {
+      owner = "haxeui";
+      repo = "haxeui-core";
+      rev = "49dcc02";
+      sha256 = "0jsqmwhj2q58fsgla7cwci553bcf64xzkzfi04ywiziqna8y8mxh";
+    };
+    meta.license = lib.licenses.mit;
+    meta.description = "The core library of the HaxeUI framework";
+  };
+
+  haxeui-flixel = buildHaxeLib {
+    libname = "haxeui-flixel";
+    version = "git";
+    src = fetchFromGitHub {
+      owner = "haxeui";
+      repo = "haxeui-flixel";
+      rev = "57c1604d6b5174839d7e0e012a4dd5dcbfc129da";
+      sha256 = "sha256-ntEsxYU326kxEZBuJuiAPArSfDhGc5S7R95cbgqgGlM=";
+    };
+    meta.license = lib.licenses.mit;
+    meta.description = "The Flixel backend of the HaxeUI framework";
+  };
+
+  flixel-text-input = buildHaxeLib {
+    libname = "flixel-text-input";
+    version = "1.1.0";
+    src = fetchFromGitHub {
+      owner = "Starmapo";
+      repo = "flixel-text-input";
+      rev = "526eebf40935910224f982abc577e427cab14d13";
+      sha256 = "sha256-ZQ4ICvBpdOF7EzeSbzlcXFi4BxBoWnr47T3cKlorpzA=";
+    };
+    meta.license = lib.licenses.mit;
+    meta.description = "An improved text input object for HaxeFlixel";
+  };
+
+  flxanimate = buildHaxeLib {
+    libname = "flxanimate";
+    version = "git";
+    src = fetchFromGitHub {
+      owner = "FunkinCrew";
+      repo = "flxanimate";
+      rev = "17e0d59fdbc2b6283a5c0e4df41f1c7f27b71c49";
+      sha256 = "sha256-4vRzBMjY5rXcVfqkgRxkYG6dtgVPaddvOlTuO0zLO8A=";
+    };
+    meta.license = lib.licenses.mit;
+    meta.description = "Adobe Animate's texture atlases player for HaxeFlixel";
+  };
+
+  hxCodec = buildHaxeLib {
+    libname = "hxCodec";
+    version = "git";
+    src = fetchFromGitHub {
+      owner = "FunkinCrew";
+      repo = "hxCodec";
+      rev = "c0c7f2680cc190c932a549c2e2fdd9b0ba2bd10e";
+      sha256 = "sha256-ODg/ONtVeKHQsvYEp4VY2PGScZ99SW/IJT9IYT0gdlE=";
+    };
+    meta.license = lib.licenses.mpl20;
+    meta.description = "Haxe library for native video playback on HaxeFlixel and OpenFL";
+  };
+
+  funkVis = buildHaxeLib {
+    libname = "funkin.vis";
+    version = "git";
+    src = fetchFromGitHub {
+      owner = "FunkinCrew";
+      repo = "funkVis";
+      rev = "38261833590773cb1de34ac5d11e0825696fc340";
+      sha256 = "sha256-uvln//zhcY7iumJxnN/sNEduE7v43BHA3s/XYJhj6dE=";
+    };
+    meta.license = lib.licenses.mit;
+    meta.description = "haxelib for processing audio data into frequency data using FFT's, created for Friday Night Funkin' by The Funkin' Crew Inc";
+  };
+
+  grigAudio = buildHaxeLib {
+    libname = "grig.audio";
+    version = "git";
+    src = fetchFromGitLab {
+      owner = "haxe-grig";
+      repo = "grig.audio";
+      rev = "57f5d47f2533fd0c3dcd025a86cb86c0dfa0b6d2";
+      sha256 = "sha256-aa73zpeExfmoa2b2jSlyWiQGIc5H7Q1ZcwZnJF3tkR8=";
+    };
+    meta.license = lib.licenses.mit;
+    meta.description = "Audio I/O and Audio Primitives for haxe";
+  };
+
   hscript = buildHaxeLib {
     libname = "hscript";
     version = "2.4.0";
Infinidoge commented 1 week ago

Of all repos to get an issue, this was not one I expected!

I'll look into it if I get spare time and want to get my hands dirty struggling to get Haxe building, but fair warning the likelihood I'll be messing with it any time in the near future is slim.