FelixKratz / JankyBorders

A lightweight window border system for macOS
GNU General Public License v3.0
1k stars 18 forks source link

Issue compiling as a Nix package #38

Closed benjigoldberg closed 8 months ago

benjigoldberg commented 8 months ago

Hello,

I'm attempting to package JankyBorders for Nix but I'm running into a compile error as below:

this derivation will be built:
  /nix/store/h39fn5v0sn0py2r43j20wr6nqxvc94f6-JankyBorders-1.3.0.drv
building '/nix/store/h39fn5v0sn0py2r43j20wr6nqxvc94f6-JankyBorders-1.3.0.drv'...
unpacking sources
unpacking source archive /nix/store/a7ri5w5wvr427xgwlyh7ax2g41gq01s4-source
source root is source
patching sources
updateAutotoolsGnuConfigScriptsPhase
configuring
no configure script, doing nothing
building
build flags: SHELL=/nix/store/x1xxsh1gp6y389hyl40a0i74dkxiprl7-bash-5.2-p15/bin/bash
mkdir bin
clang -std=c99 -O3 -g src/main.c src/mach.c src/hashtable.c src/events.c src/windows.c src/border.c  -o bin/borders -framework AppKit -F/System/Library/PrivateFrameworks/ -framework SkyLight
Undefined symbols for architecture arm64:
  "_SLSWindowManagementBridgeSetDelegate", referenced from:
      _main in main-07b876.o
ld: symbol(s) not found for architecture arm64
clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [makefile:5: all] Error 1
error: builder for '/nix/store/h39fn5v0sn0py2r43j20wr6nqxvc94f6-JankyBorders-1.3.0.drv' failed with exit code 2;
       last 10 log lines:
       > building
       > build flags: SHELL=/nix/store/x1xxsh1gp6y389hyl40a0i74dkxiprl7-bash-5.2-p15/bin/bash
       > mkdir bin
       > clang -std=c99 -O3 -g src/main.c src/mach.c src/hashtable.c src/events.c src/windows.c src/border.c  -o bin/borders -framework AppKit -F/System/Library/PrivateFrameworks/ -framework SkyLight
       > Undefined symbols for architecture arm64:
       >   "_SLSWindowManagementBridgeSetDelegate", referenced from:
       >       _main in main-07b876.o
       > ld: symbol(s) not found for architecture arm64
       > clang-16: error: linker command failed with exit code 1 (use -v to see invocation)
       > make: *** [makefile:5: all] Error 1
       For full logs, run 'nix log /nix/store/h39fn5v0sn0py2r43j20wr6nqxvc94f6-JankyBorders-1.3.0.drv'.

I am able to build this on my host with the Makefile outside of Nix without issue. I'm curious if you have any suggestion on things to troubleshoot?

FelixKratz commented 8 months ago

I am not sure, since I am not familiar with the internals of nix but I think it is due to the system frameworks used for linking in nix are outdated. They are probably pre-Ventura, since the symbol SLSWindowManagementBridgeSetDelegate was added to the SkyLight framework in macOS Ventura.

benjigoldberg commented 8 months ago

Thanks for the lead @FelixKratz! I’ll see what I can figure out

benjigoldberg commented 8 months ago

@FelixKratz thanks again - that is/was exactly the issue. There are other blockers to packaging in Nix right now, entirely based around SDK version. I'll stick to Homebrew for now. Thanks for the awesome project and for answering my question!