feat: WorkBuddy 5.5.3 build support + configurable Maintainer/Homepage - #2
Open
LeisureLinux wants to merge 6 commits into
Open
feat: WorkBuddy 5.5.3 build support + configurable Maintainer/Homepage#2LeisureLinux wants to merge 6 commits into
LeisureLinux wants to merge 6 commits into
Conversation
Upstream 5.5.x WindowManager.initialize() now attaches a tray context
menu on Linux directly:
if (process.platform === "linux") {
this.tray.setContextMenu(this.buildFallbackMenu());
}
inside the same else-branch that constructs the Tray. The legacy
anchor the patcher was matching —
const contextMenu = electron.Menu.buildFromTemplate([...]);
— no longer exists in main/index.js, so the patcher hard-fails with
"contextMenu declaration not found after tray" and exits 5.
Detect the modern layout by scanning the post-Tray window for both
"process.platform === 'linux'" and "setContextMenu(" within ~1.2KB
of the Tray construction. When matched, skip the legacy anchor patch
entirely; upstream is already correct for libayatana-appindicator, so
no fallback injection is needed. Still mark trayContextMenu=true so
assertRequiredPatches() does not flag it.
This unblocks building WorkBuddy 5.5.x. Required-patch misses for
updateMenuDisabled / updateRpcDisabled / networkDiagnosticsTimeouts
remain (same as on 5.4.7) and are still tolerated via
WB_SKIP_REQUIRED_PATCHES=1.
The extracted Electron runtime binary in /opt/workbuddy/ is the actual artifact of this port — it is the framework we ship, not part of the upstream application. Naming it after the framework makes the install tree confusingly framework-centric, and means a casual reader sees "/opt/workbuddy/electron" and wonders whether WorkBuddy is just a rebranded Electron app. Rename to /opt/workbuddy/workbuddy. start.sh and AppRun's AppRun now call $APP_DIR/workbuddy / $APPDIR/opt/workbuddy/workbuddy. Keep electron as a compat symlink to workbuddy so any internal argv[0] / process-title logic that hard-codes the framework name still resolves to the same executable. The /usr/bin/workbuddy wrapper and the .desktop file's Exec= field already used the application name and are unchanged.
The deb control template had hard-coded:
Maintainer: Community Maintainers <noreply@example.invalid>
with no Homepage field at all. Update it to read both from env vars
sourced at build time, with the project's preferred defaults baked
in:
MAINTAINER="LeisureLinux <AlbertXu@FreeLAMP.com>" make deb
HOMEPAGE="https://workbuddy.cn/" make deb
- packaging/linux/control: introduce __MAINTAINER__ / __HOMEPAGE__ /
__DOWNLOAD_HOMEPAGE__ placeholders. Replace the description's
hard-coded download URL with __DOWNLOAD_HOMEPAGE__ so it tracks
HOMEPAGE.
- scripts/build-deb.sh: accept MAINTAINER and HOMEPAGE env vars
(defaults to the values above); substitute into control via sed.
- scripts/build-rpm.sh: accept MAINTAINER_NAME and HOMEPAGE; emit
URL: $HOMEPAGE in the spec and pass --define "packager
$MAINTAINER_NAME" to rpmbuild.
- scripts/build-pacman.sh: accept MAINTAINER and HOMEPAGE; emit
url = $HOMEPAGE and packager = $MAINTAINER in .PKGINFO.
- README.md: document the three new env vars in both zh and en
"Useful Custom Configurations" sections.
Defaults match the previously committed template values, so existing
build artifacts (including the 5.4.7 .deb on disk) reproduce
byte-for-byte modulo the version string.
install.sh's write_package_version() reads CFBundleShortVersionString from the DMG's Info.plist and writes it into package.json + the workbuddy-app/.workbuddy-linux/version file on every build. After building WorkBuddy 5.5.3, package.json now reflects the verified upstream version. The previous committed version (5.1.4) was already stale relative to the verified 5.4.7 DMG.
- scripts/slim-deb.sh: convert official linux deb to slim version (strip win32/darwin payload, non-linux prebuilds, locales, node headers; strip-debug with malformed-ELF safety fallback; built-in node/python smoke tests before packaging; ~-25% installed size) - Makefile: add slim-deb target (accepts local path or URL) - CI: check-upstream.yml polls official update API daily (02:00 CST), builds and publishes slim deb to GitHub Releases on new version - README: reposition repo as unofficial slim variant of WorkBuddy
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Verified WorkBuddy 5.5.3 (DMG
WorkBuddy-darwin-x64-5.5.3.37748631-104760a2.dmg,sha256
b8289a198a871ea2f3a4acefd71a0f9e41f11aae75161def471a72c3861d3cae)end-to-end against this branch, then stacked four focused commits on top of
fix/linux-build-issues:fix(patcher): adapt tray contextMenu patch for WorkBuddy >=5.5.xUpstream 5.5.x
WindowManager.initialize()now attaches a tray context menuon Linux directly inside the same
elsebranch that constructs the Tray:The legacy anchor the patcher was matching —
const contextMenu = electron.Menu.buildFromTemplate([...])— no longerexists in
main/index.js, so the build hard-fails with"contextMenu declaration not found after tray" (exit 5).
Detect the modern layout by scanning the post-Tray window for both
process.platform === 'linux'andsetContextMenu(within ~1.2KB of the Trayconstruction. When matched, skip the legacy anchor patch entirely; upstream is
already correct for libayatana-appindicator, so no fallback injection is
needed. Still mark
trayContextMenu=truesoassertRequiredPatches()doesnot flag it.
updateMenuDisabled/updateRpcDisabled/networkDiagnosticsTimeoutsremain
falseon 5.5.x (same as on 5.4.7) and are still tolerated viaWB_SKIP_REQUIRED_PATCHES=1.refactor: rename artifact binary electron -> workbuddyThe extracted Electron runtime binary in
/opt/workbuddy/is the frameworkwe ship, not part of the upstream application. Renaming to
/opt/workbuddy/workbuddymakes the install tree uniformly named after the application.
start.shandthe AppImage
AppRuncall the new path. Keptelectronas a compat symlinkto
workbuddyso any internal argv[0] / process-title logic still resolves.The
/usr/bin/workbuddywrapper and.desktopExec=are unchanged.feat(packaging): make Maintainer / Homepage configurable via env varspackaging/linux/controlhad hard-codedMaintainer: Community Maintainers <noreply@example.invalid>and no Homepagefield. Now both are populated from env vars at build time, with the
project's preferred defaults baked in:
MAINTAINER+HOMEPAGEenv vars, default values committed.MAINTAINER_NAME+HOMEPAGE, with--define "packager $MAINTAINER_NAME"passed to
rpmbuildandURL: $HOMEPAGEin the spec.MAINTAINER+HOMEPAGE, written into.PKGINFO.常用自定义配置andUseful Custom Configurationssections.The template's
Download the official WorkBuddy macOS DMG from:line in thelong description also tracks
HOMEPAGE.chore: bump package.json version to 5.5.3Side effect of
install.sh'swrite_package_version()readingCFBundleShortVersionStringfrom the DMG's Info.plist on every build.Verification
dist/workbuddy_5.5.3_amd64.debbuilt cleanly from a clean state withmake build-app DMG=…+make deb(defaults produceMaintainer: LeisureLinux <AlbertXu@FreeLAMP.com>,Homepage: https://workbuddy.cn/).MAINTAINER="Test Person <test@example.com>" HOMEPAGE="https://example.com/wb" make debproduces the expected values in
dpkg-deb -f.bash -npasses on every modified shell script..debon disk is unchanged; new defaults reproduce thepreviously committed template values.
Out of scope
CHANGELOG.mdstill ends at5.0.3+wb3(2026-06-13). Worth a follow-upthat adds
[5.4.7+wb1]/[5.5.3+wb1]entries rather than retroactivelyrewriting the existing 5.0.3 history.