2022-09-30 11:47:45 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2023-05-24 13:37:59 +00:00
|
|
|
, installShellFiles
|
2022-09-30 11:47:45 +00:00
|
|
|
, stdenv
|
|
|
|
, pkg-config
|
|
|
|
, fontconfig
|
2022-10-21 18:38:19 +00:00
|
|
|
, xorg
|
2024-04-21 15:54:59 +00:00
|
|
|
, libxkbcommon
|
|
|
|
, wayland
|
2022-09-30 11:47:45 +00:00
|
|
|
, libGL
|
|
|
|
, openssl
|
2023-05-24 13:37:59 +00:00
|
|
|
, darwin
|
2022-09-30 11:47:45 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "inlyne";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.4.2";
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "trimental";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-Kae8WnahA/6k6QT5htYU2+diAFkmxVsbVaxRUlhf39o=";
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
cargoHash = "sha256-M6daK2y9HBRDV2wQjw87g1QYOqiJBfRf9uW1Eg6z6C8=";
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
pkg-config
|
|
|
|
];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isLinux [
|
|
|
|
fontconfig
|
2022-10-21 18:38:19 +00:00
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libxcb
|
2024-04-21 15:54:59 +00:00
|
|
|
wayland
|
|
|
|
libxkbcommon
|
2022-09-30 11:47:45 +00:00
|
|
|
openssl
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
2023-05-24 13:37:59 +00:00
|
|
|
darwin.apple_sdk_11_0.frameworks.AppKit
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
checkFlags = lib.optionals stdenv.isDarwin [
|
|
|
|
# time out on darwin
|
|
|
|
"--skip=interpreter::tests::centered_image_with_size_align_and_link"
|
|
|
|
"--skip=watcher::tests::the_gauntlet"
|
|
|
|
];
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd inlyne \
|
|
|
|
--bash <($out/bin/inlyne --gen-completions bash) \
|
|
|
|
--fish <($out/bin/inlyne --gen-completions fish) \
|
|
|
|
--zsh <($out/bin/inlyne --gen-completions zsh)
|
|
|
|
'';
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
postFixup = lib.optionalString stdenv.isLinux ''
|
|
|
|
patchelf $out/bin/inlyne \
|
2022-10-21 18:38:19 +00:00
|
|
|
--add-rpath ${lib.makeLibraryPath [ libGL xorg.libX11 ]}
|
2022-09-30 11:47:45 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A GPU powered browserless markdown viewer";
|
|
|
|
homepage = "https://github.com/trimental/inlyne";
|
2023-05-24 13:37:59 +00:00
|
|
|
changelog = "https://github.com/trimental/inlyne/releases/tag/${src.rev}";
|
2022-09-30 11:47:45 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "inlyne";
|
2022-09-30 11:47:45 +00:00
|
|
|
};
|
|
|
|
}
|