Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 gradle_8, 6 jre_headless, 7 makeBinaryWrapper, 8 tests, 9}: 10stdenv.mkDerivation (finalAttrs: { 11 pname = "json2cdn"; 12 version = "0.1.0"; 13 14 src = fetchFromGitHub { 15 owner = "uku3lig"; 16 repo = "json2cdn"; 17 tag = finalAttrs.version; 18 hash = "sha256-pHmzeZHZyr3FyfkXwrdPk+lcHQKH6t4pnDD9ImMgSV8="; 19 }; 20 21 nativeBuildInputs = [ 22 gradle_8 23 makeBinaryWrapper 24 ]; 25 26 mitmCache = gradle_8.fetchDeps { 27 inherit (finalAttrs) pname; 28 data = ./deps.json; 29 }; 30 31 # this is required for using mitm-cache on Darwin 32 __darwinAllowLocalNetworking = true; 33 34 gradleBuildTask = "shadowJar"; 35 36 installPhase = '' 37 runHook preInstall 38 39 install -Dm644 build/libs/json2cdn-${finalAttrs.version}-all.jar $out/lib/json2cdn.jar 40 41 makeWrapper ${lib.getExe jre_headless} $out/bin/json2cdn --add-flags "-jar $out/lib/json2cdn.jar" 42 43 runHook postInstall 44 ''; 45 46 passthru = { 47 tests.formats-cdn = tests.pkgs-lib.formats.passthru.entries.pass-cdnAtoms; 48 }; 49 50 meta = { 51 description = "Converts a JSON file to dzikoysk's CDN format"; 52 homepage = "https://github.com/uku3lig/json2cdn"; 53 sourceProvenance = with lib.sourceTypes; [ 54 fromSource 55 binaryBytecode 56 ]; 57 license = lib.licenses.mit; 58 maintainers = with lib.maintainers; [ uku3lig ]; 59 inherit (jre_headless.meta) platforms; 60 mainProgram = "json2cdn"; 61 }; 62})