Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e7bf6a6

Browse files
committed
nicotine-plus: 1.4.1 -> unstable-2020-05-24
Includes port to Python 3 and GTK+ 3/PyGObject; see nicotine-plus/nicotine-plus#106 for details. This unstable version identifies itself as 1.4.3, and is planned to be released as 2.0.0 after it has had more fixes and testing through the official upstream PPA. The codebase is old and flaky to begin with, and there have been several unrelated bug fixes in the years since the last stable release, so I think it's worth updating to be able to use non-obsolescent versions of the core dependencies, and have nixos-unstable users help shake out any remaining issues with the port. I verified that searching and downloading seem to work fine. Drop the rename of the executable to `nicotine-plus`, as the test depends on the executable name and there doesn't seem to be any strong reason to diverge from upstream here (the original Nicotine is long dead). This is technically a breaking change, so it might be best to include a symlink at `$out/bin/nicotine-plus` temporarily.
1 parent db6d565 commit e7bf6a6

File tree

1 file changed

+92
-20
lines changed
  • pkgs/applications/networking/soulseek/nicotine-plus

1 file changed

+92
-20
lines changed
Lines changed: 92 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,116 @@
1-
{ stdenv, fetchFromGitHub, python27Packages, geoip }:
1+
{ lib
2+
, stdenv
3+
, fetchFromGitHub
4+
, python3
5+
, wrapGAppsHook
6+
, gobject-introspection
7+
, gtk3
8+
, libnotify
9+
, geoip
210

3-
with stdenv.lib;
11+
# Test dependencies
12+
, xvfb_run
13+
, gnome3
14+
}:
415

5-
python27Packages.buildPythonApplication {
16+
python3.pkgs.buildPythonApplication {
617
pname = "nicotine-plus";
7-
version = "1.4.1";
18+
version = "unstable-2020-05-24";
819

920
src = fetchFromGitHub {
1021
owner = "Nicotine-Plus";
1122
repo = "nicotine-plus";
12-
rev = "4e057d64184885c63488d4213ade3233bd33e67b";
13-
sha256 = "11j2qm67sszfqq730czsr2zmpgkghsb50556ax1vlpm7rw3gm33c";
23+
rev = "0f9e4e1c2391196d4070df5851ff48601aceaf7f";
24+
hash = "sha256-kSDqoxmX9beqL98tMQylbhCZVMmQy6/oVOyW1xnxFLY=";
1425
};
1526

16-
propagatedBuildInputs = with python27Packages; [
17-
pygtk
27+
nativeBuildInputs = [ wrapGAppsHook ];
28+
29+
# Avoid double-wrapping; see preFixup
30+
# and https://nixos.org/nixpkgs/manual/#ssec-gnome-common-issues.
31+
dontWrapGApps = true;
32+
33+
buildInputs = [
34+
gobject-introspection
35+
gtk3
36+
libnotify
37+
];
38+
39+
propagatedBuildInputs = with python3.pkgs; [
40+
pygobject3
1841
miniupnpc
1942
mutagen
20-
notify
2143
(GeoIP.override { inherit geoip; })
2244
];
2345

24-
# Insert real docs directory.
25-
# os.getcwd() is not needed
46+
checkInputs = [ python3.pkgs.pytest ] ++ lib.optionals (!stdenv.isDarwin) [
47+
# The gtk3 package doesn't enable X11 on Darwin, so we can't
48+
# use xvfb-run.
49+
xvfb_run
50+
python3.pkgs.robotframework
51+
# Avoid warnings about missing icons.
52+
gnome3.defaultIconTheme
53+
];
54+
55+
# Run setup hooks for installCheckPhase;
56+
# see https://github.com/NixOS/nixpkgs/issues/56943.
57+
strictDeps = false;
58+
2659
postPatch = ''
27-
substituteInPlace ./pynicotine/gtkgui/frame.py \
28-
--replace "paths.append(os.getcwd())" "paths.append('"$out"/doc')"
60+
# Remove non-free files.
61+
sh debian/nicotine-rm-nonfree
62+
63+
# Find installed files in the appropriate place.
64+
# TODO: Move to importlib_resources upstream so this can be removed.
65+
find pynicotine -name '*.py' \
66+
-exec sed -i "s|sys\.prefix|'$out'|g" {} +
67+
'';
68+
69+
preBuild = ''
70+
# Regenerate languages/*/LC_MESSAGES/nicotine.mo files from source.
71+
(cd languages; python msgfmtall.py)
2972
'';
3073

31-
postFixup = ''
32-
mkdir -p $out/doc/
33-
mv ./doc/NicotinePlusGuide $out/doc/
34-
mv $out/bin/nicotine $out/bin/nicotine-plus
74+
postInstall = ''
75+
substituteInPlace $out/share/applications/nicotine.desktop \
76+
--replace "Exec=nicotine" "Exec=$out/bin/nicotine"
77+
'';
78+
79+
preFixup = ''
80+
makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
81+
'';
82+
83+
installCheckPhase = ''
84+
runHook preInstallCheck
85+
86+
export PATH="$out/bin:$PATH"
87+
export HOME="$(mktemp -d)"
88+
89+
# These tests should be kept in sync with debian/tests/control to
90+
# the extent possible.
91+
92+
nicotine --version | grep -q 'Nicotine+'
93+
94+
pytest test/unit
95+
96+
'' + lib.optionalString (!stdenv.isDarwin) ''
97+
xvfb-run -s '-screen 0 1024x768x24' \
98+
robot test/integration/nicotine.robot
99+
100+
'' + ''
101+
runHook postInstallCheck
35102
'';
36103

37104
meta = {
38105
description = "A graphical client for the SoulSeek peer-to-peer system";
39106
homepage = "https://www.nicotine-plus.org";
40-
license = licenses.gpl3;
41-
maintainers = with maintainers; [ klntsky ];
42-
platforms = platforms.unix;
107+
license = [
108+
# Main license
109+
lib.licenses.gpl3Plus
110+
# Per sounds/default/license.txt
111+
lib.licenses.cc0
112+
];
113+
maintainers = with lib.maintainers; [ klntsky emily ];
114+
platforms = lib.platforms.unix;
43115
};
44116
}

0 commit comments

Comments
 (0)