cljstyle: refactor to finalAttrs style

authored by philiptaron.tngl.sh and committed by Benjamin Sparks 85238bcc c6180d04

+14 -20
+14 -20
pkgs/by-name/cl/cljstyle/package.nix
··· 3 3 buildGraalvmNativeImage, 4 4 fetchMavenArtifact, 5 5 fetchurl, 6 - graalvmPackages, 7 6 versionCheckHook, 8 7 }: 9 8 10 - let 9 + buildGraalvmNativeImage (finalAttrs: { 11 10 pname = "cljstyle"; 12 11 version = "0.17.642"; 13 12 14 - # must be on classpath to build native image 15 - graal-build-time = fetchMavenArtifact { 16 - repos = [ "https://repo.clojars.org/" ]; 17 - groupId = "com.github.clj-easy"; 18 - artifactId = "graal-build-time"; 19 - version = "1.0.5"; 20 - hash = "sha256-M6/U27a5n/QGuUzGmo8KphVnNa2K+LFajP5coZiFXoY="; 21 - }; 22 - in 23 - buildGraalvmNativeImage { 24 - inherit pname version; 25 - 26 13 src = fetchurl { 27 - url = "https://github.com/greglook/${pname}/releases/download/${version}/${pname}-${version}.jar"; 14 + url = "https://github.com/greglook/cljstyle/releases/download/${finalAttrs.version}/cljstyle-${finalAttrs.version}.jar"; 28 15 hash = "sha256-AkCuTZeDXbNBuwPZEMhYGF/oOGIKq5zVDwL8xwnj+mE="; 29 16 }; 30 17 31 - graalvmDrv = graalvmPackages.graalvm-ce; 32 - 33 18 extraNativeImageBuildArgs = [ 34 19 "-H:+ReportExceptionStackTraces" 35 20 "--no-fallback" 36 - "-cp ${graal-build-time.passthru.jar}" 21 + "-cp ${finalAttrs.finalPackage.passthru.graal-build-time.passthru.jar}" 37 22 ]; 38 23 39 24 doInstallCheck = true; 40 25 nativeInstallCheckInputs = [ versionCheckHook ]; 41 26 versionCheckProgramArg = [ "version" ]; 42 27 28 + # must be on classpath to build native image 29 + passthru.graal-build-time = fetchMavenArtifact { 30 + repos = [ "https://repo.clojars.org/" ]; 31 + groupId = "com.github.clj-easy"; 32 + artifactId = "graal-build-time"; 33 + version = "1.0.5"; 34 + hash = "sha256-M6/U27a5n/QGuUzGmo8KphVnNa2K+LFajP5coZiFXoY="; 35 + }; 36 + 43 37 meta = { 44 38 description = "Tool for formatting Clojure code"; 45 39 homepage = "https://github.com/greglook/cljstyle"; 46 40 sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; 47 41 license = lib.licenses.epl10; 48 - changelog = "https://github.com/greglook/cljstyle/blob/${version}/CHANGELOG.md"; 42 + changelog = "https://github.com/greglook/cljstyle/blob/${finalAttrs.version}/CHANGELOG.md"; 49 43 maintainers = with lib.maintainers; [ psyclyx ]; 50 44 mainProgram = "cljstyle"; 51 45 }; 52 - } 46 + })