Skip to content

Develop#219

Draft
jappeace wants to merge 2 commits intomasterfrom
develop
Draft

Develop#219
jappeace wants to merge 2 commits intomasterfrom
develop

Conversation

@jappeace
Copy link
Copy Markdown
Owner

This branch is so I can merge stuff while not testing out on IOS, need to test this branch on ios to confirm stuff keeps working before merging in master

jappeace-sloth and others added 2 commits April 21, 2026 16:30
Combines two improvements to the Nix build infrastructure:

1. Deduplicate nix/lib.nix (995 → ~700 lines, 30% reduction):
   - Extract shared data lists (modules, C sources, headers, symbols)
     and helper functions into top-level let bindings
   - Merge mkIOSLib + mkWatchOSLib into internal mkAppleStaticLib
     parameterised by platform; public API preserved via thin wrappers
   - Merge mkSimulatorApp + mkWatchOSSimulatorApp into internal
     mkAppleSimulatorApp; public API preserved
   - Replace 14 repetitive NDK compile blocks with map over list
   - Hoist applePkgs, appleGhc, gmpStatic, libffiStatic to top-level

2. Build hatter as a cached cabal package for iOS/watchOS:
   - ios-deps.nix: add hatterSrc param, build hatter via callCabal2nix
     so the .a and package DB entry are cached
   - ios.nix, watchos.nix: pass hatterSrc to ios-deps.nix
   - mkAppleStaticLib: when crossDeps is provided, only compile
     Main.hs + run_main.c instead of all 22 modules + 19 C sources
   - Standalone fallback (crossDeps == null) preserved

Adding a new bridge module now means editing 1 list, not 6+ places.
Demo apps and consumers only recompile their entry point.

Prompt: combine PR #213 and #214 into a single PR

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…-cache

Refactor nix/lib.nix and cache hatter for iOS/watchOS
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.

1 participant