Skip to content

Commit

Permalink
chore: build aiken package directly
Browse files Browse the repository at this point in the history
When you build the application currently, it builds all crates and
exposes most of the directory inside of it, as well as not adding the
binary to the `$PATH`.

The `buildAndTestSubdir` flag for `buildRustPackage` fix this. It is not
documented anywhere, but it works...
  • Loading branch information
cfcosta committed Jul 24, 2023
1 parent 152e847 commit 6299740
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,25 @@

buildInputs = with pkgs; [ openssl ] ++ osxDependencies;
nativeBuildInputs = with pkgs; [ pkg-config openssl.dev ];
cargoBuildFlags = [ "--package aiken" ];

src = pkgs.lib.cleanSourceWith { src = self; };
src = self;

# Tests might be impure and we shouldn't need to run them.
doCheck = false;

cargoLock.lockFile = ./Cargo.lock;

buildPhase = ''
cargo build --release
'';

installPhase = ''
find . -type f ! -executable -name "aiken" -delete
mkdir -p $out/bin
install -Dm755 target/release/aiken $out/bin
'';

meta = with pkgs.lib; {
description = "Cardano smart contract language and toolchain";
homepage = "https://github.com/aiken-lang/aiken";
Expand Down

0 comments on commit 6299740

Please sign in to comment.