2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchzip
|
|
|
|
, autoPatchelfHook
|
2023-08-04 22:07:22 +00:00
|
|
|
, dotnet-runtime
|
|
|
|
, ffmpeg
|
|
|
|
, libglvnd
|
2022-06-16 17:23:12 +00:00
|
|
|
, makeWrapper
|
|
|
|
, openal
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "famistudio";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "4.1.1";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/BleuBleu/FamiStudio/releases/download/${version}/FamiStudio${lib.strings.concatStrings (lib.splitVersion version)}-LinuxAMD64.zip";
|
|
|
|
stripRoot = false;
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-fRNjboCfymBhr7Eg5ENnO1fchX0oTdeaJJ0SC3BKTVI=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
|
|
|
makeWrapper
|
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
buildInputs = [
|
2023-08-04 22:07:22 +00:00
|
|
|
dotnet-runtime
|
|
|
|
ffmpeg
|
|
|
|
libglvnd
|
2022-09-09 14:08:57 +00:00
|
|
|
openal
|
|
|
|
];
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
dontBuild = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/{bin,lib/famistudio}
|
|
|
|
mv * $out/lib/famistudio
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
makeWrapper ${lib.getExe dotnet-runtime} $out/bin/famistudio \
|
|
|
|
--add-flags $out/lib/famistudio/FamiStudio.dll \
|
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libglvnd ]} \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ ffmpeg ]}
|
2022-06-16 17:23:12 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
# Bundled openal lib freezes the application
|
2022-06-16 17:23:12 +00:00
|
|
|
rm $out/lib/famistudio/libopenal32.so
|
2022-09-09 14:08:57 +00:00
|
|
|
ln -s ${openal}/lib/libopenal.so $out/lib/famistudio/libopenal32.so
|
2022-06-16 17:23:12 +00: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" ];
|
|
|
|
};
|
|
|
|
}
|