Unverified Commit dd2290ee authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

opencode: 0.1.194 -> 0.2.33 (#423443)

parents ef9f0fee 1f0f2515
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -12,10 +12,10 @@

let
  opencode-node-modules-hash = {
    "aarch64-darwin" = "sha256-+eXXWskZg0CIY12+Ee4Y3uwpB5I92grDiZ600Whzx/I=";
    "aarch64-linux" = "sha256-rxLPrYAIiKDh6de/GACPfcYXY7nIskqAu1Xi12y5DpU=";
    "x86_64-darwin" = "sha256-LOz7N6gMRaZLPks+y5fDIMOuUCXTWpHIss1v0LHPnqw=";
    "x86_64-linux" = "sha256-GKLR+T+lCa7GFQr6HqSisfa4uf8F2b79RICZmePmCBE=";
    "aarch64-darwin" = "sha256-uk8HQfHCKTAW54rNHZ1Rr0piZzeJdx6i4o0+xKjfFZs=";
    "aarch64-linux" = "sha256-gDQh8gfFKl0rAujtos1XsCUnxC2Vjyq9xH5FLZoNW5s=";
    "x86_64-darwin" = "sha256-H5+qa7vxhwNYRXUo4v8IFUToVXtyXzU3veIqu4idAbU=";
    "x86_64-linux" = "sha256-1ZxetDrrRdNNOfDOW2uMwMwpEs5S3BLF+SejWcRdtik=";
  };
  bun-target = {
    "aarch64-darwin" = "bun-darwin-arm64";
@@ -26,12 +26,12 @@ let
in
stdenvNoCC.mkDerivation (finalAttrs: {
  pname = "opencode";
  version = "0.1.194";
  version = "0.2.33";
  src = fetchFromGitHub {
    owner = "sst";
    repo = "opencode";
    tag = "v${finalAttrs.version}";
    hash = "sha256-51Mc0Qrg3C0JTpXl2OECKEUvle+6X+j9+/Blu8Nu9Ao=";
    hash = "sha256-l/V9YHwuIPN73ieMT++enL1O5vecA9L0qBDGr8eRVxY=";
  };

  tui = buildGoModule {
@@ -39,7 +39,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
    inherit (finalAttrs) version;
    src = "${finalAttrs.src}/packages/tui";

    vendorHash = "sha256-hxtQHlaV2Em8CyTK3BNaoo/LgnGbMjj5XafbleF+p9I=";
    vendorHash = "sha256-0vf4fOk32BLF9/904W8g+5m0vpe6i6tUFRXqDHVcMIQ=";

    subPackages = [ "cmd/opencode" ];

@@ -113,7 +113,11 @@ stdenvNoCC.mkDerivation (finalAttrs: {

  nativeBuildInputs = [ bun ];

  patches = [ ./fix-models-macro.patch ];
  patches = [
    # Patch `packages/opencode/src/provider/models-macro.ts` to load the prefetched `models.dev/api.json`
    # from the `MODELS_JSON` environment variable instead of fetching it at build time.
    ./fix-models-macro.patch
  ];

  configurePhase = ''
    runHook preConfigure
@@ -144,7 +148,6 @@ stdenvNoCC.mkDerivation (finalAttrs: {
  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    install -Dm755 opencode $out/bin/opencode

    runHook postInstall