From ef5e212d20959d4d883df2ff2a54e5ef4b2512a5 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 6 Apr 2018 17:16:31 +0200 Subject: [PATCH] clementine: provide free derivation by default The `clementine` package is actually released under Apache license, but requires the unfree `libspotify` package to build. Now `nixpkgs.clementine` points to the free derivation and `nixpkgs.clementineUnfree` has been introduced for the package bundled with spotify support. Fixes #38315 --- nixos/doc/manual/release-notes/rl-1809.xml | 3 ++ .../applications/audio/clementine/default.nix | 49 ++++++------------- pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 19 insertions(+), 35 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-1809.xml b/nixos/doc/manual/release-notes/rl-1809.xml index 959bd86759b1..61f9ec8ba995 100644 --- a/nixos/doc/manual/release-notes/rl-1809.xml +++ b/nixos/doc/manual/release-notes/rl-1809.xml @@ -58,6 +58,9 @@ following incompatible changes: + The clementine package points now to the free derivation. + clementineFree is removed now and clementineUnfree + points to the package which is bundled with the unfree libspotify package. diff --git a/pkgs/applications/audio/clementine/default.nix b/pkgs/applications/audio/clementine/default.nix index 92a33035c827..b8ff3daec606 100644 --- a/pkgs/applications/audio/clementine/default.nix +++ b/pkgs/applications/audio/clementine/default.nix @@ -76,6 +76,8 @@ let enableParallelBuilding = true; + passthru.unfree = unfree; + meta = with stdenv.lib; { homepage = http://www.clementine-player.org; description = "A multiplatform music player"; @@ -85,8 +87,8 @@ let }; }; - # Spotify blob for Clementine - blob = stdenv.mkDerivation { + # Unfree Spotify blob for Clementine + unfree = stdenv.mkDerivation { name = "clementine-blob-${version}"; # Use the same patches and sources as Clementine inherit src nativeBuildInputs postPatch; @@ -95,7 +97,7 @@ let ./clementine-spotify-blob.patch ]; - buildInputs = buildInputs ++ [ libspotify ]; + buildInputs = buildInputs ++ [ libspotify makeWrapper gst_plugins ]; # Only build and install the Spotify blob preBuild = '' cd ext/clementine-spotifyblob @@ -104,6 +106,15 @@ let mkdir -p $out/libexec/clementine mv $out/bin/clementine-spotifyblob $out/libexec/clementine rmdir $out/bin + + makeWrapper ${free}/bin/clementine $out/bin/clementine \ + --set CLEMENTINE_SPOTIFYBLOB $out/libexec/clementine \ + --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0" + + mkdir -p $out/share + for dir in applications icons kde4; do + ln -s "$free/share/$dir" "$out/share/$dir" + done ''; enableParallelBuilding = true; meta = with stdenv.lib; { @@ -116,34 +127,4 @@ let }; }; -in - -with stdenv.lib; - -runCommand "clementine-${version}" -{ - inherit blob free; - buildInputs = [ makeWrapper ] ++ gst_plugins; # for the setup-hooks - dontPatchELF = true; - dontStrip = true; - meta = { - description = "A multiplatform music player" - + " (" + (optionalString withSpotify "with Spotify, ") - + "with gstreamer plugins: " - + concatStrings (intersperse ", " (map (x: x.name) gst_plugins)) - + ")"; - license = licenses.gpl3Plus; - inherit (free.meta) homepage platforms maintainers; - }; -} -'' - mkdir -p $out/bin - makeWrapper "$free/bin/${exeName}" "$out/bin/${exeName}" \ - ${optionalString withSpotify "--set CLEMENTINE_SPOTIFYBLOB \"$blob/libexec/clementine\""} \ - --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0" - - mkdir -p $out/share - for dir in applications icons kde4; do - ln -s "$free/share/$dir" "$out/share/$dir" - done -'' +in free diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index eba05ff31a3a..83fcc3932985 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1603,7 +1603,7 @@ with pkgs; with gst_all_1; [ gst-plugins-base gst-plugins-good gst-plugins-ugly gst-libav ]; }; - clementineFree = clementine.free; + clementineUnfree = clementine.unfree; ciopfs = callPackage ../tools/filesystems/ciopfs { };