about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWeijia Wang <9713184+wegank@users.noreply.github.com>2024-06-16 19:28:47 +0200
committerGitHub <noreply@github.com>2024-06-16 19:28:47 +0200
commitf82fe275d98c521c051af4892cd8b3406cee67a3 (patch)
tree362b12fa17d371a5375dc3fdef338afd77856d46
parentd0c7b3f6530f48dfde4d16669b61fe2cfff4f752 (diff)
parent9a6992a7d738a55d9637d848f83177d4c1711bdd (diff)
Merge pull request #318906 from matteo-pacini/swiftlint
swiftlint: init at 0.55.1
-rw-r--r--pkgs/by-name/sw/swiftlint/package.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/by-name/sw/swiftlint/package.nix b/pkgs/by-name/sw/swiftlint/package.nix
new file mode 100644
index 0000000000000..aa6c641e32415
--- /dev/null
+++ b/pkgs/by-name/sw/swiftlint/package.nix
@@ -0,0 +1,42 @@
+{
+  stdenvNoCC,
+  lib,
+  fetchurl,
+  unzip,
+  nix-update-script,
+}:
+stdenvNoCC.mkDerivation rec {
+  pname = "swiftlint";
+  version = "0.55.1";
+
+  src = fetchurl {
+    url = "https://github.com/realm/SwiftLint/releases/download/${version}/portable_swiftlint.zip";
+    hash = "sha256-Tmhw30CJaVQlcYnHjzmwrDpugHgR2/ihHIV8M+O2zwI=";
+  };
+
+  dontPatch = true;
+  dontConfigure = true;
+  dontBuild = true;
+
+  nativeBuildInputs = [ unzip ];
+
+  sourceRoot = ".";
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm755 swiftlint $out/bin/swiftlint
+    runHook postInstall
+  '';
+
+  passthru.updateScript = nix-update-script { };
+
+  meta = with lib; {
+    description = "A tool to enforce Swift style and conventions";
+    homepage = "https://realm.github.io/SwiftLint/";
+    license = licenses.mit;
+    mainProgram = "swiftlint";
+    maintainers = with maintainers; [ matteopacini ];
+    platforms = platforms.darwin;
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+  };
+}