termbook: fix build

This commit is contained in:
figsoda 2023-05-14 17:27:15 -04:00
parent b753135b53
commit 9d8d1301ba
2 changed files with 2927 additions and 3 deletions

2900
pkgs/tools/text/termbook/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,11 @@
{ lib, rustPlatform, fetchFromGitHub, stdenv, darwin }:
{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, oniguruma
, stdenv
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "termbook-cli";
@ -11,12 +18,29 @@ rustPlatform.buildRustPackage rec {
sha256 = "Bo3DI0cMXIfP7ZVr8MAW/Tmv+4mEJBIQyLvRfVBDG8c=";
};
cargoSha256 = "sha256-9fFvJJlDzBmbI7hes/wfjAk1Cl2H55T5n8HLnUmDw/c=";
cargoLock = {
lockFile = ./Cargo.lock;
};
buildInputs = lib.optionals stdenv.isDarwin [
nativeBuildInputs = [
pkg-config
];
buildInputs = [
oniguruma
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
];
env = {
RUSTONIG_SYSTEM_LIBONIG = true;
};
# update dependencies to fix build failure caused by unaligned packed structs
postPatch = ''
ln -sf ${./Cargo.lock} Cargo.lock
'';
meta = with lib; {
description = "A runner for `mdbooks` to keep your documentation tested";
homepage = "https://github.com/Byron/termbook/";