2022-09-28 20:29:32 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2023-05-08 13:35:00 +00:00
|
|
|
, installShellFiles
|
2022-09-28 20:29:32 +00:00
|
|
|
, stdenv
|
|
|
|
, pkg-config
|
|
|
|
, fontconfig
|
2022-10-13 22:16:16 +00:00
|
|
|
, xorg
|
2024-02-18 23:48:52 +00:00
|
|
|
, libxkbcommon
|
|
|
|
, wayland
|
2022-09-28 20:29:32 +00:00
|
|
|
, libGL
|
|
|
|
, openssl
|
2023-05-08 13:35:00 +00:00
|
|
|
, darwin
|
2022-09-28 20:29:32 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "inlyne";
|
2024-08-30 09:40:28 +00:00
|
|
|
version = "0.4.3";
|
2022-09-28 20:29:32 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-08-30 09:40:28 +00:00
|
|
|
owner = "Inlyne-Project";
|
2022-09-28 20:29:32 +00:00
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-08-30 09:40:28 +00:00
|
|
|
hash = "sha256-j4DEau7LZxIoVIIYwCUgqmkSgdRxWzF5/vOS0lvjgUk=";
|
2022-09-28 20:29:32 +00:00
|
|
|
};
|
|
|
|
|
2024-08-30 09:40:28 +00:00
|
|
|
cargoHash = "sha256-fMovzaP+R0CUwJy1HKATH2tPrIPwzGtubF1WHUoQDRY=";
|
2022-09-28 20:29:32 +00:00
|
|
|
|
2023-05-08 13:35:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
|
|
|
pkg-config
|
|
|
|
];
|
2022-09-28 20:29:32 +00:00
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
|
|
|
|
fontconfig
|
2022-10-13 22:16:16 +00:00
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libxcb
|
2024-02-18 23:48:52 +00:00
|
|
|
wayland
|
|
|
|
libxkbcommon
|
2022-09-28 20:29:32 +00:00
|
|
|
openssl
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2023-05-08 13:35:00 +00:00
|
|
|
darwin.apple_sdk_11_0.frameworks.AppKit
|
2022-09-28 20:29:32 +00:00
|
|
|
];
|
|
|
|
|
2023-11-28 19:21:05 +00:00
|
|
|
checkFlags = lib.optionals stdenv.hostPlatform.isDarwin [
|
|
|
|
# time out on darwin
|
|
|
|
"--skip=interpreter::tests::centered_image_with_size_align_and_link"
|
|
|
|
"--skip=watcher::tests::the_gauntlet"
|
|
|
|
];
|
|
|
|
|
2024-07-10 11:52:28 +00:00
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
2023-05-08 13:35:00 +00:00
|
|
|
installShellCompletion --cmd inlyne \
|
2024-07-11 02:07:49 +00:00
|
|
|
--bash completions/inlyne.bash \
|
|
|
|
--fish completions/inlyne.fish \
|
|
|
|
--zsh completions/_inlyne
|
2023-05-08 13:35:00 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-28 20:29:32 +00:00
|
|
|
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
|
|
|
|
patchelf $out/bin/inlyne \
|
2022-10-13 22:16:16 +00:00
|
|
|
--add-rpath ${lib.makeLibraryPath [ libGL xorg.libX11 ]}
|
2022-09-28 20:29:32 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "GPU powered browserless markdown viewer";
|
2024-08-30 09:40:28 +00:00
|
|
|
homepage = "https://github.com/Inlyne-Project/inlyne";
|
|
|
|
changelog = "https://github.com/Inlyne-Project/inlyne/releases/tag/${src.rev}";
|
2022-09-28 20:29:32 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
2024-02-11 02:19:15 +00:00
|
|
|
mainProgram = "inlyne";
|
2022-09-28 20:29:32 +00:00
|
|
|
};
|
|
|
|
}
|