Closed jonchang closed 3 years ago
xpa
doesn't seem to link against any X11 libraries:
➜ brew linkage xpa
System libraries:
/usr/lib/libSystem.B.dylib
xpa doesn't seem to link against any X11 libraries:
My guess is that it has a build-time dependency. Looking at the README maybe depends_on "libxt" => :build
would work?
Copy-and-pasteable checklist:
- [ ] `brew install FORMULA` on this list (should be poured from a bottle, not built from source)
- [ ] Run `brew linkage FORMULA` and observe which X11 libraries it links against
- [ ] Modify the formula to remove `depends_on :x11` and replace it with e.g. `depends_on "libx11"` and any additional X libraries
- [ ] Update `/opt/X11` or `MacOS::XQuartz` references to instead point them to the brewed formula paths
- [ ] `revision` bump
- [ ] `brew install -s FORMULA` and `brew linkage FORMULA` to check that it's now linking against brewed X and not XQuartz
Just a couple of working notes:
brew linkage
outputs /opt/X11/lib/libXp.6.dylib
, that's officially obsolete/deprecated, linuxbrew/xorg
. openmotif
used to link to it, but seems to build just fine without it post-migration, and I suspect it can generally be ignored for the purpose of this exercise.libxp
now exists for migration purposes.#include <X11/bitmaps/...>
, I've created #64282 to add the xbitmaps
formula that you can depends_on
. (Would be great if someone could review that ASAP.)A number of formulae link against
/opt/X11/lib/libGL.1.dylib
such as freeglut
and mesalib-glw
. I can't find a libgl
formula (or one like it), unfortunately. I'm guessing this has to do with OpenGL being deprecated in favour of Metal?
I believe we can link against opengl with -framework OpenGL
but I don't know if that makes sense if Apple has deprecated that going forward. We disabled building libgl
in https://github.com/homebrew/homebrew-core/pull/46992 so one solution might be to re-enable that in the mesa
formula and then depend on mesa
going forward for formulae that need OpenGL. See https://github.com/Homebrew/homebrew-core/pull/64330 for my attempt
I've added a couple of new formulae that were not in #57995, which are needed in certain cases:
xbitmaps
(#64282) - for any formula that does #include <X11/bitmaps/...>
libxp
(#64337) - turns out I was wrong about not needing it. nedit
actually refuses to build without it when linked with the migrated openmotif
, and it's probably safer to have openmotif
use it too. Add this if /opt/X11/lib/libXp.6.dylib
is in the linkage list of the original formula.Important note: If you usually ssh into your macOS box like me, X11 migration builds and tests absolutely need to be run from the console. For instance, I was getting false successes from brew install/test nedit
because the lack of a valid DISPLAY
actually caused it to not attempt any GUI operations at all. When I started running it from the console, even brew install
would fail with the same errors as the CI box.
It's also possible that remote-displaying to a separate X11 server could also trigger false successes (XQuartz seems to be a finicky beast), so best to stick to console runs.
Just a small comment about the libgl
thing: on linux we use the one provided by mesa
, so this is the right thing to do.
I've merged libxp
in https://github.com/Homebrew/homebrew-core/pull/64337
Not sure what I'm doing wrong, but brew install fox
is giving me errors after I tried migrating fox. (It says it can't find the formula, but then suggests a similarly named formula called "fox". Weird.)
Anyway, if someone else wants to try migrating fox, here's a patch: fox_diff.txt
And the original linkage:
❯ brew linkage fox #before
System libraries:
/opt/X11/lib/libGL.1.dylib
/opt/X11/lib/libGLU.1.dylib
/opt/X11/lib/libX11.6.dylib
/opt/X11/lib/libXcursor.1.dylib
/opt/X11/lib/libXext.6.dylib
/opt/X11/lib/libXfixes.3.dylib
/opt/X11/lib/libXft.2.dylib
/opt/X11/lib/libXi.6.dylib
/opt/X11/lib/libXrandr.2.dylib
/opt/X11/lib/libXrender.1.dylib
/usr/lib/libSystem.B.dylib
/usr/lib/libbz2.1.0.dylib
/usr/lib/libc++.1.dylib
/usr/lib/libz.1.dylib
Homebrew libraries:
/usr/local/opt/fontconfig/lib/libfontconfig.1.dylib (fontconfig)
/usr/local/Cellar/fox/1.6.56_1/lib/libFOX-1.6.0.dylib (fox)
/usr/local/opt/freetype/lib/libfreetype.6.dylib (freetype)
/usr/local/opt/jpeg/lib/libjpeg.9.dylib (jpeg)
/usr/local/opt/libpng/lib/libpng16.16.dylib (libpng)
/usr/local/opt/libtiff/lib/libtiff.5.dylib (libtiff)
@carlocab, your patch is b0rked:
$ brew audit --strict --online fox
Error: fox: undefined method `on' for Formulary::FormulaNamespace5faef846cfba2b699fd0b4ba2c6a26ec::Fox:Class
which led me rather quickly to:
+ depends on "libxi"
Pretty sure that's supposed to be an underscore between depends
and on
, not a space.
Yes, I figured I messed something up. :) Thanks for looking at it!
Edit: Fixed now. Thanks, @gromgit.
robot-framework:
On macOS:
❯ brew linkage robot-framework
System libraries:
/usr/lib/libSystem.B.dylib
/usr/lib/libffi.dylib
Homebrew libraries:
/usr/local/opt/openssl@1.1/lib/libcrypto.1.1.dylib (openssl@1.1)
/usr/local/opt/openssl@1.1/lib/libssl.1.1.dylib (openssl@1.1)
I'm guessing linkage needs to be checked on Linux, as in https://github.com/Homebrew/homebrew-core/pull/64584
I grepped the repo, though, and I couldn't find a reference to X11, so I don't know if it's a build-dependency either.
The fmsx license (found here) doesn't appear to be Homebrew-compatible:
fMSX source code is open for everyone to see but it is not in public domain. You can look and learn from it, but you cannot change it or copy it without giving a credit to the original author and a few other conditions. If you would like to port fMSX to another platform or make changes to the code, please, contact me by email or some other means.
You cannot use fMSX source code for commercial purposes unless you contact me to arrange the conditions of such usage. If your company intends to use MSX software in its products and you are considering using fMSX source code, please, email me about licensing.
At the very least, this seems similar to the case of pgplot: https://github.com/Homebrew/homebrew-core/pull/64332
This is now complete! Thanks to @gromgit, @issyl0, @SeekingMeaning, @yurikoles, and new contributor @carlocab for helping with migrations, @fxcoudert and @SMillerDev for reviewing pull requests, and @iMichka and @maxim-belkin for maintaining and migrating the X formula to homebrew/core from linuxbrew/xorg!
:tada: :partying_face:
Amazing. Who would have thought we would achieve this one day :)
I wouldn't have expected it last month.
Now that X in all its legion forms can be installed as a formula, we should start migrating our current formulae that
depends_on :x11
to instead depend on the brewed versions of the various X libraries.This is part of our long-term goal to remove all cask Requirements from Homebrew/core, which will help speed up our CI deployment time. Once this is complete the only cask Requirements remaining would be java and osxfuse.
General instructions:
brew install FORMULA
on this list (should be poured from a bottle, not built from source)brew linkage FORMULA
and observe which X11 libraries it links againstdepends_on :x11
and replace it with e.g.depends_on "libx11"
and any additional X libraries/opt/X11
orMacOS::XQuartz
references to instead point them to the brewed formula pathsrevision
bumpbrew install -s FORMULA
andbrew linkage FORMULA
to check that it's now linking against brewed X and not XQuartzSee an example here: https://github.com/Homebrew/homebrew-core/pull/64165
Some caveats to these instructions:
formulae that need to create or interact with an x11 GUI element might not work as not all components that exist in XQuartz.app have been ported over to our brewed versions. The missing X library (e.g. apple-wm) will need to be added as a new formula.
formulae that have build time dependencies on X libraries won't show up in
brew linkage
. In this case you'll have to figure out what it's depending on based on the configure or cmake script.if you really can't figure out how to build something and its usage is low (
brew info
analytics) consider disabling or removing the formula[x] cgoban - #64252
[x] chezscheme - #64367
[x] corectl https://github.com/Homebrew/homebrew-core/pull/64780
[x] curlftpfs https://github.com/Homebrew/homebrew-core/pull/64491
[x] ddd - #64407
[x] diff-pdf https://github.com/Homebrew/homebrew-core/pull/64651
[x] dmenu - #64279
[x] dwm https://github.com/Homebrew/homebrew-core/pull/64281
[x] feh https://github.com/Homebrew/homebrew-core/pull/64377
[x] fizmo https://github.com/Homebrew/homebrew-core/pull/64378
[x] fmsx 1ed8d74aab
[x] fox https://github.com/Homebrew/homebrew-core/pull/64713
[x] freeglut https://github.com/Homebrew/homebrew-core/pull/64419
[x] freerdp https://github.com/Homebrew/homebrew-core/pull/64502
[x] geomview https://github.com/Homebrew/homebrew-core/pull/64618
[x] grace https://github.com/Homebrew/homebrew-core/pull/64481
[x] hyperkit https://github.com/Homebrew/homebrew-core/pull/64613
[x] imake https://github.com/Homebrew/homebrew-core/pull/64499
[x] imlib2 https://github.com/Homebrew/homebrew-core/pull/64165
[x] jnethack https://github.com/Homebrew/homebrew-core/pull/64347
[x] lesstif https://github.com/Homebrew/homebrew-core/pull/64775
[x] libxkbcommon https://github.com/Homebrew/homebrew-core/pull/64776
[x] mesalib-glw https://github.com/Homebrew/homebrew-core/pull/64346
[x] morse https://github.com/Homebrew/homebrew-core/pull/64333
[x] mupdf #64479
[x] ncview https://github.com/Homebrew/homebrew-core/pull/64777
[x] nedit https://github.com/Homebrew/homebrew-core/pull/64356
[x] openmotif https://github.com/Homebrew/homebrew-core/pull/64356
[x] pdf2image https://github.com/Homebrew/homebrew-core/pull/64738
[x] pgplot https://github.com/Homebrew/homebrew-core/pull/64332
[x] rdesktop https://github.com/Homebrew/homebrew-core/pull/64611
[x] robot-framework https://github.com/Homebrew/homebrew-core/pull/64749
[x] rxvt-unicode https://github.com/Homebrew/homebrew-core/pull/64564
[x] sng https://github.com/Homebrew/homebrew-core/pull/64646
[x] startup-notification https://github.com/Homebrew/homebrew-core/pull/64778
[x] sxiv https://github.com/Homebrew/homebrew-core/pull/64278
[x] tgif https://github.com/Homebrew/homebrew-core/pull/64528
[x] tiger-vnc https://github.com/Homebrew/homebrew-core/pull/64608
[x] wmctrl https://github.com/Homebrew/homebrew-core/pull/64581
[x] wordnet https://github.com/Homebrew/homebrew-core/pull/64531
[x] xclip https://github.com/Homebrew/homebrew-core/pull/64314
[x] xdotool https://github.com/Homebrew/homebrew-core/pull/64204
[x] xlispstat https://github.com/Homebrew/homebrew-core/pull/64203
[x] xpa https://github.com/Homebrew/homebrew-core/issues/64166
[x] xshogi https://github.com/Homebrew/homebrew-core/pull/64200