Nixpkgs: firefox-bin should support darwin

Created on 22 Oct 2019  ·  11Comments  ·  Source: NixOS/nixpkgs

Issue description

firefox-devedition-bin seems to not allow installation on MacOS, but there a commits that
make me think darwin support was added?

Here is the commit that seems to add darwin support: commit

Steps to reproduce

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.6
BuildVersion:   18G103

$ nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-unstable

$ nix-env -i firefox-devedition-bin
installing 'firefox-devedition-bin-70.0b2'
error: Package ‘firefox-devedition-bin-70.0b2’ in /nix/store/b01n50s0yx4yrnjnk954p9h4dg44098a-nixpkgs-20.03pre197053.d08a7431561/nixpkgs/pkgs/applications/networking/browsers/firefox/wrapper.nix:180 is not supported on ‘x86_64-darwin’, refusing to evaluate.

Technical details

$ nix run nixpkgs.nix-info -c nix-info -m
[2 copied (0.0 MiB), 0.0 MiB DL]
 - system: `"x86_64-darwin"`
 - host os: `Darwin 18.7.0, macOS 10.14.6`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3.1`
 - channels(chris_wiggins): `"nixpkgs-20.03pre197053.d08a7431561"`
 - nixpkgs: `/Users/chris_wiggins/.nix-defexpr/channels/nixpkgs`
question darwin

All 11 comments

@NixOS/darwin-maintainers

@cwiggs That commit appears to change the source based firefox package, while your issue is with firefox-devedition-bin which is a firefox binary.

It looks like the firefox and firefox-devedition-bin both point to the same nix expression when viewing them on https://nixos.org/nixos/packages.html?channel=nixpkgs-unstable, looking at the nix expression history here is where I found that commit.

When I try and search for firefox it also doesn't seem to be available for darwin?

$ nix-env -qaP firefox
error: selector 'firefox' matches no derivations

I'm not familiar enough with nix to understand how this all works, so I'm a little lost, perhaps I'm doing something wrong?

you should see something, my output on NixOS:

$ nix-env -qaP firefox
nixos.firefox-esr-52         firefox-52.9.0esr
nixpkgs.firefox-esr-52       firefox-52.9.0esr
nixos.firefox-esr-60         firefox-60.9.0esr
nixpkgs.firefox-esr-60       firefox-60.9.0esr
nixos.firefox-esr            firefox-68.1.0esr
nixos.firefox-esr-wrapper    firefox-68.1.0esr
nixpkgs.firefox-esr          firefox-68.1.0esr
nixpkgs.firefox-esr-wrapper  firefox-68.1.0esr
nixos.firefox                firefox-69.0.2
nixos.firefox-wayland        firefox-69.0.2
nixos.firefox-wrapper        firefox-69.0.2
nixos.firefoxWrapper         firefox-69.0.2
nixpkgs.firefox              firefox-69.0.2
nixpkgs.firefox-wayland      firefox-69.0.2
nixpkgs.firefox-wrapper      firefox-69.0.2
nixpkgs.firefoxWrapper       firefox-69.0.2

They all use the firefox wrapper @jonringer @cwiggs, which is why they point to the same expression and probably have the same derivation name.

In all-packages.nix firefox-devedition-bin is res.wrapFirefox firefox-devedition-bin-unwrapped and firefox-devedition-bin-unwrapped, which callPackage ../applications/networking/browsers/firefox-bin.

So the expression is

and overriding some parameters to make it devedition.

Looking here, it doesn't support darwin

The expression would need a bit of changes to have this.

ah, this makes sense, the evaluated package list would exclude results that are not supported on that platform.

Did the commit I mentioned above add some changes that need to be made to the expression? Or does the expression just need to be changed so it says it supposed darwin?

I'm new to nixos but I'd like to try and get firefox working in darwin, just not 100% sure how.

Did the commit I mentioned above add some changes that need to be made to the expression? Or does the expression just need to be changed so it says it supposed darwin?

I'm new to nixos but I'd like to try and get firefox working in darwin, just not 100% sure how.

When I mentioned

In all-packages.nix firefox-devedition-bin is res.wrapFirefox firefox-devedition-bin-unwrapped and firefox-devedition-bin-unwrapped, which callPackage ../applications/networking/browsers/firefox-bin.
So the expression is
https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/browsers/firefox-bin/default.nix

I meant that https://github.com/NixOS/nixpkgs/commit/8fba05403ae6c34790179dc10fe048e67a40e243 is operating on the source version of firefox, and that you're looking at the incorrect expression and it's

From looking at
https://github.com/NixOS/nixpkgs/blob/2c09cfc097daef5b85d21fe906441b5702bb2101/pkgs/applications/networking/browsers/firefox-bin/default.nix#L60

I can tell it doesn't support darwin, and would need to be added.

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

still important to me

Is this as easy as adding a configuration tuple to that expression?

No, nothing works.

Problems you'll encounter (roughly) in order:

  1. mozillaPlatform.x86_64-darwin = "mac";
  2. alsa, glibc and systemd aren't available on darwin of course, mac probably binaries don't need them though
  3. The updater needs xidel to fetch the newest version which we don't package for darwin (it's some crufty package on sourceforge we fetch the binaries for, a mac version exists ...in a zip file ...in some evernote notebook)
  4. Patching the xidel drv to use the zip is easy enough but doesn't work and fetches version "".
  5. after you remove xidel and hard-code the version to $currentFFVerHere, you'll find out that Mozilla's key server is down permanently
  6. after you've replaced the keyserver with key.openpgp.org, you'll find that gpg doesn't want to work properly on darwin
  7. after disabling gpg verification and adding mac to the arches for loop, you'll find that it just skips mac
  8. after extending the grep regex magic to accomodate for a completely different naming scheme and capitalisation for mac binaries (thanks Mozilla), you'll find that, because it's Firefox $ver instead of firefox-$ver now, the arcane sed scrolls produce source URLs only up to */Firefox because there's a space behind it.
  9. after giving up on the update script you'll find that the space in the URL prevents you from nix-prefetch-urling it
  10. replacing with %20 works but it can't save the downloaded file because you can't use % in a file name
  11. (ノಠ益ಠ)ノ彡┻━┻
Was this page helpful?
0 / 5 - 0 ratings

Related issues

copumpkin picture copumpkin  ·  3Comments

langston-barrett picture langston-barrett  ·  3Comments

tomberek picture tomberek  ·  3Comments

edolstra picture edolstra  ·  3Comments

ayyess picture ayyess  ·  3Comments