Skip to content
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

Darwin closed-source apps: init Steam, Spotify #20670

Closed
wants to merge 4 commits into from

Conversation

matthewbauer
Copy link
Member

@matthewbauer matthewbauer commented Nov 24, 2016

Motivation for this change

This inits derivations for spotify and steam on Darwin. undmg needs to be updated to set the executable bits correctly.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@mention-bot
Copy link

@matthewbauer, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mpscholten to be a potential reviewer.

@matthewbauer matthewbauer changed the title Darwin close-source apps: init Steam, Spotify Darwin closed-source apps: init Steam, Spotify Nov 24, 2016
@LnL7 LnL7 added the 6.topic: darwin Running or building packages on Darwin label Nov 24, 2016
name = "spotify-mac";

src = fetchurl {
url = "http://download.spotify.com/Spotify.dmg";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume there's no versioned url we can use, it would be nice if we could provide a source that will keep working.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't found a versioned release yet.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's going to be hard for applications like that in general.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have pulled older versions from here: http://filehippo.com/mac/download_spotify_for_mac/
But I am not sure whether we want to trust a third-party site...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what they link to on the website (but with a versioned file)
https://d1clcicqv97n4s.cloudfront.net/Spotify-1.0.42.151.g19de0aa6.dmg

libgcrypt = libgcrypt_1_5;
libpng = libpng12;
};
spotify_mac = callPackage ../applications/audio/spotify/darwin.nix {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we perhaps put them in a darwin.applications attrset, might be easier if everything is in one place.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing is most of these have equivalent linux derivations that you should have the same name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it pick the correct derivation based on the platform.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, I was talking about the spotify_mac attribute here.

@matthewbauer
Copy link
Member Author

I'm thinking of just starting a "nixpkgs-app" repo. It will be to nixpkgs what cask is to homebrew.

@mpscholten
Copy link
Contributor

What would be the advantage of this? Keeping everything in the main nixpkgs keeps things simpler IMO.

homepage = http://store.steampowered.com/;
license = licenses.unfreeRedistributable;
platforms = platforms.darwin;
maintainers = with maintainers; [ jagajaga ];
Copy link

@ghost ghost Dec 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure that @jagajaga has an interest in maintaining Steam for Darwin platform?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woops, I'll get rid of that.

@ghost
Copy link

ghost commented Dec 1, 2016

@mpscholten IMO this will lead to nixpkgs repo bloat, so separate repo will be better. Why do we need these macOS only binary things?

  • The natural way to have software in NixOS is to install it from nixpkgs
  • The natural way to have software in macOS is to get .dmg from web and copy an app from it

In my opinion the real need to add a package for Darwin is when it does invasion into the sytem or is not available in binary form for macOS

@matthewbauer
Copy link
Member Author

@gnidorah I guess the best answer I have is for completeness: we already have versions of these for Linux so we might as well have macOS versions as well. That being said the lack of a permanent versioned url make things very difficult.

@LnL7
Copy link
Member

LnL7 commented Dec 1, 2016

@gnidorah I strongly disagree with that, for me there's no difference between an unfree derivation that targets linux or darwin. We also have other very large attribute sets that not everybody might care about (eg. the 10929 haskellPackages).

However I don't like adding packages that break at any point if a new version is released.

@LnL7
Copy link
Member

LnL7 commented Dec 1, 2016

@matthewbauer can you create a pr for undmg

@ghost
Copy link

ghost commented Dec 1, 2016

@matthewbauer @LnL7 got your points guys. But nix expressions for such packages look similar. Perhaps adding new ones may be somehow simplified? I.e. using single file or whatever.

for me there's no difference between an unfree derivation that targets linux or darwin

The difference is that on Linux you need to care about dependencies, but on Darwin they are bundled in case of .app programs, so the role of package manager is not very significant in that case

@LnL7
Copy link
Member

LnL7 commented Dec 1, 2016

That's actually more of a discussion of free vs unfree derivations.

Most unfree linux packages are statically linked or have vendored dependencies,
and we have a derivation for MacVim.app that uses nix dependencies for example.

@mpscholten
Copy link
Contributor

Regarding the versioning issues: We could build a script which updates the package hashes on a regulary schedule (e.g. every 30 minutes). This way, even when there is only the latest version of a package available for download, a simple nix-channel --update would fix the hashes. We could also just steal the hashes from the homebrew cask repository for most of the packages.

In general I really like this idea of being able to install all my software with nix on macOS.

@Mic92
Copy link
Member

Mic92 commented Dec 3, 2016

You could also upload the packages to archive.org to get stable sources for updates.

@LnL7
Copy link
Member

LnL7 commented Dec 4, 2016

I had no idea that https://archive.org also has software, I think that's a great solution if there are no licence issues with that.

Using a different source is not really a problem if we compare it with the latest official version at the point that it's merged in or if we automate the uploads with an update.

@ghost ghost mentioned this pull request Nov 5, 2017
8 tasks
yurrriq added a commit to yurrriq/dotfiles that referenced this pull request Aug 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: darwin Running or building packages on Darwin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants