-
-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
ride: add darwin support #313397
ride: add darwin support #313397
Conversation
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.
already looking good
--add-flags $out/share/ride/resources/app.asar \ | ||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \ | ||
--inherit-argv0 | ||
${lib.optionalString (!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.
${lib.optionalString (!stdenv.isDarwin) '' | |
'' + lib.optionalString (!stdenv.isDarwin) '' |
that's easier than string interpolation inside strings
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 don't really agree with this. This is very similar to how bash's if
statements look. I'm not using if then else
because that would add extra levels of indentation and it doesn't really look much more readable.
pkgs/by-name/ri/ride/package.nix
Outdated
--inherit-argv0 | ||
''} | ||
|
||
${lib.optionalString (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.
We could probably work with if then else here, too.
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.
nativeBuildInputs = | ||
[ | ||
zip | ||
makeWrapper | ||
] | ||
++ lib.optionals (!stdenv.isDarwin) [ copyDesktopItems ] | ||
++ lib.optionals stdenv.isDarwin [ darwin.cctools ]; |
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.
nativeBuildInputs = | |
[ | |
zip | |
makeWrapper | |
] | |
++ lib.optionals (!stdenv.isDarwin) [ copyDesktopItems ] | |
++ lib.optionals stdenv.isDarwin [ darwin.cctools ]; | |
nativeBuildInputs = [ | |
zip | |
makeWrapper | |
] ++ lib.optionals stdenv.isLinux [ copyDesktopItems ] | |
++ lib.optionals stdenv.isDarwin [ darwin.cctools ]; |
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 formatting is done by nixfmt-rfc-style
, so I won't change that.
I think I'll stay consistent with using stdenv.isDarwin
everywhere.
0ae062e
to
5d11ab8
Compare
# Fix error: no member named 'aligned_alloc' in the global namespace | ||
env.NIX_CFLAGS_COMPILE = lib.optionalString ( | ||
stdenv.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinSdkVersion "11.0" | ||
) "-D_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION=1"; | ||
|
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 added this instead of doing overrideSDK
since this requires less overriding.
017bb18
to
b2cd0fe
Compare
Description of changes
This PR adds darwin support to the
ride
package.I was working on supporting darwin in #250627, but I gave up since I didn't have a darwin machine to do debugging.
I have finally set up a
macos-ventura
VM so I can test on Darwin now.Turns out I was very very close, the only thing missing was that I accidentally removed some of the execute permissions from the electron directory, which made it not be able to launch.
Now, instead of doing
cp -r --no-preserve=all
I docp -r
withchmod -R u+w
, this way the directory becomes writable without messing up the other permissions.Note: since
dyalog
is not packaged for Darwin, you'll have to connect to adyalog
instance remotely if you want to test it out. (Or just run the non-nix package)Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.