Conversation
|
Here's the LaunchAgent and LaunchDaemon distributed with XQuartz:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.macosforge.xquartz.startx</string>
<key>ProgramArguments</key>
<array>
<string>/opt/X11/lib/X11/xinit/launchd_startx</string>
<string>/opt/X11/bin/startx</string>
<string>--</string>
<string>/opt/X11/bin/Xquartz</string>
</array>
<key>Sockets</key>
<dict>
<key>org.macosforge.xquartz:0</key>
<dict>
<key>SecureSocketWithKey</key>
<string>DISPLAY</string>
</dict>
</dict>
<key>ServiceIPC</key>
<true/>
<key>EnableTransactions</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.macosforge.xquartz.privileged_startx</string>
<key>ProgramArguments</key>
<array>
<string>/opt/X11/lib/X11/xinit/privileged_startx</string>
<string>-d</string>
<string>/opt/X11/lib/X11/xinit/privileged_startx.d</string>
</array>
<key>MachServices</key>
<dict>
<key>org.macosforge.xquartz.privileged_startx</key>
<true/>
</dict>
<key>TimeOut</key>
<integer>120</integer>
<key>EnableTransactions</key>
<true/>
</dict>
</plist> |
|
This is now feature complete. I've confirmed the following:
I'm now using this @jwiegley @viric @vcunat (and any other interested parties): Can I have you take a look at this? If I did everything correctly, it shouldn't impact Linux/NixOS (maybe some rebuilds due to extra empty environment variables on those platforms, but nothing more). |
|
Looks well-separated, and quite a lot of work, too. I know very little about darwin and less about XQuartz, but what is the purpose of mesa there? It is (transitively) used by many other packages, as they need libGL_. At build time it's probably fine to use the newly added mesa-darwin, but during runtime I would expect to prefer the native /usr/lib/libGL_ on the machine, just as on NixOS we use the one from the chosen GPU driver. |
|
@vcunat Thank you for reviewing this. In XQuartz's case, it seems to just be a build time dependency - it isn't dynamically linked to mesa. As for the other cases, I'm not really sure how they might be used on Darwin. (The mesa-darwin package was a pretty direct port from the MacPort's Portfile.) |
|
Would you/someone try at least running glxgears from |
|
@vcunat Aside from a vboxvideo related error message (I ran glxinfo in a VM), it appears to be working: |
|
A darwin inside VM surprised me, but it's probably almost identical to real darwin. BTW, that mentioned driver is in vbox guest additions (at least on Linux). |
|
@vcunat Oops - you wanted me to run that on Darwin! That works too: |
Yes, looks like it's picking the system driver. I'm quite confident that linux is unaffected by this (just added -p to mkdir in xkeyboardconfig), but I have no idea about what it can break on darwin (and I never had any darwin). I think it might be best to create a separate darwin-only jobset for this on Hydra, so at least builds are tested and binaries provided for potential testers, before actually merging. I have no Hydra permissions to do this, however. @shlevy: still interested in darwin? |
That sounds like an excellent approach. If we can get a jobset configured, I'd be more than happy to tackle any failures. Thanks again for diving into this, I know it's a non-trivial PR to wade through. |
|
I just gave this one last self-review, and I found that there was an error logged in |
|
This is all working for me, so I'm going to pull the trigger now. |
|
I guess the comments linked below are just forgotten and can be deleted (will be on regeneration): https://github.com/cstrahan/nixpkgs/blob/4b7fd0e5614368b7c5aef1e1ba75da4100c69ea4/pkgs/servers/x11/xorg/default.nix#L1987 |
|
@vcunat Yes, that's an old comment. |


I'm opening this ticket to track my work on getting XQuartz into Nixpkgs for X11 on Darwin.
As of writing this, this branch is incredibly chopped up and unstable. I'd would suggest waiting for me to give the thumbs up here before diving in and trying to make any sense of it.Some notes:
xorgserver(X,Xvfb,Xnest,Xephyr,Xfake, etc) and theXQuartz.appin the same source tree. They must be compiled separately (the--disable-xquartz --enable-xvfb --enable-xnest --enable-kdriveconfigure flags mentioned in the build instructions)xorgserver(sansXQuartz.app) builds fine withstdenv(haven't tested that it functions properly yet), while theXQuartz.appwill only build withclangStdenvclock_gettime) inlibdrm, all ofxorgserver's dependencies build as-isxinitneeds to be built withclangStdenv. Currently, the generatedpkgs/servers/x11/xorg/default.nixfile does not support overriding the stdenv per package, so I'll need to come up with some solution to that.