guile-goblins-rs/default.nix

64 lines
1.2 KiB
Nix

# default.nix
{ lib
, naersk
, stdenv
, clangStdenv
, hostPlatform
, targetPlatform
, pkg-config
, libiconv
, rustfmt
, cargo
, rustc
# , llvmPackages # Optional
# , protobuf # Optional
}:
let
cargoToml = (builtins.fromTOML (builtins.readFile ./Cargo.toml));
in
naersk.lib."${targetPlatform.system}".buildPackage rec {
src = ./.;
buildInputs = [
rustfmt
pkg-config
cargo
rustc
libiconv
];
checkInputs = [ cargo rustc ];
doCheck = true;
CARGO_BUILD_INCREMENTAL = "false";
RUST_BACKTRACE = "full";
copyLibs = true;
# Optional things you might need:
#
# If you depend on `libclang`:
# LIBCLANG_PATH = "${llvmPackages.libclang}/lib";
#
# If you depend on protobuf:
# PROTOC = "${protobuf}/bin/protoc";
# PROTOC_INCLUDE = "${protobuf}/include";
name = cargoToml.package.name;
version = cargoToml.package.version;
meta = with lib; {
description = cargoToml.package.description;
homepage = cargoToml.package.homepage;
license = with licenses; [ mit ];
maintainers = with maintainers; [ ];
};
postInstall = ''
#mkdir -p "$out/var/lib/bespoke/templates"
#cp ./templates/* "$out/var/lib/bespoke/templates"
'';
}