summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladislav Suratov2017-03-20 20:33:27 +0300
committerVladislav Suratov2017-03-20 20:33:27 +0300
commit1123a7c345e87ce36c318c95dcd0e9d36ceb7fb2 (patch)
treed4542eb11210096d62491763b4e866ef4174b4d5
downloadaur-1123a7c345e87ce36c318c95dcd0e9d36ceb7fb2.tar.gz
Initial release of dark version of qBittorrent. Based on last master
-rw-r--r--.SRCINFO26
-rw-r--r--0001-Revert-Use-new-libtorrent-1.1.2-utility-function-to-.patch76
-rw-r--r--PKGBUILD49
3 files changed, 151 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..c9641a3f883
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+pkgbase = qbittorrent-dark-git
+ pkgdesc = A dark version of bittorrent client powered by C++, Qt5 and the good libtorrent library (development version)
+ pkgver = 3.3.11.r730.g3e50ca15f
+ pkgrel = 1
+ url = http://www.qbittorrent.org/
+ arch = i686
+ arch = x86_64
+ license = custom
+ license = GPL
+ makedepends = boost
+ makedepends = git
+ makedepends = qt5-tools
+ depends = libtorrent-rasterbar
+ depends = qt5-base
+ optdepends = python: needed for torrent search tab
+ provides = qbittorrent
+ conflicts = qbittorrent
+ conflicts = qbittorrent-git
+ conflicts = qbittorrent-stable-git
+ source = qbittorrent-dark::git+https://github.com/suratovvlad/qBittorrent.git
+ source = 0001-Revert-Use-new-libtorrent-1.1.2-utility-function-to-.patch
+ sha256sums = SKIP
+ sha256sums = d020ac4ce37a871cb92e3f203cc5ccd6de24c1f0a369f7aea67a4be578c48b64
+
+pkgname = qbittorrent-dark-git
+
diff --git a/0001-Revert-Use-new-libtorrent-1.1.2-utility-function-to-.patch b/0001-Revert-Use-new-libtorrent-1.1.2-utility-function-to-.patch
new file mode 100644
index 00000000000..46365243822
--- /dev/null
+++ b/0001-Revert-Use-new-libtorrent-1.1.2-utility-function-to-.patch
@@ -0,0 +1,76 @@
+From 622a34887a1221dd194adb739710fa4ae42dcb12 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93@gmail.com>
+Date: Sun, 12 Mar 2017 00:51:33 -0500
+Subject: [PATCH] Revert "Use new libtorrent 1.1.2+ utility function to
+ generate client ID instead."
+
+This reverts commit afe930cbeec5a1f8a397baf322eda9a8c4b58c80.
+---
+ src/base/bittorrent/session.cpp | 37 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 37 insertions(+)
+
+diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp
+index 2497ef2a6..bfc719768 100644
+--- a/src/base/bittorrent/session.cpp
++++ b/src/base/bittorrent/session.cpp
+@@ -44,6 +44,9 @@
+ #include <QTimer>
+
+ #include <cstdlib>
++#if LIBTORRENT_VERSION_NUM >= 10100 && LIBTORRENT_VERSION_NUM < 10102
++#include <sstream>
++#endif
+ #include <queue>
+ #include <vector>
+
+@@ -194,6 +197,36 @@ namespace
+
+ template <typename T>
+ LowerLimited<T> lowerLimited(T limit, T ret) { return LowerLimited<T>(limit, ret); }
++
++#if LIBTORRENT_VERSION_NUM >= 10100 && LIBTORRENT_VERSION_NUM < 10102
++ std::string makeFingerprint(const char* peerId, int major, int minor, int revision, int tag)
++ {
++ Q_ASSERT(peerId);
++ Q_ASSERT(major >= 0);
++ Q_ASSERT(minor >= 0);
++ Q_ASSERT(revision >= 0);
++ Q_ASSERT(tag >= 0);
++ Q_ASSERT(std::strlen(peerId) == 2);
++
++ auto versionToChar = [](int v) -> char
++ {
++ if (v >= 0 && v < 10) return static_cast<char>('0' + v);
++ if (v >= 10) return static_cast<char>('A' + (v - 10));
++ Q_ASSERT(false);
++ return '0';
++ };
++
++ std::ostringstream buf;
++ buf << '-'
++ << peerId
++ << versionToChar(major)
++ << versionToChar(minor)
++ << versionToChar(revision)
++ << versionToChar(tag)
++ << '-';
++ return buf.str();
++ }
++#endif
+ }
+
+ // Session
+@@ -340,7 +373,11 @@ Session::Session(QObject *parent)
+ dispatchAlerts(alertPtr.release());
+ });
+ #else
++#if LIBTORRENT_VERSION_NUM < 10102
++ std::string peerId = makeFingerprint(PEER_ID, QBT_VERSION_MAJOR, QBT_VERSION_MINOR, QBT_VERSION_BUGFIX, QBT_VERSION_BUILD);
++#else
+ std::string peerId = libt::generate_fingerprint(PEER_ID, QBT_VERSION_MAJOR, QBT_VERSION_MINOR, QBT_VERSION_BUGFIX, QBT_VERSION_BUILD);
++#endif
+ libt::settings_pack pack;
+ pack.set_int(libt::settings_pack::alert_mask, alertMask);
+ pack.set_str(libt::settings_pack::peer_fingerprint, peerId);
+--
+2.12.0
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..8422ec909a3
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,49 @@
+# Maintainer: degreeme <suratovvlad@gmail.com>
+
+pkgname=qbittorrent-dark-git
+pkgver=3.3.11.r730.g3e50ca15f
+pkgrel=1
+pkgdesc="A dark version of bittorrent client powered by C++, Qt5 and the good libtorrent library (development version)"
+arch=('i686' 'x86_64')
+url="http://www.qbittorrent.org/"
+license=('custom' 'GPL')
+depends=('libtorrent-rasterbar' 'qt5-base')
+makedepends=('boost' 'git' 'qt5-tools')
+optdepends=('python: needed for torrent search tab')
+conflicts=('qbittorrent' 'qbittorrent-git' 'qbittorrent-stable-git')
+provides=('qbittorrent')
+source=("${pkgname%-*}::git+https://github.com/suratovvlad/qBittorrent.git"
+ "0001-Revert-Use-new-libtorrent-1.1.2-utility-function-to-.patch")
+sha256sums=('SKIP'
+ 'd020ac4ce37a871cb92e3f203cc5ccd6de24c1f0a369f7aea67a4be578c48b64')
+
+pkgver() {
+ cd ${pkgname%-*}
+
+ _tag=$(git tag -l --sort -v:refname | sed -n '1,1{s/release-//p}')
+ _rev=$(git rev-list --count release-${_tag}..HEAD)
+ _hash=$(git rev-parse --short HEAD)
+ printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash"
+}
+
+prepare() {
+ cd ${pkgname%-*}
+
+ # Remove this once libtorrent-rasterbar 1.1.2 is released and packaged
+ # See: https://github.com/qbittorrent/qBittorrent/issues/5888
+ patch -p1 < ../0001-Revert-Use-new-libtorrent-1.1.2-utility-function-to-.patch
+}
+
+build() {
+ cd ${pkgname%-*}
+
+ ./configure --prefix=/usr
+ make
+}
+
+package() {
+ cd ${pkgname%-*}
+
+ make INSTALL_ROOT="$pkgdir/" install
+ install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
+}