<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lan-mouse/scripts, branch main</title>
<subtitle>a fork</subtitle>
<id>https://git.nsrddyn.com/lan-mouse/atom/scripts?h=main</id>
<link rel='self' href='https://git.nsrddyn.com/lan-mouse/atom/scripts?h=main'/>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/'/>
<updated>2026-09-21T10:27:03Z</updated>
<entry>
<title>fix(macos): reject colliding library names, tighten argument handling</title>
<updated>2026-09-21T10:27:03Z</updated>
<author>
<name>Ferdinand Schober</name>
<email>ferdinandschober20@gmail.com</email>
</author>
<published>2026-09-21T09:43:50Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=f9aaf11109ca894675cee58aee0e55c0c819c49d'/>
<id>urn:sha1:f9aaf11109ca894675cee58aee0e55c0c819c49d</id>
<content type='text'>
Frameworks is flat, so a file name identifies a library there. Two
libraries sharing a name silently collapsed into one: the first was
copied, and every later binary had its reference rewritten to point at it
regardless of which library it actually wanted. The result built and
signed cleanly and then died at launch with `Symbol not found`.

Record which source each bundled name came from and refuse to continue on
a mismatch, naming both paths. Identity is device and inode rather than
the path, so a library reached through both `$homebrew_path/lib` and
`$homebrew_path/opt/&lt;formula&gt;/lib` -- both symlinks into the Cellar -- is
still recognised as one library. Bundling genuine duplicates would mean
renaming them or nesting them, so this only reports the situation; nothing
in the gtk4/libadwaita closure hits it.

Argument handling:
- match the Homebrew prefix at a path boundary, so a prefix of
  /opt/homebrew no longer also matches /opt/homebrew-testing/lib/...
  and pulls libraries from an unrelated tree into the bundle
- reject a second positional argument instead of letting it win
- accept `--`, and prefix a dashed exec_path with ./ so that `dirname`
  does not read it as an option of its own
- show the real default exec_path in `--help` rather than whatever had
  been parsed so far

Co-Authored-By: Claude Opus 5 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>fix(macos): resolve @rpath deps via LC_RPATH, drop Homebrew rpaths</title>
<updated>2026-09-21T10:27:03Z</updated>
<author>
<name>Ferdinand Schober</name>
<email>ferdinandschober20@gmail.com</email>
</author>
<published>2026-09-21T09:38:45Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=733ee49d30240950b9ff59caeb4639ff5c49057c'/>
<id>urn:sha1:733ee49d30240950b9ff59caeb4639ff5c49057c</id>
<content type='text'>
`@rpath`/`@loader_path` references were resolved by looking only in
`$homebrew_path/lib`. A formula whose dylib is not symlinked there -- a
keg-only one, or a dependency reachable only through the referencing
library's own LC_RPATH -- produced a `Warning:` line, and the build then
completed with exit 0 and the library missing from the bundle. That is the
same failure mode the `@rpath` handling was added to fix, just one level
further down.

References are now resolved the way dyld does it: each LC_RPATH entry of
the loading binary, in order, with `@loader_path` and `@executable_path`
expanded, falling back to `$homebrew_path/lib`. `@loader_path` is relative
to where the library *originally* lived rather than to its copy under
Frameworks, so `fix_references` takes the origin directory as an argument
and passes it down through the recursion.

An unresolved reference is now fatal. The whole point of the script is a
bundle that launches without Homebrew, and a warning in the middle of a
few hundred lines of CI output does not stop one from shipping. No
dependency in the gtk4/libadwaita closure is a weak reference, so this
cannot fail a build over an optional dylib.

Also:
- strip LC_RPATH entries pointing into the build machine's Homebrew tree
  (`libjpeg.8.dylib` carries `/opt/homebrew/Cellar/jpeg-turbo/3.1.4.1/lib`).
  dyld searches the loading binary's own rpaths before those of the
  binaries above it, so a user with the same formula installed would load
  their copy instead of the bundled one
- add `@loader_path/.` to each bundled dylib so they resolve each other
  even when loaded outside the main executable's load chain
