File tree Expand file tree Collapse file tree 1 file changed +57
-0
lines changed
pkgs/by-name/pr/protoc-gen-swift Expand file tree Collapse file tree 1 file changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ lib ,
3+ fetchFromGitHub ,
4+ swiftPackages ,
5+ swift ,
6+ swiftpm ,
7+ nix-update-script ,
8+ } :
9+ let
10+ stdenv = swiftPackages . stdenv ;
11+ in
12+ stdenv . mkDerivation ( finalAttrs : {
13+ pname = "protoc-gen-swift" ;
14+ version = "1.28.2" ;
15+
16+ src = fetchFromGitHub {
17+ owner = "apple" ;
18+ repo = "swift-protobuf" ;
19+ rev = "${ finalAttrs . version } " ;
20+ hash = "sha256-YOEr73xDjNrc4TTkIBY8AdAUX2MBtF9ED1UF2IjTu44=" ;
21+ } ;
22+
23+ nativeBuildInputs = [
24+ swift
25+ swiftpm
26+ ] ;
27+
28+ # Not needed for darwin, as `apple-sdk` is implicit and part of the stdenv
29+ buildInputs = lib . optionals stdenv . hostPlatform . isLinux [
30+ swiftPackages . Foundation
31+ swiftPackages . Dispatch
32+ ] ;
33+
34+ # swiftpm fails to found libdispatch.so on Linux
35+ LD_LIBRARY_PATH = lib . optionalString stdenv . hostPlatform . isLinux (
36+ lib . makeLibraryPath [
37+ swiftPackages . Dispatch
38+ ]
39+ ) ;
40+
41+ installPhase = ''
42+ runHook preInstall
43+ install -Dm755 .build/release/protoc-gen-swift $out/bin/protoc-gen-swift
44+ runHook postInstall
45+ '' ;
46+
47+ passthru . updateScript = nix-update-script { } ;
48+
49+ meta = {
50+ description = "Protobuf plugin for generating Swift code" ;
51+ homepage = "https://github.com/apple/swift-protobuf" ;
52+ license = lib . licenses . asl20 ;
53+ maintainers = with lib . maintainers ; [ matteopacini ] ;
54+ mainProgram = "protoc-gen-swift" ;
55+ inherit ( swift . meta ) platforms badPlatforms ;
56+ } ;
57+ } )
You can’t perform that action at this time.
0 commit comments