2024-05-15 15:35:15 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildDotnetModule,
|
|
|
|
fetchFromGitHub,
|
|
|
|
dotnetCorePackages,
|
|
|
|
wrapGAppsHook3,
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
glew,
|
|
|
|
gtk3,
|
2024-01-02 11:29:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildDotnetModule rec {
|
|
|
|
pname = "libation";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "11.3.14.2";
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rmcrackan";
|
|
|
|
repo = "Libation";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-MsCUTXN9lwJ7YvYvrgyqapa1iZ/roMCTz3mqMhhPh14=";
|
2024-01-02 11:29:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "${src.name}/Source";
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
dotnet-sdk = dotnetCorePackages.sdk_8_0;
|
|
|
|
dotnet-runtime = dotnetCorePackages.runtime_8_0;
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
nugetDeps = ./deps.nix;
|
|
|
|
|
|
|
|
dotnetFlags = [ "-p:PublishReadyToRun=false" ];
|
|
|
|
|
|
|
|
projectFile = [
|
|
|
|
"LibationAvalonia/LibationAvalonia.csproj"
|
|
|
|
"LibationCli/LibationCli.csproj"
|
|
|
|
"HangoverAvalonia/HangoverAvalonia.csproj"
|
|
|
|
];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeBuildInputs = [ wrapGAppsHook3 ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
|
|
|
runtimeDeps = [
|
|
|
|
# For Avalonia UI
|
|
|
|
glew
|
|
|
|
# For file dialogs
|
|
|
|
gtk3
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2024-05-15 15:35:15 +00:00
|
|
|
install -Dm644 LoadByOS/LinuxConfigApp/libation_glass.svg $out/share/icons/hicolor/scalable/apps/libation.svg
|
|
|
|
install -Dm644 LoadByOS/LinuxConfigApp/Libation.desktop $out/share/applications/libation.desktop
|
|
|
|
substituteInPlace $out/share/applications/libation.desktop \
|
|
|
|
--replace-fail "/usr/bin/libation" "${meta.mainProgram}"
|
2024-01-02 11:29:13 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# wrap manually, because we need lower case excutables
|
|
|
|
dontDotnetFixup = true;
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
# remove binaries for other platform, like upstream does
|
2024-09-19 14:19:46 +00:00
|
|
|
pushd $out/lib/libation
|
2024-01-02 11:29:13 +00:00
|
|
|
rm -f *.x86.dll *.x64.dll
|
|
|
|
${lib.optionalString (stdenv.system != "x86_64-linux") "rm -f *.x64.so"}
|
|
|
|
${lib.optionalString (stdenv.system != "aarch64-linux") "rm -f *.arm64.so"}
|
|
|
|
${lib.optionalString (stdenv.system != "x86_64-darwin") "rm -f *.x64.dylib"}
|
|
|
|
${lib.optionalString (stdenv.system != "aarch64-darwin") "rm -f *.arm64.dylib"}
|
|
|
|
popd
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
wrapDotnetProgram $out/lib/libation/Libation $out/bin/libation
|
|
|
|
wrapDotnetProgram $out/lib/libation/LibationCli $out/bin/libationcli
|
|
|
|
wrapDotnetProgram $out/lib/libation/Hangover $out/bin/hangover
|
2024-01-02 11:29:13 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
changelog = "https://github.com/rmcrackan/Libation/releases/tag/${src.rev}";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Audible audiobook manager";
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://github.com/rmcrackan/Libation";
|
|
|
|
license = lib.licenses.gpl3Only;
|
|
|
|
mainProgram = "libation";
|
|
|
|
maintainers = with lib.maintainers; [ tomasajt ];
|
|
|
|
};
|
|
|
|
}
|