diff --git a/Cargo.lock b/Cargo.lock index 6566a6f..d835208 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,6 +95,7 @@ dependencies = [ name = "tylc" version = "0.1.0" dependencies = [ + "gmp-mpfr-sys", "rug", "thiserror", ] diff --git a/Cargo.toml b/Cargo.toml index 5793b00..60d7a9f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,9 @@ thiserror = "2.0.18" version = "1.30" default-features = false features = ["std", "float"] +[dependencies.gmp-mpfr-sys] +version = "*" +features = ["force-cross"] [profile.release] lto = true diff --git a/flake.nix b/flake.nix index e55276e..99a051a 100644 --- a/flake.nix +++ b/flake.nix @@ -22,21 +22,29 @@ cargoToml = fromTOML (builtins.readFile "${src}/Cargo.toml"); name = cargoToml.package.name; - bin = pkgs.rustPlatform.buildRustPackage { - inherit name src; + bin = + { + rustPlatform, + m4, + }: + rustPlatform.buildRustPackage { + inherit name src; - cargoLock.lockFile = "${src}/Cargo.lock"; + cargoLock.lockFile = "${src}/Cargo.lock"; - nativeBuildInputs = with pkgs; [ - m4 - ]; - }; + nativeBuildInputs = [ + m4 + ]; + }; + + default = pkgs.callPackage bin { }; in { - packages.default = bin; + packages.default = default; + packages.static = pkgs.pkgsStatic.callPackage bin { }; devShells.default = pkgs.mkShell { - inputsFrom = [ bin ]; + inputsFrom = [ default ]; packages = with pkgs; [ clippy