1
mirror of https://github.com/qbittorrent/qBittorrent synced 2025-10-14 11:52:15 +02:00

Compare commits

..

1 Commits

Author SHA1 Message Date
sledgehammer999
508896c4f2 Bump to 4.6.0RC1 2023-07-17 09:21:32 +03:00
993 changed files with 154212 additions and 162185 deletions

101
.appveyor.yml Normal file
View File

@@ -0,0 +1,101 @@
version: '{branch}-{build}'
# Do not build on tags (GitHub only)
skip_tags: true
image: Visual Studio 2022
branches:
except: # blacklist
- coverity_scan
environment:
REPO_DIR: &REPO_DIR c:\qbittorrent
CACHE_DIR: &CACHE_DIR c:\qbt_cache
QBT_VER_URL: https://builds.shiki.hu/appveyor/version_64
QBT_LIB_URL: https://builds.shiki.hu/appveyor/qbt_libraries_64.7z
# project directory
clone_folder: *REPO_DIR
# cache size should < 100MB (after compressing with fastest option):
# see: https://www.appveyor.com/docs/build-cache#save-update-cache-before-build-finishes
cache:
- *CACHE_DIR
clone_depth: 50
install:
# check if library needs update
- appveyor DownloadFile "%QBT_VER_URL%" -FileName "c:\version_new" && SET /P newVersion=<"c:\version_new"
- IF EXIST "%CACHE_DIR%\version" (SET /P oldVersion=<"%CACHE_DIR%\version")
- IF NOT EXIST "%CACHE_DIR%\version" (SET updateCache=1)
- IF NOT "%oldVersion%" == "%newVersion%" (SET updateCache=1)
# update library
- IF "%updateCache%" == "1" (ECHO "--- Will redownload libraries ---" &&
RMDIR /S /Q "%CACHE_DIR%" & MKDIR "%CACHE_DIR%" &&
appveyor DownloadFile "%QBT_LIB_URL%" -FileName "c:\qbt_lib.7z" && 7z x "c:\qbt_lib.7z" -o"%CACHE_DIR%" > nul &&
COPY "c:\version_new" "%CACHE_DIR%\version")
before_build:
# setup env
- CALL "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
- SET PATH=%PATH%;C:\Qt\5.15.2\msvc2019_64\bin;%CACHE_DIR%\jom
# setup project
- COPY /Y "%CACHE_DIR%\conf.pri" "%REPO_DIR%"
# workarounds
- MKDIR "c:\qbt"
- MKLINK /J "c:\qbt\base" "%CACHE_DIR%\base"
build_script:
- cd "%REPO_DIR%"
# lupdate chokes when it parses headers from system includes, especially Boost
# it also chokes with the sources from src/app/qtlocalpeer (formerly qtsingleapplication)
# Workaround: temporarily rename them to run lupdate with the .pro file
- RENAME conf.pri conf.pri.temp
- RENAME src\app\qtlocalpeer qtlocalpeer.temp
- lupdate qbittorrent.pro
- RENAME conf.pri.temp conf.pri
- RENAME src\app\qtlocalpeer.temp qtlocalpeer
- qmake qbittorrent.pro && cd src && qmake src.pro
- jom -j2 -f Makefile.Release
after_build:
- cd "%REPO_DIR%"
- MKDIR upload
- COPY dist\windows\qt.conf upload
- COPY src\release\qbittorrent.exe upload
- COPY src\release\qbittorrent.pdb upload
- COPY "%CACHE_DIR%\base\bin\libcrypto-1_1-x64.dll" upload
- COPY "%CACHE_DIR%\base\bin\libcrypto-1_1-x64.pdb" upload
- COPY "%CACHE_DIR%\base\bin\libssl-1_1-x64.dll" upload
- COPY "%CACHE_DIR%\base\bin\libssl-1_1-x64.pdb" upload
- COPY "%CACHE_DIR%\base\bin\torrent-rasterbar.dll" upload
- COPY "%CACHE_DIR%\base\bin\torrent-rasterbar.pdb" upload
- COPY "%CACHE_DIR%\base\lib\zlib1.dll" upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Core.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Gui.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Network.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Sql.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Svg.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Widgets.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5WinExtras.dll upload
- COPY C:\Qt\5.15.2\msvc2019_64\bin\Qt5Xml.dll upload
- MKDIR upload\plugins\iconengines
- COPY C:\Qt\5.15.2\msvc2019_64\plugins\iconengines\qsvgicon.dll upload\plugins\iconengines
- MKDIR upload\plugins\imageformats
- COPY C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qico.dll upload\plugins\imageformats
- COPY C:\Qt\5.15.2\msvc2019_64\plugins\imageformats\qsvg.dll upload\plugins\imageformats
- MKDIR upload\plugins\platforms
- COPY C:\Qt\5.15.2\msvc2019_64\plugins\platforms\qwindows.dll upload\plugins\platforms
- MKDIR upload\plugins\sqldrivers
- COPY C:\Qt\5.15.2\msvc2019_64\plugins\sqldrivers\qsqlite.dll upload\plugins\sqldrivers
- MKDIR upload\plugins\styles
- COPY C:\Qt\5.15.2\msvc2019_64\plugins\styles\qwindowsvistastyle.dll upload\plugins\styles
test: off
artifacts:
- path: upload
name: qBittorrent-Appveyor_Windows-x64

View File

@@ -35,6 +35,7 @@ Checks: >
-modernize-use-auto, -modernize-use-auto,
-modernize-use-nodiscard, -modernize-use-nodiscard,
-modernize-use-trailing-return-type, -modernize-use-trailing-return-type,
-modernize-use-using,
-readability-function-cognitive-complexity, -readability-function-cognitive-complexity,
-readability-function-size, -readability-function-size,
-readability-identifier-length, -readability-identifier-length,

View File

@@ -1,10 +1,8 @@
# EditorConfig is awesome: https://EditorConfig.org # EditorConfig is awesome: http://EditorConfig.org
root = true root = true
[*] [*]
charset = utf-8
end_of_line = lf
indent_style = space indent_style = space
indent_size = 4 indent_size = 4
insert_final_newline = true insert_final_newline = true

1
.gitattributes vendored
View File

@@ -6,5 +6,4 @@ core.eol=lf
*.qm binary *.qm binary
*.zip binary *.zip binary
dist/windows/license.txt text eol=crlf
test/testdata/crlf.txt text eol=crlf test/testdata/crlf.txt text eol=crlf

2
.github/SUPPORT.md vendored
View File

@@ -9,7 +9,7 @@ For such questions, use one of the following community support resources:
* The [discussions section][discussions-url] * The [discussions section][discussions-url]
* The [official forum][forum-url] * The official forum [official forum][forum-url]
* The [qBittorrent subreddit][subreddit-url] * The [qBittorrent subreddit][subreddit-url]

View File

@@ -1,15 +0,0 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
commit-message:
prefix: "GHA CI"
groups:
github-actions:
patterns:
- "*"
labels:
- "CI"
schedule:
interval: "monthly"

View File

