Files

106 lines
2.1 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,
python3,
rustPlatform,
rustc,
shared-mime-info,
wrapGAppsHook4,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "rnote";
version = "0.14.2";
src = fetchFromGitHub {
owner = "flxzt";
repo = "rnote";
tag = "v${finalAttrs.version}";
hash = "sha256-uuLoc1nWlb3Xm/WSrvjCit1G8kUZA3+HIW8akFXPGi4=";
};
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname version src;
hash = "sha256-eDKyA8LaH+nvDcCG74ucWYSJc8qLmps1xz3WPHoOJ0w=";
};
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
]
++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
];
postPatch = ''
chmod +x build-aux/*.py
patchShebangs build-aux
'';
postInstall = ''
substituteInPlace $out/share/thumbnailers/rnote.thumbnailer \
--replace-fail "TryExec=rnote-cli" "TryExec=$out/bin/rnote-cli" \
--replace-fail "Exec=rnote-cli" "Exec=$out/bin/rnote-cli"
'';
env = lib.optionalAttrs stdenv.cc.isClang {
NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types";
};
meta = {
homepage = "https://github.com/flxzt/rnote";
changelog = "https://github.com/flxzt/rnote/releases/tag/${finalAttrs.src.tag}";
description = "Simple drawing application to create handwritten notes";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [
dotlambda
gepbird
yrd
];
platforms = lib.platforms.unix;
};
})