diff --git a/.SRCINFO b/.SRCINFO index a75be4f23f14b..b2d4734649f51 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = claude-desktop-bin pkgdesc = Claude AI Desktop Application (Official Binary - Linux Compatible) - pkgver = 1.0.1217 + pkgver = 1.0.1307 pkgrel = 1 url = https://claude.ai arch = x86_64 diff --git a/PKGBUILD b/PKGBUILD index 1883400764552..4c9a767733096 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -3,7 +3,7 @@ # AUR Package Repository: https://github.com/patrickjaja/claude-desktop-bin pkgname=claude-desktop-bin -pkgver=1.0.1217 +pkgver=1.0.1307 pkgrel=1 pkgdesc="Claude AI Desktop Application (Official Binary - Linux Compatible)" arch=('x86_64') @@ -14,8 +14,8 @@ makedepends=('p7zip' 'wget' 'asar' 'python') optdepends=('claude-code: Claude Code CLI for agentic coding features (npm i -g @anthropic-ai/claude-code)') provides=('claude-desktop') conflicts=('claude-desktop') -source_x86_64=("Claude-Setup-x64-${pkgver}.exe::https://downloads.claude.ai/releases/win32/x64/1.0.1217/Claude-0cb4a3120aa28421aeb48e8c54f5adf8414ab411.exe") -sha256sums_x86_64=('6da48ea20930934c1c1bd52666de0c1458fea2fb7089d3d0b479ac527b140880') +source_x86_64=("Claude-Setup-x64-${pkgver}.exe::https://downloads.claude.ai/releases/win32/x64/1.0.1307/Claude-1ed8835ce5539ba2a894ab752752be672a17c0d8.exe") +sha256sums_x86_64=('4e6b99a9bd2d0f9e42048608b7f2a36fcf3224c97400564299c8a60b0b04196f') options=('!strip') prepare() { @@ -452,34 +452,41 @@ def patch_quick_entry_position(filepath): original_content = content failed = False - # Patch 1: In pTe() function - the fallback position generator - pattern1 = rb'(function pTe\(\)\{const t=ce\.screen\.)getPrimaryDisplay\(\)' - replacement1 = rb'\1getDisplayNearestPoint(ce.screen.getCursorScreenPoint())' - content, count1 = re.subn(pattern1, replacement1, content) + # Patch 1: In position function - the fallback position generator + # Pattern matches: function FUNCNAME(){const t=ELECTRON.screen.getPrimaryDisplay() + # Function names change between versions (pTe, lPe, etc.), electron var changes (ce, de, etc.) + pattern1 = rb'(function \w+\(\)\{const t=)(\w+)(\.screen\.)getPrimaryDisplay\(\)' + + def replacement1_func(m): + electron_var = m.group(2).decode('utf-8') + return (m.group(1) + m.group(2) + m.group(3) + + f'getDisplayNearestPoint({electron_var}.screen.getCursorScreenPoint())'.encode('utf-8')) + + content, count1 = re.subn(pattern1, replacement1_func, content) if count1 > 0: - print(f" [OK] pTe() function: {count1} match(es)") + print(f" [OK] position function: {count1} match(es)") else: - print(f" [FAIL] pTe() function: 0 matches, expected >= 1") + print(f" [FAIL] position function: 0 matches, expected >= 1") failed = True - # Patch 2: In dTe() function - the fallback display lookup - pattern2 = rb'r\|\|\(r=ce\.screen\.getPrimaryDisplay\(\)\)' - replacement2 = rb'r||(r=ce.screen.getDisplayNearestPoint(ce.screen.getCursorScreenPoint()))' - content, count2 = re.subn(pattern2, replacement2, content) + # Patch 2: In fallback display lookup + # Pattern matches: r||(r=ELECTRON.screen.getPrimaryDisplay()) + pattern2 = rb'r\|\|\(r=(\w+)\.screen\.getPrimaryDisplay\(\)\)' + + def replacement2_func(m): + electron_var = m.group(1).decode('utf-8') + return f'r||(r={electron_var}.screen.getDisplayNearestPoint({electron_var}.screen.getCursorScreenPoint()))'.encode('utf-8') + + content, count2 = re.subn(pattern2, replacement2_func, content) if count2 > 0: - print(f" [OK] dTe() fallback: {count2} match(es)") + print(f" [OK] fallback display: {count2} match(es)") else: - print(f" [FAIL] dTe() fallback: 0 matches, expected >= 1") + print(f" [FAIL] fallback display: 0 matches, expected >= 1") failed = True - # Patch 3: Override dTe to always use cursor position (optional enhancement) - pattern3 = rb'function dTe\(\)\{const t=hn\.get\("quickWindowPosition",null\),e=ce\.screen\.getAllDisplays\(\);if\(!\(t&&t\.absolutePointInWorkspace&&t\.monitor&&t\.relativePointFromMonitor\)\)return pTe\(\)' - replacement3 = rb'function dTe(){return pTe()/*patched to always use cursor position*/;const t=hn.get("quickWindowPosition",null),e=ce.screen.getAllDisplays();if(!(t&&t.absolutePointInWorkspace&&t.monitor&&t.relativePointFromMonitor))return pTe()' - content, count3 = re.subn(pattern3, replacement3, content) - if count3 > 0: - print(f" [OK] dTe() override: {count3} match(es)") - else: - print(f" [INFO] dTe() override: 0 matches (optional)") + # Patch 3: Disabled - this optional enhancement caused syntax errors + # The pattern only matched part of a function, leaving dangling code + print(f" [INFO] dTe() override: skipped (disabled)") # Check results if failed: @@ -792,25 +799,43 @@ def patch_tray_path(filepath): original_content = content patches_applied = 0 - # Pattern 1: Generic function pattern - # Pattern: function FUNCNAME(){return ce.app.isPackaged?pn.resourcesPath:...} - pattern1 = rb'(function \w+\(\)\{return ce\.app\.isPackaged\?)pn\.resourcesPath(:[^}]+\})' - replacement1 = rb'\1(pn.platform==="linux"?"/usr/lib/claude-desktop-bin/locales":pn.resourcesPath)\2' + # Pattern 1: Generic function pattern with variable electron/process module names + # Pattern: function FUNCNAME(){return ELECTRON.app.isPackaged?PROCESS.resourcesPath:...} + # Variable names change between versions (ce->de, pn->gn, etc.) + pattern1 = rb'(function \w+\(\)\{return )(\w+)(\.app\.isPackaged\?)(\w+)(\.resourcesPath)(:[^}]+\})' - content, count1 = re.subn(pattern1, replacement1, content) + def replacement1_func(m): + prefix = m.group(1) + electron_var = m.group(2) + middle = m.group(3) + process_var = m.group(4) + suffix = m.group(5) + m.group(6) + # Insert Linux check: (process.platform==="linux"?"/usr/lib/claude-desktop-bin/locales":process.resourcesPath) + return (prefix + electron_var + middle + + b'(' + process_var + b'.platform==="linux"?"/usr/lib/claude-desktop-bin/locales":' + + process_var + b'.resourcesPath)' + m.group(6)) + + content, count1 = re.subn(pattern1, replacement1_func, content) if count1 > 0: patches_applied += count1 print(f" [OK] generic resources path function: {count1} match(es)") - # Pattern 2: Specific wTe function pattern (alternative) + # Pattern 2: Alternative pattern with process.resourcesPath directly (no variable) if patches_applied == 0: - pattern2 = rb'function wTe\(\)\{return ce\.app\.isPackaged\?pn\.resourcesPath:' - replacement2 = rb'function wTe(){return ce.app.isPackaged?(pn.platform==="linux"?"/usr/lib/claude-desktop-bin/locales":pn.resourcesPath):' + pattern2 = rb'(function \w+\(\)\{return )(\w+)(\.app\.isPackaged\?)process\.resourcesPath(:[^}]+\})' - content, count2 = re.subn(pattern2, replacement2, content) + def replacement2_func(m): + prefix = m.group(1) + electron_var = m.group(2) + middle = m.group(3) + suffix = m.group(4) + return (prefix + electron_var + middle + + b'(process.platform==="linux"?"/usr/lib/claude-desktop-bin/locales":process.resourcesPath)' + suffix) + + content, count2 = re.subn(pattern2, replacement2_func, content) if count2 > 0: patches_applied += count2 - print(f" [OK] specific wTe function: {count2} match(es)") + print(f" [OK] process.resourcesPath function: {count2} match(es)") # Check results - at least one pattern must match if patches_applied == 0: