Unverified Commit 3707ee77 authored by Jhony Elmer Angulo Fabian's avatar Jhony Elmer Angulo Fabian Committed by TomaSajt
Browse files

codex: 0.92.0 -> 0.111.0

Add a vendoring workaround that deletes manifest files that would
trip up fetchCargoVendor's logic
parent 02d3ed46
Loading
Loading
Loading
Loading
+20 −3
Original line number Diff line number Diff line
@@ -4,9 +4,11 @@
  rustPlatform,
  fetchFromGitHub,
  installShellFiles,
  cargo,
  clang,
  cmake,
  gitMinimal,
  libcap,
  libclang,
  makeBinaryWrapper,
  nix-update-script,
@@ -18,18 +20,30 @@
}:
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "codex";
  version = "0.92.0";
  version = "0.111.0";

  src = fetchFromGitHub {
    owner = "openai";
    repo = "codex";
    tag = "rust-v${finalAttrs.version}";
    hash = "sha256-m/g+5wdehyaHDw6i5vik4HXiisY/iWFtPX0gKjCFPNY=";
    hash = "sha256-hdR70BhiMg9G/ibLCeHnRSY3PcGZDv0vnqBCbzSRD6I=";
  };

  sourceRoot = "${finalAttrs.src.name}/codex-rs";

  cargoHash = "sha256-fuT8vPb9/7fZam129nR6y+r+3j46WBhlf73Htkcjpzc=";
  # TODO: Drop workaround once PR #486983 reaches master.
  depsExtraArgs = {
    nativeBuildInputs = [ cargo ];
    postBuild = ''
      # delete all Cargo.toml files for which `cargo metadata` fails
      shopt -s globstar
      for manifest_path in "$out"/**/Cargo.toml; do
        cargo metadata --format-version 1 --no-deps --manifest-path "$manifest_path" >/dev/null || rm -v "$manifest_path"
      done
    '';
  };

  cargoHash = "sha256-Ym2fB9IWQzYdgOX3hiBd9XUI00xF4cIoKO2jpal4eUA=";

  nativeBuildInputs = [
    clang
@@ -43,6 +57,9 @@ rustPlatform.buildRustPackage (finalAttrs: {
  buildInputs = [
    libclang
    openssl
  ]
  ++ lib.optionals stdenv.hostPlatform.isLinux [
    libcap
  ];

  # NOTE: set LIBCLANG_PATH so bindgen can locate libclang, and adjust