Files
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

58 lines
1.3 KiB
Nix

{
lib,
fetchFromGitHub,
swiftPackages,
swift,
swiftpm,
nix-update-script,
}:
let
stdenv = swiftPackages.stdenv;
in
stdenv.mkDerivation (finalAttrs: {
pname = "protoc-gen-swift";
version = "1.29.0";
src = fetchFromGitHub {
owner = "apple";
repo = "swift-protobuf";
rev = "${finalAttrs.version}";
hash = "sha256-UPYwu8SiBUHofqHdUT6uxdeY2WUXYqbkLj+h4chSCa4=";
};
nativeBuildInputs = [
swift
swiftpm
];
# Not needed for darwin, as `apple-sdk` is implicit and part of the stdenv
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
swiftPackages.Foundation
swiftPackages.Dispatch
];
# swiftpm fails to found libdispatch.so on Linux
LD_LIBRARY_PATH = lib.optionalString stdenv.hostPlatform.isLinux (
lib.makeLibraryPath [
swiftPackages.Dispatch
]
);
installPhase = ''
runHook preInstall
install -Dm755 .build/release/protoc-gen-swift $out/bin/protoc-gen-swift
runHook postInstall
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Protobuf plugin for generating Swift code";
homepage = "https://github.com/apple/swift-protobuf";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ matteopacini ];
mainProgram = "protoc-gen-swift";
inherit (swift.meta) platforms badPlatforms;
};
})