Unverified Commit cbf4bf1d authored by Tomodachi94's avatar Tomodachi94 Committed by GitHub
Browse files

aws-cdk-cli: init at 2.1100.1 (#473650)

parents 49733223 0f7c8572
Loading
Loading
Loading
Loading
+121 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitHub,
  fetchYarnDeps,
  nodejs,
  yarnBuildHook,
  yarnConfigHook,
  yarnInstallHook,
  diffutils,
  zip,
  jq,
  unzip,
  testers,
  nix-update-script,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "aws-cdk-cli";
  version = "2.1100.1";

  src = fetchFromGitHub {
    owner = "aws";
    repo = "aws-cdk-cli";
    tag = "cdk@v${finalAttrs.version}";
    hash = "sha256-GIW6y2njqZExAiegDXNWUQB0HzNvXlg02L9DBo4oQnI=";
  };

  yarnOfflineCache = fetchYarnDeps {
    yarnLock = "${finalAttrs.src}/yarn.lock";
    hash = "sha256-oUsH7ccuHFgZw9cnwhIq/mbEgNdJJv9GzBh6HsJT+kU=";
  };

  nativeBuildInputs = [
    yarnConfigHook
    yarnBuildHook
    yarnInstallHook
    nodejs
    zip
    jq
    # tests
    diffutils
    unzip
  ];

  env = {
    NX_DISABLE_REMOTE_CACHE = "true";
    NX_TASKS_RUNNER_DYNAMIC_OUTPUT = "false";
    NX_VERBOSE_LOGGING = "true";
    # Needed to properly embed version info
    CODEBUILD_RESOLVED_SOURCE_VERSION = finalAttrs.version;
  };

  # Regular "build" is very heavy and does things we don't need.
  yarnBuildScript = "compile";

  postPatch =
    let
      cliVersionJson = builtins.toJSON {
        inherit (finalAttrs) version;
      };
    in
    ''
      echo '${cliVersionJson}' > packages/@aws-cdk/cloud-assembly-schema/cli-version.json
    '';

  preBuild = ''
    export NX_PARALLEL="$NIX_BUILD_CORES"
    pushd packages/@aws-cdk/integ-runner
    patchShebangs build-tools/generate.sh
    build-tools/generate.sh
    popd
    pushd packages/aws-cdk
    patchShebangs generate.sh
    ./generate.sh
    popd
  '';

  postInstall = ''
    # Manually bundle non-bundled dependencies
    cp -r packages/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema $out/lib/node_modules/aws-cdk-cli/node_modules/jsonschema
    cp -r packages/aws-cdk/node_modules/decamelize $out/lib/node_modules/aws-cdk-cli/node_modules/decamelize

    patchShebangs "$out/lib/node_modules/aws-cdk-cli/node_modules/aws-cdk/bin"
    ln -s "$out/lib/node_modules/aws-cdk-cli/node_modules/aws-cdk/bin" "$out/bin"
    # Delete broken symlinks
    find "$out/lib/node_modules" -xtype l -delete

    # Fix version
    pushd $out/lib/node_modules/aws-cdk-cli/packages/aws-cdk
    mv package.json package.json.bak
    jq '.version = "${finalAttrs.version}"' < package.json.bak > package.json
    rm package.json.bak
    mv build-info.json bi.json
    jq '.commit = "nixpkgs"' < bi.json > build-info.json
    rm bi.json
    popd
  '';

  # Fixup takes an absurdly long time, so disable it
  dontFixup = true;

  passthru = {
    tests.version = testers.testVersion { package = finalAttrs.package; };
    updateScript = nix-update-script {
      extraArgs = [
        "--version-regex"
        "cdk@v(.*)"
      ];
    };
  };

  meta = {
    description = "AWS CDK Toolkit";
    homepage = "https://docs.aws.amazon.com/cdk/v2/guide/cli.html";
    license = lib.licenses.asl20;
    maintainers = [ ];
    mainProgram = "cdk";
    platforms = lib.platforms.all;
  };
})
+1 −0
Original line number Diff line number Diff line
@@ -73,6 +73,7 @@ mapAliases {
  inherit (pkgs) asar; # added 2023-08-26
  inherit (pkgs) auto-changelog; # added 2024-06-25
  inherit (pkgs) aws-azure-login; # added 2023-09-30
  aws-cdk = pkgs.aws-cdk-cli; # Added 2025-12-23
  awesome-lint = throw "'awesome-lint' has been removed because it was unmaintainable in nixpkgs"; # Added 2025-11-17
  balanceofsatoshis = pkgs.balanceofsatoshis; # added 2023-07-31
  inherit (pkgs) bash-language-server; # added 2024-06-07
+0 −1
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@

  # Packages that provide a single executable.
  "@angular/cli" = "ng";
  aws-cdk = "cdk";
  grunt-cli = "grunt";
  gulp-cli = "gulp";
}
+0 −1
Original line number Diff line number Diff line
@@ -6,7 +6,6 @@
, "@tailwindcss/line-clamp"
, "@tailwindcss/typography"
, "alex"
, "aws-cdk"
, "browserify"
, "browser-sync"
, "coc-go"
+0 −18
Original line number Diff line number Diff line
@@ -19471,24 +19471,6 @@ in
    bypassCache = true;
    reconstructLock = true;
  };
  aws-cdk = nodeEnv.buildNodePackage {
    name = "aws-cdk";
    packageName = "aws-cdk";
    version = "2.1004.0";
    src = fetchurl {
      url = "https://registry.npmjs.org/aws-cdk/-/aws-cdk-2.1004.0.tgz";
      sha512 = "3E5ICmSc7ZCZCwLX7NY+HFmmdUYgRaL+67h/BDoDQmkhx9StC8wG4xgzHFY9k8WQS0+ib/MP28f2d9yzHtQLlQ==";
    };
    buildInputs = globalBuildInputs;
    meta = {
      description = "AWS CDK CLI, the command line tool for CDK apps";
      homepage = "https://github.com/aws/aws-cdk";
      license = "Apache-2.0";
    };
    production = true;
    bypassCache = true;
    reconstructLock = true;
  };
  browserify = nodeEnv.buildNodePackage {
    name = "browserify";
    packageName = "browserify";