nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 79 lines 1.8 kB view raw
1{ 2 cctools, 3 fetchFromGitHub, 4 lib, 5 makeWrapper, 6 node-gyp, 7 nodejs, 8 pnpm_10, 9 fetchPnpmDeps, 10 pnpmConfigHook, 11 python3, 12 stdenv, 13 xcbuild, 14}: 15stdenv.mkDerivation (finalAttrs: { 16 pname = "cdxgen"; 17 version = "11.10.0"; 18 19 src = fetchFromGitHub { 20 owner = "CycloneDX"; 21 repo = "cdxgen"; 22 tag = "v${finalAttrs.version}"; 23 hash = "sha256-RmgR6OfNrZUYFyn36zTHERIHlzszaFqTX8b4Rf2TF/U="; 24 }; 25 26 nativeBuildInputs = [ 27 makeWrapper 28 nodejs 29 node-gyp # required for sqlite3 bindings 30 pnpmConfigHook 31 pnpm_10 32 python3 # required for sqlite3 bindings 33 ] 34 ++ lib.optional stdenv.hostPlatform.isDarwin [ 35 xcbuild 36 cctools.libtool 37 ]; 38 39 pnpmDeps = fetchPnpmDeps { 40 inherit (finalAttrs) pname version src; 41 pnpm = pnpm_10; 42 fetcherVersion = 2; 43 hash = "sha256-o5pNgn+ZqaEfsWO97jXkRyPH+0pffR6TBZcF6nApWVg="; 44 }; 45 46 buildPhase = '' 47 runHook preBuild 48 49 pushd node_modules/sqlite3 50 node-gyp rebuild 51 popd 52 53 runHook postBuild 54 ''; 55 56 installPhase = '' 57 runHook preInstall 58 59 mkdir -p $out/bin $out/lib 60 cp -r * $out/lib 61 makeWrapper ${nodejs}/bin/node "$out/bin/cdxgen" --add-flags "$out/lib/bin/cdxgen.js" 62 makeWrapper ${nodejs}/bin/node "$out/bin/cdxgen-evinse" --add-flags "$out/lib/bin/evinse.js" 63 makeWrapper ${nodejs}/bin/node "$out/bin/cdxgen-repl" --add-flags "$out/lib/bin/repl.js" 64 makeWrapper ${nodejs}/bin/node "$out/bin/cdxgen-verify" --add-flags "$out/lib/bin/verify.js" 65 66 runHook postInstall 67 ''; 68 69 meta = { 70 description = "Creates CycloneDX Software Bill-of-Materials (SBOM) for your projects from source and container images"; 71 mainProgram = "cdxgen"; 72 homepage = "https://github.com/CycloneDX/cdxgen"; 73 license = lib.licenses.asl20; 74 maintainers = with lib.maintainers; [ 75 dit7ya 76 quincepie 77 ]; 78 }; 79})