swiftlint: convert to finalAttrs, use sources.json
This commit is contained in:
@@ -7,13 +7,19 @@
|
||||
nix-update-script,
|
||||
versionCheckHook,
|
||||
}:
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
let
|
||||
sources = lib.importJSON ./sources.json;
|
||||
platform =
|
||||
sources.platforms.${stdenvNoCC.hostPlatform.system}
|
||||
or (throw "Unsupported platform: ${stdenvNoCC.hostPlatform.system}");
|
||||
in
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
pname = "swiftlint";
|
||||
version = "0.63.2";
|
||||
inherit (sources) version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/realm/SwiftLint/releases/download/${version}/portable_swiftlint.zip";
|
||||
hash = "sha256-xZpAXIX5W5LO1nelAIBOCBWWpMrkpqSFr3YGVVfW7Sk=";
|
||||
url = "https://github.com/realm/SwiftLint/releases/download/${finalAttrs.version}/${platform.filename}";
|
||||
inherit (platform) hash;
|
||||
};
|
||||
|
||||
dontPatch = true;
|
||||
@@ -54,7 +60,7 @@ stdenvNoCC.mkDerivation rec {
|
||||
matteopacini
|
||||
DimitarNestorov
|
||||
];
|
||||
platforms = lib.platforms.darwin;
|
||||
platforms = lib.attrNames sources.platforms;
|
||||
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"version": "0.63.2",
|
||||
"platforms": {
|
||||
"x86_64-darwin": {
|
||||
"filename": "portable_swiftlint.zip",
|
||||
"hash": "sha256-xZpAXIX5W5LO1nelAIBOCBWWpMrkpqSFr3YGVVfW7Sk="
|
||||
},
|
||||
"aarch64-darwin": {
|
||||
"filename": "portable_swiftlint.zip",
|
||||
"hash": "sha256-xZpAXIX5W5LO1nelAIBOCBWWpMrkpqSFr3YGVVfW7Sk="
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user