mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
Made with
```shell
git restore .
fd '\.nix$' pkgs/ --type f -j1 -x bash -xc "$(cat <<"EOF"
typos --no-check-filenames --write-changes "$1"
git diff --exit-code "$1" && exit
#( git diff "$1" | grep -qE "^\+ +[^# ]") && git restore "$1"
count1="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> ' | wc -l )"
count2="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> (<span style="color:#f8f8f2;"> *</span>)?<span style="color:#75715e;">.*</span>$' | wc -l )"
[[ $count1 -ne $count2 ]] && git restore "$1"
EOF
)" -- {}
```
and filtered with `GIT_DIFF_OPTS='--unified=15' git -c interactive.singleKey=true add --patch`
I initially tried using the tree-sitter cli, python bindings and even ast-grep through various means, but this is what I ended up with.
86 lines
2.4 KiB
Nix
86 lines
2.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildDotnetModule,
|
|
fetchFromGitHub,
|
|
dotnetCorePackages,
|
|
wrapGAppsHook3,
|
|
|
|
glew,
|
|
gtk3,
|
|
}:
|
|
|
|
buildDotnetModule rec {
|
|
pname = "libation";
|
|
version = "11.5.5";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "rmcrackan";
|
|
repo = "Libation";
|
|
rev = "v${version}";
|
|
hash = "sha256-FD3f2Cba1xN15BloyRQ/m/vDovhN8x0AlfeJk+LGVV4=";
|
|
};
|
|
|
|
sourceRoot = "${src.name}/Source";
|
|
|
|
dotnet-sdk = dotnetCorePackages.sdk_8_0;
|
|
dotnet-runtime = dotnetCorePackages.runtime_8_0;
|
|
|
|
nugetDeps = ./deps.json;
|
|
|
|
dotnetFlags = [
|
|
"-p:PublishReadyToRun=false"
|
|
# for some reason this is set to win-x64 in the project files
|
|
"-p:RuntimeIdentifier="
|
|
];
|
|
|
|
projectFile = [
|
|
"LibationAvalonia/LibationAvalonia.csproj"
|
|
"LibationCli/LibationCli.csproj"
|
|
"HangoverAvalonia/HangoverAvalonia.csproj"
|
|
];
|
|
|
|
nativeBuildInputs = [ wrapGAppsHook3 ];
|
|
|
|
runtimeDeps = [
|
|
# For Avalonia UI
|
|
glew
|
|
# For file dialogs
|
|
gtk3
|
|
];
|
|
|
|
postInstall = ''
|
|
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}"
|
|
'';
|
|
|
|
# wrap manually, because we need lower case executables
|
|
dontDotnetFixup = true;
|
|
|
|
preFixup = ''
|
|
# remove binaries for other platform, like upstream does
|
|
pushd $out/lib/libation
|
|
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
|
|
|
|
wrapDotnetProgram $out/lib/libation/Libation $out/bin/libation
|
|
wrapDotnetProgram $out/lib/libation/LibationCli $out/bin/libationcli
|
|
wrapDotnetProgram $out/lib/libation/Hangover $out/bin/hangover
|
|
'';
|
|
|
|
meta = {
|
|
changelog = "https://github.com/rmcrackan/Libation/releases/tag/${src.rev}";
|
|
description = "Audible audiobook manager";
|
|
homepage = "https://github.com/rmcrackan/Libation";
|
|
license = lib.licenses.gpl3Only;
|
|
mainProgram = "libation";
|
|
maintainers = with lib.maintainers; [ tomasajt ];
|
|
};
|
|
}
|