Files
nixpkgs/pkgs/by-name/st/steel/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

119 lines
2.4 KiB
Nix

{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
curl,
pkg-config,
makeBinaryWrapper,
installShellFiles,
libgit2,
oniguruma,
openssl,
sqlite,
zlib,
nix-update-script,
includeLSP ? true,
includeForge ? true,
}:
rustPlatform.buildRustPackage {
pname = "steel";
version = "0-unstable-2025-10-07";
src = fetchFromGitHub {
owner = "mattwparas";
repo = "steel";
rev = "f18298647e727f9f79f312511bbf4e8e397998bb";
hash = "sha256-vXSwAfJVjMuz2O/FSF+ijzTK8TYVY4a0Zuzrnqhpja8=";
};
cargoHash = "sha256-CrmQhOfh7SQ5GvBywmYkfU6wMlgZq2x61+T+mIeQ7z4=";
nativeBuildInputs = [
curl
makeBinaryWrapper
pkg-config
rustPlatform.bindgenHook
installShellFiles
];
buildInputs = [
curl
libgit2
oniguruma
openssl
sqlite
zlib
];
postPatch = ''
rm .cargo/config.toml
'';
cargoBuildFlags = [
"--package"
"steel-interpreter"
"--package"
"cargo-steel-lib"
]
++ lib.optionals includeLSP [
"--package"
"steel-language-server"
]
++ lib.optionals includeForge [
"--package"
"steel-forge"
];
# Tests are disabled since they always fail when building with Nix
doCheck = false;
postInstall = ''
mkdir -p $out/lib/steel
substituteInPlace crates/forge/installer/download.scm \
--replace-fail '"cargo-steel-lib"' '"$out/bin/cargo-steel-lib"'
pushd cogs
$out/bin/steel install.scm
popd
mv $out/lib/steel/bin/repl-connect $out/bin
rm -rf $out/lib/steel/bin
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd steel \
--bash <($out/bin/steel completions bash) \
--fish <($out/bin/steel completions fish) \
--zsh <($out/bin/steel completions zsh)
'';
postFixup = ''
wrapProgram $out/bin/steel --set-default STEEL_HOME "$out/lib/steel"
'';
env = {
OPENSSL_NO_VENDOR = true;
RUSTONIG_SYSTEM_LIBONIG = true;
STEEL_HOME = "${placeholder "out"}/lib/steel";
};
passthru.updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
};
meta = {
description = "Embedded scheme interpreter in Rust";
homepage = "https://github.com/mattwparas/steel";
license = with lib.licenses; [
asl20
mit
];
maintainers = with lib.maintainers; [ HeitorAugustoLN ];
mainProgram = "steel";
platforms = lib.platforms.unix;
sourceProvenance = [ lib.sourceTypes.fromSource ];
};
}