nixpkgs/pkgs/applications/misc/inlyne/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

70 lines
1.6 KiB
Nix
Raw Normal View History

2022-09-28 20:29:32 +00:00
{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
2022-09-28 20:29:32 +00:00
, stdenv
, pkg-config
, fontconfig
, xorg
2022-09-28 20:29:32 +00:00
, libGL
, openssl
, darwin
2022-09-28 20:29:32 +00:00
}:
rustPlatform.buildRustPackage rec {
pname = "inlyne";
version = "0.3.2";
2022-09-28 20:29:32 +00:00
src = fetchFromGitHub {
owner = "trimental";
repo = pname;
rev = "v${version}";
hash = "sha256-DSi6iS1ySdvGf6FxZpsDOAFpAKx/APcZjxA3Qy0gQBU=";
2022-09-28 20:29:32 +00:00
};
cargoHash = "sha256-UzegSJGAOBUDN8WluN7fLWS7NfHhm9YY0Zuq6DCIqHo=";
2022-09-28 20:29:32 +00:00
nativeBuildInputs = [
installShellFiles
] ++ lib.optionals stdenv.isLinux [
pkg-config
];
2022-09-28 20:29:32 +00:00
buildInputs = lib.optionals stdenv.isLinux [
fontconfig
xorg.libXcursor
xorg.libXi
xorg.libXrandr
xorg.libxcb
2022-09-28 20:29:32 +00:00
openssl
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk_11_0.frameworks.AppKit
2022-09-28 20:29:32 +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"
];
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-28 20:29:32 +00:00
postFixup = lib.optionalString stdenv.isLinux ''
patchelf $out/bin/inlyne \
--add-rpath ${lib.makeLibraryPath [ libGL xorg.libX11 ]}
2022-09-28 20:29:32 +00:00
'';
meta = with lib; {
description = "A GPU powered browserless markdown viewer";
homepage = "https://github.com/trimental/inlyne";
changelog = "https://github.com/trimental/inlyne/releases/tag/${src.rev}";
2022-09-28 20:29:32 +00:00
license = licenses.mit;
maintainers = with maintainers; [ figsoda ];
};
}