2023-03-22 00:28:18 +01:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
2023-04-11 22:43:19 +02:00
|
|
|
, installShellFiles
|
2023-03-22 00:28:18 +01:00
|
|
|
, stdenv
|
|
|
|
, darwin
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "typst";
|
2023-12-04 17:15:02 +01:00
|
|
|
version = "0.10.0";
|
2023-03-22 00:28:18 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "typst";
|
|
|
|
repo = "typst";
|
2023-03-26 23:13:19 +02:00
|
|
|
rev = "v${version}";
|
2023-12-04 17:15:02 +01:00
|
|
|
hash = "sha256-qiskc0G/ZdLRZjTicoKIOztRFem59TM4ki23Rl55y9s=";
|
2023-03-22 00:28:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"iai-0.1.1" = "sha256-EdNzCPht5chg7uF9O8CtPWR/bzSYyfYIXNdLltqdlR0=";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-04-11 22:43:19 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
|
2023-03-22 00:28:18 +01:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.CoreServices
|
|
|
|
];
|
|
|
|
|
2023-04-11 22:43:19 +02:00
|
|
|
env = {
|
|
|
|
GEN_ARTIFACTS = "artifacts";
|
|
|
|
};
|
|
|
|
|
|
|
|
postInstall = ''
|
2023-08-07 18:43:44 +02:00
|
|
|
installManPage crates/typst-cli/artifacts/*.1
|
2023-04-11 22:43:19 +02:00
|
|
|
installShellCompletion \
|
2023-08-07 18:43:44 +02:00
|
|
|
crates/typst-cli/artifacts/typst.{bash,fish} \
|
|
|
|
--zsh crates/typst-cli/artifacts/_typst
|
2023-04-11 22:43:19 +02:00
|
|
|
'';
|
|
|
|
|
2023-12-04 17:15:02 +01:00
|
|
|
meta = {
|
2023-04-05 02:09:08 +02:00
|
|
|
changelog = "https://github.com/typst/typst/releases/tag/${src.rev}";
|
2023-12-04 17:15:02 +01:00
|
|
|
description = "A new markup-based typesetting system that is powerful and easy to learn";
|
|
|
|
homepage = "https://github.com/typst/typst";
|
|
|
|
license = lib.licenses.asl20;
|
2023-08-26 16:30:00 +02:00
|
|
|
mainProgram = "typst";
|
2023-12-04 17:15:02 +01:00
|
|
|
maintainers = with lib.maintainers; [ drupol figsoda kanashimia ];
|
2023-03-22 00:28:18 +01:00
|
|
|
};
|
|
|
|
}
|