- read `otool -L` output via here-strings rather than pipes, so the loops
  run in the current shell instead of a subshell
- skip the `install_name_tool -change` when a library could not be copied;
  rewriting the reference to `@rpath` turned a dependency that still
  resolved on a Homebrew machine into one that resolves nowhere, and under
  `set -e` the failure aborted the script mid-bundle, before the rpath was
  added and before anything was signed
- sign every file under Frameworks, not just `*.dylib`; a differently named
  library would be left unsigned and invalidate the bundle seal

Verified against the real gtk4 + libadwaita closure (43 dylibs): no
warnings, no `/opt/homebrew` left in any load command or rpath in the
finished bundle, signature valid, re-runs cleanly.

Co-Authored-By: Claude Opus 5 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>fix(macos): correct -b handling and bundle @loader_path deps</title>
<updated>2026-09-21T10:27:03Z</updated>
<author>
<name>Ferdinand Schober</name>
<email>ferdinandschober20@gmail.com</email>
</author>
<published>2026-09-21T08:39:10Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=2ebf18ce6aa5ebdb541f188420185191f07f14dc'/>
<id>urn:sha1:2ebf18ce6aa5ebdb541f188420185191f07f14dc</id>
<content type='text'>
The `-b`/`--homebrew` case assigned `$1` (the flag itself) instead of
`$2`, so the prefix became the literal string "-b". The empty-check then
passed, no `otool -L` entry matched, and the script exited 0 with an
empty Frameworks directory -- the bundle only failed at launch time.

Also:
- reject unknown options and a missing `-b` value instead of silently
  treating them as `exec_path` / aborting on `shift 2`
- stop command-substituting `brew --prefix` inside the usage heredoc,
  and unswap the `-b` / `exec_path` default descriptions
- declare `libs`/`rpath_libs` local; they were only safe by accident of
  the `while` loops running in pipe subshells
- handle `@loader_path/` references, which break once the library is
  moved into Frameworks, by rewriting them to `@rpath`
- match the Homebrew prefix as a literal prefix of the path field rather
  than as an unanchored regex over the whole `otool` line
- sign nested code inside-out; `codesign --deep` is deprecated
- switch the shebang to bash, which `local` already required

Co-Authored-By: Claude Opus 5 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Fixed missing `libsharpyuv.0.dylib` error when launching bundled app</title>
<updated>2026-09-21T10:27:03Z</updated>
<author>
<name>Dodi Wahyu Purnomo</name>
<email>dev01@Dodis-Mac01.local</email>
</author>
<published>2026-07-16T03:22:38Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=b646ba54091bf7eada60d4e93bab7c25c657cb52'/>
<id>urn:sha1:b646ba54091bf7eada60d4e93bab7c25c657cb52</id>
<content type='text'>
</content>
</entry>
<entry>
<title>macos: run as LSUIElement menubar app with NSStatusItem</title>
<updated>2026-04-29T20:59:43Z</updated>
<author>
<name>Jon Kinney</name>
<email>jonkinney@gmail.com</email>
</author>
<published>2026-04-24T07:09:12Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=903b0504e020afaca534a5be9299763da58775a2'/>
<id>urn:sha1:903b0504e020afaca534a5be9299763da58775a2</id>
<content type='text'>
Ship Lan Mouse on macOS as an accessory app (no Dock icon, no main
window on launch) with a status-bar item for show/quit. Closing the
window hides it instead of quitting so the menu bar stays the primary
surface.

