summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libre/minitube/PKGBUILD35
-rw-r--r--libre/minitube/remove_unfree_recommendations.patch204
2 files changed, 239 insertions, 0 deletions
diff --git a/libre/minitube/PKGBUILD b/libre/minitube/PKGBUILD
new file mode 100644
index 000000000..563c20968
--- /dev/null
+++ b/libre/minitube/PKGBUILD
@@ -0,0 +1,35 @@
+# $Id$
+# Maintainer: fauno <fauno@parabola.nu>
+# Maintainer (Arch): speps <speps at aur dot archlinux dot org>
+# Contributor (Arch): Andrea Scarpino <andrea@archlinux.org>
+
+pkgname=minitube
+pkgver=2.8
+pkgrel=2.parabola1
+pkgdesc="A native YouTube client in Qt. Watch YouTube videos without Flash Player and nonfree recommendations"
+arch=('i686' 'x86_64')
+url='http://flavio.tordini.org/minitube'
+license=('GPL3')
+depends=('phonon-qt5' 'qt5-declarative' 'hicolor-icon-theme')
+makedepends=('qt5-tools')
+source=(https://repo.parabola.nu/other/${pkgname}/${pkgname}-${pkgver}-libre${_srcrel}.tar.gz)
+sha512sums=('a9b54f2120c9404a492380bffcffa210a92eebfe7702df6124a0e8ebec1a9031b96e3daa601f0e076b1748cbe0e094e8347e915c564369e6a4cfd4441495a9d3')
+mksource=($pkgname-$pkgver.tar.gz::"https://github.com/flaviotordini/minitube/archive/$pkgver.tar.gz"
+ remove_unfree_recommendations.patch)
+mksha256sums=('c8e7c39d5125027d076440830c6cc33d2782e0d65047d639dfa55e839e64d88c'
+ '6486ebc95349f906b1cbbf9104b03909875c68c0db199748562b77ac39bbb50f')
+
+mksource() {
+ cd $pkgname-$pkgver
+ patch -p1 -i ../remove_unfree_recommendations.patch
+}
+
+build() {
+ cd $pkgname-$pkgver
+ qmake
+}
+
+package() {
+ cd $pkgname-$pkgver
+ make install INSTALL_ROOT="$pkgdir/"
+}
diff --git a/libre/minitube/remove_unfree_recommendations.patch b/libre/minitube/remove_unfree_recommendations.patch
new file mode 100644
index 000000000..98f3b06a8
--- /dev/null
+++ b/libre/minitube/remove_unfree_recommendations.patch
@@ -0,0 +1,204 @@
+diff -aurN minitube-2.8.orig/minitube.pro minitube-2.8/minitube.pro
+--- minitube-2.8.orig/minitube.pro 2017-07-24 10:05:55.000000000 -0300
++++ minitube-2.8/minitube.pro 2017-09-04 12:38:11.228677768 -0300
+@@ -103,7 +103,6 @@
+ src/exlineedit.h \
+ src/channellistview.h \
+ src/httputils.h \
+- src/appwidget.h \
+ src/clickablelabel.h
+ SOURCES += src/main.cpp \
+ src/searchlineedit.cpp \
+@@ -174,7 +173,6 @@
+ src/exlineedit.cpp \
+ src/channellistview.cpp \
+ src/httputils.cpp \
+- src/appwidget.cpp \
+ src/clickablelabel.cpp
+ RESOURCES += resources.qrc
+ DESTDIR = build/target/
+diff -aurN minitube-2.8.orig/src/aboutview.cpp minitube-2.8/src/aboutview.cpp
+--- minitube-2.8.orig/src/aboutview.cpp 2017-07-24 10:05:55.000000000 -0300
++++ minitube-2.8/src/aboutview.cpp 2017-09-04 12:37:56.485294782 -0300
+@@ -32,7 +32,6 @@
+ #endif
+ #include "fontutils.h"
+ #include "iconutils.h"
+-#include "appwidget.h"
+ #include "clickablelabel.h"
+ #include "mainwindow.h"
+
+@@ -116,8 +115,6 @@
+ buttonLayout->addWidget(closeButton);
+
+ layout->addLayout(buttonLayout);
+-
+- verticalLayout->addWidget(new AppsWidget());
+ }
+
+ void AboutView::appear() {
+diff -aurN minitube-2.8.orig/src/appwidget.cpp minitube-2.8/src/appwidget.cpp
+--- minitube-2.8.orig/src/appwidget.cpp 2017-07-24 10:05:55.000000000 -0300
++++ minitube-2.8/src/appwidget.cpp 1969-12-31 21:00:00.000000000 -0300
+@@ -1,111 +0,0 @@
+-#include "appwidget.h"
+-#include "constants.h"
+-#include "http.h"
+-#ifdef APP_EXTRA
+-#include "updatedialog.h"
+-#endif
+-
+-AppsWidget::AppsWidget(QWidget *parent) : QWidget(parent) {
+- const int padding = 30;
+-
+- QBoxLayout *layout = new QHBoxLayout(this);
+- layout->setMargin(padding);
+- layout->setSpacing(padding*2);
+- layout->setAlignment(Qt::AlignCenter);
+-
+-#ifdef APP_MAC
+- const QString ext = "dmg";
+-#elif defined APP_WIN
+- const QString ext = "exe";
+-#else
+- const QString ext = "deb";
+-#endif
+-
+- setupApp("Finetune", "finetune." + ext);
+- setupApp("Musictube", "musictube." + ext);
+- setupApp("Musique", "musique." + ext);
+-}
+-
+-void AppsWidget::setupApp(const QString &name, const QString &code) {
+- AppWidget *w = new AppWidget(name, code);
+- layout()->addWidget(w);
+-}
+-
+-void AppsWidget::paintEvent(QPaintEvent *e) {
+- Q_UNUSED(e);
+- QStyleOption o;
+- o.initFrom(this);
+- QPainter p(this);
+- style()->drawPrimitive(QStyle::PE_Widget, &o, &p, this);
+-}
+-
+-AppWidget::AppWidget(const QString &name, const QString &code, QWidget *parent) : QWidget(parent), icon(0), name(name), downloadButton(0) {
+- const QString unixName = code.left(code.lastIndexOf('.'));
+- const QString baseUrl = QLatin1String("http://") + Constants::ORG_DOMAIN;
+- const QString filesUrl = baseUrl + QLatin1String("/files/");
+- url = filesUrl + unixName + QLatin1String("/") + code;
+- webPage = baseUrl + QLatin1String("/") + unixName;
+-
+- QBoxLayout *layout = new QVBoxLayout(this);
+- layout->setMargin(0);
+- layout->setAlignment(Qt::AlignHCenter);
+-
+- icon = new QLabel();
+- layout->addWidget(icon);
+- const QString iconUrl = filesUrl + QLatin1String("products/") + unixName + QLatin1String(".png");
+- QObject *reply = Http::instance().get(iconUrl);
+- connect(reply, SIGNAL(data(QByteArray)), SLOT(iconDownloaded(QByteArray)));
+-
+- QLabel *appTitle = new QLabel(name);
+- appTitle->setAlignment(Qt::AlignHCenter);
+- layout->addWidget(appTitle);
+-
+-#ifdef APP_EXTRA
+-#if !defined(APP_UBUNTU) && !defined(APP_MAC_STORE)
+- downloadButton = new QPushButton(tr("Download"));
+- downloadButton->setAttribute(Qt::WA_MacSmallSize);
+- downloadButton->setCursor(Qt::ArrowCursor);
+- QSizePolicy sp = downloadButton->sizePolicy();
+- sp.setHorizontalPolicy(QSizePolicy::Fixed);
+- sp.setRetainSizeWhenHidden(true);
+- downloadButton->setSizePolicy(sp);
+- connect(downloadButton, SIGNAL(clicked(bool)), SLOT(downloadApp()));
+- layout->addWidget(downloadButton, Qt::AlignHCenter);
+- layout->setAlignment(downloadButton, Qt::AlignHCenter);
+- downloadButton->hide();
+-#endif
+-#endif
+-
+- setCursor(Qt::PointingHandCursor);
+-}
+-
+-void AppWidget::enterEvent(QEvent *e) {
+- Q_UNUSED(e);
+- if (downloadButton) downloadButton->show();
+-}
+-
+-void AppWidget::leaveEvent(QEvent *e) {
+- Q_UNUSED(e);
+- if (downloadButton) downloadButton->hide();
+-}
+-
+-void AppWidget::mouseReleaseEvent(QMouseEvent *e) {
+- if (e->button() == Qt::LeftButton) {
+- QDesktopServices::openUrl(webPage);
+- }
+-}
+-
+-void AppWidget::iconDownloaded(const QByteArray &bytes) {
+- QPixmap pixmap;
+- pixmap.loadFromData(bytes, "PNG");
+- icon->setPixmap(pixmap);
+-}
+-
+-void AppWidget::downloadApp() {
+-#ifdef APP_EXTRA
+- if (!icon) return;
+- UpdateDialog *dialog = new UpdateDialog(icon->pixmap(), name, QString(), url, this);
+- dialog->downloadUpdate();
+- dialog->show();
+-#endif
+-}
+diff -aurN minitube-2.8.orig/src/appwidget.h minitube-2.8/src/appwidget.h
+--- minitube-2.8.orig/src/appwidget.h 2017-07-24 10:05:55.000000000 -0300
++++ minitube-2.8/src/appwidget.h 1969-12-31 21:00:00.000000000 -0300
+@@ -1,46 +0,0 @@
+-#ifndef APPWIDGET_H
+-#define APPWIDGET_H
+-
+-#include <QtWidgets>
+-
+-
+-class AppWidget : public QWidget {
+-
+- Q_OBJECT
+-
+-public:
+- AppWidget(const QString &name, const QString &code, QWidget *parent = 0);
+- QLabel *icon;
+-
+-protected:
+- void enterEvent(QEvent *e);
+- void leaveEvent(QEvent *e);
+- void mouseReleaseEvent(QMouseEvent *e);
+-
+-private slots:
+- void iconDownloaded(const QByteArray &bytes);
+- void downloadApp();
+-
+-private:
+- QPushButton *downloadButton;
+- QString name;
+- QString url;
+- QString webPage;
+-};
+-
+-class AppsWidget : public QWidget {
+-
+- Q_OBJECT
+-
+-public:
+- AppsWidget(QWidget *parent = 0);
+-
+-protected:
+- void paintEvent(QPaintEvent *e);
+-
+-private:
+- void setupApp(const QString &name, const QString &code);
+-
+-};
+-
+-#endif // APPWIDGET_H