2022-02-14 13:05:34 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
2023-11-27 06:35:56 +01:00
|
|
|
, fetchPypi
|
2022-02-14 13:05:34 +01:00
|
|
|
, python3
|
|
|
|
, makeWrapper
|
|
|
|
, libtorrent-rasterbar-1_2_x
|
|
|
|
, qt5
|
2021-11-24 17:40:40 +01:00
|
|
|
}:
|
2011-09-02 13:11:48 +02:00
|
|
|
|
2021-11-24 17:40:40 +01:00
|
|
|
let
|
2022-12-01 23:46:16 +01:00
|
|
|
libtorrent = (python3.pkgs.toPythonModule (libtorrent-rasterbar-1_2_x)).python;
|
2021-11-24 17:40:40 +01:00
|
|
|
in
|
2015-07-12 00:09:46 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "tribler";
|
2023-11-27 06:35:56 +01:00
|
|
|
version = "7.13.0";
|
2011-05-03 19:12:31 +02:00
|
|
|
|
2017-09-10 12:06:01 +02:00
|
|
|
src = fetchurl {
|
2023-11-27 06:35:56 +01:00
|
|
|
url = "https://github.com/Tribler/tribler/releases/download/v${version}/Tribler-${version}.tar.xz";
|
|
|
|
hash = "sha256-j9+Kq6dOqiJCTY3vuRWGnciuwACU7L0pl73l6nkDLN4=";
|
2011-05-03 19:12:31 +02:00
|
|
|
};
|
|
|
|
|
2019-11-25 20:32:28 +01:00
|
|
|
nativeBuildInputs = [
|
2021-11-24 17:40:40 +01:00
|
|
|
python3.pkgs.wrapPython
|
2015-07-12 00:09:46 +02:00
|
|
|
makeWrapper
|
2023-11-27 06:35:56 +01:00
|
|
|
# we had a "copy" of this in tribler's makeWrapper
|
|
|
|
# but it went out of date and broke, so please just use it directly
|
|
|
|
qt5.wrapQtAppsHook
|
2019-11-25 20:32:28 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-11-24 17:40:40 +01:00
|
|
|
python3.pkgs.python
|
2015-07-12 00:09:46 +02:00
|
|
|
];
|
|
|
|
|
2021-11-24 17:40:40 +01:00
|
|
|
pythonPath = [
|
|
|
|
libtorrent
|
|
|
|
] ++ (with python3.pkgs; [
|
2023-11-27 06:35:56 +01:00
|
|
|
# requirements-core.txt
|
2022-02-14 13:05:34 +01:00
|
|
|
aiohttp
|
|
|
|
aiohttp-apispec
|
2023-11-27 06:35:56 +01:00
|
|
|
anyio
|
2021-01-03 09:22:27 +01:00
|
|
|
chardet
|
|
|
|
configobj
|
2022-02-14 13:05:34 +01:00
|
|
|
cryptography
|
2021-01-03 09:22:27 +01:00
|
|
|
decorator
|
2022-02-14 13:05:34 +01:00
|
|
|
faker
|
|
|
|
libnacl
|
|
|
|
lz4
|
2023-11-27 06:35:56 +01:00
|
|
|
marshmallow
|
2022-02-14 13:05:34 +01:00
|
|
|
netifaces
|
2021-01-03 09:22:27 +01:00
|
|
|
networkx
|
|
|
|
pony
|
2022-02-14 13:05:34 +01:00
|
|
|
psutil
|
|
|
|
pyasn1
|
2024-02-12 14:28:01 +01:00
|
|
|
pydantic_1
|
2023-11-27 06:35:56 +01:00
|
|
|
pyopenssl
|
2022-02-14 13:05:34 +01:00
|
|
|
pyyaml
|
|
|
|
sentry-sdk
|
|
|
|
service-identity
|
2021-11-24 17:40:40 +01:00
|
|
|
yappi
|
2023-11-27 06:35:56 +01:00
|
|
|
yarl
|
|
|
|
bitarray
|
|
|
|
(pyipv8.overrideAttrs (p: rec {
|
|
|
|
version = "2.10.0";
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit (p) pname;
|
|
|
|
inherit version;
|
|
|
|
hash = "sha256-yxiXBxBiPokequm+vjsHIoG9kQnRnbsOx3mYOd8nmiU=";
|
|
|
|
};
|
|
|
|
}))
|
|
|
|
libtorrent
|
|
|
|
file-read-backwards
|
|
|
|
brotli
|
|
|
|
human-readable
|
|
|
|
# requirements.txt
|
|
|
|
pillow
|
|
|
|
pyqt5
|
|
|
|
#pyqt5-sip
|
|
|
|
pyqtgraph
|
|
|
|
pyqtwebengine
|
2021-11-24 17:40:40 +01:00
|
|
|
]);
|
2011-05-03 19:12:31 +02:00
|
|
|
|
2017-03-22 01:01:51 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -pv $out
|
|
|
|
# Nasty hack; call wrapPythonPrograms to set program_PYTHONPATH.
|
|
|
|
wrapPythonPrograms
|
|
|
|
cp -prvd ./* $out/
|
2021-11-24 17:40:40 +01:00
|
|
|
makeWrapper ${python3.pkgs.python}/bin/python $out/bin/tribler \
|
2022-03-14 19:06:00 +01:00
|
|
|
--set _TRIBLERPATH "$out/src" \
|
2021-11-24 17:40:40 +01:00
|
|
|
--set PYTHONPATH $out/src/tribler-core:$out/src/tribler-common:$out/src/tribler-gui:$program_PYTHONPATH \
|
2017-03-22 01:01:51 +01:00
|
|
|
--set NO_AT_BRIDGE 1 \
|
2022-03-14 19:06:00 +01:00
|
|
|
--chdir "$out/src" \
|
2021-11-24 17:40:40 +01:00
|
|
|
--add-flags "-O $out/src/run_tribler.py"
|
2020-03-16 21:37:41 +01:00
|
|
|
|
2021-11-24 17:40:40 +01:00
|
|
|
mkdir -p $out/share/applications $out/share/icons
|
2022-02-17 14:55:32 +01:00
|
|
|
cp $out/build/debian/tribler/usr/share/applications/org.tribler.Tribler.desktop $out/share/applications/
|
2021-11-24 17:40:40 +01:00
|
|
|
cp $out/build/debian/tribler/usr/share/pixmaps/tribler_big.xpm $out/share/icons/tribler.xpm
|
2023-12-16 15:32:02 +01:00
|
|
|
mkdir -p $out/share/copyright/tribler
|
|
|
|
mv $out/LICENSE $out/share/copyright/tribler
|
2017-03-22 01:01:51 +01:00
|
|
|
'';
|
2011-05-03 19:12:31 +02:00
|
|
|
|
2022-02-17 14:55:32 +01:00
|
|
|
shellHook = ''
|
|
|
|
wrapPythonPrograms || true
|
|
|
|
export QT_QPA_PLATFORM_PLUGIN_PATH=$(echo ${qt5.qtbase.bin}/lib/qt-*/plugins/platforms)
|
|
|
|
export PYTHONPATH=./tribler-core:./tribler-common:./tribler-gui:$program_PYTHONPATH
|
|
|
|
export QT_PLUGIN_PATH="${qt5.qtsvg.bin}/${qt5.qtbase.qtPluginPrefix}"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2022-02-14 13:05:34 +01:00
|
|
|
description = "Decentralised P2P filesharing client based on the Bittorrent protocol";
|
2024-03-19 03:14:51 +01:00
|
|
|
mainProgram = "tribler";
|
2020-03-03 20:29:13 +01:00
|
|
|
homepage = "https://www.tribler.org/";
|
2022-02-14 13:05:34 +01:00
|
|
|
license = licenses.lgpl21Plus;
|
2023-11-27 06:35:56 +01:00
|
|
|
maintainers = with maintainers; [ xvapx viric mkg20001 ];
|
2017-03-22 01:01:51 +01:00
|
|
|
platforms = platforms.linux;
|
2011-05-03 19:12:31 +02:00
|
|
|
};
|
|
|
|
}
|