nixpkgs/pkgs/applications/networking/instant-messengers/chatterino2/default.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

50 lines
1.6 KiB
Nix

{ stdenv, lib, cmake, pkg-config, fetchFromGitHub, qt6, boost, openssl, libsecret }:
stdenv.mkDerivation rec {
pname = "chatterino2";
version = "2.5.1";
src = fetchFromGitHub {
owner = "Chatterino";
repo = pname;
rev = "v${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; {
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 ];
};
}