Skip to content

Commit

Permalink
Chatterino7: init at 7.5.1
Browse files Browse the repository at this point in the history
- Added chatterino7, using same build as chatterino2 since it is a very
similar fork
- Added unstable build versions for chatterino2 and chatterino7
- Added update script to support the unstable builds
- Applied formatting
- Added Hausken as maintainer
  • Loading branch information
hauskens committed Sep 29, 2024
1 parent 01df3c1 commit 1220203
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 47 deletions.
169 changes: 125 additions & 44 deletions pkgs/applications/networking/instant-messengers/chatterino2/default.nix
Original file line number Diff line number Diff line change
@@ -1,49 +1,130 @@
{ 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.isDarwin then darwin.apple_sdk_11_0.stdenv else stdenv;
mkPackage =
{
pname,
version,
src,
extraDescription ? "",
}:

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;
inherit version;
inherit 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 ];

GIT_HASH = "nix-${version}";
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
'';
passthru.updateScript = ./update.sh;
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".
''
+ extraDescription;
homepage = "https://github.com/${src.owner}/${src.repo}";
changelog = "https://github.com/${src.owner}/${src.repo}/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [
rexim
supa
hausken
];
};
};
in
{
chatterino2 = mkPackage rec {
pname = "chatterino2";
version = "2.5.1";
src = fetchFromGitHub {
owner = "Chatterino";
repo = pname;
rev = "v${version}";
hash = "sha256-c3Vhzes54xLjKV0Of7D1eFpQvIWJwcUBXvLT2p6VwBE=";
fetchSubmodules = true;
};
};
chatterino2-unstable = mkPackage rec {
pname = "chatterino2";
version = "0-unstable-2024-09-29";
src = fetchFromGitHub {
owner = "Chatterino";
repo = pname;
rev = "0db477665c5a4b40149aed231c09ce00a075baf7";
hash = "sha256-1LTfRfxodvyqLSBZsGuFrZaQ5+vYA6LNxuVkLXaTZKI=";
fetchSubmodules = true;
};
};
chatterino7 = mkPackage rec {
pname = "chatterino7";
version = "7.5.1";
src = fetchFromGitHub {
owner = "SevenTV";
repo = pname;
rev = "v${version}";
hash = "sha256-T0H+p9hyNd73gETwLilXN0uzcF75TJgx/LzHqnC099M=";
fetchSubmodules = true;
};
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".
chatterino7-unstable = mkPackage rec {
pname = "chatterino7";
version = "0-unstable-2024-09-28";
src = fetchFromGitHub {
owner = "SevenTV";
repo = pname;
rev = "978fb9820361c2e9ce1b5f1425e0243af1d5517d";
hash = "sha256-pkY8+UvttYLOJ/9OtJ4q5SY27rutCjR/iJ25+rVGxvk=";
fetchSubmodules = true;
};
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.
'';
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 ];
};
}
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;

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

Expand Down

0 comments on commit 1220203

Please sign in to comment.