nixpkgs/pkgs/by-name/rc/rcodesign/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

67 lines
2.0 KiB
Nix

{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
apple-sdk_11,
uutils-coreutils,
}:
rustPlatform.buildRustPackage rec {
pname = "rcodesign";
version = "0.28.0";
src = fetchFromGitHub {
owner = "indygreg";
repo = "apple-platform-rs";
rev = "apple-codesign/${version}";
hash = "sha256-xyjq5mdc29OwzlUAQZWSg1k68occ81i7KBGUiiq0ke0=";
};
patches = [
# Disable cli_tests test that requires network access.
./disable-sign-for-notarization-test.patch
];
cargoHash = "sha256-xMhyKovXoBPZp6epWQ+CYODpyvHgpv6eZfdWPTuDnK8=";
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ apple-sdk_11 ];
cargoBuildFlags = [
# Only build the binary we want
"--bin"
"rcodesign"
];
checkFlags = [
# Does network IO
"--skip=ticket_lookup::test::lookup_ticket"
# These tests require Xcode to be installed
"--skip=find_all_platform_directories"
"--skip=find_all_sdks"
];
# Set up uutils-coreutils for cli_tests. Without this, it will be installed with `cargo install`, which will fail
# due to the lack of network access in the build environment.
preCheck = ''
coreutils_dir=''${CARGO_TARGET_DIR:-"$(pwd)/target"}/${stdenv.hostPlatform.rust.cargoShortTarget}/coreutils/bin
install -m 755 -d "$coreutils_dir"
ln -s '${lib.getExe' uutils-coreutils "uutils-coreutils"}' "$coreutils_dir/coreutils"
'';
meta = with lib; {
description = "Cross-platform CLI interface to interact with Apple code signing";
mainProgram = "rcodesign";
longDescription = ''
rcodesign provides various commands to interact with Apple signing,
including signing and notarizing binaries, generating signing
certificates, and verifying existing signed binaries.
For more information, refer to the [documentation](https://gregoryszorc.com/docs/apple-codesign/stable/apple_codesign_rcodesign.html).
'';
homepage = "https://github.com/indygreg/apple-platform-rs";
license = licenses.mpl20;
maintainers = with maintainers; [ euank ];
};
}