-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
157 additions
and
48 deletions.
There are no files selected for viewing
181 changes: 136 additions & 45 deletions
181
pkgs/applications/networking/instant-messengers/chatterino2/default.nix
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 |
---|---|---|
@@ -1,49 +1,140 @@ | ||
{ stdenv, lib, cmake, pkg-config, fetchFromGitHub, qt6, boost, openssl, libsecret }: | ||
{ | ||
stdenv, | ||
lib, | ||
cmake, | ||
pkg-config, | ||
fetchFromGitHub, | ||
qt6, | ||
boost, | ||
openssl, | ||
libsecret, | ||
darwin, | ||
}: | ||
let | ||
stdenv' = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv; | ||
mkPackage = | ||
{ | ||
pname, | ||
version, | ||
src, | ||
extraMeta, | ||
}: | ||
|
||
stdenv.mkDerivation rec { | ||
pname = "chatterino2"; | ||
version = "2.5.1"; | ||
src = fetchFromGitHub { | ||
owner = "Chatterino"; | ||
repo = pname; | ||
rev = "v${version}"; | ||
hash = "sha256-c3Vhzes54xLjKV0Of7D1eFpQvIWJwcUBXvLT2p6VwBE="; | ||
fetchSubmodules = true; | ||
stdenv'.mkDerivation { | ||
inherit pname version src; | ||
nativeBuildInputs = [ | ||
cmake | ||
pkg-config | ||
qt6.wrapQtAppsHook | ||
]; | ||
buildInputs = [ | ||
qt6.qtbase | ||
qt6.qtsvg | ||
qt6.qtimageformats | ||
qt6.qttools | ||
qt6.qt5compat | ||
boost | ||
openssl | ||
libsecret | ||
] ++ lib.optionals stdenv.hostPlatform.isLinux [ qt6.qtwayland ]; | ||
|
||
env.GIT_HASH = "nix-${version}"; | ||
cmakeFlags = [ (lib.cmakeBool "BUILD_WITH_QT6" true) ]; | ||
postInstall = | ||
lib.optionalString stdenv.hostPlatform.isDarwin '' | ||
mkdir -p "$out/Applications" | ||
mv bin/chatterino.app "$out/Applications/" | ||
'' | ||
+ '' | ||
mkdir -p $out/share/icons/hicolor/256x256/apps | ||
cp $src/resources/icon.png $out/share/icons/hicolor/256x256/apps/chatterino.png | ||
''; | ||
passthru.updateScript = ./update.sh; | ||
meta = { | ||
description = "Chat client for Twitch chat"; | ||
mainProgram = "chatterino"; | ||
longDescription = '' | ||
Chatterino is a chat client for Twitch chat. | ||
It aims to be an improved/extended version of the Twitch web chat. | ||
Chatterino 2 is the second installment of the Twitch chat client series "Chatterino". | ||
''; | ||
license = lib.licenses.mit; | ||
platforms = lib.platforms.unix; | ||
maintainers = with lib.maintainers; [ | ||
rexim | ||
supa | ||
hausken | ||
]; | ||
} // extraMeta; | ||
}; | ||
in | ||
{ | ||
chatterino2 = mkPackage rec { | ||
pname = "chatterino2"; | ||
version = "2.5.1"; | ||
src = fetchFromGitHub { | ||
owner = "Chatterino"; | ||
repo = "chatterino2"; | ||
rev = "v${version}"; | ||
hash = "sha256-c3Vhzes54xLjKV0Of7D1eFpQvIWJwcUBXvLT2p6VwBE="; | ||
fetchSubmodules = true; | ||
}; | ||
extraMeta = { | ||
homepage = "https://github.com/Chatterino/chatterino2"; | ||
changelog = "https://github.com/Chatterino/chatterino2/blob/${src.rev}/CHANGELOG.md"; | ||
}; | ||
}; | ||
chatterino2-unstable = mkPackage rec { | ||
pname = "chatterino2"; | ||
version = "0-unstable-2024-09-29"; | ||
src = fetchFromGitHub { | ||
owner = "Chatterino"; | ||
repo = "chatterino2"; | ||
rev = "0db477665c5a4b40149aed231c09ce00a075baf7"; | ||
hash = "sha256-1LTfRfxodvyqLSBZsGuFrZaQ5+vYA6LNxuVkLXaTZKI="; | ||
fetchSubmodules = true; | ||
}; | ||
extraMeta = { | ||
homepage = "https://github.com/Chatterino/chatterino2"; | ||
changelog = "https://github.com/Chatterino/chatterino2/blob/${src.rev}/CHANGELOG.md"; | ||
}; | ||
}; | ||
chatterino7 = mkPackage rec { | ||
pname = "chatterino7"; | ||
version = "7.5.1"; | ||
src = fetchFromGitHub { | ||
owner = "SevenTV"; | ||
repo = "chatterino7"; | ||
rev = "v${version}"; | ||
hash = "sha256-T0H+p9hyNd73gETwLilXN0uzcF75TJgx/LzHqnC099M="; | ||
fetchSubmodules = true; | ||
}; | ||
extraMeta = { | ||
homepage = "https://github.com/SevenTV/chatterino7"; | ||
changelog = "https://github.com/SevenTV/chatterino7/blob/${src.rev}/CHANGELOG.md"; | ||
extraDescription = '' | ||
Chatterino7 is a fork of Chatterino 2. | ||
This fork mainly contains features that aren't accepted into Chatterino 2, most notably 7TV subscriber features. | ||
''; | ||
}; | ||
}; | ||
nativeBuildInputs = [ cmake pkg-config qt6.wrapQtAppsHook ]; | ||
buildInputs = [ | ||
qt6.qtbase | ||
qt6.qtsvg | ||
qt6.qtimageformats | ||
qt6.qttools | ||
qt6.qt5compat | ||
boost | ||
openssl | ||
libsecret | ||
] ++ lib.optionals stdenv.hostPlatform.isLinux [ | ||
qt6.qtwayland | ||
]; | ||
cmakeFlags = [ "-DBUILD_WITH_QT6=ON" ]; | ||
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin '' | ||
mkdir -p "$out/Applications" | ||
mv bin/chatterino.app "$out/Applications/" | ||
'' + '' | ||
mkdir -p $out/share/icons/hicolor/256x256/apps | ||
cp $src/resources/icon.png $out/share/icons/hicolor/256x256/apps/chatterino.png | ||
''; | ||
meta = with lib; { | ||
description = "Chat client for Twitch chat"; | ||
mainProgram = "chatterino"; | ||
longDescription = '' | ||
Chatterino is a chat client for Twitch chat. It aims to be an | ||
improved/extended version of the Twitch web chat. Chatterino 2 is | ||
the second installment of the Twitch chat client series | ||
"Chatterino". | ||
''; | ||
homepage = "https://github.com/Chatterino/chatterino2"; | ||
changelog = "https://github.com/Chatterino/chatterino2/blob/master/CHANGELOG.md"; | ||
license = licenses.mit; | ||
platforms = platforms.unix; | ||
maintainers = with maintainers; [ rexim supa ]; | ||
chatterino7-unstable = mkPackage rec { | ||
pname = "chatterino7"; | ||
version = "0-unstable-2024-09-28"; | ||
src = fetchFromGitHub { | ||
owner = "SevenTV"; | ||
repo = "chatterino7"; | ||
rev = "978fb9820361c2e9ce1b5f1425e0243af1d5517d"; | ||
hash = "sha256-pkY8+UvttYLOJ/9OtJ4q5SY27rutCjR/iJ25+rVGxvk="; | ||
fetchSubmodules = true; | ||
}; | ||
extraMeta = { | ||
homepage = "https://github.com/SevenTV/chatterino7"; | ||
changelog = "https://github.com/SevenTV/chatterino7/blob/${src.rev}/CHANGELOG.md"; | ||
extraDescription = '' | ||
Chatterino7 is a fork of Chatterino 2. | ||
This fork mainly contains features that aren't accepted into Chatterino 2, most notably 7TV subscriber features. | ||
''; | ||
}; | ||
}; | ||
} |
20 changes: 20 additions & 0 deletions
20
pkgs/applications/networking/instant-messengers/chatterino2/update.sh
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,20 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -I nixpkgs=./. -i bash -p curl common-updater-scripts jq | ||
|
||
set -euo pipefail | ||
|
||
ATTR=$1 | ||
|
||
OLD_VERSION=$(nix eval --raw -f default.nix "$ATTR.version") | ||
OWNER=$(nix eval --raw -f default.nix "$ATTR.src.owner") | ||
REPO=$(nix eval --raw -f default.nix "$ATTR.src.repo") | ||
|
||
if [[ $OLD_VERSION =~ "0-unstable-" ]]; then | ||
releaseDate=$(curl "https://api.github.com/repos/$OWNER/$REPO/commits/nightly-build" | jq -r '.commit.author.date' | cut -d 'T' -f 1) | ||
revision=$(curl "https://api.github.com/repos/$OWNER/$REPO/commits/nightly-build" | jq -r '.sha') | ||
version="0-unstable-$releaseDate" | ||
update-source-version "$ATTR" "$version" --rev="$revision" | ||
else | ||
version=$(curl --silent "https://api.github.com/repos/$OWNER/$REPO/releases" | jq -r '[.[] | select(.tag_name != "nightly-build")] | .[0].tag_name' | sed 's/v//') | ||
update-source-version "$ATTR" "$version" | ||
fi |
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