nixpkgs/pkgs/by-name/rn/rnote/package.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

100 lines
2.0 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, alsa-lib
, appstream
, appstream-glib
, cargo
, cmake
, desktop-file-utils
, dos2unix
, glib
, gst_all_1
, gtk4
, libadwaita
, libxml2
, meson
, ninja
, pkg-config
, poppler
, python3
, rustPlatform
, rustc
, shared-mime-info
, wrapGAppsHook4
, darwin
}:
stdenv.mkDerivation rec {
pname = "rnote";
version = "0.11.0";
src = fetchFromGitHub {
owner = "flxzt";
repo = "rnote";
rev = "v${version}";
hash = "sha256-RbuEgmly6Mjmx58zOV+tg6Mv5ghCNy/dE5FXYrEXtdg=";
};
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
outputHashes = {
"ink-stroke-modeler-rs-0.1.0" = "sha256-B6lT6qSOIHxqBpKTE4nO2+Xs9KF7JLVRUHOkYp8Sl+M=";
"piet-0.6.2" = "sha256-3juXzuKwoLuxia6MoVwbcBJ3jXBQ9QRNVoxo3yFp2Iw=";
};
};
nativeBuildInputs = [
appstream-glib # For appstream-util
cmake
desktop-file-utils # For update-desktop-database
dos2unix
meson
ninja
pkg-config
python3 # For the postinstall script
rustPlatform.bindgenHook
rustPlatform.cargoSetupHook
cargo
rustc
shared-mime-info # For update-mime-database
wrapGAppsHook4
];
dontUseCmakeConfigure = true;
mesonFlags = [
(lib.mesonBool "cli" true)
];
buildInputs = [
appstream
glib
gst_all_1.gstreamer
gtk4
libadwaita
libxml2
poppler
] ++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.AudioUnit
];
postPatch = ''
chmod +x build-aux/*.py
patchShebangs build-aux
'';
meta = with lib; {
homepage = "https://github.com/flxzt/rnote";
changelog = "https://github.com/flxzt/rnote/releases/tag/${src.rev}";
description = "Simple drawing application to create handwritten notes";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ dotlambda gepbird yrd ];
platforms = platforms.unix;
# compiler error since 2023-11-17
broken = stdenv.hostPlatform.isDarwin;
};
}