maa-cli: support darwin
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, installShellFiles
|
||||
, makeWrapper
|
||||
, pkg-config
|
||||
, openssl
|
||||
, maa-assistant-arknights
|
||||
, android-tools
|
||||
, git
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
installShellFiles,
|
||||
makeWrapper,
|
||||
pkg-config,
|
||||
openssl,
|
||||
darwin,
|
||||
maa-assistant-arknights,
|
||||
android-tools,
|
||||
git,
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
@@ -28,13 +30,22 @@ rustPlatform.buildRustPackage rec {
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
];
|
||||
buildInputs =
|
||||
[ openssl ]
|
||||
++ lib.optionals stdenv.isDarwin (
|
||||
with darwin.apple_sdk.frameworks;
|
||||
[
|
||||
Security
|
||||
SystemConfiguration
|
||||
]
|
||||
);
|
||||
|
||||
# https://github.com/MaaAssistantArknights/maa-cli/pull/126
|
||||
buildNoDefaultFeatures = true;
|
||||
buildFeatures = [ "git2" "core_installer" ];
|
||||
buildFeatures = [
|
||||
"git2"
|
||||
"core_installer"
|
||||
];
|
||||
|
||||
cargoHash = "sha256-iy9myT3bVW1TXCZx3ddiiDoDXx5BWqeQnSsJ97bc4IA=";
|
||||
|
||||
@@ -47,9 +58,12 @@ rustPlatform.buildRustPackage rec {
|
||||
mv $out/bin/maa $out/share/maa-assistant-arknights/
|
||||
|
||||
makeWrapper $out/share/maa-assistant-arknights/maa $out/bin/maa \
|
||||
--prefix PATH : "${lib.makeBinPath [
|
||||
android-tools git
|
||||
]}"
|
||||
--prefix PATH : "${
|
||||
lib.makeBinPath [
|
||||
android-tools
|
||||
git
|
||||
]
|
||||
}"
|
||||
|
||||
installShellCompletion --cmd maa \
|
||||
--bash <($out/bin/maa complete bash) \
|
||||
@@ -65,7 +79,7 @@ rustPlatform.buildRustPackage rec {
|
||||
description = "A simple CLI for MAA by Rust";
|
||||
homepage = "https://github.com/MaaAssistantArknights/maa-cli";
|
||||
license = licenses.agpl3Only;
|
||||
platforms = platforms.linux;
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
maintainers = with maintainers; [ Cryolitia ];
|
||||
mainProgram = "maa";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user