Nixpkgs: Clementine requires unfree libspotify to build

Created on 2 Apr 2018  Â·  8Comments  Â·  Source: NixOS/nixpkgs

Issue description

Clementine requires unfree libspotify to build.

Steps to reproduce

$ nix-shell -p clementine --show-trace
error: while evaluating the attribute 'buildInputs' of the derivation 'shell' at /etc/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute 'blob' of the derivation 'clementine-1.3.1' at /etc/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute 'buildInputs' of the derivation 'clementine-blob-1.3.1' at /etc/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:148:11:
while evaluating the attribute 'handled' at /etc/nixpkgs/pkgs/stdenv/generic/check-meta.nix:204:7:
while evaluating 'handleEvalIssue' at /etc/nixpkgs/pkgs/stdenv/generic/check-meta.nix:124:28, called from /etc/nixpkgs/pkgs/stdenv/generic/check-meta.nix:205:14:
Package ‘libspotify-12.1.51’ in /etc/nixpkgs/pkgs/development/libraries/libspotify/default.nix:84 has an unfree license (‘unfree’), refusing to evaluate.

a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnfree = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnfree = true; }
to ~/.config/nixpkgs/config.nix.

Technical details

Please run nix-shell -p nix-info --run "nix-info -m" and paste the
results.

$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.29, NixOS, 18.09.git.7f291f8 (Jellyfish)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.0`
 - nixpkgs: `/etc/nixpkgs`

Most helpful comment

@Ma27 Yes, I understood that. I meant to say that perhaps Clementine shouldn't require such unfree packages by default. And as far as I understand, the packaging of Clementine tries to avoid unfree dependencies by default but there's something wrong because it doesn't work.

All 8 comments

Nix disallows the installation of unfree packages by default. As explained in the error message you have to explicitly allow Nix to install unfree software.

@Ma27 Yes, I understood that. I meant to say that perhaps Clementine shouldn't require such unfree packages by default. And as far as I understand, the packaging of Clementine tries to avoid unfree dependencies by default but there's something wrong because it doesn't work.

you're right. I can have a look at the internals of Clementine, but it
should be possible to use some sort of feature flag to optionally enable
using libspotify %)

On Mon, Apr 2, 2018 at 1:14 PM, Jaakko Luttinen notifications@github.com
wrote:

@Ma27 https://github.com/Ma27 Yes, I understood that. I meant to say
that perhaps Clementine shouldn't require such unfree packages by default.
And as far as I understand, the packaging of Clementine tries to achieve
that but there's something wrong because it doesn't work.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/NixOS/nixpkgs/issues/38315#issuecomment-377909259,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFvwBFSLGOLiiuqDCgCG6lmBitBmlb0dks5tkggrgaJpZM4TDJph
.

I think we can even set it to only enable spotify when "config.allowUnfree" is true.

Related: clementine-player/Clementine#5619

I just tried to fix this issue with the following patch:

diff --git a/pkgs/applications/audio/clementine/default.nix b/pkgs/applications/audio/clementine/default.nix
index 92a33035c82..fdc1c042217 100644
--- a/pkgs/applications/audio/clementine/default.nix
+++ b/pkgs/applications/audio/clementine/default.nix
@@ -1,7 +1,8 @@
 { stdenv, fetchurl, fetchpatch, boost, cmake, chromaprint, gettext, gst_all_1, liblastfm
 , qt4, taglib, fftw, glew, qjson, sqlite, libgpod, libplist, usbmuxd, libmtp
 , libpulseaudio, gvfs, libcdio, libechonest, libspotify, pcre, projectm, protobuf
-, qca2, pkgconfig, sparsehash, config, makeWrapper, runCommand, gst_plugins }:
+, qca2, pkgconfig, sparsehash, config, makeWrapper, runCommand, gst_plugins
+}:

 let
   withSpotify = config.clementine.spotify or false;
@@ -95,7 +96,7 @@ let
       ./clementine-spotify-blob.patch
     ];

-    buildInputs = buildInputs ++ [ libspotify ];
+    buildInputs = buildInputs ++ stdenv.lib.optional (config.allowUnfree or false) libspotify;
     # Only build and install the Spotify blob
     preBuild = ''
       cd ext/clementine-spotifyblob

However this breaks the build with the following message:

Either crypto++ must be available or the non-GPL Spotify code must be available

I'm not sure about librespot as alternative as it seems to be unmaintained as well (https://github.com/plietar/librespot#unmaintained). Furthermore I'm not sure if it might cause legal issues for us if we distribute packages including such libraries (https://github.com/plietar/librespot#disclaimer)

I can have a deeper look at it tonight, but I could image two solutions:

  • patch the source of the affected build accordingly to make sure no libspotifyis needed anymore or make it truly optional
  • explicitly mark clementine as unfree and use clementineFree as new default

I think we can even set it to only enable spotify when "config.allowUnfree" is true.

When I set allowUnfree, then that doesn't mean I want to also get unfree software when there is a free variant that likely does what I need.

@FRidh am I missing something?

As mentioned above it seems as the free celementine build requires libspotify, so my suggestion would be to make clementineFree the default and rename clementine to clementineUnfree and then we wouldn’t actually have to mess around with config.allowUnfree conditionals, right? :)

just submitted a patch which uses the free build yb default:)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

7c6f434c picture 7c6f434c  Â·  66Comments

nico202 picture nico202  Â·  70Comments

Infinisil picture Infinisil  Â·  146Comments

worldofpeace picture worldofpeace  Â·  103Comments

ttuegel picture ttuegel  Â·  98Comments