Unverified Commit 485d7414 authored by Aleksana's avatar Aleksana Committed by GitHub
Browse files

code: 0.2.188 -> 0.6.5 (#456104)

parents 284ad3f2 d654f1d3
Loading
Loading
Loading
Loading
+12 −27
Original line number Diff line number Diff line
{
  bash,
  fetchFromGitHub,
  gitMinimal,
  lib,
  nix-update-script,
  openssl,
  pkg-config,
  rustPlatform,
@@ -12,24 +11,18 @@

rustPlatform.buildRustPackage (finalAttrs: {
  pname = "code";
  version = "0.2.188";
  version = "0.6.5";

  src = fetchFromGitHub {
    owner = "just-every";
    repo = "code";
    tag = "v${finalAttrs.version}";
    hash = "sha256-xUhgA4poybzFehVgVWHKx1ejhncvYAnug2oxLwGNrk0=";
    hash = "sha256-X+YwTXla6EePXLhMgokiZkgkm9P/rkl2+2XC27tqAEk=";
  };

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

  postPatch = ''
    # shell::tests::test_run_with_profile_bash_escaping_and_execution
    substituteInPlace core/src/shell.rs \
      --replace-fail '"/bin/bash"' '"${lib.getExe bash}"'
  '';

  cargoHash = "sha256-wQHcwfBJE/qGXHgLDQ1NfBpgFdmQhuHCvfAG8KV+MHM=";
  cargoHash = "sha256-oNrBwI0klqQtGTMhPzVvOqMqvdexEVkZpLD6ssXqQX8=";

  nativeBuildInputs = lib.optionals stdenvNoCC.hostPlatform.isLinux [
    pkg-config
@@ -50,26 +43,18 @@ rustPlatform.buildRustPackage (finalAttrs: {
    "code-exec"
  ];

  nativeCheckInputs = [
    gitMinimal
  ];

  doInstallCheck = true;
  nativeInstallCheckInputs = [ versionCheckHook ];

  checkFlags = [
    # pty_error: No such file or directory (os error 2)
    "--skip=exec_command::session_manager::tests::session_manager_streams_and_truncates_from_now"
    "--skip=unified_exec::tests::multi_unified_exec_sessions"
    "--skip=unified_exec::tests::reusing_completed_session_returns_unknown_session"
    "--skip=unified_exec::tests::unified_exec_persists_across_requests_jif"
    "--skip=unified_exec::tests::unified_exec_timeouts"
  ];
  # Takes too much time
  doCheck = false;

  postInstall = ''
    ln -s $out/bin/code $out/bin/coder
  '';

  doInstallCheck = true;
  nativeInstallCheckInputs = [ versionCheckHook ];

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Fast, effective, mind-blowing, coding CLI";
    homepage = "https://github.com/just-every/code";
@@ -80,7 +65,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
      mit
    ];
    maintainers = with lib.maintainers; [ prince213 ];
    mainProgram = "code";
    mainProgram = "coder";
    priority = 10;
  };
})