Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions pkgs/applications/audio/exaile/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{ stdenv, lib, fetchFromGitHub
, gobject-introspection, makeWrapper, wrapGAppsHook
, gtk3, gst_all_1, python3
, gettext, gnome, help2man, keybinder3, libnotify, librsvg, streamripper, udisks, webkitgtk
, iconTheme ? gnome.adwaita-icon-theme
, deviceDetectionSupport ? true
, documentationSupport ? true
, notificationSupport ? true
, scalableIconSupport ? true
, translationSupport ? true
, bpmCounterSupport ? false
, ipythonSupport ? false
, lastfmSupport ? false
, lyricsManiaSupport ? false
, lyricsWikiSupport ? false
, multimediaKeySupport ? false
, musicBrainzSupport ? false
, podcastSupport ? false
, streamripperSupport ? false
, wikipediaSupport ? false
Comment on lines 11 to 20
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 enable them by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe? The options I defaulted to false are all plugins that are disabled by default and can be enabled in the gui so the only real consequence is closure size. If they're all going to be true by default perhaps they should be renamed disableX ? false per this discussion.

Copy link
Member

Choose a reason for hiding this comment

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

@ryneeverett Adding too many options is not very productive as we are not build testing all of the combinations. A power user can always do something like exaile.override { webkitgtk = null; }.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@veprbl I guess I don't really accept the premise that it's a package manager's job to test whether the optional dependencies -- as declared by upstream -- are truly optional. Also isn't your argument equally valid against any number of options?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, I ran some builds to compare closure size:

  • All options false -> 583mb
  • Current default options -> 832mb
  • All options true -> 1.5gb

Nearly doubling the closure size in order to install the dependencies of all the plugins (which are disabled by default) seems crazy. Especially when there's no reason to believe upstream is done adding plugins.

Also, particularly for the optional python dependencies, it seems improbable that they have any effect at build time.

Copy link
Member

Choose a reason for hiding this comment

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

I guess I don't really accept the premise that it's a package manager's job to test whether the optional dependencies -- as declared by upstream -- are truly optional.

When you write an API with a bunch of knobs you usually want those to be tested. In the current setup there is not even a test that exile's build system accepts the libraries that we may pass to it. It will be up to a user to discover if something is broken.

Also isn't your argument equally valid against any number of options?

Not sure what you mean by that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the current setup there is not even a test that exile's build system accepts the libraries that we may pass to it.

Is there a simple way to test packages with different combinations of inputs? I'm not familiar, though a hack would be to add another top level package exaileWithPlugins in which all the flags are true.

Also isn't your argument equally valid against any number of options?

Not sure what you mean by that.

I'm working from the assumption that options are not generally tested and if that's the case then it's not clear that many options are worse in principle than fewer options.

Copy link
Member

Choose a reason for hiding this comment

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

In the current setup there is not even a test that exile's build system accepts the libraries that we may pass to it.

Is there a simple way to test packages with different combinations of inputs? I'm not familiar, though a hack would be to add another top level package exaileWithPlugins in which all the flags are true.

Such package is often called exaileFull (e.g. gitFull).

Also isn't your argument equally valid against any number of options?

Not sure what you mean by that.

I'm working from the assumption that options are not generally tested and if that's the case then it's not clear that many options are worse in principle than fewer options.

More options means more combinations to test/debug, or, if you like, combinations left untested.

, fetchpatch
}:

stdenv.mkDerivation rec {
pname = "exaile";
version = "4.1.1";

src = fetchFromGitHub {
owner = "exaile";
repo = pname;
rev = version;
sha256 = "0s29lm0i4slgaw5l5s9a2zx0b83xac43rnil5cvyi210dxm5s048";
};
patches = [
(fetchpatch {
url = "https://github.com/exaile/exaile/pull/751.patch";
sha256 = "sha256-jCJh85Z3HQcyS4ntQP5HwYJgM7WNHcWzjf0BdNJitsM=";
})
];

nativeBuildInputs = [
gobject-introspection
makeWrapper
wrapGAppsHook
] ++ lib.optionals documentationSupport [
help2man
python3.pkgs.sphinx
python3.pkgs.sphinx_rtd_theme
] ++ lib.optional translationSupport gettext;

buildInputs = [
iconTheme
gtk3
] ++ (with gst_all_1; [
gstreamer
gst-plugins-base
gst-plugins-good
]) ++ (with python3.pkgs; [
bsddb3
dbus-python
mutagen
pygobject3
pycairo
gst-python
]) ++ lib.optional deviceDetectionSupport udisks
++ lib.optional notificationSupport libnotify
++ lib.optional scalableIconSupport librsvg
++ lib.optional bpmCounterSupport gst_all_1.gst-plugins-bad
++ lib.optional ipythonSupport python3.pkgs.ipython
++ lib.optional lastfmSupport python3.pkgs.pylast
++ lib.optional (lyricsManiaSupport || lyricsWikiSupport) python3.pkgs.lxml
++ lib.optional lyricsWikiSupport python3.pkgs.beautifulsoup4
++ lib.optional multimediaKeySupport keybinder3
++ lib.optional musicBrainzSupport python3.pkgs.musicbrainzngs
++ lib.optional podcastSupport python3.pkgs.feedparser
++ lib.optional wikipediaSupport webkitgtk;

checkInputs = with python3.pkgs; [
mox3
pytest
];

makeFlags = [
"PREFIX=${placeholder "out"}"
];

doCheck = true;
preCheck = ''
substituteInPlace Makefile --replace "PYTHONPATH=$(shell pwd)" "PYTHONPATH=$PYTHONPATH:$(shell pwd)"
export PYTEST="py.test"
export XDG_CACHE_HOME=$(mktemp -d)
'';

postInstall = ''
wrapProgram $out/bin/exaile \
--set PYTHONPATH $PYTHONPATH \
${lib.optionalString streamripperSupport "--prefix PATH : ${lib.makeBinPath [ streamripper ]}"}
'';

meta = with lib; {
homepage = "https://www.exaile.org/";
description = "A music player with a simple interface and powerful music management capabilities";
license = licenses.gpl2Only;
maintainers = with maintainers; [ ryneeverett ];
platforms = platforms.all;
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24257,6 +24257,8 @@ with pkgs;

evilpixie = libsForQt5.callPackage ../applications/graphics/evilpixie { };

exaile = callPackage ../applications/audio/exaile { };

exercism = callPackage ../applications/misc/exercism { };

expenses = callPackage ../applications/misc/expenses { };
Expand Down