Open
[EUR] update opencode from build #114043 #18
[EUR] update opencode from build #114043 #18
Open
openeuler-infra-botAdd on 10 days ago
Total: 2 files changed+184-357
Binary files do not support preview
Mopencode.spec+184-357
@@ -1,402 +1,229 @@
1+# Source build of opencode 1.19.5 for openEuler 25.09 (x86_64).
2+#
3+# Adapted from the openEuler EUR reference SRPM (user_76c6f026/openEuler_summit,
4+# opencode-1.19.5-2, built for openEuler 24.03 LTS SP4), rebuilt for 25.09.
5+#
6+# The EUR upload endpoint rejects SRPMs of a few MB, so the reference spec
7+# fetched the upstream archive in %prep from a reachable GitHub proxy. This
8+# COPR build ships the archive in the SRPM instead (Source0) and %prep prefers
9+# it, so the build no longer depends on a proxy being reachable. Node.js and
10+# Bun still come from Huawei Cloud mirrors and the npm dependency tree from the
11+# Huawei npm mirror. The models.dev snapshot is small enough to ship compressed
12+# in the SRPM (Source1).
13+#
14+# The upstream source is pruned to the CLI + embedded Web UI workspace closure
15+# (console/stats/desktop/docs/web/storybook/slack/identity/containers/cli/
16+# sdk-next/function removed). The ghostty-web dependency, which upstream pins
17+# to a GitHub commit, is switched to the published 0.3.0 npm package so the
18+# build does not need GitHub access.
19+#
20+# topdir: opencode-1.19.5
21+ 
1%global debug_package %{nil}22%global debug_package %{nil}
2%global __strip /bin/true23%global __strip /bin/true
3-%global __provides_exclude_from ^/opt/OpenCode/.*$
4-%global __requires_exclude_from ^/opt/OpenCode/.*$
5-%global electron_mirror https://mirrors.huaweicloud.com/electron/
6-%global electron_builder_binaries_mirror https://mirrors.huaweicloud.com/electron-builder-binaries/
7-%global nodejs_version 24.18.0
8-%{!?opencode_cache_dir:%global opencode_cache_dir %{_builddir}/%{name}-%{version}/.cache/opencode-rpm}
9 24 
10-# Both architecture variants of the vendored node_modules and of the Node.js25+%global node_version 24.18.0
11-# toolchain are declared as separate Source entries with fixed file names, so a26+%global node_sha256 55aa7153f9d88f28d765fcdad5ae6945b5c0f98a36881703817e4c450fa76742
12-# single SRPM carries the complete source set for aarch64 and x86_64. Deriving27+%global bun_version 1.4.4
13-# those file names from the build target architecture instead would resolve to28+%global bun_sha256 93ca5a2abe45f3bcac6dd55baff8bb06c4ac824b70f89650b54e5c8b80dbef18
14-# a single variant per spec parse, leave the other one out of the SRPM and make29+ 
15-# that SRPM impossible to rebuild for the second architecture.30+%global src_proxy https://ghfast.top/https://github.com/anomalyco/opencode/archive/refs/tags/v1.19.5.tar.gz
16-%ifarch aarch64
17-%global electron_builder_arch arm64
18-%global opencode_deps_source %{SOURCE3}
19-%global opencode_node_source %{SOURCE5}
20-%endif
21-%ifarch x86_64
22-%global electron_builder_arch x64
23-%global opencode_deps_source %{SOURCE2}
24-%global opencode_node_source %{SOURCE4}
25-%endif
26-%global opencode_build_target opencode-linux-%{electron_builder_arch}
27-%global electron_rpm_arch %{_target_cpu}
28 31 
29Name: opencode32Name: opencode
30-Version: 1.17.1333+Version: 1.19.5
31-Release: 234+Release: 1%{?dist}
32-Summary: The open source coding agent.35+Summary: The open source coding agent
33 36 
34License: MIT37License: MIT
35URL: https://github.com/anomalyco/opencode38URL: https://github.com/anomalyco/opencode
36-%global source_archive v%{version}.tar.gz39+# Source0 carries the upstream tarball (opencode-1.19.5/ top-level dir).
37-Source0: https://github.com/anomalyco/%{name}/archive/refs/tags/%{source_archive}40+Source0: opencode-1.19.5.tar.gz
38-# Build-time models.dev snapshot consumed by packages/opencode/script/build.ts.41+Source1: models-api.json.xz
39-Source1: opencode-models-api.json
40-# Vendored node_modules, one tarball per architecture.
41-Source2: opencode-deps-x86_64-%{version}.tar.xz
42-Source3: opencode-deps-aarch64-%{version}.tar.xz
43-# Pre-downloaded Node.js LTS, one tarball per architecture.
44-Source4: https://nodejs.org/dist/v%{nodejs_version}/node-v%{nodejs_version}-linux-x64.tar.xz
45-Source5: https://nodejs.org/dist/v%{nodejs_version}/node-v%{nodejs_version}-linux-arm64.tar.xz
46-# Desktop .desktop files and icons extracted from official upstream RPMs.
47-Source6: opencode-assets-%{version}.tar.gz
48 42 
49-ExclusiveArch: aarch64 x86_6443+# The build downloads x86_64 Node.js/Bun binaries and produces a linux-x64
50- 44+# Bun single-file executable; only x86_64 builds are supported.
51-BuildRequires: findutils45+ExclusiveArch: x86_64
52-BuildRequires: git46+BuildRequires: bash
53-BuildRequires: gzip47+BuildRequires: ca-certificates
54-BuildRequires: cpio
55BuildRequires: chrpath48BuildRequires: chrpath
49+BuildRequires: coreutils
50+BuildRequires: cpio
51+BuildRequires: curl
52+BuildRequires: findutils
53+BuildRequires: gcc
54+BuildRequires: gcc-c++
55+BuildRequires: git
56+BuildRequires: glibc-devel
57+BuildRequires: grep
58+BuildRequires: gzip
59+BuildRequires: make
56BuildRequires: patch60BuildRequires: patch
61+BuildRequires: python3
62+BuildRequires: sed
57BuildRequires: tar63BuildRequires: tar
58BuildRequires: unzip64BuildRequires: unzip
59BuildRequires: which65BuildRequires: which
60BuildRequires: xz66BuildRequires: xz
61BuildRequires: zip67BuildRequires: zip
62-Requires: git68+Requires: glibc
63- 
64-%package desktop
65-Summary: Electron desktop app for OpenCode with bundled sidecar CLI
66-License: MIT