nixpkgs-suyu/pkgs/applications/audio/famistudio/default.nix

66 lines
1.6 KiB
Nix
Raw Normal View History

2022-06-02 23:02:33 +02:00
{ lib
, stdenv
, fetchzip
, autoPatchelfHook
, makeWrapper
, mono
, openal
2022-08-25 14:22:00 +02:00
, libGL
2022-06-02 23:02:33 +02:00
}:
stdenv.mkDerivation rec {
pname = "famistudio";
2022-12-22 14:17:00 +01:00
version = "4.0.6";
2022-06-02 23:02:33 +02:00
src = fetchzip {
url = "https://github.com/BleuBleu/FamiStudio/releases/download/${version}/FamiStudio${lib.strings.concatStrings (lib.splitVersion version)}-LinuxAMD64.zip";
stripRoot = false;
2022-12-22 14:17:00 +01:00
sha256 = "sha256-Se9EIQTjZQM5qqzlEB4hGVRHDFdu6GecNGpw9gYMbW4=";
2022-06-02 23:02:33 +02:00
};
2022-08-25 14:22:00 +02:00
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
];
2022-06-02 23:02:33 +02:00
2022-08-25 14:22:00 +02:00
buildInputs = [
mono
openal
libGL
];
2022-06-02 23:02:33 +02:00
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 \
2022-08-25 14:22:00 +02:00
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libGL ]}
2022-06-02 23:02:33 +02:00
2022-08-25 14:22:00 +02:00
# Bundled openal lib freezes the application
2022-06-02 23:02:33 +02:00
rm $out/lib/famistudio/libopenal32.so
2022-08-25 14:22:00 +02:00
ln -s ${openal}/lib/libopenal.so $out/lib/famistudio/libopenal32.so
2022-06-02 23:02:33 +02:00
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" ];
};
}