2023-08-22 20:05:09 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildDotnetModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, dotnetCorePackages
|
|
|
|
, dbus
|
|
|
|
, fontconfig
|
|
|
|
, libICE
|
|
|
|
, libSM
|
|
|
|
, libX11
|
|
|
|
, portaudio
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildDotnetModule rec {
|
|
|
|
pname = "OpenUtau";
|
2024-02-07 01:22:34 +00:00
|
|
|
version = "0.1.327";
|
2023-08-22 20:05:09 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stakira";
|
|
|
|
repo = "OpenUtau";
|
|
|
|
rev = "build/${version}";
|
2024-02-07 01:22:34 +00:00
|
|
|
hash = "sha256-Bss32Fk4yBEFqaIxT2dfdvWXz09sO6akiitDQBXoSvY=";
|
2023-08-22 20:05:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dotnet-sdk = dotnetCorePackages.sdk_7_0;
|
|
|
|
dotnet-runtime = dotnetCorePackages.runtime_7_0;
|
|
|
|
|
|
|
|
projectFile = "OpenUtau.sln";
|
|
|
|
nugetDeps = ./deps.nix;
|
|
|
|
|
|
|
|
executables = [ "OpenUtau" ];
|
|
|
|
|
|
|
|
runtimeDeps = [
|
|
|
|
dbus
|
|
|
|
fontconfig
|
|
|
|
libICE
|
|
|
|
libSM
|
|
|
|
libX11
|
|
|
|
portaudio
|
|
|
|
];
|
|
|
|
|
|
|
|
dotnetInstallFlags = [ "-p:PublishReadyToRun=false" ];
|
|
|
|
|
|
|
|
# socket cannot bind to localhost on darwin for tests
|
|
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
# net7.0 replacement needed until upstream bumps to dotnet 7
|
2023-08-22 20:05:09 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace OpenUtau/OpenUtau.csproj OpenUtau.Test/OpenUtau.Test.csproj --replace \
|
2023-10-19 13:55:26 +00:00
|
|
|
'<TargetFramework>net6.0</TargetFramework>' \
|
|
|
|
'<TargetFramework>net7.0</TargetFramework>'
|
2024-02-07 01:22:34 +00:00
|
|
|
|
|
|
|
substituteInPlace OpenUtau/Program.cs --replace \
|
|
|
|
'/usr/bin/fc-match' \
|
|
|
|
'${lib.getExe' fontconfig "fc-match"}'
|
2023-08-22 20:05:09 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# need to make sure proprietary worldline resampler is copied
|
|
|
|
postInstall = let
|
|
|
|
runtime = if (stdenv.isLinux && stdenv.isx86_64) then "linux-x64"
|
|
|
|
else if (stdenv.isLinux && stdenv.isAarch64) then "linux-arm64"
|
|
|
|
else if stdenv.isDarwin then "osx"
|
|
|
|
else null;
|
|
|
|
in lib.optionalString (runtime != null) ''
|
|
|
|
cp runtimes/${runtime}/native/libworldline${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/OpenUtau/
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Open source singing synthesis platform and UTAU successor";
|
|
|
|
homepage = "http://www.openutau.com/";
|
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
fromSource
|
|
|
|
# deps
|
|
|
|
binaryBytecode
|
|
|
|
# some deps and worldline resampler
|
|
|
|
binaryNativeCode
|
|
|
|
];
|
|
|
|
license = with licenses; [
|
2023-11-16 04:20:00 +00:00
|
|
|
# dotnet code and worldline resampler binary
|
2023-08-22 20:05:09 +00:00
|
|
|
mit
|
2023-11-16 04:20:00 +00:00
|
|
|
# worldline resampler binary - no source is available (hence "unfree") but usage of the binary is MIT
|
|
|
|
unfreeRedistributable
|
2023-08-22 20:05:09 +00:00
|
|
|
];
|
|
|
|
maintainers = with maintainers; [ lilyinstarlight ];
|
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
|
|
|
};
|
|
|
|
}
|