From 93003f28a1bc1058f99dae0687161c003f971254 Mon Sep 17 00:00:00 2001 From: sbwml Date: Fri, 4 Mar 2022 03:52:38 +0800 Subject: [PATCH] Add qBittorrent & Build deps --- qBittorrent/Makefile | 76 +++++++++++++ qtbase/Makefile | 201 +++++++++++++++++++++++++++++++++ qtbase/patches/010-gcc11.patch | 36 ++++++ qttools/Makefile | 51 +++++++++ rblibtorrent/Makefile | 75 ++++++++++++ 5 files changed, 439 insertions(+) create mode 100644 qBittorrent/Makefile create mode 100644 qtbase/Makefile create mode 100644 qtbase/patches/010-gcc11.patch create mode 100644 qttools/Makefile create mode 100644 rblibtorrent/Makefile diff --git a/qBittorrent/Makefile b/qBittorrent/Makefile new file mode 100644 index 0000000..7d12bdd --- /dev/null +++ b/qBittorrent/Makefile @@ -0,0 +1,76 @@ +# +# Copyright (C) 2017-2020 +# +# This is free software, licensed under the GNU General Public License v2. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=qbittorrent +PKG_VERSION:=4.4.1 +PKG_RELEASE=1 + +PKG_SOURCE:=qBittorrent-release-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/qbittorrent/qBittorrent/tar.gz/release-4.4.1? +PKG_HASH:=144a609514a7b516e65c4a4e32e49529b5e3949a713daf86332cd95867c991ba + +PKG_BUILD_DIR:=$(BUILD_DIR)/qBittorrent-release-$(PKG_VERSION) + +PKG_LICENSE:=GPL-2.0+ +PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:qbittorrent:qbittorrent + +PKG_BUILD_DEPENDS:=qttools + +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 +PKG_USE_MIPS16:=0 + +include $(INCLUDE_DIR)/package.mk + +define Package/qbittorrent + SECTION:=net + CATEGORY:=Network + SUBMENU:=BitTorrent + DEPENDS:=+libgcc +libstdcpp \ + +rblibtorrent \ + +libopenssl \ + +qt5-core \ + +qt5-network \ + +qt5-sql \ + +qt5-xml \ + +zlib + TITLE:=bittorrent client programmed in C++ / Qt + URL:=https://www.qbittorrent.org/ + PROVIDES:=qBittorrent +endef + +define Package/qbittorrent/description + qBittorrent is a bittorrent client programmed in C++ / Qt that uses + libtorrent (sometimes called libtorrent-rasterbar) by Arvid Norberg. + It aims to be a good alternative to all other bittorrent clients out + there. qBittorrent is fast, stable and provides unicode support as + well as many features. +endef + +CONFIGURE_ARGS += \ + --disable-gui \ + --enable-stacktrace=no \ + --with-boost=$(STAGING_DIR)/usr + +MAKE_VARS += \ + INSTALL_ROOT="$(PKG_INSTALL_DIR)" + + +TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed + +define Package/qbittorrent/conffiles +/etc/config/qbittorrent +endef + +define Package/qbittorrent/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/qbittorrent-nox $(1)/usr/bin +endef + +$(eval $(call BuildPackage,qbittorrent)) diff --git a/qtbase/Makefile b/qtbase/Makefile new file mode 100644 index 0000000..dea0c41 --- /dev/null +++ b/qtbase/Makefile @@ -0,0 +1,201 @@ +# +# Copyright (C) 2020 Openwrt.org +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=qtbase +PKG_BASE:=5.15 +PKG_BUGFIX:=2 +PKG_VERSION:=$(PKG_BASE).$(PKG_BUGFIX) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-everywhere-src-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:= \ + http://download.qt.io/official_releases/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules \ + http://master.qt.io/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules \ + http://mirrors.tuna.tsinghua.edu.cn/qt/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules \ + http://qt.mirror.constant.com/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules +PKG_HASH:=909fad2591ee367993a75d7e2ea50ad4db332f05e1c38dd7a5a274e156a4e0f8 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-everywhere-src-$(PKG_VERSION) + +PKG_BUILD_PARALLEL:=1 +PKG_USE_MIPS16:=0 +PKG_CPE_ID:=cpe:/a:qt:qt + +include $(INCLUDE_DIR)/package.mk + +define Package/qtbase/Default + SECTION:=libs + CATEGORY:=Libraries + SUBMENU:=Qt5 + TITLE:=qtbase + URL:=http://qt-project.org + DEPENDS:=+libgcc +libstdcpp @!LINUX_2_6_36 +endef + +define Package/qtbase/description + This package provides the Qt5 libraries. + + Qt is a cross-platform application development framework for desktop, embedded and mobile. + Supported Platforms include Linux, OS X, Windows, VxWorks, QNX, Android, iOS, BlackBerry, + Sailfish OS and others. + + Qt is not a programming language on its own. It is a framework written in C++. + + This package provides the following run-time libraries: + - core + - network + - xml +endef + +define Package/qtbase + $(call Package/qtbase/Default) + TITLE+=all libs + DEPENDS+=$(QTBASE_DEPENDS) +endef + +define Package/qtbase/install + true +endef + +define Package/qtbase/config + config QT5_INCLUDE_ATOMIC + bool "Depends on libatomic" + default y if !(arm_v7 || ARCH_64BIT || TARGET_x86) + default n + help + Check this options to add the libatomic to the dependences. + - You'd better to confirm whether your compiler need the external libatomic. + Otherwise, it is not recommended to modify this option mannually. + + menu "Select Qtbase Libraries" + comment "Qtbase Libraries" + + $(foreach lib,$(QTBASE_LIBS), + config PACKAGE_qt5-$(lib) + prompt "Qtbase $(lib) library." + default m if ALL + ) + endmenu +endef + +PKG_CONFIG_DEPENDS = CONFIG_QT5_INCLUDE_ATOMIC + +EXTRA_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -flto +EXTRA_LDFLAGS += -Wl,--gc-sections,--as-needed + +CONFIGURE_ARGS = \ + -sysroot $(STAGING_DIR) \ + -hostprefix $(STAGING_DIR_HOSTPKG) \ + -extprefix $(STAGING_DIR)/usr \ + -prefix /usr \ + -archdatadir /usr/share/Qt \ + -datadir /usr/share/Qt \ + -device linux-generic-g++ \ + -device-option CROSS_COMPILE="$(TARGET_CROSS)" \ + -device-option COMPILER_FLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \ + -device-option LINKER_FLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \ + -confirm-license \ + -opensource \ + -release \ + -shared \ + -strip \ + -no-rpath \ + -no-use-gold-linker \ + -ltcg \ + -mimetype-database \ + -openssl-linked \ + -qt-doubleconversion \ + -system-pcre \ + -system-zlib \ + $(if $(findstring i386,$(ARCH)),-no-sse2 -no-sse4.1) \ + -no-angle \ + -no-cups \ + -no-dbus \ + -no-directfb \ + -no-dtls\ + -no-egl \ + -no-eglfs \ + -no-freetype \ + -no-gbm \ + -no-glib \ + -no-gtk \ + -no-gui \ + -no-harfbuzz \ + -no-iconv \ + -no-icu \ + -no-kms \ + -no-libjpeg \ + -no-libmd4c \ + -no-libpng \ + -no-libudev \ + -no-mtdev \ + -no-opengl \ + -no-opengles3 \ + -no-openvg \ + -no-pch \ + -no-slog2 \ + -sql-sqlite \ + -no-trace \ + -no-tslib \ + -no-vulkan \ + -no-widgets \ + -no-xcb \ + -no-xkbcommon \ + -no-zstd \ + -no-compile-examples \ + -no-feature-concurrent \ + -no-feature-gssapi \ + -no-feature-testlib \ + -make libs \ + -nomake examples \ + -nomake tests \ + -nomake tools \ + -v + + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) +endef + +define Build/InstallDev + $(MAKE) -C $(PKG_BUILD_DIR) install +endef + +define Package/qtbase/Default/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/lib/libQt5$(shell echo $(2) | sed -e 's/\b[[:alpha:]]/\u&/g').so* $(1)/usr/lib +endef + +define DefineQtbaseLibrary + QTBASE_DEPENDS+=+qt5-$(1) + + QTBASE_LIBS+=$(1) + + define Package/qt5-$(1) + $(call Package/qtbase/Default) + TITLE+=$(1) + DEPENDS+=$(foreach lib,$(2),+qt5-$(lib)) $(3) + HIDDEN:=1 + endef + + define Package/qt5-$(1)/description + This package contains the qt5 $(1) library. + endef + + define Package/qt5-$(1)/install + $(call Package/qtbase/Default/install,$$(1),$(1)) + endef +endef + +$(eval $(call DefineQtbaseLibrary,core,,+QT5_INCLUDE_ATOMIC:libatomic +libpcre2-16 +zlib)) +$(eval $(call DefineQtbaseLibrary,network,core,+libopenssl +zlib)) +$(eval $(call DefineQtbaseLibrary,xml,core,)) +$(eval $(call DefineQtbaseLibrary,sql,core)) + +$(foreach lib,$(QTBASE_LIBS),$(eval $(call BuildPackage,qt5-$(lib)))) +$(eval $(call BuildPackage,qtbase)) diff --git a/qtbase/patches/010-gcc11.patch b/qtbase/patches/010-gcc11.patch new file mode 100644 index 0000000..97d277e --- /dev/null +++ b/qtbase/patches/010-gcc11.patch @@ -0,0 +1,36 @@ +diff --color -uNr a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h +--- a/src/corelib/global/qendian.h 2020-10-27 16:02:11.000000000 +0800 ++++ b/src/corelib/global/qendian.h 2021-07-19 06:21:23.185297425 +0800 +@@ -43,7 +43,7 @@ + + #include + #include +- ++#include + // include stdlib.h and hope that it defines __GLIBC__ for glibc-based systems + #include + #include +diff --color -uNr a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h +--- a/src/corelib/global/qfloat16.h 2020-10-27 16:02:11.000000000 +0800 ++++ b/src/corelib/global/qfloat16.h 2021-07-19 06:22:10.387349829 +0800 +@@ -44,7 +44,7 @@ + #include + #include + #include +- ++#include + #if defined(QT_COMPILER_SUPPORTS_F16C) && defined(__AVX2__) && !defined(__F16C__) + // All processors that support AVX2 do support F16C too. That doesn't mean + // we're allowed to use the intrinsics directly, so we'll do it only for +diff --color -uNr a/src/corelib/text/qbytearraymatcher.h b/src/corelib/text/qbytearraymatcher.h +--- a/src/corelib/text/qbytearraymatcher.h 2020-10-27 16:02:11.000000000 +0800 ++++ b/src/corelib/text/qbytearraymatcher.h 2021-07-19 06:22:30.139372013 +0800 +@@ -41,7 +41,7 @@ + #define QBYTEARRAYMATCHER_H + + #include +- ++#include + QT_BEGIN_NAMESPACE + + diff --git a/qttools/Makefile b/qttools/Makefile new file mode 100644 index 0000000..40d726c --- /dev/null +++ b/qttools/Makefile @@ -0,0 +1,51 @@ +# +# Copyright (C) 2019 Openwrt.org +# +# This is free software, licensed under the Apache License, Version 2.0 . +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=qttools +PKG_BASE:=5.15 +PKG_BUGFIX:=2 +PKG_VERSION:=$(PKG_BASE).$(PKG_BUGFIX) +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-everywhere-src-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:= \ + http://download.qt.io/official_releases/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules \ + http://master.qt.io/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules \ + http://mirrors.tuna.tsinghua.edu.cn/qt/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules \ + http://qt.mirror.constant.com/archive/qt/$(PKG_BASE)/$(PKG_VERSION)/submodules +PKG_HASH:=c189d0ce1ff7c739db9a3ace52ac3e24cb8fd6dbf234e49f075249b38f43c1cc + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-everywhere-src-$(PKG_VERSION) + +PKG_BUILD_PARALLEL:=1 +PKG_BUILD_DEPENDS:=qtbase + +include $(INCLUDE_DIR)/package.mk + +define Package/qttools + SECTION:=libs + CATEGORY:=Libraries + SUBMENU:=Qt5 + TITLE:=qttools + URL:=http://qt-project.org + BUILDONLY:=1 +endef + +define Build/Configure + cd $(PKG_BUILD_DIR) && qmake -o Makefile qttools.pro +endef + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) +endef + +define Build/InstallDev + $(MAKE) -C $(PKG_BUILD_DIR) install +endef + +$(eval $(call BuildPackage,qttools)) diff --git a/rblibtorrent/Makefile b/rblibtorrent/Makefile new file mode 100644 index 0000000..fc4a388 --- /dev/null +++ b/rblibtorrent/Makefile @@ -0,0 +1,75 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=rblibtorrent +PKG_VERSION:=1.2.15 +PKG_RELEASE=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/arvidn/libtorrent.git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=9c5b26b8d9bdb168256566a2986c563187638e5a +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_MIRROR_HASH:=15c9d37a56cf09b22b9d1eeec8a0c21eff7c9fb6b30b04c4cba9a61d5201d57a + +PKG_LICENSE:=BSD +PKG_LICENSE_FILES:=COPYING + +PKG_USE_MIPS16:=0 +PKG_BUILD_PARALLEL:=1 +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/rblibtorrent + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Rasterbar BitTorrent library + URL:=https://www.libtorrent.org/ + DEPENDS:=+libgcc +libstdcpp +libopenssl +boost +boost-system +boost-chrono +boost-random + MAINTAINER:=Arvid Norberg +endef + +define Package/rblibtorrent/description +Rasterbar libtorrent is a C++ library that aims to be a good alternative to +all the other bittorrent implementations around. It is a library and not a +full featured client, although it comes with a working example client. +endef + +TARGET_CFLAGS += $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC + +EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_VERSION_4_8),-std=gnu++11,-std=gnu++14) + +TARGET_LDFLAGS += -lstdc++ + +CONFIGURE_ARGS += \ + --disable-debug \ + --disable-rpath \ + --enable-encryption \ + --enable-deprecated-functions \ + --with-gnu-ld \ + --with-openssl=$(STAGING_DIR)/usr \ + --with-boost=$(STAGING_DIR)/usr \ + --with-libiconv \ + --with-libiconv-prefix=$(ICONV_PREFIX) + +define Build/Configure + cd $(PKG_BUILD_DIR) ; \ + sh autotool.sh + $(call Build/Configure/Default) +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/libtorrent $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libtorrent-rasterbar.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libtorrent-rasterbar.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/rblibtorrent/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,rblibtorrent))