mirror of
https://github.com/serokell/deploy-rs.git
synced 2024-09-17 13:37:39 +03:00
Fix running & building under macOS (Big Sur) (#9)
* Add xcbuild as native build input 2 ways & pass --verbose to cargo build * Make "deploy" build on macOS * Bump the nixpkgs version to one that ships Rust 1.47, which can produce binaries under macOS 11 (Big Sur). * Use darwin-specific options that let Naersk build the "deploy" binary under macOS. (With a work-around for https://github.com/nmattia/naersk/issues/127, which prevents this from being much more straight-forward). Unfortunately, the "activate" binary can't be built under macOS due to the inotify dependency; that means the best we can do is to run the deploy under macOS, not deploy *to* macOS.
This commit is contained in:
parent
ed97d54648
commit
42cbe751a8
@ -39,11 +39,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1601961544,
|
||||
"narHash": "sha256-uuh9CkDWkXlXse8IcergqoIM5JffqfQDKsl1uHB7XJI=",
|
||||
"lastModified": 1605716121,
|
||||
"narHash": "sha256-CbHicvkzLTfEY+aSUeUY7dfFlDOgZH3uK+PpUfb/DPA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "89281dd1dfed6839610f0ccad0c0e493606168fe",
|
||||
"rev": "6625284c397b44bc9518a5a1567c1b5aae455c08",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
18
flake.nix
18
flake.nix
@ -23,10 +23,20 @@
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system; };
|
||||
naersk-lib = pkgs.callPackage naersk { };
|
||||
isDarwin = pkgs.lib.strings.hasSuffix "-darwin" system;
|
||||
darwinOptions = pkgs.lib.optionalAttrs isDarwin {
|
||||
nativeBuildInputs = [
|
||||
pkgs.darwin.apple_sdk.frameworks.SystemConfiguration
|
||||
];
|
||||
singleStep = true; # https://github.com/nmattia/naersk/issues/127
|
||||
cargoBuildOptions = opts: opts ++ [ "--bin" "deploy" ]; # The "activate" binary is linux-only.
|
||||
};
|
||||
in
|
||||
{
|
||||
defaultPackage = self.packages."${system}".deploy-rs;
|
||||
packages.deploy-rs = naersk-lib.buildPackage ./.;
|
||||
packages.deploy-rs = naersk-lib.buildPackage (darwinOptions // {
|
||||
root = ./.;
|
||||
});
|
||||
|
||||
defaultApp = self.apps."${system}".deploy-rs;
|
||||
apps.deploy-rs = {
|
||||
@ -35,9 +45,9 @@
|
||||
};
|
||||
|
||||
devShell = pkgs.mkShell {
|
||||
inputsFrom = [ self.packages.${system}.deploy-rs ];
|
||||
buildInputs = [ pkgs.nixUnstable ];
|
||||
};
|
||||
inputsFrom = [ self.packages.${system}.deploy-rs ];
|
||||
buildInputs = [ pkgs.nixUnstable ];
|
||||
};
|
||||
|
||||
lib = rec {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user