Skip to content

Support Claude Desktop 2.x (bump to 2.2553.1) - #4

Open
JayOfTheKeyboard wants to merge 2 commits into
christian-korneck:mainfrom
JayOfTheKeyboard:upstream-2x-support
Open

JayOfTheKeyboard wants to merge 2 commits into
christian-korneck:mainfrom
JayOfTheKeyboard:upstream-2x-support

Conversation

@JayOfTheKeyboard

Copy link
Copy Markdown

This is #3 reopened from my main account. The old sigiletlabs account that opened it is being closed, and its fork goes with it. The commit is the same change, now with my noreply address as author and signed. rperrotti confirmed in #3 that it upgrades Claude Desktop on Fedora 44.

I've kept building later releases (up to 2.42304.0) on my own branch, with a couple of small follow-ups. I can send those once this one is settled.


Claude Desktop 2.x changes enough inside the Windows package that the spec no longer produces a working app, so this bumps to 2.2553.1 and fixes what broke on the way. Happy to split it up if you would rather take the fixes separately from the bump.

The main process is no longer one file. 2.x ships index.pre.js plus about 220 index.chunk-*.js files instead of .vite/build/index.js. Every sed in %prep silently matched nothing, and the build still succeeded, so the result was an unpatched Windows app running under Linux Electron. The patches now run over every JS file in .vite/build.

The file:// origin patch had already stopped matching before that. The minified receiver is t.protocol now rather than e.protocol, so I matched the name loosely with a capture group instead of pinning it.

node-pty moved. It ships as prebuilds/win32-arm64 rather than build/Release, and it is 1.2.0-beta.14. The bigger catch is that installing the Linux pty.node into app.asar.unpacked during %install is no longer enough: with no entry in the asar header, require from inside the archive cannot reach the file at all, so "run in terminal" fails. I put the binary into the asar contents before packing and let --unpack "*.node" write it out, which keeps the header entry.

Electron 42 dropped its postinstall hook. npm install [email protected] no longer fetches the runtime, and node_modules/electron/dist never appears, so %install fails on a cp of a path that does not exist. install.js is still shipped, so I run it and check the result. This bites on any Electron 42 or newer, mock included.

Two smaller things: the win32-only guard on the quit-on-close path is gone upstream, so I dropped that patch and let the menuBarEnabled one do the work; and Source0 is now the nupkg named in the release feed, which saves chasing a per-release installer hash and gives a SHA1 to check the download against. I know you passed on the nupkg switch in #2, so drop that commit if you still would rather not.

Because four separate sed patches can fail silently, I checked the built RPM rather than the build tree: extract app.asar from it and grep the chunks. On this build, zero titleBarStyle:"hidden" left and two "default", zero menuBarEnabled getter calls, zero isPackaged file-origin checks, and the Linux platform branch present.

Built with rpmbuild -bb and installed on Fedora 44 x86_64. Untested on aarch64 and under mock, which is the gap you would care about most, given you are on Asahi.

Claude Desktop 2.x restructures the app in ways the current spec does not
survive, so this bumps to 2.2553.1 and fixes what broke along the way.

- Source0 is now the Squirrel nupkg named in the release feed
  (https://downloads.claude.ai/releases/win32/arm64/RELEASES), which also
  publishes its SHA1, so no per-release installer hash is needed.
- Electron 41.6.1 -> 44.2.0 and node-pty -> 1.2.0-beta.14, matching what
  2.2553.1 bundles.
- Electron 42 dropped the postinstall hook that fetched its runtime, so
  install.js is run explicitly and the result checked.
- The main process is now index.pre.js plus ~220 index.chunk-*.js files
  instead of one index.js, so the patches are applied across the whole
  build directory. The file:// origin patch also matches the minified
  receiver name loosely, since it had already stopped matching.
- The win32-only guard on the quit-on-close path is gone upstream, so that
  patch is dropped; the menuBarEnabled patch alone now does the job.
- node-pty ships as prebuilds/win32-arm64 rather than build/Release, so the
  Linux pty.node is placed in the asar contents before packing. A path that
  is not in the archive header cannot be required from inside the asar,
  which is what made 'run in terminal' fail.

Built and installed on Fedora 44 x86_64; not tested on aarch64.
@bastafidli

Copy link
Copy Markdown

This works. Validated on Asahi Fedora 43.
There is missing dependency in the instructions on clean OS install. It needs

sudo dnf install gcc-c++

@bastafidli

Copy link
Copy Markdown

@JayOfTheKeyboard

Copy link
Copy Markdown
Author

Thanks for testing it, and good catch on the compiler.

That dependency is actually already in the spec — BuildRequires: gcc-c++ (plus make and python3), added for the node-pty rebuild that 2.x needs. A mock build pulls those in automatically. The gap is the README's manual dnf install line, which still lists the old set from before node-pty was built from source. I'll update that line to match the spec.

On the 5.x script: this PR is just the 2.x bump so the current spec builds a working app again. I've kept later releases building on my own branch and can send those as a follow-up once this one lands.

The 2.x spec rebuilds node-pty from source, so a manual rpmbuild needs the C++ toolchain. These are already in the spec's BuildRequires; this lines the manual-install instructions up with them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants