-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
opencode: new submission #30358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
opencode: new submission #30358
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 | ||
|
|
||
| PortSystem 1.0 | ||
| PortGroup github 1.0 | ||
|
|
||
| github.setup sst opencode 1.0.141 v | ||
|
|
||
| revision 0 | ||
| categories devel | ||
| license MIT | ||
| maintainers @diogom93 openmaintainer | ||
|
|
||
| description Terminal AI coding agent | ||
| long_description OpenCode is an open-source AI coding agent \ | ||
| built for the terminal, with a native TUI, \ | ||
| provider-agnostic model support and strong \ | ||
| integration with modern developer workflows. | ||
|
|
||
| homepage https://opencode.ai/ | ||
|
|
||
| supported_archs arm64 x86_64 | ||
|
|
||
| github.tarball_from archive | ||
| fetch.type git | ||
|
|
||
| depends_build port:bun | ||
|
|
||
| patchfiles bun-version.diff | ||
|
|
||
| checksums rmd160 ac2eaa72e680d7c433688c601d3fcd3d5ed8261a \ | ||
| sha256 84c04fba88e2be8b0bba2f2cd05d96f76d3891ead1603646eecbfc627d75f4d4 \ | ||
| size 48587896 | ||
|
|
||
| if {${build_arch} eq "x86_64"} { | ||
| set arch "x64" | ||
| } elseif {${build_arch} eq "arm64"} { | ||
| set arch "arm64" | ||
| } | ||
|
|
||
| configure.cmd bun | ||
| configure.args install | ||
| configure.pre_args | ||
|
|
||
| build.dir ${worksrcpath}/packages/opencode/scripts | ||
| build.cmd bun | ||
| build.env OPENCODE_VERSION=${version} | ||
| build.args run build --single | ||
| build.target | ||
|
|
||
| destroot { | ||
| xinstall -d ${destroot}${prefix}/bin | ||
| xinstall -m 755 ${worksrcpath}/packages/opencode/dist/opencode-darwin-${arch}/bin/opencode ${destroot}${prefix}/bin/ | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Applying a patch to the script that checks the bun version to allow builds with same minor version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- packages/script/src/index.ts.orig 2025-12-09 15:36:24 | ||
| +++ packages/script/src/index.ts 2025-12-09 15:39:57 | ||
| @@ -5,12 +5,15 @@ | ||
| const rootPkg = await Bun.file(rootPkgPath).json() | ||
| const expectedBunVersion = rootPkg.packageManager?.split("@")[1] | ||
|
|
||
| +const [expectedMajor, expectedMinor] = expectedBunVersion.split(".") | ||
| +const [actualMajor, actualMinor] = process.versions.bun.split(".") | ||
| + | ||
| if (!expectedBunVersion) { | ||
| throw new Error("packageManager field not found in root package.json") | ||
| } | ||
|
|
||
| -if (process.versions.bun !== expectedBunVersion) { | ||
| - throw new Error(`This script requires bun@${expectedBunVersion}, but you are using bun@${process.versions.bun}`) | ||
| +if (expectedMajor !== actualMajor || expectedMinor !== actualMinor) { | ||
| + throw new Error(`This script requires bun ~${expectedBunVersion}, but you are using bun@${process.versions.bun}`) | ||
| } | ||
|
|
||
| const CHANNEL = process.env["OPENCODE_CHANNEL"] ?? (await $`git branch --show-current`.text().then((x) => x.trim())) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without cloning the repo, it would throw an error during build:
"fatal: not a git repository (or any of the parent directories): .git\n"