forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
discordchatexporter-desktop: init at 2.44 (NixOS#353864)
- Loading branch information
Showing
4 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
}; | ||
} |
19 changes: 19 additions & 0 deletions
19
pkgs/by-name/di/discordchatexporter-desktop/settings-path.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) | ||
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |