about summary refs log tree commit diff
path: root/pkgs/applications/audio/famistudio
diff options
context:
space:
mode:
authorOPNA2608 <christoph.neidahl@gmail.com>2022-06-02 23:02:33 +0200
committerOPNA2608 <christoph.neidahl@gmail.com>2022-06-02 23:02:33 +0200
commit4b190c0888a4171e93e07eabbc88e45885dc9130 (patch)
tree7df9247be51ba9d561b2881a44705226d6473ad1 /pkgs/applications/audio/famistudio
parent17e891b141ca8e599ebf6443d0870a67dd98f94f (diff)
famistudio: init at 3.3.0
Diffstat (limited to 'pkgs/applications/audio/famistudio')
-rw-r--r--pkgs/applications/audio/famistudio/default.nix66
1 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/applications/audio/famistudio/default.nix b/pkgs/applications/audio/famistudio/default.nix
new file mode 100644
index 0000000000000..f1971ad0216ec
--- /dev/null
+++ b/pkgs/applications/audio/famistudio/default.nix
@@ -0,0 +1,66 @@
+{ lib
+, stdenv
+, fetchzip
+, autoPatchelfHook
+, makeWrapper
+, alsa-lib
+, gtk-sharp-2_0
+, glib
+, gtk2
+, mono
+, openal
+}:
+
+stdenv.mkDerivation rec {
+  pname = "famistudio";
+  version = "3.3.0";
+
+  src = fetchzip {
+    url = "https://github.com/BleuBleu/FamiStudio/releases/download/${version}/FamiStudio${lib.strings.concatStrings (lib.splitVersion version)}-LinuxAMD64.zip";
+    stripRoot = false;
+    sha256 = "1r7y7z3s3b0zm7lvdgr9z70iall1swzlr3npx7g5azz6vza00vva";
+  };
+
+  nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
+
+  buildInputs = [ alsa-lib gtk-sharp-2_0 glib gtk2 mono openal ];
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/{bin,lib/famistudio}
+    mv * $out/lib/famistudio
+
+    makeWrapper ${mono}/bin/mono $out/bin/famistudio \
+      --add-flags $out/lib/famistudio/FamiStudio.exe \
+      --prefix MONO_GAC_PREFIX : ${gtk-sharp-2_0} \
+      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ glib gtk2 gtk-sharp-2_0 ]}
+
+    # Fails to find openal32.dll on its own, needs abit of help
+    rm $out/lib/famistudio/libopenal32.so
+    cat <<EOF >$out/lib/famistudio/OpenTK.dll.config
+    <configuration>
+      <dllmap dll="openal32.dll" target="${openal}/lib/libopenal.so"/>
+    </configuration>
+    EOF
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://famistudio.org/";
+    description = "NES Music Editor";
+    longDescription = ''
+      FamiStudio is very simple music editor for the Nintendo Entertainment System
+      or Famicom. It is targeted at both chiptune artists and NES homebrewers.
+    '';
+    license = licenses.mit;
+    # Maybe possible to build from source but I'm not too familiar with C# packaging
+    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+    maintainers = with maintainers; [ OPNA2608 ];
+    platforms = [ "x86_64-linux" ];
+  };
+}