New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Anki: Darwin support #21681
Anki: Darwin support #21681
Conversation
@matthewbauer, thanks for your PR! By analyzing the history of the files in this pull request, we identified @lovek323, @bjornfor and @urkud to be potential reviewers. |
@@ -41,7 +43,8 @@ stdenv.mkDerivation rec { | |||
sha256 = "11j682g2mn723sz3bh4i44ggq29z053zcggy0glzn63zh9mxdly3"; | |||
}; | |||
|
|||
patches = [ ./caps-fix.patch ]; | |||
patches = [ ./caps-fix.patch ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where did this patch come from? It looks like you can probably use fetchpatch
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this patch was already here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think he was referring to the below one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, the changes are good now apart from the xcode dependency.
[ "--build=x86_64" "--without-oss" "--enable-static" "--enable-shared" ]; | ||
[ "--disable-mac-universal" ]; | ||
|
||
propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ]; | ||
|
||
preBuild = stdenv.lib.optionalString stdenv.isDarwin '' | ||
sed -i '50 i\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not your changes, but this looks really fragile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. It's needed here because Makefile is not generated until after configurePhase. We should just modify Makefile.in but the line numbers won't be the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer a patch that fixes the Makefile.in
then, if that's possible.
This builds fine, but running it seems to require xcode. Is that expected? |
@LnL7 It shouldn't require Xcode. Do you have any clues as to where it uses Xcode? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just trying to understand some minor changes in here -- looks good, but particularly concerned about the change from linux
to unix
when the title suggests only Darwin support.
@@ -199,6 +199,6 @@ stdenv.mkDerivation rec { | |||
homepage = "http://mplayerhq.hu"; | |||
license = "GPL"; | |||
maintainers = [ stdenv.lib.maintainers.eelco stdenv.lib.maintainers.urkud ]; | |||
platforms = stdenv.lib.platforms.linux; | |||
platforms = stdenv.lib.platforms.unix; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hesitations about changing this to "unix" when the title says "Darwin support". Unix is defined to be Linux, Darwin, FreeBSD, OpenBSD, NetBSD and Illumos; as defined here:
Line 21 in 56904d7
unix = linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos; |
with stdenv.lib.platforms; linux ++ darwin ;
to conform to the header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally don't like being to restrictive with the platforms, IMHO this should include all the platforms that are supported upstream even if they don't necessarily work (yet) in nixpkgs.
@@ -4,7 +4,7 @@ | |||
, libmng, which, mesaSupported, mesa, mesa_glu, openssl, dbus, cups, pkgconfig | |||
, libtiff, glib, icu, mysql, postgresql, sqlite, perl, coreutils, libXi | |||
, buildMultimedia ? stdenv.isLinux, alsaLib, gstreamer, gst_plugins_base | |||
, buildWebkit ? stdenv.isLinux | |||
, buildWebkit ? true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this now set to true
? Seems like a change for any library dependent on qt-4.8. Why not buildWebkit ? stdenv.isLinux | stdenv.isDarwin
?
@@ -12,30 +13,26 @@ stdenv.mkDerivation rec { | |||
++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib; | |||
|
|||
configureFlags = stdenv.lib.optionals stdenv.isDarwin | |||
[ "--build=x86_64" "--without-oss" "--enable-static" "--enable-shared" ]; | |||
[ "--disable-mac-universal" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this flag do any harm when passed into a non-darwin build? I generally try to minimize platform-conditional stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will just appear on stdenv..isDarwin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what I mean. Does it need to be conditional at all? Wouldn't a linux build just ignore the flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditional is probably not needed but it will cause a rebuild without it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also prefer not to use isDarwin conditionals if not necessary, is the resulting rebuild significant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I can change it
Oh, I'll take a closer look at the error then. |
OS version: Mac OS X 10.11.6 (15G1212)
|
@vbgl Are you on the latest master? http://hydra.nixos.org/build/46408265 |
After updating to master, |
QtWebkit is needed by Anki
- don't use preBuild for patching - leave all of the tests in place (no tests are run anyway)
@LnL7 Do you know which derivation requires Xcode to be installed? Most likely it is some bogus version check. |
Oh right, forget about that. It's either fixed or I just did something strange when testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testing, I'll merge once it's finished.
Motivation for this change
These are all changes needed to get Anki working on macOS. No changes to the Anki derivation are necessary. However, to run Anki correctly you must set DYLD_FRAMEWORK_PATH correctly until #20484 is fixed:
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)