diff --git a/pkgs/by-name/di/discordchatexporter-desktop/deps.nix b/pkgs/by-name/di/discordchatexporter-desktop/deps.nix new file mode 100644 index 0000000000000..fd58241eab6fb --- /dev/null +++ b/pkgs/by-name/di/discordchatexporter-desktop/deps.nix @@ -0,0 +1,59 @@ +# This file was automatically generated by passthru.fetch-deps. +# Please dont edit it manually, your changes might get overwritten! + +{ fetchNuGet }: [ + (fetchNuGet { pname = "AdvancedStringBuilder"; version = "0.1.1"; hash = "sha256-pLixGUct2lQnSeckSHVnIEoGfsvz3gkA914QSHdaheE="; }) + (fetchNuGet { pname = "AngleSharp"; version = "1.1.2"; hash = "sha256-LvJDD+C/NiPLVjEnIWkR+39UkzoeWgPd7BBXakij0WU="; }) + (fetchNuGet { pname = "AsyncImageLoader.Avalonia"; version = "3.3.0"; hash = "sha256-blhfKI+vX+ojT2cOvSHu3Kp2CuxvhW/l+as88Dia4bA="; }) + (fetchNuGet { pname = "AsyncKeyedLock"; version = "7.0.2"; hash = "sha256-UFPta8yWtuFhpfy7OpBkUDQnyO8TODXEE0zA6ubz1QM="; }) + (fetchNuGet { pname = "Avalonia"; version = "11.0.0"; hash = "sha256-7QE0MtD1QDiG3gRx5xW33E33BXyEtASQSw+Wi3Lmy3E="; }) + (fetchNuGet { pname = "Avalonia"; version = "11.0.0-rc1.1"; hash = "sha256-tcIOUqi/EmV2mKfrhvIfYKSHt9fNbXeGzuqbvhY29pU="; }) + (fetchNuGet { pname = "Avalonia"; version = "11.1.0"; hash = "sha256-HVcwSKc+f69vuRHJ9CT0QL46WFM/gggnY6Wn8IUQq+U="; }) + (fetchNuGet { pname = "Avalonia"; version = "11.2.0"; hash = "sha256-kG3tnsLdodlvIjYd5feBZ0quGd2FsvV8FIy7uD5UZ5Q="; }) + (fetchNuGet { pname = "Avalonia.Angle.Windows.Natives"; version = "2.1.22045.20230930"; hash = "sha256-RxPcWUT3b/+R3Tu5E5ftpr5ppCLZrhm+OTsi0SwW3pc="; }) + (fetchNuGet { pname = "Avalonia.BuildServices"; version = "0.0.29"; hash = "sha256-WPHRMNowRnYSCh88DWNBCltWsLPyOfzXGzBqLYE7tRY="; }) + (fetchNuGet { pname = "Avalonia.Controls.ColorPicker"; version = "11.2.0"; hash = "sha256-x6IdcSo3e2Pq/En9/N80HpPblEXSAv51VRlBrF8wlVM="; }) + (fetchNuGet { pname = "Avalonia.Controls.DataGrid"; version = "11.2.0"; hash = "sha256-pd/cD82onMZ0iMLl9TOCl35PEvAPbyX2lUj49lrBpOA="; }) + (fetchNuGet { pname = "Avalonia.Desktop"; version = "11.2.0"; hash = "sha256-+5ISi6WXe8AIjClVo3UqZHgzZpFbMgFk13YvHHhx9MM="; }) + (fetchNuGet { pname = "Avalonia.Diagnostics"; version = "11.2.0"; hash = "sha256-k60HGDKnsXiDOnxSH+Hx2ihyqmxSSeWIBJx2XD1ELW0="; }) + (fetchNuGet { pname = "Avalonia.FreeDesktop"; version = "11.2.0"; hash = "sha256-u4CQvG6EdsyaHSWa+Y704sDiWZlqbArB0g4gcoCFwQo="; }) + (fetchNuGet { pname = "Avalonia.Native"; version = "11.2.0"; hash = "sha256-fMikurP2RAnOahZkORxuGOKGn5iQ0saZCEYsvoFiFQI="; }) + (fetchNuGet { pname = "Avalonia.Remote.Protocol"; version = "11.2.0"; hash = "sha256-QwYY3bpShJ1ayHUx+mjnwaEhCPDzTk+YeasCifAtGzM="; }) + (fetchNuGet { pname = "Avalonia.Skia"; version = "11.2.0"; hash = "sha256-rNR+l+vLtlzTU+F51FpOi4Ujy7nR5+lbTc3NQte8s/o="; }) + (fetchNuGet { pname = "Avalonia.Themes.Simple"; version = "11.2.0"; hash = "sha256-l88ZX50Nao8wjtRnyZxNFFgRpJ/yxxNki6NY48dyTUg="; }) + (fetchNuGet { pname = "Avalonia.Win32"; version = "11.2.0"; hash = "sha256-A9PB6Bt61jLdQlMOkchWy/3BwROgxS9BP8FObs/KFiU="; }) + (fetchNuGet { pname = "Avalonia.X11"; version = "11.2.0"; hash = "sha256-EP9cCqriEh8d+Wwyv27QGK/CY6w2LcCjtcIv79PZqkM="; }) + (fetchNuGet { pname = "Cogwheel"; version = "2.1.0"; hash = "sha256-Gby3JWUOSgQQmTLZfiItGdjE95GoZ/Cfqfp1CsWyS5g="; }) + (fetchNuGet { pname = "CommunityToolkit.Mvvm"; version = "8.3.2"; hash = "sha256-zY+iB5Rj/8ru0xpRWwFLFO6JI3UFB/XHnx9pWmrZCAs="; }) + (fetchNuGet { pname = "CSharpier.MsBuild"; version = "0.29.2"; hash = "sha256-JRIIhn2Um+vWaaJtJ9ej5Ov6ywPNfd5EOAVtNXv++DE="; }) + (fetchNuGet { pname = "Deorcify"; version = "1.0.2"; hash = "sha256-deEn+hUElOZS7lq3SUeot7vDB3VFQxGDML20TGj2nVs="; }) + (fetchNuGet { pname = "DialogHost.Avalonia"; version = "0.8.1"; hash = "sha256-5gMb8Ap53YFIyFYfpceAd53RzlK0OF5PbiQtyCT5hew="; }) + (fetchNuGet { pname = "Gress"; version = "2.1.1"; hash = "sha256-k5EbB4xOWoTCurtIuIx7t3obpWQKQCb7gEZQD6kLf+s="; }) + (fetchNuGet { pname = "HarfBuzzSharp"; version = "7.3.0.2"; hash = "sha256-ibgoqzT1NV7Qo5e7X2W6Vt7989TKrkd2M2pu+lhSDg8="; }) + (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.Linux"; version = "7.3.0.2"; hash = "sha256-SSfyuyBaduGobJW+reqyioWHhFWsQ+FXa2Gn7TiWxrU="; }) + (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.macOS"; version = "7.3.0.2"; hash = "sha256-dmEqR9MmpCwK8AuscfC7xUlnKIY7+Nvi06V0u5Jff08="; }) + (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.WebAssembly"; version = "7.3.0.3-preview.2.2"; hash = "sha256-1NlcTnXrWUYZ2r2/N3SPxNIjNcyIpiiv3g7h8XxpNkM="; }) + (fetchNuGet { pname = "HarfBuzzSharp.NativeAssets.Win32"; version = "7.3.0.2"; hash = "sha256-x4iM3NHs9VyweG57xA74yd4uLuXly147ooe0mvNQ8zo="; }) + (fetchNuGet { pname = "JsonExtensions"; version = "1.2.0"; hash = "sha256-vhuDDUSzDS5u9dfup0qk6j7Vc9i8Wyo7dBivpVaEpDw="; }) + (fetchNuGet { pname = "Material.Avalonia"; version = "3.7.4"; hash = "sha256-XRcAb8LPPCRCQx9qWVHrm8tbyNp74aTZmMhBlo7upWs="; }) + (fetchNuGet { pname = "Material.Icons"; version = "2.1.10"; hash = "sha256-Xn/CRyvLFiixRvA/NXMxX9geLJu9QKDKtKMkJAZN6po="; }) + (fetchNuGet { pname = "Material.Icons.Avalonia"; version = "2.1.10"; hash = "sha256-L7bjGcYOxC+7VgQNmpIKlHypNCD5GVEK7q47PG93HgI="; }) + (fetchNuGet { pname = "MicroCom.Runtime"; version = "0.11.0"; hash = "sha256-VdwpP5fsclvNqJuppaOvwEwv2ofnAI5ZSz2V+UEdLF0="; }) + (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection"; version = "8.0.1"; hash = "sha256-O9g0jWS+jfGoT3yqKwZYJGL+jGSIeSbwmvomKDC3hTU="; }) + (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection.Abstractions"; version = "8.0.2"; hash = "sha256-UfLfEQAkXxDaVPC7foE/J3FVEXd31Pu6uQIhTic3JgY="; }) + (fetchNuGet { pname = "Onova"; version = "2.6.12"; hash = "sha256-kYChxhtYxRhQ5gldSKg+jr6SoMqq6w2ezXZkBd4AtZk="; }) + (fetchNuGet { pname = "Polly"; version = "8.4.2"; hash = "sha256-cuaH3SdTEdwLA1VddtY6CsmHTiDuYk0dVJ79r/6jSpQ="; }) + (fetchNuGet { pname = "Polly.Core"; version = "8.4.2"; hash = "sha256-4fn5n6Bu29uqWg8ciii3MDsi9bO2/moPa9B3cJ9Ihe8="; }) + (fetchNuGet { pname = "RazorBlade"; version = "0.6.0"; hash = "sha256-2ihHI4leF0co2IyEsQDtLmNFNvL0TkqkPmS1dtqRYoY="; }) + (fetchNuGet { pname = "SkiaSharp"; version = "2.88.8"; hash = "sha256-rD5gc4SnlRTXwz367uHm8XG5eAIQpZloGqLRGnvNu0A="; }) + (fetchNuGet { pname = "SkiaSharp.NativeAssets.Linux"; version = "2.88.8"; hash = "sha256-fOmNbbjuTazIasOvPkd2NPmuQHVCWPnow7AxllRGl7Y="; }) + (fetchNuGet { pname = "SkiaSharp.NativeAssets.macOS"; version = "2.88.8"; hash = "sha256-CdcrzQHwCcmOCPtS8EGtwsKsgdljnH41sFytW7N9PmI="; }) + (fetchNuGet { pname = "SkiaSharp.NativeAssets.WebAssembly"; version = "2.88.8"; hash = "sha256-GWWsE98f869LiOlqZuXMc9+yuuIhey2LeftGNk3/z3w="; }) + (fetchNuGet { pname = "SkiaSharp.NativeAssets.Win32"; version = "2.88.8"; hash = "sha256-b8Vb94rNjwPKSJDQgZ0Xv2dWV7gMVFl5GwTK/QiZPPM="; }) + (fetchNuGet { pname = "Superpower"; version = "3.0.0"; hash = "sha256-5MNmhBDYyOs+sTH364Qdn+Ck328BAQaVC1KMQ7yK2Vw="; }) + (fetchNuGet { pname = "System.IO.Pipelines"; version = "8.0.0"; hash = "sha256-LdpB1s4vQzsOODaxiKstLks57X9DTD5D6cPx8DE1wwE="; }) + (fetchNuGet { pname = "System.Text.Encoding.CodePages"; version = "8.0.0"; hash = "sha256-fjCLQc1PRW0Ix5IZldg0XKv+J1DqPSfu9pjMyNBp7dE="; }) + (fetchNuGet { pname = "Tmds.DBus.Protocol"; version = "0.20.0"; hash = "sha256-CRW/tkgsuBiBJfRwou12ozRQsWhHDooeP88E5wWpWJw="; }) + (fetchNuGet { pname = "WebMarkupMin.Core"; version = "2.17.0"; hash = "sha256-LuTotFyrjbUf9hrVqNPVs443lizPgNINbKoHT4cfjYs="; }) + (fetchNuGet { pname = "YoutubeExplode"; version = "6.4.3"; hash = "sha256-y2mlhXO3KHz1CfksjCVEvh3LZqDUiXh5sHlioNR70Ww="; }) +] diff --git a/pkgs/by-name/di/discordchatexporter-desktop/package.nix b/pkgs/by-name/di/discordchatexporter-desktop/package.nix new file mode 100644 index 0000000000000..ecb680619fb93 --- /dev/null +++ b/pkgs/by-name/di/discordchatexporter-desktop/package.nix @@ -0,0 +1,47 @@ +{ + lib, + buildDotnetModule, + dotnetCorePackages, + fetchFromGitHub, + testers, + discordchatexporter-desktop, +}: + +buildDotnetModule rec { + pname = "discordchatexporter-desktop"; + version = "2.44"; + + src = fetchFromGitHub { + owner = "tyrrrz"; + repo = "discordchatexporter"; + rev = version; + hash = "sha256-eLwSodbEux8pYXNZZg8c2rCYowTEkvPzYbxANYe0O7w="; + }; + + env.XDG_CONFIG_HOME = "$HOME/.config"; + + projectFile = "DiscordChatExporter.Gui/DiscordChatExporter.Gui.csproj"; + nugetDeps = ./deps.nix; + dotnet-sdk = dotnetCorePackages.sdk_9_0; + dotnet-runtime = dotnetCorePackages.runtime_9_0; + + patches = [ ./settings-path.patch ]; + + postFixup = '' + ln -s $out/bin/DiscordChatExporter $out/bin/discordchatexporter + ''; + + passthru = { + updateScript = ./updater.sh; + }; + + meta = with lib; { + description = "Tool to export Discord chat logs to a file (GUI version)"; + homepage = "https://github.com/Tyrrrz/DiscordChatExporter"; + license = licenses.gpl3Plus; + changelog = "https://github.com/Tyrrrz/DiscordChatExporter/blob/${version}/Changelog.md"; + maintainers = with maintainers; [ kekschen ]; + platforms = [ "x86_64-linux" ]; + mainProgram = "discordchatexporter"; + }; +} diff --git a/pkgs/by-name/di/discordchatexporter-desktop/settings-path.patch b/pkgs/by-name/di/discordchatexporter-desktop/settings-path.patch new file mode 100644 index 0000000000000..c0fcbb3161954 --- /dev/null +++ b/pkgs/by-name/di/discordchatexporter-desktop/settings-path.patch @@ -0,0 +1,19 @@ +diff --git a/DiscordChatExporter.Gui/Services/SettingsService.cs b/DiscordChatExporter.Gui/Services/SettingsService.cs +index 4f69969..80a8d4b 100644 +--- a/DiscordChatExporter.Gui/Services/SettingsService.cs ++++ b/DiscordChatExporter.Gui/Services/SettingsService.cs +@@ -14,7 +14,13 @@ namespace DiscordChatExporter.Gui.Services; + [INotifyPropertyChanged] + public partial class SettingsService() + : SettingsBase( +- Path.Combine(AppContext.BaseDirectory, "Settings.dat"), ++ Path.Combine( ++ System.IO.Path.Combine( ++ Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), ++ "discordchatexporter" ++ ), ++ "Settings.dat" ++ ), + SerializerContext.Default + ) + { diff --git a/pkgs/by-name/di/discordchatexporter-desktop/updater.sh b/pkgs/by-name/di/discordchatexporter-desktop/updater.sh new file mode 100755 index 0000000000000..0487fd1c392c4 --- /dev/null +++ b/pkgs/by-name/di/discordchatexporter-desktop/updater.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env nix-shell +#!nix-shell -I nixpkgs=./. -i bash -p curl jq common-updater-scripts +set -eo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +new_version="$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} "https://api.github.com/repos/tyrrrz/DiscordChatExporter/releases?per_page=1" | jq -r '.[0].name')" +old_version="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./package.nix)" +if [[ "$new_version" == "$old_version" ]]; then + echo "Up to date" + exit 0 +fi + +cd ../../../.. +update-source-version discordchatexporter-desktop "$new_version" +$(nix-build -A discordchatexporter-desktop.fetch-deps --no-out-link)