chatterino2: generalize expression

Make chatterino2's expression more generic, so that it can be reused for
chatterino7.
This commit is contained in:
Marie Ramlow
2025-01-06 11:46:24 +01:00
parent d86ae899d2
commit 909dc0158a
2 changed files with 71 additions and 31 deletions
+46
View File
@@ -0,0 +1,46 @@
{
enableAvifSupport ? false,
stdenv,
lib,
cmake,
pkg-config,
boost,
openssl,
libsecret,
libavif,
kdePackages,
}:
stdenv.mkDerivation {
nativeBuildInputs = [
cmake
pkg-config
kdePackages.wrapQtAppsHook
];
buildInputs =
(with kdePackages; [
qtbase
qtsvg
qt5compat
qtkeychain
])
++ [
boost
openssl
libsecret
]
++ lib.optional stdenv.hostPlatform.isLinux kdePackages.qtwayland
++ lib.optional enableAvifSupport libavif;
cmakeFlags = [
(lib.cmakeBool "BUILD_WITH_QT6" true)
(lib.cmakeBool "USE_SYSTEM_QTKEYCHAIN" true)
(lib.cmakeBool "CHATTERINO_UPDATER" false)
];
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p "$out/Applications"
mv bin/chatterino.app "$out/Applications/"
'';
}
+25 -31
View File
@@ -1,37 +1,28 @@
{ stdenv, lib, cmake, pkg-config, fetchFromGitHub, qt6, boost, openssl, libsecret }:
{
lib,
callPackage,
fetchFromGitHub,
nix-update-script,
}:
stdenv.mkDerivation rec {
(callPackage ./common.nix { }).overrideAttrs (finalAttrs: _: {
pname = "chatterino2";
version = "2.5.1";
src = fetchFromGitHub {
owner = "Chatterino";
repo = pname;
rev = "v${version}";
repo = "chatterino2";
tag = "v${finalAttrs.version}";
hash = "sha256-c3Vhzes54xLjKV0Of7D1eFpQvIWJwcUBXvLT2p6VwBE=";
fetchSubmodules = true;
};
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; {
passthru = {
buildChatterino = args: callPackage ./common.nix args;
updateScript = nix-update-script { };
};
meta = {
description = "Chat client for Twitch chat";
mainProgram = "chatterino";
longDescription = ''
@@ -41,9 +32,12 @@ stdenv.mkDerivation rec {
"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 ];
changelog = "https://github.com/Chatterino/chatterino2/blob/${finalAttrs.src.rev}/CHANGELOG.md";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [
rexim
supa
];
};
}
})