Merge updates from master

This commit is contained in:
Repository mirror & CI
2020-04-18 19:05:08 +00:00
11 changed files with 1436 additions and 0 deletions

View File

@@ -0,0 +1 @@
DIST qhttpengine-1.0.1.tar.gz 107937 BLAKE2B c93711a16c53bea9622f5bfd4eeb480bf8bf4366f1d30d44d8c208b9600e632fd2c3b0129c2494858f6c51fd6d9df7973f02c28adf84c8b63186eec5ea9c3450 SHA512 d9b67db5f752cb494e71e37bed523490c53ce97d01b32925846a019e866776cef9e73f580acfb639fb04465439e8328e756dabd7b505380d3976ec872849fe22

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>vowstar@gmail.com</email>
<name>Huang Rui</name>
</maintainer>
<upstream>
<remote-id type="github">nitroshare/qhttpengine</remote-id>
</upstream>
<longdescription>
QHttpEngine provides a simple set of classes for developing HTTP server
applications in Qt. The design goals of QHttpEngine include:
Reliability - extremely exhaustive test suite ensures that bugs are caught
as soon as they are introduced.
Flexibility - classes are designed for easy integration with existing Qt
code.
Simplicity - everything is intentionally kept as simple as possible.
Usability - documentation is provided for all classes.
All of QHttpEngine's functionality is included in a single monolithic
library.
</longdescription>
</pkgmetadata>

View File

