nixpkgs/pkgs/by-name/at/atuin/package.nix
Cody P Schafer 769eb09232
atuin: fix build on x86_64-darwin by updating to apple_sdk_11_0
Otherwise, fails to build with:

```
       >   = note: Undefined symbols for architecture x86_64:
       >             "_kCFURLVolumeAvailableCapacityForImportantUsageKey", referenced from:
       >                 sysinfo::unix:🍎:disk::get_list::h5f0b9b2218314fb0 in libsysinfo-48f55e52227ea9a5.rlib(sysinfo-48f55e52227ea9a5.sysinfo.81d4345a26454b80-cgu.10.rcgu.o)
       >           ld: symbol(s) not found for architecture x86_64
       >           clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
       >
       >
       > error: could not compile `atuin` (bin "atuin") due to 1 previous error
```

See #234678 for a similar fix on another package.
2024-03-14 23:21:49 -04:00

73 lines
2.0 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, installShellFiles
, rustPlatform
, libiconv
, darwin
, nixosTests
}:
rustPlatform.buildRustPackage rec {
pname = "atuin";
version = "18.1.0";
src = fetchFromGitHub {
owner = "atuinsh";
repo = "atuin";
rev = "v${version}";
hash = "sha256-ddj8vHFTRBzeueSvY9kS1ZIcAID8k3MXrQkUVt04rQg=";
};
# TODO: unify this to one hash because updater do not support this
cargoHash =
if stdenv.isLinux
then "sha256-LKHBXm9ZThX96JjxJb8d7cRdhWL1t/3aG3Qq1TYBC74="
else "sha256-RSkC062XB5zy3lmI0OQhJfJ6FqFWXhpMPNIIqbrrlso=";
# atuin's default features include 'check-updates', which do not make sense
# for distribution builds. List all other default features.
buildNoDefaultFeatures = true;
buildFeatures = [
"client" "sync" "server" "clipboard"
];
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [
libiconv
darwin.apple_sdk_11_0.frameworks.AppKit
darwin.apple_sdk_11_0.frameworks.Security
darwin.apple_sdk_11_0.frameworks.SystemConfiguration
];
postInstall = ''
installShellCompletion --cmd atuin \
--bash <($out/bin/atuin gen-completions -s bash) \
--fish <($out/bin/atuin gen-completions -s fish) \
--zsh <($out/bin/atuin gen-completions -s zsh)
'';
passthru.tests = {
inherit (nixosTests) atuin;
};
checkFlags = [
# tries to make a network access
"--skip=registration"
# No such file or directory (os error 2)
"--skip=sync"
# PermissionDenied (Operation not permitted)
"--skip=change_password"
"--skip=multi_user_test"
];
meta = with lib; {
description = "Replacement for a shell history which records additional commands context with optional encrypted synchronization between machines";
homepage = "https://github.com/atuinsh/atuin";
license = licenses.mit;
maintainers = with maintainers; [ SuperSandro2000 sciencentistguy _0x4A6F ];
mainProgram = "atuin";
};
}