nixpkgs/pkgs/applications/misc/girara/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

88 lines
1.6 KiB
Nix

{ lib
, stdenv
, fetchFromGitLab
, meson
, ninja
, pkg-config
, check
, dbus
, xvfb-run
, glib
, gtk
, gettext
, libiconv
, json-glib
, libintl
, zathura
}:
stdenv.mkDerivation rec {
pname = "girara";
version = "0.4.3";
outputs = [ "out" "dev" ];
src = fetchFromGitLab {
domain = "git.pwmt.org";
owner = "pwmt";
repo = "girara";
rev = version;
hash = "sha256-/bJXdLXksTxUFC3w7zuBZY6Zh7tJxUJVbS87ENDQbDE=";
};
nativeBuildInputs = [
meson
ninja
pkg-config
gettext
check
dbus
glib # for glib-compile-resources
];
buildInputs = [
libintl
libiconv
json-glib
];
propagatedBuildInputs = [
glib
gtk
];
nativeCheckInputs = [
xvfb-run
];
doCheck = !stdenv.hostPlatform.isDarwin;
mesonFlags = [
"-Ddocs=disabled" # docs do not seem to be installed
(lib.mesonEnable "tests" ((stdenv.buildPlatform.canExecute stdenv.hostPlatform) && (!stdenv.hostPlatform.isDarwin)))
];
checkPhase = ''
export NO_AT_BRIDGE=1
xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
--config-file=${dbus}/share/dbus-1/session.conf \
meson test --print-errorlogs
'';
passthru.tests = {
inherit zathura;
};
meta = with lib; {
homepage = "https://git.pwmt.org/pwmt/girara";
description = "User interface library";
longDescription = ''
girara is a library that implements a GTK based VIM-like user interface
that focuses on simplicity and minimalism.
'';
license = licenses.zlib;
platforms = platforms.linux ++ platforms.darwin;
maintainers = [ ];
};
}