- build-aux/macos-lsui-element.plist: LSUIElement=true plus
  NSInputMonitoringUsageDescription and NSAppleEventsUsageDescription
  (merged into Info.plist via cargo-bundle's osx_info_plist_exts).
- lan-mouse-gtk/src/macos_status_item.rs: NSStatusItem setup via raw
  objc_msgSend FFI. Loads a bundled 22pt PNG as a template image so
  it auto-tints for light/dark menu bars.
- scripts/makeicns.sh: emit Contents/Resources/menubar-template.png
  from the existing SVG.
- scripts/copy-macos-dylib.sh: flatten cargo-bundle's preserved
  target/ subdir under Resources so NSBundle pathForResource: finds
  the template image.
- lan-mouse-gtk/src/lib.rs: register the new modules, set up a
  Cmd+Q-wired quit action, configure bundle env vars (schemas,
  XDG_DATA_DIRS, GTK_DATA_PREFIX) when running from inside the .app,
  and filter the known upstream Gtk theme-parser warning spam.

Co-Authored-By: Claude Opus 4.7 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>makeicns.sh: produce Big Sur+ style macOS app icon</title>
<updated>2026-04-29T20:59:43Z</updated>
<author>
<name>Jon Kinney</name>
<email>jonkinney@gmail.com</email>
</author>
<published>2026-04-23T18:55:14Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=f858a7de00836f9fad61aefc5c504ac3ea8c86ae'/>
<id>urn:sha1:f858a7de00836f9fad61aefc5c504ac3ea8c86ae</id>
<content type='text'>
The previous script generated a 1024x1024 icon from the SVG with no
squircle background and no transparent padding, which caused macOS
to render the Dock/Finder icon noticeably larger than first-party
apps and without the rounded-square shape users expect.

Rewrite the script to follow Apple's Big Sur+ icon template:

  - 1024x1024 canvas
  - 824x824 white squircle, centered (100px transparent padding outside)
  - Artwork rendered at 560x560, centered inside the squircle
  - Squircle corner radius ~22.5% of the squircle size

Use rsvg-convert to rasterize the SVG (ImageMagick crops this
particular SVG when rendering directly), then composite onto the
squircle background in two steps for reliability.

Co-Authored-By: Claude Opus 4.7 (1M context) &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>update makeicns.sh</title>
<updated>2026-03-24T13:02:16Z</updated>
<author>
<name>Ferdinand Schober</name>
<email>ferdinand.schober@fau.de</email>
</author>
<published>2026-03-24T13:02:16Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=7fa3d2fafdf706617716a2fe4262e040bd4be76d'/>
<id>urn:sha1:7fa3d2fafdf706617716a2fe4262e040bd4be76d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Include libadwaita and other dependencies in the app bundle on macOS (#271)</title>
<updated>2025-10-14T11:35:07Z</updated>
<author>
<name>Micah R Ledbetter</name>
<email>me@micahrl.com</email>
</author>
<published>2025-10-14T11:35:07Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=0a0d91b0da83349b89a17ee6839e180494553199'/>
<id>urn:sha1:0a0d91b0da83349b89a17ee6839e180494553199</id>
<content type='text'>
* Include libadwaita and other dependencies in the app bundle on macOS

* Fix missing pipes

* Use recent bash for associative array support (declare -A)

* Use correct path for homebrew bash on Intel macOS

* Get homebrew path from the brew command

* Simplify copy-macos-dylib and convert to POSIX sh

Remove need for recent bash altogether

* Fix permissions nit

* Update macOS dylib copy script path in release workflow

* fix a few typos

* fix script invocation in pre-release.yml

---------

Co-authored-by: Apoorv Khandelwal &lt;mail@apoorvkh.com&gt;
Co-authored-by: Ferdinand Schober &lt;ferdinandschober20@gmail.com&gt;</content>
</entry>
<entry>
<title>Build a macOS bundle for Intel and ARM (#266)</title>
<updated>2025-02-21T11:35:13Z</updated>
<author>
<name>Micah R Ledbetter</name>
<email>me@micahrl.com</email>
</author>
<published>2025-02-21T11:35:13Z</published>
<link rel='alternate' type='text/html' href='https://git.nsrddyn.com/lan-mouse/commit/?id=508d06670064df2df19bdae4926cf3c9c241980c'/>
<id>urn:sha1:508d06670064df2df19bdae4926cf3c9c241980c</id>
<content type='text'>
* Build a macOS bundle for Intel and ARM

* Build icon.icns file in a script

* Add imagemagick

* Add macOS bundling to pre/tagged-release actions</content>
</entry>
</feed>
