forked from mattwparas/steel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.nix
61 lines (56 loc) · 1.41 KB
/
package.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
lib,
stdenv,
Security,
openssl,
pkg-config,
rustPlatform,
}: let
manifest = lib.importTOML ../Cargo.toml;
fs = lib.fileset;
in
rustPlatform.buildRustPackage {
pname = manifest.package.name;
version = manifest.workspace.package.version;
src = fs.toSource {
root = ../.;
fileset =
fs.intersection
(fs.gitTracked ../.)
(fs.fileFilter
(f:
f.name
== "Cargo.lock"
|| f.hasExt "rkt"
|| f.hasExt "rs"
|| f.hasExt "scm"
|| f.hasExt "toml")
../.);
};
cargoLock = {
lockFile = ../Cargo.lock;
};
cargoBuildFlags = "-p cargo-steel-lib -p steel-interpreter";
buildInputs = [openssl] ++ lib.optionals stdenv.isDarwin [Security];
nativeBuildInputs = [
pkg-config
];
# Test failing
doCheck = false;
postInstall = ''
substituteInPlace cogs/installer/download.scm --replace-warn "cargo-steel-lib" "$out/bin/cargo-steel-lib"
mkdir $out/lib
export STEEL_HOME="$out/lib"
pushd cogs
$out/bin/steel install.scm
popd
rm "$out/bin/cargo-steel-lib"
'';
meta = {
description = "An embedded scheme interpreter in Rust";
homepage = "https://github.com/mattwparas/steel";
license = with lib.licenses; [asl20 mit];
platforms = lib.platforms.unix;
mainProgram = "steel";
};
}