Skip to content

Commit

Permalink
Merge pull request #317561 from matteo-pacini/needle
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 authored Jun 6, 2024
2 parents 31f4099 + 28fbc62 commit 3bdd553
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkgs/by-name/ne/needle/nix/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file was generated by swiftpm2nix.
{
workspaceStateFile = ./workspace-state.json;
hashes = {
"swift-common" = "1zqdiwz934kpdlig22ikvmklhb720hv3i70wnznhhxfg2v4c115j";
"swift-concurrency" = "06x9fc8gwyvg5ymf889rfqs3jp89l1pbpm3m9553nq75vwcia6d3";
"swift-syntax" = "0sc29acwxv6rl3i8nwfazk0p0cm41figxls8n4aks84vww7m2in1";
"swift-system" = "0402hkx2q2dv27gccnn8ma79ngvwiwzkhcv4zlcdldmy6cgi0px7";
"swift-tools-support-core" = "0lbc3naj9hrbaa7ifxsvcs4mjigmiv61npzsphbpb6axx8s065mn";
};
}
93 changes: 93 additions & 0 deletions pkgs/by-name/ne/needle/nix/workspace-state.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"object": {
"artifacts": [],
"dependencies": [
{
"basedOn": null,
"packageRef": {
"identity": "swift-common",
"kind": "remoteSourceControl",
"location": "https://github.com/uber/swift-common.git",
"name": "Swift-Common"
},
"state": {
"checkoutState": {
"revision": "32c4757e0702686df12c32e06b9bbf815ec4e641",
"version": "0.5.0"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-common"
},
{
"basedOn": null,
"packageRef": {
"identity": "swift-concurrency",
"kind": "remoteSourceControl",
"location": "https://github.com/uber/swift-concurrency.git",
"name": "Concurrency"
},
"state": {
"checkoutState": {
"revision": "e29e42c41c47c82ec32d3a2b2695719c32415ca9",
"version": "0.7.1"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-concurrency"
},
{
"basedOn": null,
"packageRef": {
"identity": "swift-syntax",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-syntax.git",
"name": "SwiftSyntax"
},
"state": {
"checkoutState": {
"branch": "0e85cf7",
"revision": "0e85cf739b10103190a2d7e6de0c0532a0514981"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-syntax"
},
{
"basedOn": null,
"packageRef": {
"identity": "swift-system",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-system.git",
"name": "swift-system"
},
"state": {
"checkoutState": {
"revision": "836bc4557b74fe6d2660218d56e3ce96aff76574",
"version": "1.1.1"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-system"
},
{
"basedOn": null,
"packageRef": {
"identity": "swift-tools-support-core",
"kind": "remoteSourceControl",
"location": "https://github.com/apple/swift-tools-support-core",
"name": "swift-tools-support-core"
},
"state": {
"checkoutState": {
"revision": "4f07be3dc201f6e2ee85b6942d0c220a16926811",
"version": "0.2.7"
},
"name": "sourceControlCheckout"
},
"subpath": "swift-tools-support-core"
}
]
},
"version": 6
}
49 changes: 49 additions & 0 deletions pkgs/by-name/ne/needle/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
stdenv,
lib,
fetchFromGitHub,
swift,
swiftpm,
swiftpm2nix,
sqlite,
}:
let
generated = swiftpm2nix.helpers ./nix;
in
stdenv.mkDerivation rec {
pname = "needle";
version = "0.24.0";

src = fetchFromGitHub {
owner = "uber";
repo = "needle";
rev = "v${version}";
hash = "sha256-vQlUcfIj+LHZ3R+XwSr9bBIjcZUWkW2k/wI6HF+sDPo=";
};

sourceRoot = "${src.name}/Generator";

nativeBuildInputs = [
swift
swiftpm
];

propagatedBuildInputs = [ sqlite ];

configurePhase = generated.configure;

installPhase = ''
runHook preInstall
install -Dm755 "$(swiftpmBinPath)"/needle $out/bin/needle
runHook postInstall
'';

meta = with lib; {
description = "Compile-time safe Swift dependency injection framework";
homepage = "https://github.com/uber/needle";
license = licenses.asl20;
mainProgram = "needle";
maintainers = with maintainers; [ matteopacini ];
platforms = platforms.darwin;
};
}

0 comments on commit 3bdd553

Please sign in to comment.