@@ -0,0 +1,51 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit cmake-utils
DESCRIPTION="HTTP server for Qt applications"
HOMEPAGE="https://github.com/nitroshare/qhttpengine"
if [[ ${PV} == "9999" ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/nitroshare/${PN}.git"
else
SRC_URI="https://github.com/nitroshare/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
S="${WORKDIR}/${PN}-${PV}"
fi
LICENSE="MIT"
SLOT="5"
IUSE="doc examples test"
RDEPEND="
dev-qt/qtnetwork:5
"
DEPEND="
doc? ( app-doc/doxygen )
test? ( dev-qt/qttest:5 )
${RDEPEND}
"
BDEPEND="
virtual/pkgconfig
"
src_configure() {
local mycmakeargs=(
-DBUILD_DOC=$(usex doc)
-DBUILD_EXAMPLES=$(usex examples)
-DBUILD_TESTS=$(usex test)
-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
-DLIB_INSTALL_DIR=$(get_libdir)
-DDOC_INSTALL_DIR="share/doc/${PF}"
${CMAKE_CONF}
)
cmake-utils_src_configure
}

View File

@@ -0,0 +1,51 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit cmake-utils
DESCRIPTION="HTTP server for Qt applications"
HOMEPAGE="https://github.com/nitroshare/qhttpengine"
if [[ ${PV} == "9999" ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/nitroshare/${PN}.git"
else
SRC_URI="https://github.com/nitroshare/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
S="${WORKDIR}/${PN}-${PV}"
fi
LICENSE="MIT"
SLOT="5"
IUSE="doc examples test"
RDEPEND="
dev-qt/qtnetwork:5
"
DEPEND="
doc? ( app-doc/doxygen )
test? ( dev-qt/qttest:5 )
${RDEPEND}
"
BDEPEND="
virtual/pkgconfig
"
src_configure() {
local mycmakeargs=(
-DBUILD_DOC=$(usex doc)
-DBUILD_EXAMPLES=$(usex examples)
-DBUILD_TESTS=$(usex test)
-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
-DLIB_INSTALL_DIR=$(get_libdir)
-DDOC_INSTALL_DIR="share/doc/${PF}"
${CMAKE_CONF}
)
cmake-utils_src_configure
}

View File

@@ -0,0 +1 @@
DIST kikoplay-0.6.0.tar.gz 7497254 BLAKE2B a23106151782477194d15712e9458171a0bc1dd53f8b6c8dbed12663be1c2c76204674c23eba61f2b8828be7acbd10449f51c766ab57be86cf21844591430b18 SHA512 9d8801f7c9b091f097d1edf9496a389718e81399a8d380d7763c1d12eafd1d4ce444e4df22a0e4a6c8eebbc7f1176e58a3cbac6bea60e87ccd44a5890927bf21

View File

@@ -0,0 +1,16 @@
diff --git a/kikoplay.desktop b/kikoplay.desktop
new file mode 100644
index 0000000..6171559
--- /dev/null
+++ b/kikoplay.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Type=Application
+Name=KikoPlay
+Comment=KikoPlay is a full-featured danmu player!
+TryExec=KikoPlay
+Exec=KikoPlay
+Icon=/usr/share/pixmaps/kikoplay.png
+Terminal=false
+StartupNotify=true
+Categories=Qt;AudioVideo;Video;

View File

@@ -0,0 +1,97 @@
diff --git a/Download/Script/scriptmanager.cpp b/Download/Script/scriptmanager.cpp
index f99c261..8ede8e3 100644
--- a/Download/Script/scriptmanager.cpp
+++ b/Download/Script/scriptmanager.cpp
@@ -163,7 +163,11 @@ QString ScriptManager::search(QString sid, const QString &keyword, int page, int
{
if(s.id==sid)
{
+#ifndef CONFIG_HOME_DATA
scriptPath=QCoreApplication::applicationDirPath()+"/script/"+s.fileName;
+#else
+ scriptPath=QDir::homePath()+"/.config/kikoplay/script/"+s.fileName;
+#endif
break;
}
}
@@ -270,7 +274,11 @@ void ScriptManager::removeScript(const QModelIndex &index)
else
normalScriptId="";
}
+#ifndef CONFIG_HOME_DATA
QFileInfo fi(QCoreApplication::applicationDirPath()+"/script/"+script.fileName);
+#else
+ QFileInfo fi(QDir::homePath()+"/.config/kikoplay/script/"+script.fileName);
+#endif
if(fi.exists()) fi.dir().remove(fi.fileName());
beginRemoveRows(QModelIndex(),index.row(),index.row());
scriptList.removeAt(index.row());
@@ -319,7 +327,11 @@ QVariant ScriptManager::headerData(int section, Qt::Orientation orientation, int
void ScriptWorker::refreshScriptList()
{
+#ifndef CONFIG_HOME_DATA
QString scriptPath(QCoreApplication::applicationDirPath()+"/script/");
+#else
+ QString scriptPath(QDir::homePath()+"/.config/kikoplay/script/");
+#endif
QDir folder(scriptPath);
QList<ScriptInfo> sList;
for (QFileInfo fileInfo : folder.entryInfoList())
diff --git a/Download/aria2jsonrpc.cpp b/Download/aria2jsonrpc.cpp
index 7999128..43bc63d 100644
--- a/Download/aria2jsonrpc.cpp
+++ b/Download/aria2jsonrpc.cpp
@@ -1,4 +1,5 @@
#include "aria2jsonrpc.h"
+#include <QFileInfo>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
@@ -19,7 +20,13 @@ Aria2JsonRPC::Aria2JsonRPC(QObject *parent) : QObject(parent)
#ifdef Q_OS_WIN
process->start(QCoreApplication::applicationDirPath()+"\\aria2c.exe", args);
#else
- process->start(QCoreApplication::applicationDirPath()+"/aria2c", args);
+ QFileInfo check_file(QCoreApplication::applicationDirPath()+"/aria2c");
+ /* check if file exists and if yes: Is it really a file and no directory? */
+ if (check_file.exists() && check_file.isFile()) {
+ process->start(QCoreApplication::applicationDirPath()+"/aria2c", args);
+ } else {
+ process->start("aria2c", args);
+ }
#endif
process->waitForStarted(-1);
diff --git a/LANServer/httpserver.cpp b/LANServer/httpserver.cpp
index 5b3fa08..d66a6ee 100644
--- a/LANServer/httpserver.cpp
+++ b/LANServer/httpserver.cpp
@@ -127,7 +127,11 @@ namespace
HttpServer::HttpServer(QObject *parent) : QObject(parent)
{
MediaFileHandler *handler=new MediaFileHandler(&mediaHash,this);
+#ifndef CONFIG_HOME_DATA
handler->setDocumentRoot(QCoreApplication::applicationDirPath()+"/web");
+#else
+ handler->setDocumentRoot(QDir::homePath()+"/.config/kikoplay/web");
+#endif
handler->addRedirect(QRegExp("^$"), "/index.html");
QHttpEngine::QObjectHandler *apiHandler=new QHttpEngine::QObjectHandler(this);
diff --git a/globalobjects.cpp b/globalobjects.cpp
index 07bf674..32b82a2 100644
--- a/globalobjects.cpp
+++ b/globalobjects.cpp
@@ -42,7 +42,11 @@ namespace {
}
void GlobalObjects::init()
{
+#ifndef CONFIG_HOME_DATA
dataPath=QCoreApplication::applicationDirPath()+"/data/";
+#else
+ dataPath=QDir::homePath()+"/.config/kikoplay/data/";
+#endif
QDir dir;
if(!dir.exists(dataPath))
{

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,78 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
GIT_PN="KikoPlay"
inherit qmake-utils xdg
DESCRIPTION="KikoPlay is a full-featured danmu player"
HOMEPAGE="
https://kikoplay.fun
https://github.com/Protostars/KikoPlay
"
if [[ ${PV} == "9999" ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/Protostars/${GIT_PN}.git"
else
SRC_URI="https://github.com/Protostars/${GIT_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
S="${WORKDIR}/${GIT_PN}-${PV}"
fi
LICENSE="GPL-3"
SLOT="0"
RDEPEND="
dev-lang/lua:5.3
dev-libs/qhttpengine:5
dev-qt/qtconcurrent:5
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtnetwork:5
dev-qt/qtsql:5
dev-qt/qtwidgets:5
media-video/mpv[libmpv,-luajit]
net-misc/aria2
"
DEPEND="
${RDEPEND}
"
BDEPEND="
media-gfx/imagemagick
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}"/${PN}-0.6.0-install.patch # Fix install problem
"${FILESDIR}"/${PN}-0.6.0-desktop.patch # Add a desktop file
"${FILESDIR}"/${PN}-0.6.0-home.patch # Fix config file path
)
src_prepare() {
default
# Fix lua link problem, link to lua5.3 to fix bug
sed -i "s/-llua/-llua5.3/" KikoPlay.pro || die "Could not fix lua link"
echo "target.path += /usr/bin" >> KikoPlay.pro || die "Could not fix install path"
echo "INSTALLS += target icons desktop" >> KikoPlay.pro || die "Could not fix install target"
echo "unix:icons.path = /usr/share/pixmaps" >> KikoPlay.pro || die "Could not fix install icon PATH"
echo "unix:desktop.path = /usr/share/applications" >> KikoPlay.pro || die "Could not fix install desktop PATH"
echo "unix:icons.files = kikoplay.png kikoplay.xpm" >> KikoPlay.pro || die "Could not fix install desktop PATH"
echo "unix:desktop.files = kikoplay.desktop" >> KikoPlay.pro || die "Could not fix install desktop PATH"
echo "DEFINES += CONFIG_HOME_DATA" >> KikoPlay.pro || die "Could not set defines"
convert kikoplay.ico kikoplay.png || die "Could not create PNG icon"
convert kikoplay.ico kikoplay.xpm || die "Could not create XPM icon"
}
src_configure() {
eqmake5 PREFIX="${D}"/usr
}
src_install() {
# Can't use default, set INSTALL_ROOT
emake INSTALL_ROOT="${D}" install
}

View File

@@ -0,0 +1,77 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
GIT_PN="KikoPlay"
inherit qmake-utils xdg
DESCRIPTION="KikoPlay is a full-featured danmu player"
HOMEPAGE="
https://kikoplay.fun
https://github.com/Protostars/KikoPlay
"
if [[ ${PV} == "9999" ]] ; then
inherit git-r3
EGIT_REPO_URI="https://github.com/Protostars/${GIT_PN}.git"
else
SRC_URI="https://github.com/Protostars/${GIT_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
S="${WORKDIR}/${GIT_PN}-${PV}"
fi
LICENSE="GPL-3"
SLOT="0"
RDEPEND="
dev-lang/lua:5.3
dev-libs/qhttpengine:5
dev-qt/qtconcurrent:5
dev-qt/qtcore:5
dev-qt/qtgui:5
dev-qt/qtnetwork:5
dev-qt/qtsql:5
dev-qt/qtwidgets:5
media-video/mpv[libmpv,-luajit]
net-misc/aria2
"
DEPEND="
${RDEPEND}
"
BDEPEND="
media-gfx/imagemagick
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}"/${PN}-0.6.0-desktop.patch # Add a desktop file
"${FILESDIR}"/${PN}-0.6.0-home.patch # Fix config file path
)
src_prepare() {
default
# Fix lua link problem, link to lua5.3 to fix bug
sed -i "s/-llua/-llua5.3/" KikoPlay.pro || die "Could not fix lua link"
echo "target.path += /usr/bin" >> KikoPlay.pro || die "Could not fix install path"
echo "INSTALLS += target icons desktop" >> KikoPlay.pro || die "Could not fix install target"
echo "unix:icons.path = /usr/share/pixmaps" >> KikoPlay.pro || die "Could not fix install icon PATH"
echo "unix:desktop.path = /usr/share/applications" >> KikoPlay.pro || die "Could not fix install desktop PATH"
echo "unix:icons.files = kikoplay.png kikoplay.xpm" >> KikoPlay.pro || die "Could not fix install desktop PATH"
echo "unix:desktop.files = kikoplay.desktop" >> KikoPlay.pro || die "Could not fix install desktop PATH"
echo "DEFINES += CONFIG_HOME_DATA" >> KikoPlay.pro || die "Could not set defines"
convert kikoplay.ico kikoplay.png || die "Could not create PNG icon"
convert kikoplay.ico kikoplay.xpm || die "Could not create XPM icon"
}
src_configure() {
eqmake5 PREFIX="${D}"/usr
}
src_install() {
# Can't use default, set INSTALL_ROOT
emake INSTALL_ROOT="${D}" install
}

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>vowstar@gmail.com</email>
<name>Huang Rui</name>
</maintainer>
<upstream>
<remote-id type="github">Protostars/KikoPlay</remote-id>
</upstream>
<longdescription>
KikoPlay - A Full-Featured Danmu Player.
OpenGL rendering, smooth barrage experience. The libmpv playback kernel
supports multiple media file formats, retaining flexible parameter settings
for mpv.
Tree playlist, you can organize your fan play at will.
Support all major video sites for barrage search and download:
AcFun, Bilibili, Tucao, 5dm, Bahamut, iQiyi, Youku, Tencent Video, PPTV
Flexible barrage shielding rule setting, support for automatically merging
similar barrage and barrage event analysis annotations to enhance the
viewing experience.
Support batch management of the barrage pool, support the adjustment of the
barrage timeline, and better handle the inconsistency between the local
video and the video on the website.
The database can record and organize the dramas you have watched, and you
can get detailed information from Bangumi LAN service, you can watch it on
other devices through the webpage, and now there is an Android side to
choose from.
Integrated aria2 download function. Daily broadcast function: you can
quickly browse the new fan list and add followers.
Based on the resource search function of Lua script, you can also write
scripts for KikoPlay, script repository.
Support automatic downloading, by setting rules, KikoPlay can automatically
search for download resources.
Unique KikoPlay resource code and barrage pool code, can directly share
resource links containing barrage pool information.
</longdescription>
</pkgmetadata>