Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chatterino7: init at 7.5.1 #345298

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 136 additions & 45 deletions pkgs/applications/networking/instant-messengers/chatterino2/default.nix
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";
longDescription = ''
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";
longDescription = ''
Chatterino7 is a fork of Chatterino 2.
This fork mainly contains features that aren't accepted into Chatterino 2, most notably 7TV subscriber features.
'';
};
};
}
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
4 changes: 1 addition & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33845,9 +33845,7 @@ with pkgs;
xwaylandSupport = false;
};

chatterino2 = callPackage ../applications/networking/instant-messengers/chatterino2 {
stdenv = if stdenv.hostPlatform.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
};
inherit (callPackages ../applications/networking/instant-messengers/chatterino2 { } ) chatterino2 chatterino2-unstable chatterino7 chatterino7-unstable;
hauskens marked this conversation as resolved.
Show resolved Hide resolved

weston = callPackage ../applications/window-managers/weston { };

Expand Down
Loading