@@ -14,31 +14,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Install tools - name: Install tools
uses: actions/setup-python@v5 uses: actions/setup-python@v4
with: with:
python-version: "*" python-version: "*"
- name: Check files - name: Check files
uses: pre-commit/action@v3.0.1 uses: pre-commit/action@v3.0.0
- name: Check doc
env:
pandoc_path: "${{ github.workspace }}/../pandoc"
run: |
# install pandoc
curl \
-L \
-o "${{ runner.temp }}/pandoc.tar.gz" \
"https://github.com/jgm/pandoc/releases/download/3.1.7/pandoc-3.1.7-linux-amd64.tar.gz"
tar -xf "${{ runner.temp }}/pandoc.tar.gz" -C "${{ github.workspace }}/.."
mv "${{ github.workspace }}/.."/pandoc-* "${{ env.pandoc_path }}"
# run pandoc
for lang in doc/*/; do
"${{ env.pandoc_path }}/bin/pandoc" -f markdown -t man -s "$lang/qbittorrent.1.md" -o "$lang/qbittorrent.1"
"${{ env.pandoc_path }}/bin/pandoc" -f markdown -t man -s "$lang/qbittorrent-nox.1.md" -o "$lang/qbittorrent-nox.1"
done
# check diff, ignore "Automatically generated by ..." part
git diff -I '\.\\".*' --exit-code

View File

@@ -17,18 +17,20 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
libt_version: ["2.0.10", "1.2.19"] libt_version: ["2.0.9", "1.2.19"]
qbt_gui: ["GUI=ON", "GUI=OFF"] qbt_gui: ["GUI=ON", "GUI=OFF"]
qt_version: ["6.5.2"] qt_version: ["5.15.2", "6.5.0"]
exclude:
- libt_version: "1.2.19"
qt_version: "6.5.0"
env: env:
boost_path: "${{ github.workspace }}/../boost" boost_path: "${{ github.workspace }}/../boost"
openssl_root: /usr/local/opt/openssl@3 openssl_root: /usr/local/opt/openssl@1.1
libtorrent_path: "${{ github.workspace }}/../libtorrent"
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Install dependencies - name: Install dependencies
uses: Wandalen/wretry.action@v1 uses: Wandalen/wretry.action@v1
@@ -42,29 +44,20 @@ jobs:
brew update > /dev/null brew update > /dev/null
brew install \ brew install \
cmake ninja \ cmake ninja \
openssl@3 zlib openssl@1.1 zlib
- name: Setup ccache - name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1 uses: Chocobo1/setup-ccache-action@v1
with: with:
store_cache: ${{ startsWith(github.ref, 'refs/heads/') }}
update_packager_index: false update_packager_index: false
- name: Install boost - name: Install boost
env:
BOOST_MAJOR_VERSION: "1"
BOOST_MINOR_VERSION: "84"
BOOST_PATCH_VERSION: "0"
run: | run: |
boost_url="https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz" curl \
boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz" -L \
set +e -o "${{ runner.temp }}/boost.tar.bz2" \
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url" "https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.bz2"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?" tar -xf "${{ runner.temp }}/boost.tar.bz2" -C "${{ github.workspace }}/.."
if [ "$_exitCode" -ne "0" ]; then
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
fi
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}" mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
- name: Install Qt - name: Install Qt
@@ -73,7 +66,6 @@ jobs:
version: ${{ matrix.qt_version }} version: ${{ matrix.qt_version }}
archives: qtbase qtdeclarative qtsvg qttools archives: qtbase qtdeclarative qtsvg qttools
# Not sure why Qt made a hard dependency on qtdeclarative, try removing it when Qt > 6.4.0 # Not sure why Qt made a hard dependency on qtdeclarative, try removing it when Qt > 6.4.0
cache: true
- name: Install libtorrent - name: Install libtorrent
run: | run: |
@@ -81,9 +73,8 @@ jobs:
--branch v${{ matrix.libt_version }} \ --branch v${{ matrix.libt_version }} \
--depth 1 \ --depth 1 \
--recurse-submodules \ --recurse-submodules \
https://github.com/arvidn/libtorrent.git \ https://github.com/arvidn/libtorrent.git
${{ env.libtorrent_path }} cd libtorrent
cd ${{ env.libtorrent_path }}
cmake \ cmake \
-B build \ -B build \
-G "Ninja" \ -G "Ninja" \
@@ -97,7 +88,8 @@ jobs:
cmake --build build cmake --build build
sudo cmake --install build sudo cmake --install build
- name: Build qBittorrent - name: Build qBittorrent (Qt5)
if: startsWith(matrix.qt_version, 5)
run: | run: |
CXXFLAGS="$CXXFLAGS -Werror -Wno-error=deprecated-declarations" \ CXXFLAGS="$CXXFLAGS -Werror -Wno-error=deprecated-declarations" \
LDFLAGS="$LDFLAGS -gz" \ LDFLAGS="$LDFLAGS -gz" \
@@ -115,6 +107,26 @@ jobs:
cmake --build build cmake --build build
cmake --build build --target check cmake --build build --target check
- name: Build qBittorrent (Qt6)
if: startsWith(matrix.qt_version, 6)
run: |
CXXFLAGS="$CXXFLAGS -Wno-gnu-zero-variadic-macro-arguments -Werror -Wno-error=deprecated-declarations" \
LDFLAGS="$LDFLAGS -gz" \
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBOOST_ROOT="${{ env.boost_path }}" \
-DOPENSSL_ROOT_DIR="${{ env.openssl_root }}" \
-DQT6=ON \
-DTESTING=ON \
-DVERBOSE_CONFIGURE=ON \
-D${{ matrix.qbt_gui }}
cmake --build build --target qbt_update_translations
cmake --build build
cmake --build build --target check
- name: Prepare build artifacts - name: Prepare build artifacts
run: | run: |
# create .dmg # create .dmg
@@ -131,10 +143,10 @@ jobs:
mkdir upload/cmake mkdir upload/cmake
cp build/compile_commands.json upload/cmake cp build/compile_commands.json upload/cmake
mkdir upload/cmake/libtorrent mkdir upload/cmake/libtorrent
cp ${{ env.libtorrent_path }}/build/compile_commands.json upload/cmake/libtorrent cp libtorrent/build/compile_commands.json upload/cmake/libtorrent
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }} name: qBittorrent-CI_macOS_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
path: upload path: upload

View File

@@ -18,57 +18,36 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
libt_version: ["2.0.10", "1.2.19"] libt_version: ["2.0.9", "1.2.19"]
qbt_gui: ["GUI=ON", "GUI=OFF"] qbt_gui: ["GUI=ON", "GUI=OFF"]
qt_version: ["6.5.2"] qt_version: ["5.15.2", "6.2.0"]
exclude:
env: - libt_version: "1.2.19"
boost_path: "${{ github.workspace }}/../boost" qt_version: "6.2.0"
harden_flags: "-D_FORTIFY_SOURCE=2 -D_GLIBCXX_ASSERTIONS"
libtorrent_path: "${{ github.workspace }}/../libtorrent"
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt update sudo apt update
sudo apt install \ sudo apt install \
build-essential cmake ninja-build \ build-essential cmake ninja-build pkg-config \
libssl-dev libxkbcommon-x11-dev libxcb-cursor-dev zlib1g-dev libboost-dev libssl-dev libxkbcommon-x11-dev zlib1g-dev
- name: Setup ccache - name: Setup ccache
uses: Chocobo1/setup-ccache-action@v1 uses: Chocobo1/setup-ccache-action@v1
with: with:
store_cache: ${{ startsWith(github.ref, 'refs/heads/') }}
update_packager_index: false update_packager_index: false
ccache_options: | ccache_options: |
max_size=2G max_size=2G
- name: Install boost
env:
BOOST_MAJOR_VERSION: "1"
BOOST_MINOR_VERSION: "76"
BOOST_PATCH_VERSION: "0"
run: |
boost_url="https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
set +e
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
if [ "$_exitCode" -ne "0" ]; then
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
fi
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v3 uses: jurplel/install-qt-action@v3
with: with:
version: ${{ matrix.qt_version }} version: ${{ matrix.qt_version }}
archives: icu qtbase qtdeclarative qtsvg qttools archives: icu qtbase qtsvg qttools
cache: true
- name: Install libtorrent - name: Install libtorrent
run: | run: |
@@ -76,39 +55,36 @@ jobs:
--branch v${{ matrix.libt_version }} \ --branch v${{ matrix.libt_version }} \
--depth 1 \ --depth 1 \
--recurse-submodules \ --recurse-submodules \
https://github.com/arvidn/libtorrent.git \ https://github.com/arvidn/libtorrent.git
${{ env.libtorrent_path }} cd libtorrent
cd ${{ env.libtorrent_path }}
CXXFLAGS="$CXXFLAGS ${{ env.harden_flags }}" \
cmake \ cmake \
-B build \ -B build \
-G "Ninja" \ -G "Ninja" \
-DBUILD_SHARED_LIBS=OFF \ -DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBOOST_ROOT="${{ env.boost_path }}" \
-Ddeprecated-functions=OFF -Ddeprecated-functions=OFF
cmake --build build cmake --build build
sudo cmake --install build sudo cmake --install build
# to avoid scanning 3rdparty codebases, initialize it just before building qbt # to avoid scanning 3rdparty codebases, initialize it just before building qbt
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v3 uses: github/codeql-action/init@v2
if: startsWith(matrix.libt_version, 2) && (matrix.qbt_gui == 'GUI=ON') if: startsWith(matrix.libt_version, 2) && (matrix.qbt_gui == 'GUI=ON') && startsWith(matrix.qt_version, 6)
with: with:
config-file: ./.github/workflows/helper/codeql/cpp.yaml config-file: ./.github/workflows/helper/codeql/cpp.yaml
languages: cpp languages: cpp
- name: Build qBittorrent - name: Build qBittorrent (Qt5)
if: startsWith(matrix.qt_version, 5)
run: | run: |
CXXFLAGS="$CXXFLAGS ${{ env.harden_flags }} -Werror" \ CXXFLAGS="$CXXFLAGS -Werror -Wno-error=deprecated-declarations" \
LDFLAGS="$LDFLAGS -gz" \ LDFLAGS="$LDFLAGS -gz" \
cmake \ cmake \
-B build \ -B build \
-G "Ninja" \ -G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DBOOST_ROOT="${{ env.boost_path }}" \
-DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_INSTALL_PREFIX="/usr" \
-DTESTING=ON \ -DTESTING=ON \
-DVERBOSE_CONFIGURE=ON \ -DVERBOSE_CONFIGURE=ON \
@@ -118,11 +94,29 @@ jobs:
cmake --build build --target check cmake --build build --target check
DESTDIR="qbittorrent" cmake --install build DESTDIR="qbittorrent" cmake --install build
- name: Build qBittorrent (Qt6)
if: startsWith(matrix.qt_version, 6)
run: |
CXXFLAGS="$CXXFLAGS -Werror" \
LDFLAGS="$LDFLAGS -gz" \
cmake \
-B build \
-G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DQT6=ON \
-DTESTING=ON \
-DVERBOSE_CONFIGURE=ON \
-D${{ matrix.qbt_gui }}
cmake --build build --target qbt_update_translations
cmake --build build
cmake --build build --target check
DESTDIR="qbittorrent" cmake --install build
- name: Run CodeQL analysis - name: Run CodeQL analysis
uses: github/codeql-action/analyze@v3 uses: github/codeql-action/analyze@v2
if: startsWith(matrix.libt_version, 2) && (matrix.qbt_gui == 'GUI=ON') if: startsWith(matrix.libt_version, 2) && (matrix.qbt_gui == 'GUI=ON') && startsWith(matrix.qt_version, 6)
with:
category: ${{ github.base_ref || github.ref_name }}
- name: Prepare build artifacts - name: Prepare build artifacts
run: | run: |
@@ -130,41 +124,37 @@ jobs:
mkdir upload/cmake mkdir upload/cmake
cp build/compile_commands.json upload/cmake cp build/compile_commands.json upload/cmake
mkdir upload/cmake/libtorrent mkdir upload/cmake/libtorrent
cp ${{ env.libtorrent_path }}/build/compile_commands.json upload/cmake/libtorrent cp libtorrent/build/compile_commands.json upload/cmake/libtorrent
- name: Install AppImage - name: 'AppImage: Prepare env'
run: | run: |
sudo apt install libfuse2 sudo apt install libfuse2
curl \ wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
-L \ wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
-Z \ wget https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage
-O https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage \ chmod +x linuxdeploy-x86_64.AppImage
-O https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage \ chmod +x linuxdeploy-plugin-qt-x86_64.AppImage
-O https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage chmod +x linuxdeploy-plugin-appimage-x86_64.AppImage
chmod +x \
linuxdeploy-x86_64.AppImage \
linuxdeploy-plugin-qt-x86_64.AppImage \
linuxdeploy-plugin-appimage-x86_64.AppImage
- name: Prepare files for AppImage - name: 'AppImage: Prepare nox'
if: matrix.qbt_gui == 'GUI=OFF' if: matrix.qbt_gui == 'GUI=OFF'
run: | run: |
mkdir -p qbittorrent/usr/share/applications mkdir -p qbittorrent/usr/share/icons/hicolor/scalable/apps/
cp .github/workflows/helper/appimage/org.qbittorrent.qBittorrent.desktop qbittorrent/usr/share/applications/org.qbittorrent.qBittorrent.desktop mkdir -p qbittorrent/usr/share/applications/
mkdir -p qbittorrent/usr/share/icons/hicolor/scalable/apps
cp dist/unix/menuicons/scalable/apps/qbittorrent.svg qbittorrent/usr/share/icons/hicolor/scalable/apps/qbittorrent.svg cp dist/unix/menuicons/scalable/apps/qbittorrent.svg qbittorrent/usr/share/icons/hicolor/scalable/apps/qbittorrent.svg
cp .github/workflows/helper/appimage/org.qbittorrent.qBittorrent.desktop qbittorrent/usr/share/applications/org.qbittorrent.qBittorrent.desktop
- name: Package AppImage - name: 'AppImage: Package'
run: | run: |
./linuxdeploy-x86_64.AppImage --appdir qbittorrent --plugin qt ./linuxdeploy-x86_64.AppImage --appdir=qbittorrent --plugin qt
rm qbittorrent/apprun-hooks/* rm qbittorrent/apprun-hooks/*
cp .github/workflows/helper/appimage/export_vars.sh qbittorrent/apprun-hooks/export_vars.sh cp .github/workflows/helper/appimage/export_vars.sh qbittorrent/apprun-hooks/export_vars.sh
NO_APPSTREAM=1 \ NO_APPSTREAM=1 \
OUTPUT=upload/qbittorrent-CI_Ubuntu_x86_64.AppImage \ OUTPUT=upload/qbittorrent-CI_Ubuntu_x86_64.AppImage \
./linuxdeploy-x86_64.AppImage --appdir qbittorrent --output appimage ./linuxdeploy-x86_64.AppImage --appdir=qbittorrent --output appimage
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: qBittorrent-CI_Ubuntu-x64_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }} name: qBittorrent-CI_Ubuntu-x64_${{ matrix.qbt_gui }}_libtorrent-${{ matrix.libt_version }}_Qt-${{ matrix.qt_version }}
path: upload path: upload

View File

@@ -20,10 +20,10 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Setup nodejs - name: Setup nodejs
uses: actions/setup-node@v4 uses: actions/setup-node@v3
with: with:
node-version: 'lts/*' node-version: 'lts/*'
@@ -39,10 +39,10 @@ jobs:
git diff --exit-code git diff --exit-code
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v3 uses: github/codeql-action/init@v2
with: with:
config-file: ./.github/workflows/helper/codeql/js.yaml config-file: ./.github/workflows/helper/codeql/js.yaml
languages: javascript languages: javascript
- name: Run CodeQL analysis - name: Run CodeQL analysis
uses: github/codeql-action/analyze@v3 uses: github/codeql-action/analyze@v2

View File

@@ -17,87 +17,70 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
libt_version: ["2.0.10", "1.2.19"] libt_version: ["2.0.9", "1.2.19"]
env: env:
boost_path: "${{ github.workspace }}/../boost" boost_path: "${{ github.workspace }}/../boost"
libtorrent_path: "${{ github.workspace }}/../libtorrent" libtorrent_path: "${{ github.workspace }}/libtorrent"
vcpkg_path: "c:/vcpkg"
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Setup devcmd - name: Setup devcmd
uses: ilammy/msvc-dev-cmd@v1 uses: ilammy/msvc-dev-cmd@v1
- name: Install build tools - name: Install build tools
run: | run: |
if ((Get-Command "ninja.exe" -ErrorAction SilentlyContinue) -eq $null)
{
choco install ninja choco install ninja
}
where.exe ninja
ninja --version
# https://learn.microsoft.com/en-us/vcpkg/users/binarycaching#gha # use the preinstalled vcpkg from image
- name: Set variables for vcpkg # https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#package-management
uses: actions/github-script@v7 - name: Setup vcpkg
uses: lukka/run-vcpkg@v10
with: with:
script: | vcpkgDirectory: C:/vcpkg
core.exportVariable('ACTIONS_CACHE_URL', (process.env.ACTIONS_CACHE_URL || '')); doNotUpdateVcpkg: true # the preinstalled vcpkg is updated regularly
core.exportVariable('ACTIONS_RUNTIME_TOKEN', (process.env.ACTIONS_RUNTIME_TOKEN || ''));
- name: Install dependencies with vcpkg - name: Install dependencies from vcpkg
run: | run: |
# create our own triplet # tell vcpkg to only build Release variants of the dependencies
New-Item ` New-Item `
-Force ` -Path "${{ github.workspace }}" `
-ItemType File ` -Name "triplets_overlay" `
-Path "${{ env.vcpkg_path }}/triplets_overlay/x64-windows-static-md-release.cmake" -ItemType Directory
# OpenSSL isn't compatible with `/guard:cf` flag so we omit it for now, see: https://github.com/openssl/openssl/issues/22554 Copy-Item `
"${{ env.RUNVCPKG_VCPKG_ROOT }}/triplets/x64-windows-static.cmake" `
"${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake"
Add-Content ` Add-Content `
-Path "${{ env.vcpkg_path }}/triplets_overlay/x64-windows-static-md-release.cmake" ` "${{ github.workspace }}/triplets_overlay/x64-windows-static-release.cmake" `
-Value @("set(VCPKG_TARGET_ARCHITECTURE x64)", -Value "set(VCPKG_BUILD_TYPE release)"
"set(VCPKG_LIBRARY_LINKAGE static)",
"set(VCPKG_CRT_LINKAGE dynamic)",
"set(VCPKG_BUILD_TYPE release)")
# clear buildtrees after each package installation to reduce disk space requirements # clear buildtrees after each package installation to reduce disk space requirements
$packages = ` $packages = `
"openssl:x64-windows-static-md-release", "openssl:x64-windows-static-release",
"zlib:x64-windows-static-md-release" "zlib:x64-windows-static-release"
${{ env.vcpkg_path }}/vcpkg.exe upgrade ` ${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe upgrade `
--no-dry-run ` --overlay-triplets="${{ github.workspace }}/triplets_overlay" `
--overlay-triplets="${{ env.vcpkg_path }}/triplets_overlay" --no-dry-run
${{ env.vcpkg_path }}/vcpkg.exe install ` ${{ env.RUNVCPKG_VCPKG_ROOT }}/vcpkg.exe install `
--binarysource="clear;x-gha,readwrite" ` --overlay-triplets="${{ github.workspace }}/triplets_overlay" `
--clean-after-build ` --clean-after-build `
--overlay-triplets="${{ env.vcpkg_path }}/triplets_overlay" `
$packages $packages
- name: Install boost - name: Install boost
env:
BOOST_MAJOR_VERSION: "1"
BOOST_MINOR_VERSION: "84"
BOOST_PATCH_VERSION: "0"
run: | run: |
$boost_url="https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz" aria2c `
$boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz" "https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.7z" `
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url" -d "${{ runner.temp }}" `
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.." -o "boost.7z"
if ($LastExitCode -ne 0) 7z x "${{ runner.temp }}/boost.7z" -o"${{ github.workspace }}/.."
{
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."
}
move "${{ github.workspace }}/../boost_*" "${{ env.boost_path }}" move "${{ github.workspace }}/../boost_*" "${{ env.boost_path }}"
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v3 uses: jurplel/install-qt-action@v3
with: with:
version: "6.5.2" version: "6.5.0"
archives: qtbase qtsvg qttools archives: qtbase qtsvg qttools
cache: true
- name: Install libtorrent - name: Install libtorrent
run: | run: |
@@ -105,40 +88,39 @@ jobs:
--branch v${{ matrix.libt_version }} ` --branch v${{ matrix.libt_version }} `
--depth 1 ` --depth 1 `
--recurse-submodules ` --recurse-submodules `
https://github.com/arvidn/libtorrent.git ` https://github.com/arvidn/libtorrent.git
${{ env.libtorrent_path }} cd libtorrent
cd ${{ env.libtorrent_path }}
$env:CXXFLAGS+=" /guard:cf"
$env:LDFLAGS+=" /guard:cf"
cmake ` cmake `
-B build ` -B build `
-G "Ninja" ` -G "Ninja" `
-DCMAKE_BUILD_TYPE=RelWithDebInfo ` -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_CXX_FLAGS=/guard:cf `
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON ` -DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
-DCMAKE_INSTALL_PREFIX="${{ env.libtorrent_path }}/install" ` -DCMAKE_INSTALL_PREFIX="${{ env.libtorrent_path }}" `
-DCMAKE_TOOLCHAIN_FILE="${{ env.vcpkg_path }}/scripts/buildsystems/vcpkg.cmake" ` -DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
-DBOOST_ROOT="${{ env.boost_path }}" ` -DBOOST_ROOT="${{ env.boost_path }}" `
-DBUILD_SHARED_LIBS=OFF ` -DBUILD_SHARED_LIBS=OFF `
-Ddeprecated-functions=OFF ` -Ddeprecated-functions=OFF `
-Dstatic_runtime=OFF ` -Dstatic_runtime=ON `
-DVCPKG_TARGET_TRIPLET=x64-windows-static-md-release -DVCPKG_TARGET_TRIPLET=x64-windows-static-release
cmake --build build cmake --build build
cmake --install build cmake --install build
- name: Build qBittorrent - name: Build qBittorrent
run: | run: |
$env:CXXFLAGS+=" /WX"
cmake ` cmake `
-B build ` -B build `
-G "Ninja" ` -G "Ninja" `
-DCMAKE_BUILD_TYPE=RelWithDebInfo ` -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_CXX_FLAGS="/WX" `
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON ` -DCMAKE_EXPORT_COMPILE_COMMANDS=ON `
-DCMAKE_TOOLCHAIN_FILE="${{ env.vcpkg_path }}/scripts/buildsystems/vcpkg.cmake" ` -DCMAKE_TOOLCHAIN_FILE="${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
-DBOOST_ROOT="${{ env.boost_path }}" ` -DBOOST_ROOT="${{ env.boost_path }}" `
-DLibtorrentRasterbar_DIR="${{ env.libtorrent_path }}/install/lib/cmake/LibtorrentRasterbar" ` -DLibtorrentRasterbar_DIR="${{ env.libtorrent_path }}/lib/cmake/LibtorrentRasterbar" `
-DMSVC_RUNTIME_DYNAMIC=ON ` -DMSVC_RUNTIME_DYNAMIC=OFF `
-DQT6=ON `
-DTESTING=ON ` -DTESTING=ON `
-DVCPKG_TARGET_TRIPLET=x64-windows-static-md-release ` -DVCPKG_TARGET_TRIPLET=x64-windows-static-release `
-DVERBOSE_CONFIGURE=ON ` -DVERBOSE_CONFIGURE=ON `
--graphviz=build/target_graph.dot --graphviz=build/target_graph.dot
cmake --build build --target qbt_update_translations cmake --build build --target qbt_update_translations
@@ -148,51 +130,39 @@ jobs:
- name: Prepare build artifacts - name: Prepare build artifacts
run: | run: |
mkdir upload mkdir upload
mkdir upload/qBittorrent copy build/qbittorrent.exe upload
copy build/qbittorrent.exe upload/qBittorrent copy build/qbittorrent.pdb upload
copy build/qbittorrent.pdb upload/qBittorrent copy dist/windows/qt.conf upload
copy dist/windows/qt.conf upload/qBittorrent
# runtimes # runtimes
copy "${{ env.Qt6_DIR }}/bin/Qt6Core.dll" upload/qBittorrent copy "${{ env.Qt6_DIR }}/bin/Qt6Core.dll" upload
copy "${{ env.Qt6_DIR }}/bin/Qt6Gui.dll" upload/qBittorrent copy "${{ env.Qt6_DIR }}/bin/Qt6Gui.dll" upload
copy "${{ env.Qt6_DIR }}/bin/Qt6Network.dll" upload/qBittorrent copy "${{ env.Qt6_DIR }}/bin/Qt6Network.dll" upload
copy "${{ env.Qt6_DIR }}/bin/Qt6Sql.dll" upload/qBittorrent copy "${{ env.Qt6_DIR }}/bin/Qt6Sql.dll" upload
copy "${{ env.Qt6_DIR }}/bin/Qt6Svg.dll" upload/qBittorrent copy "${{ env.Qt6_DIR }}/bin/Qt6Svg.dll" upload
copy "${{ env.Qt6_DIR }}/bin/Qt6Widgets.dll" upload/qBittorrent copy "${{ env.Qt6_DIR }}/bin/Qt6Widgets.dll" upload
copy "${{ env.Qt6_DIR }}/bin/Qt6Xml.dll" upload/qBittorrent copy "${{ env.Qt6_DIR }}/bin/Qt6Xml.dll" upload
mkdir upload/qBittorrent/plugins/iconengines mkdir upload/plugins/iconengines
copy "${{ env.Qt6_DIR }}/plugins/iconengines/qsvgicon.dll" upload/qBittorrent/plugins/iconengines copy "${{ env.Qt6_DIR }}/plugins/iconengines/qsvgicon.dll" upload/plugins/iconengines
mkdir upload/qBittorrent/plugins/imageformats mkdir upload/plugins/imageformats
copy "${{ env.Qt6_DIR }}/plugins/imageformats/qico.dll" upload/qBittorrent/plugins/imageformats copy "${{ env.Qt6_DIR }}/plugins/imageformats/qico.dll" upload/plugins/imageformats
copy "${{ env.Qt6_DIR }}/plugins/imageformats/qsvg.dll" upload/qBittorrent/plugins/imageformats copy "${{ env.Qt6_DIR }}/plugins/imageformats/qsvg.dll" upload/plugins/imageformats
mkdir upload/qBittorrent/plugins/platforms mkdir upload/plugins/platforms
copy "${{ env.Qt6_DIR }}/plugins/platforms/qwindows.dll" upload/qBittorrent/plugins/platforms copy "${{ env.Qt6_DIR }}/plugins/platforms/qwindows.dll" upload/plugins/platforms
mkdir upload/qBittorrent/plugins/sqldrivers mkdir upload/plugins/sqldrivers
copy "${{ env.Qt6_DIR }}/plugins/sqldrivers/qsqlite.dll" upload/qBittorrent/plugins/sqldrivers copy "${{ env.Qt6_DIR }}/plugins/sqldrivers/qsqlite.dll" upload/plugins/sqldrivers
mkdir upload/qBittorrent/plugins/styles mkdir upload/plugins/styles
copy "${{ env.Qt6_DIR }}/plugins/styles/qwindowsvistastyle.dll" upload/qBittorrent/plugins/styles copy "${{ env.Qt6_DIR }}/plugins/styles/qwindowsvistastyle.dll" upload/plugins/styles
mkdir upload/qBittorrent/plugins/tls mkdir upload/plugins/tls
copy "${{ env.Qt6_DIR }}/plugins/tls/qschannelbackend.dll" upload/qBittorrent/plugins/tls copy "${{ env.Qt6_DIR }}/plugins/tls/qschannelbackend.dll" upload/plugins/tls
# cmake additionals # cmake additionals
mkdir upload/cmake mkdir upload/cmake
copy build/compile_commands.json upload/cmake copy build/compile_commands.json upload/cmake
copy build/target_graph.dot upload/cmake copy build/target_graph.dot upload/cmake
mkdir upload/cmake/libtorrent mkdir upload/cmake/libtorrent
copy ${{ env.libtorrent_path }}/build/compile_commands.json upload/cmake/libtorrent copy libtorrent/build/compile_commands.json upload/cmake/libtorrent
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: qBittorrent-CI_Windows-x64_libtorrent-${{ matrix.libt_version }} name: qBittorrent-CI_Windows-x64_libtorrent-${{ matrix.libt_version }}
path: upload path: upload
- name: Create installer
run: |
7z x -o"dist/windows/" "dist/windows/NSISPlugins.zip"
makensis /DQBT_DIST_DIR="../../upload/qBittorrent" /WX dist/windows/qbittorrent.nsi
- name: Upload installer
uses: actions/upload-artifact@v4
with:
name: qBittorrent-CI_Windows-x64_libtorrent-${{ matrix.libt_version }}-setup
path: dist/windows/qbittorrent_*_setup.exe

View File

@@ -12,82 +12,48 @@ jobs:
name: Scan name: Scan
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
libt_version: ["2.0.10"]
qbt_gui: ["GUI=ON"]
qt_version: ["6.5.2"]
env:
boost_path: "${{ github.workspace }}/../boost"
coverity_path: "${{ github.workspace }}/../coverity"
libtorrent_path: "${{ github.workspace }}/../libtorrent"
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt update sudo apt update
sudo apt install \ sudo apt install \
build-essential cmake ninja-build \ build-essential cmake ninja-build pkg-config \
libssl-dev libxkbcommon-x11-dev libxcb-cursor-dev zlib1g-dev libboost-dev libssl-dev zlib1g-dev
- name: Install boost
env:
BOOST_MAJOR_VERSION: "1"
BOOST_MINOR_VERSION: "84"
BOOST_PATCH_VERSION: "0"
run: |
boost_url="https://boostorg.jfrog.io/artifactory/main/release/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/source/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
boost_url2="https://sourceforge.net/projects/boost/files/boost/${{ env.BOOST_MAJOR_VERSION }}.${{ env.BOOST_MINOR_VERSION }}.${{ env.BOOST_PATCH_VERSION }}/boost_${{ env.BOOST_MAJOR_VERSION }}_${{ env.BOOST_MINOR_VERSION }}_${{ env.BOOST_PATCH_VERSION }}.tar.gz"
set +e
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
if [ "$_exitCode" -ne "0" ]; then
curl -L -o "${{ runner.temp }}/boost.tar.gz" "$boost_url2"
tar -xf "${{ runner.temp }}/boost.tar.gz" -C "${{ github.workspace }}/.."; _exitCode="$?"
fi
mv "${{ github.workspace }}/.."/boost_* "${{ env.boost_path }}"
- name: Install Qt - name: Install Qt
uses: jurplel/install-qt-action@v3 uses: jurplel/install-qt-action@v3
with: with:
version: ${{ matrix.qt_version }} version: "6.5.0"
archives: icu qtbase qtdeclarative qtsvg qttools archives: icu qtbase qtsvg qttools
cache: true
- name: Install libtorrent - name: Install libtorrent
run: | run: |
git clone \ git clone \
--branch v${{ matrix.libt_version }} \ --branch "v2.0.9" \
--depth 1 \ --depth 1 \
--recurse-submodules \ --recurse-submodules \
https://github.com/arvidn/libtorrent.git \ https://github.com/arvidn/libtorrent.git
${{ env.libtorrent_path }} cd libtorrent
cd ${{ env.libtorrent_path }}
cmake \ cmake \
-B build \ -B build \
-G "Ninja" \ -G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBOOST_ROOT="${{ env.boost_path }}" \
-Ddeprecated-functions=OFF -Ddeprecated-functions=OFF
cmake --build build cmake --build build
sudo cmake --install build sudo cmake --install build
- name: Download Coverity Build Tool - name: Download Coverity Build Tool
run: | run: |
curl \ wget \
-L \ -q \
-d "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=qbittorrent%2FqBittorrent" \ https://scan.coverity.com/download/linux64 \
-o "${{ runner.temp }}/coverity_tool.tgz" \ --post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=qbittorrent%2FqBittorrent" \
"https://scan.coverity.com/download/linux64" -O coverity_tool.tgz
mkdir -p ${{ env.coverity_path }} mkdir coverity_tool
tar \ tar xzf coverity_tool.tgz --strip 1 -C coverity_tool
-xf "${{ runner.temp }}/coverity_tool.tgz" \
-C "${{ env.coverity_path }}" \
--strip-components 1
- name: Build qBittorrent - name: Build qBittorrent
run: | run: |
@@ -95,13 +61,11 @@ jobs:
-B build \ -B build \
-G "Ninja" \ -G "Ninja" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBOOST_ROOT="${{ env.boost_path }}" \ -DGUI=ON \
-DVERBOSE_CONFIGURE=ON \ -DQT6=ON \
-D${{ matrix.qbt_gui }} -DVERBOSE_CONFIGURE=ON
PATH="${{ env.coverity_path }}/bin:$PATH" \ export PATH="$(pwd)/coverity_tool/bin:$PATH"
cov-build \ cov-build --dir cov-int cmake --build build
--dir cov-int \
cmake --build build
- name: Submit the result to Coverity Scan - name: Submit the result to Coverity Scan
run: | run: |

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Mark and close stale PRs - name: Mark and close stale PRs
uses: actions/stale@v9 uses: actions/stale@v8
with: with:
stale-pr-message: "This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity." stale-pr-message: "This PR is stale because it has been 60 days with no activity. This PR will be automatically closed within 7 days if there is no further activity."
close-pr-message: "This PR was closed because it has been stalled for some time with no activity." close-pr-message: "This PR was closed because it has been stalled for some time with no activity."

5
.gitignore vendored
View File

@@ -1,4 +1,3 @@
.vscode/
src/gui/geoip/GeoIP.dat src/gui/geoip/GeoIP.dat
src/gui/geoip/GeoIP.dat.gz src/gui/geoip/GeoIP.dat.gz
src/qbittorrent src/qbittorrent
@@ -17,7 +16,6 @@ Makefile*
*.o *.o
*.pdb *.pdb
*.exe *.exe
*.dll
# Generated MOC, resource and UI files # Generated MOC, resource and UI files
moc_*.cpp moc_*.cpp
@@ -25,7 +23,8 @@ moc_*.h
qrc_*.cpp qrc_*.cpp
ui_*.h ui_*.h
*.moc *.moc
*.qm src/lang/qbittorrent_*.qm
src/webui/www/translations/webui_*.qm
.DS_Store .DS_Store
.qmake.stash .qmake.stash
src/qbittorrent.app src/qbittorrent.app

View File

@@ -13,7 +13,7 @@ repos:
- ts - ts
- repo: https://github.com/pre-commit/pre-commit-hooks.git - repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.5.0 rev: v4.4.0
hooks: hooks:
- id: check-json - id: check-json
name: Check JSON files name: Check JSON files
@@ -35,7 +35,6 @@ repos:
(?x)^( (?x)^(
src/webui/www/private/css/lib/.* | src/webui/www/private/css/lib/.* |
src/webui/www/private/scripts/lib/.* | src/webui/www/private/scripts/lib/.* |
dist/windows/license.txt |
test/testdata/crlf.txt test/testdata/crlf.txt
)$ )$
@@ -62,12 +61,12 @@ repos:
exclude_types: exclude_types:
- ts - ts
- repo: https://github.com/codespell-project/codespell.git - repo: https://github.com/codespell-project/codespell
rev: v2.2.6 rev: v2.2.5
hooks: hooks:
- id: codespell - id: codespell
name: Check spelling (codespell) name: Check spelling (codespell)
args: ["--ignore-words-list", "additionals,curren,fo,ist,ket,superseeding,te,ths"] args: ["--ignore-words-list", "additionals,curren,fo,ket,superseeding,te,ths"]
exclude: | exclude: |
(?x)^( (?x)^(
.*\.desktop | .*\.desktop |
@@ -78,17 +77,13 @@ repos:
m4/.* | m4/.* |
src/base/3rdparty/.* | src/base/3rdparty/.* |
src/searchengine/nova3/socks.py | src/searchengine/nova3/socks.py |
src/webui/www/private/lang/.* | src/webui/www/private/scripts/lib/.*
src/webui/www/private/scripts/lib/.* |
src/webui/www/public/lang/.* |
src/webui/www/public/scripts/lib/.* |
src/webui/www/transifex/.*
)$ )$
exclude_types: exclude_types:
- ts - ts
- repo: https://github.com/crate-ci/typos.git - repo: https://github.com/crate-ci/typos
rev: v1.16.18 rev: v1.15.5
hooks: hooks:
- id: typos - id: typos
name: Check spelling (typos) name: Check spelling (typos)
@@ -106,11 +101,7 @@ repos:
m4/.* | m4/.* |
src/base/3rdparty/.* | src/base/3rdparty/.* |
src/searchengine/nova3/socks.py | src/searchengine/nova3/socks.py |
src/webui/www/private/lang/.* | src/webui/www/private/scripts/lib/.*
src/webui/www/private/scripts/lib/.* |
src/webui/www/public/lang/.* |
src/webui/www/public/scripts/lib/.* |
src/webui/www/transifex/.*
)$ )$
exclude_types: exclude_types:
- svg - svg

View File

@@ -17,14 +17,6 @@ type = QT
minimum_perc = 23 minimum_perc = 23
lang_map = pt: pt_PT, zh: zh_CN lang_map = pt: pt_PT, zh: zh_CN
[o:sledgehammer999:p:qbittorrent:r:qbittorrent_webui_json]
file_filter = src/webui/www/transifex/<lang>.json
source_file = src/webui/www/transifex/en.json
source_lang = en
type = KEYVALUEJSON
minimum_perc = 23
lang_map = pt: pt_PT, zh: zh_CN
[o:sledgehammer999:p:qbittorrent:r:qbittorrentdesktop_master] [o:sledgehammer999:p:qbittorrent:r:qbittorrentdesktop_master]
source_file = dist/unix/org.qbittorrent.qBittorrent.desktop source_file = dist/unix/org.qbittorrent.qBittorrent.desktop
source_lang = en source_lang = en

10
AUTHORS
View File

@@ -53,7 +53,7 @@ Images Authors:
* file: src/icons/qbittorrent-tray-dark.svg src/icons/qbittorrent-tray-light.svg * file: src/icons/qbittorrent-tray-dark.svg src/icons/qbittorrent-tray-light.svg
copyright: Daniel Eguren <deguren@gmail.com> copyright: Daniel Eguren <deguren@gmail.com>
modified by: now-im <now-im.d8gcu@simplelogin.com> (@now-im) modified by: Nowshed H. Imran <nowshed.imran@gmail.com> (@now-im)
license: LGPL license: LGPL
* folder: src/icons/ * folder: src/icons/
@@ -63,7 +63,7 @@ Images Authors:
media-seek-forward.svg, network-connect.svg, object-locked.svg, queued.svg, ratio.svg, reannounce.svg, slow_off.svg, slow.svg, media-seek-forward.svg, network-connect.svg, object-locked.svg, queued.svg, ratio.svg, reannounce.svg, slow_off.svg, slow.svg,
speedometer.svg, system-log-out.svg, tags.svg, task-complete.svg, task-reject.svg, tracker-error.svg, tracker-warning.svg, speedometer.svg, system-log-out.svg, tags.svg, task-complete.svg, task-reject.svg, tracker-error.svg, tracker-warning.svg,
trackerless.svg, trackers.svg, view-categories.svg trackerless.svg, trackers.svg, view-categories.svg
copyright: now-im <now-im.d8gcu@simplelogin.com> (@now-im) modified from La-Capitaine icon theme (https://github.com/keeferrourke/la-capitaine-icon-theme) copyright: Nowshed H. Imran <nowshed.imran@gmail.com> (@now-im) modified from La-Capitaine icon theme (https://github.com/keeferrourke/la-capitaine-icon-theme)
license: GPLv3+ license: GPLv3+
* folder: src/icons/ * folder: src/icons/
@@ -76,18 +76,18 @@ Images Authors:
name.svg, network-server.svg, office-chart-line.svg, plugins.svg, preferences-desktop.svg, preferences-other.svg, name.svg, network-server.svg, office-chart-line.svg, plugins.svg, preferences-desktop.svg, preferences-other.svg,
preferences-system-network.svg, security-high.svg, security-low.svg, set-location.svg, torrent-creator.svg, user-group-delete.svg, preferences-system-network.svg, security-high.svg, security-low.svg, set-location.svg, torrent-creator.svg, user-group-delete.svg,
user-group-new.svg, view-preview.svg, view-refresh.svg, view-statistics.svg, wallet-open.svg, webui.svg user-group-new.svg, view-preview.svg, view-refresh.svg, view-statistics.svg, wallet-open.svg, webui.svg
copyright: now-im <now-im.d8gcu@simplelogin.com> (@now-im) modified from Ionicons icon theme (https://github.com/ionic-team/ionicons) copyright: Nowshed H. Imran <nowshed.imran@gmail.com> (@now-im) modified from Ionicons icon theme (https://github.com/ionic-team/ionicons)
license: MIT license: MIT
* folder: src/icons/ * folder: src/icons/
files: force-recheck.svg files: force-recheck.svg
copyright: now-im <now-im.d8gcu@simplelogin.com> (@now-im) modified from Font-Awesome icon theme (https://github.com/FortAwesome/Font-Awesome) copyright: Nowshed H. Imran <nowshed.imran@gmail.com> (@now-im) modified from Font-Awesome icon theme (https://github.com/FortAwesome/Font-Awesome)
license: CC BY 4.0 License license: CC BY 4.0 License
* folder: src/icons/ * folder: src/icons/
files: downloading.svg, edit-clear.svg, error.svg, filter-active.svg, filter-inactive.svg, filter-stalled.svg, kt-set-max-download-speed.svg, files: downloading.svg, edit-clear.svg, error.svg, filter-active.svg, filter-inactive.svg, filter-stalled.svg, kt-set-max-download-speed.svg,
kt-set-max-upload-speed.svg, list-add.svg, preferences-web-browser-cookies.svg, stalledDL.svg, stalledUP.svg kt-set-max-upload-speed.svg, list-add.svg, preferences-web-browser-cookies.svg, stalledDL.svg, stalledUP.svg
copyright: now-im <now-im.d8gcu@simplelogin.com> (@now-im) copyright: Nowshed H. Imran <nowshed.imran@gmail.com> (@now-im)
license: BSD 2-Clause License license: BSD 2-Clause License
Translations authors: Translations authors:

View File

@@ -7,13 +7,15 @@ project(qBittorrent
) )
# version requirements - older versions may work, but you are on your own # version requirements - older versions may work, but you are on your own
set(minBoostVersion 1.76) set(minBoostVersion 1.71)
set(minQt6Version 6.5.0) set(minQt5Version 5.15.2)
set(minOpenSSLVersion 3.0.2) set(minQt6Version 6.2)
set(minOpenSSLVersion 1.1.1)
set(minLibtorrent1Version 1.2.19) set(minLibtorrent1Version 1.2.19)
set(minLibtorrentVersion 2.0.9) set(minLibtorrentVersion 2.0.9)
set(minZlibVersion 1.2.11) set(minZlibVersion 1.2.11)
include(CheckCXXSourceCompiles) # TODO: migrate to CheckSourceCompiles in CMake >= 3.19
include(GNUInstallDirs) include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
@@ -23,25 +25,21 @@ include(FeatureOptionsSetup)
# features, list is loosely sorted by user's interests # features, list is loosely sorted by user's interests
feature_option(GUI "Build GUI application" ON) feature_option(GUI "Build GUI application" ON)
feature_option(WEBUI "Enable built-in HTTP server for remote control" ON) feature_option(WEBUI "Enable built-in HTTP server for remote control" ON)
feature_option(QT6 "Build with Qt 6 instead of Qt 5" OFF)
feature_option(STACKTRACE "Enable stacktrace support" ON) feature_option(STACKTRACE "Enable stacktrace support" ON)
feature_option(TESTING "Build internal testing suite" OFF) feature_option(TESTING "Build internal testing suite" OFF)
feature_option(VERBOSE_CONFIGURE "Show information about PACKAGES_FOUND and PACKAGES_NOT_FOUND in the configure output (only useful for debugging the CMake build scripts)" OFF) feature_option(VERBOSE_CONFIGURE "Show information about PACKAGES_FOUND and PACKAGES_NOT_FOUND in the configure output (only useful for debugging the CMake build scripts)" OFF)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
feature_option_dependent(DBUS feature_option_dependent(DBUS
"Enable support for notifications and power-management features via D-Bus" "Enable support for notifications and power-management features via D-Bus on Linux"
ON "GUI" OFF ON "GUI" OFF
) )
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
feature_option_dependent(SYSTEMD feature_option_dependent(SYSTEMD
"Install systemd service file. Target directory is overridable with `SYSTEMD_SERVICES_INSTALL_DIR` variable" "Install systemd service file. Target directory is overridable with `SYSTEMD_SERVICES_INSTALL_DIR` variable"
OFF "NOT GUI" OFF OFF "NOT GUI" OFF
) )
endif() elseif (MSVC)
if (MSVC)
feature_option(MSVC_RUNTIME_DYNAMIC "Use MSVC dynamic runtime library (-MD) instead of static (-MT)" ON) feature_option(MSVC_RUNTIME_DYNAMIC "Use MSVC dynamic runtime library (-MD) instead of static (-MT)" ON)
endif() endif()

View File

@@ -276,7 +276,7 @@ struct StructName {};
enum EnumName {}; enum EnumName {};
using SomeList = QList<ClassName>; typedef QList<ClassName> SomeList;
namespace NamespaceName namespace NamespaceName
{ {
@@ -318,7 +318,7 @@ The headers should be ordered alphabetically within each group. \
If there are conditionals for the same header group, then put them at the bottom of the respective group. \ If there are conditionals for the same header group, then put them at the bottom of the respective group. \
If there are conditionals that contain headers from several different header groups, then put them above the "qBittorrent's own headers" group. If there are conditionals that contain headers from several different header groups, then put them above the "qBittorrent's own headers" group.
One exception is the header containing the library version (for example, QtVersionChecks), this particular header isn't constrained by the aforementioned order. One exception is the header containing the library version (for example, QtGlobal), this particular header isn't constrained by the aforementioned order.
Example: Example:
@@ -331,7 +331,7 @@ Example:
// exceptions, headers containing version number // exceptions, headers containing version number
#include <boost/version.hpp> #include <boost/version.hpp>
#include <libtorrent/version.hpp> #include <libtorrent/version.hpp>
#include <QtVersionChecks> #include <QtGlobal>
// C++ Standard Library headers // C++ Standard Library headers
#include <cstdio> #include <cstdio>
@@ -342,7 +342,7 @@ Example:
// System headers // System headers
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
#include <windows.h> #include <Windows.h>
#endif #endif
// Boost library headers // Boost library headers

285
Changelog

File diff suppressed because it is too large Load Diff

20
INSTALL
View File

@@ -3,20 +3,20 @@ qBittorrent - A BitTorrent client in C++ / Qt
1) Install these dependencies: 1) Install these dependencies:
- Boost >= 1.76 - Boost >= 1.71
- libtorrent-rasterbar 1.2.19 - 1.2.x || 2.0.9 - 2.0.x - libtorrent-rasterbar 1.2.19 - 1.2.x || 2.0.9 - 2.0.x
* By Arvid Norberg, https://www.libtorrent.org/ * By Arvid Norberg, https://www.libtorrent.org/
* Be careful: another library (the one used by rTorrent) uses a similar name * Be careful: another library (the one used by rTorrent) uses a similar name
- OpenSSL >= 3.0.2 - OpenSSL >= 1.1.1
- Qt 6.5.0 - 6.x - Qt 5.15.2 - 5.x || 6.2.0 - 6.x
- zlib >= 1.2.11 - zlib >= 1.2.11
- CMake >= 3.16 - pkg-config *
* Compile-time only * Compile-time only on *nix systems
- Python >= 3.7.0 - Python >= 3.7.0
* Optional, run-time only * Optional, run-time only
@@ -28,18 +28,16 @@ Please ensure you are building with an officially supported configuration when r
2a) Compile and install qBittorrent with Qt graphical interface 2a) Compile and install qBittorrent with Qt graphical interface
$ cmake -B build -DCMAKE_BUILD_TYPE=Release $ ./configure
$ cmake --build build $ make && make install
$ cmake --install build
$ qbittorrent $ qbittorrent
will install and execute qBittorrent. will install and execute qBittorrent.
2b) Compile and install qBittorrent without Qt graphical interface 2b) Compile and install qBittorrent without Qt graphical interface
$ cmake -B build -DCMAKE_BUILD_TYPE=Release -DGUI=OFF $ ./configure --disable-gui
$ cmake --build build $ make && make install
$ cmake --install build
$ qbittorrent-nox $ qbittorrent-nox
will install and execute qBittorrent. will install and execute qBittorrent.

View File

@@ -1,7 +1,8 @@
qBittorrent - A BitTorrent client in Qt qBittorrent - A BitTorrent client in Qt
------------------------------------------ ------------------------------------------
[![GitHub Actions CI Status](https://github.com/qbittorrent/qBittorrent/actions/workflows/ci_ubuntu.yaml/badge.svg)](https://github.com/qbittorrent/qBittorrent/actions) [![AppVeyor Status](https://ci.appveyor.com/api/projects/status/github/qbittorrent/qBittorrent?branch=master&svg=true)](https://ci.appveyor.com/project/qbittorrent/qBittorrent)
[![GitHub Actions CI Status](https://github.com/qbittorrent/qBittorrent/workflows/GitHub%20Actions%20CI/badge.svg)](https://github.com/qbittorrent/qBittorrent/actions)
[![Coverity Status](https://scan.coverity.com/projects/5494/badge.svg)](https://scan.coverity.com/projects/5494) [![Coverity Status](https://scan.coverity.com/projects/5494/badge.svg)](https://scan.coverity.com/projects/5494)
******************************** ********************************
### Description: ### Description:
@@ -15,8 +16,15 @@ support as well as many features.
The free [IP to Country Lite database](https://db-ip.com/db/download/ip-to-country-lite) by [DB-IP](https://db-ip.com/) is used for resolving the countries of peers. The database is licensed under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/). The free [IP to Country Lite database](https://db-ip.com/db/download/ip-to-country-lite) by [DB-IP](https://db-ip.com/) is used for resolving the countries of peers. The database is licensed under the [Creative Commons Attribution 4.0 International License](https://creativecommons.org/licenses/by/4.0/).
### Installation: ### Installation:
For installation, follow the instructions from INSTALL file, but simple:
Refer to the [INSTALL](INSTALL) file. ```
./configure
make && make install
qbittorrent
```
will install and execute qBittorrent hopefully without any problem.
### Public key: ### Public key:
Starting from v3.3.4 all source tarballs and binaries are signed.<br /> Starting from v3.3.4 all source tarballs and binaries are signed.<br />

4
bootstrap.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
aclocal -I m4
autoconf

348
build-aux/compile Executable file

File diff suppressed because it is too large Load Diff

1665
build-aux/config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

1793
build-aux/config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

518
build-aux/install-sh Executable file

File diff suppressed because it is too large Load Diff

215
build-aux/missing Executable file
View File

@@ -0,0 +1,215 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2018-03-07.03; # UTC
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# Run the given program, remember its exit status.
"$@"; st=$?
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=https://www.perl.org/
flex_URL=https://github.com/westes/flex
gnu_software_URL=https://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:

View File

@@ -46,11 +46,22 @@ set_property(CACHE LibtorrentRasterbar_DIR PROPERTY TYPE PATH)
find_package(Boost ${minBoostVersion} REQUIRED) find_package(Boost ${minBoostVersion} REQUIRED)
find_package(OpenSSL ${minOpenSSLVersion} REQUIRED) find_package(OpenSSL ${minOpenSSLVersion} REQUIRED)
find_package(ZLIB ${minZlibVersion} REQUIRED) find_package(ZLIB ${minZlibVersion} REQUIRED)
find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS Core Network Sql Xml LinguistTools) if (QT6)
if (DBUS) find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS Core Network Sql Xml LinguistTools)
if (DBUS)
find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS DBus) find_package(Qt6 ${minQt6Version} REQUIRED COMPONENTS DBus)
set_package_properties(Qt6DBus PROPERTIES set_package_properties(Qt6DBus PROPERTIES
DESCRIPTION "Qt6 module for inter-process communication over the D-Bus protocol" DESCRIPTION "Qt6 module for inter-process communication over the D-Bus protocol"
PURPOSE "Required by the DBUS feature" PURPOSE "Required by the DBUS feature"
) )
endif()
else()
find_package(Qt5 ${minQt5Version} REQUIRED COMPONENTS Core Network Sql Xml LinguistTools)
if (DBUS)
find_package(Qt5 ${minQt5Version} REQUIRED COMPONENTS DBus)
set_package_properties(Qt5DBus PROPERTIES
DESCRIPTION "Qt5 module for inter-process communication over the D-Bus protocol"
PURPOSE "Required by the DBUS feature"
)
endif()
endif() endif()

View File

@@ -8,19 +8,19 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON) set(CMAKE_AUTORCC ON)
set(CMAKE_AUTORCC_OPTIONS --compress-algo best --threshold 5) set(CMAKE_AUTORCC_OPTIONS --compress 9 --threshold 5)
add_library(qbt_common_cfg INTERFACE) add_library(qbt_common_cfg INTERFACE)
# C++ 20 support is required # Full C++ 17 support is required
# See also https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html # See also https://cmake.org/cmake/help/latest/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html
# for a breakdown of the features that CMake recognizes for each C++ standard # for a breakdown of the features that CMake recognizes for each C++ standard
target_compile_features(qbt_common_cfg INTERFACE target_compile_features(qbt_common_cfg INTERFACE
cxx_std_20 cxx_std_17
) )
target_compile_definitions(qbt_common_cfg INTERFACE target_compile_definitions(qbt_common_cfg INTERFACE
QT_DISABLE_DEPRECATED_UP_TO=0x060500 QT_DISABLE_DEPRECATED_BEFORE=0x050f02
QT_NO_CAST_FROM_ASCII QT_NO_CAST_FROM_ASCII
QT_NO_CAST_TO_ASCII QT_NO_CAST_TO_ASCII
QT_NO_CAST_FROM_BYTEARRAY QT_NO_CAST_FROM_BYTEARRAY
@@ -38,9 +38,9 @@ endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Windows") if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
target_compile_definitions(qbt_common_cfg INTERFACE target_compile_definitions(qbt_common_cfg INTERFACE
NTDDI_VERSION=0x0A000006 NTDDI_VERSION=0x06010000
_WIN32_WINNT=0x0A00 _WIN32_WINNT=0x0601
_WIN32_IE=0x0A00 _WIN32_IE=0x0601
WIN32_LEAN_AND_MEAN WIN32_LEAN_AND_MEAN
NOMINMAX NOMINMAX
UNICODE UNICODE
@@ -83,7 +83,6 @@ endif()
if (MSVC) if (MSVC)
target_compile_options(qbt_common_cfg INTERFACE target_compile_options(qbt_common_cfg INTERFACE
/guard:cf /guard:cf
/permissive-
/utf-8 /utf-8
# https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ # https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
/Zc:__cplusplus /Zc:__cplusplus

26
conf.pri.in Normal file
View File

@@ -0,0 +1,26 @@
# @configure_input@
PREFIX = @EXPAND_PREFIX@
BINDIR = @EXPAND_BINDIR@
DATADIR = @EXPAND_DATADIR@
MANPREFIX = @EXPAND_MANDIR@
QMAKE_CC = @QBT_CC@
QMAKE_CXX = @QBT_CXX@
QMAKE_CXXFLAGS += @QBT_CONF_EXTRA_CFLAGS@
EXTERNAL_INCLUDES = @QBT_CONF_INCLUDES@
EXTERNAL_INCLUDES -= $$QMAKE_DEFAULT_INCDIRS
# added /usr/local/include due to Qt 5.7.0 bug on macOS
macx: EXTERNAL_INCLUDES += "/usr/local/include"
INCLUDEPATH += $$EXTERNAL_INCLUDES
EXTERNAL_LIBS = @LDFLAGS@ @LIBS@
EXTERNAL_LIBS -= $$QMAKE_DEFAULT_LIBDIRS
LIBS += $$EXTERNAL_LIBS
CONFIG += @QBT_ADD_CONFIG@
CONFIG -= @QBT_REMOVE_CONFIG@
DEFINES += @QBT_ADD_DEFINES@
DEFINES -= @QBT_REMOVE_DEFINES@

58
conf.pri.windows Normal file
View File

@@ -0,0 +1,58 @@
# Adapt these paths
# Point these to the include folders
INCLUDEPATH += $$quote(C:/qBittorrent/boost)
INCLUDEPATH += $$quote(C:/qBittorrent/libtorrent/include)
INCLUDEPATH += $$quote(C:/qBittorrent/zlib/include)
INCLUDEPATH += $$quote(C:/qBittorrent/openssl/include)
# Point these to the lib folders
LIBS += $$quote(-LC:/qBittorrent/boost/stage/lib)
LIBS += $$quote(-LC:/qBittorrent/libtorrent/lib)
LIBS += $$quote(-LC:/qBittorrent/zlib/lib)
LIBS += $$quote(-LC:/qBittorrent/openssl/lib)
# Adapt the lib names/versions accordingly
# If you want to use Boost auto-linking then disable
# BOOST_ALL_NO_LIB below and omit Boost libraries here
LIBS += libcrypto.lib libssl.lib libtorrent.lib zlib.lib
CONFIG(debug, debug|release) {
LIBS += boost_system-vc140-mt-d.lib
}
else {
LIBS += boost_system-vc140-mt.lib
}
# ...or if you use MinGW
#LIBS += libcrypto libssl libz
#CONFIG(debug, debug|release) {
# LIBS += libtorrent-rasterbar \
# libboost_system-mt
#}
#else {
# LIBS += libtorrent-rasterbar \
# libboost_system-mt
#}
# Disable to use Boost auto-linking
DEFINES += BOOST_ALL_NO_LIB
# Use one of the following options
DEFINES += BOOST_SYSTEM_STATIC_LINK
#DEFINES += BOOST_SYSTEM_DYN_LINK
# Enable it if compiling with libtorrent 3.x
#DEFINES += BOOST_SYSTEM_USE_UTF8
# Enable if libtorrent was built with this flag defined
#DEFINES += TORRENT_NO_DEPRECATE
# Enable if linking dynamically against libtorrent
#DEFINES += TORRENT_LINKING_SHARED
# Enable this if compiling with libtorrent 2.x
#DEFINES += QBT_USES_LIBTORRENT2
# Enable stack trace support
CONFIG += stacktrace
win32-msvc* {
QMAKE_CXXFLAGS += "/guard:cf"
QMAKE_LFLAGS += "/guard:cf"
QMAKE_LFLAGS_RELEASE += "/OPT:REF /OPT:ICF"
}

Some files were not shown because too many files have changed in this diff Show More