Commit Graph

233 Commits

Author SHA1 Message Date
Yat Ho
4f7b932fee build: correctly set MSVC __cplusplus (#8120)
* build: correctly set MSVC `__cplusplus`

* refactor: let utf8cpp infer `UTF_CPP_CPLUSPLUS`
2026-01-13 15:02:50 -06:00
Charles Kerr
8dea0e863f fix: several CI errors (#8124)
* Revert "build(cmake): support building with (almost) all system 3rd-party libraries (#7554)"

This reverts commit a89ca4f2c9.

* fixup! refactor: use a map of getters, setters for `session_get` and `session_set` properties (#8024)

fix: capture-by-reference error in session_accessors()

* fix: 'Qt depends on a UTF-8 locale' CI warning

* fix: 'qt.qpa.xcb: could not connect to display' CI error
2026-01-13 13:16:40 -06:00
Yat Ho
a89ca4f2c9 build(cmake): support building with (almost) all system 3rd-party libraries (#7554)
* build: overhaul tr_add_external_auto_library

* build: use package-provided CMake config file libevent

* build: use package-provided CMake config file miniupnpc

* build: update libutp find module

* build: make LIBNAME an optional parameter

* build: use package-provided CMake config file libdeflate

* build: update libb64 find module

* build: update libnatpmp find module

* build: update libpsl find module

* build: support system fast_float library

* chore: reformat long brew commands

* build: support system fmt library

* build: support system rapidjson library

* build: support system small library

* build: support system library utf8cpp

* build: support system library WideInteger

* build: support system library gtest

* fix: incorrectly labeled test suites

* build: remove unused parameters from tr_add_external_auto_library

* build: update crc32c cmake script

* fix: dht system library

* fix: add libutp interface target

* code review: move TrGtest.cmake

* code review: move tr_get_fmt_version into Findfmt.cmake

* code review: use option() for gtest

* code review: move find_package(PkgConfig) out of loop

* build: delete FindCrc32c.cmake

Impossible to parse package version from distributed source files.

* code review: Finddht.cmake

* build: delete FindFastFloat.cmake

Impossible to parse package version from distributed source files.

* code review: Findfmt.cmake

* code review: Findlibb64.cmake

* code review: Findlibdeflate.cmake

* code review: Findlibevent.cmake

* code review: Findlibnatpmp.cmake

* code review: Findlibpsl.cmake

* code review: Findlibutp.cmake

* code review: Findlibminiupnpc.cmake

* code review: FindRapidJSON.cmake

* build: delete FindSmall.cmake

Impossible to parse package version from distributed source files.

* build: only accept cmake config package for utf8cpp

Impossible to parse package version from distributed source files.

* build: delete FindWideInteger.cmake

Impossible to parse package version from distributed source files.

* build: add `USE_SYSTEM_DEFAULT`

* ci: drop Fedora 40 and adopt Fedora 43

* ci: try to silence system header warnings

* ci: use `cmake --install`

* Revert "build: only accept cmake config package for utf8cpp"

This reverts commit 2158d631fd.

* build: harden utf8cpp find module

* chore: bump wide-integer

Pick up bf9398f9da and bcc726a30f

* refactor: gtest should be included with angled brackets

Now that gtest is built as a system library, it should be included with angled brackets instead of quotes.

* code review: fixup libutp variables before `find_package_handle_standard_args`

* code review: define `WIDE_INTEGER_HAS_LIMB_TYPE_UINT64` only for targets depending on WideInteger

* chore: bump wide-integer

Pickup 4b2258acac so that wide-integer tests won't run in Transmission project.
2026-01-12 09:04:47 -06:00
Charles Kerr
d177f9f903 test: add unit tests for Prefs (#8112)
* fix: hicpp-use-auto,modernize-use-auto

* refactor: make Prefs::getKey() a static method

refactor: make Prefs::isCore() a static method

refactor: make Prefs::type() a static method

* refactor: Application takes a Prefs& arg, not a std::unique_ptr<Prefs> arg

* fix: bugprone-exception-escape

save settings by calling prefs.save() from main()

* refactor: load settings by calling prefs.load() from main()

* refactor: use preferred declaration order in Prefs

* fixup! fix: bugprone-exception-escape

* refactor: add Prefs::current_values()

* refactor: clean up namespace use in Prefs.cc

* feat: add QString, QDateTime serializers

* test: add scaffolding for testing Qt code

test: add tests for Prefs

* refactor: remove unused #includes

* build: add clang-tidy rules to tests/qt/

* refactor: clean up the new test code a little

* chore: add missing copyright statement

* ci: ensure Qt6Test is installed

build: check for QTest when ENABLE_TESTS + ENABLE_QT are ON

* fixup! feat: add QString, QDateTime serializers

* fix: Wswitch warning

* build: do not disable tests in release/windows/build-qt5.psl, build-qt6.psl

* ci: set QT_QPA_PLATFORM for running new Qt tests

* test: build cleanly in Qt 5.15

* fixup! fixup! feat: add QString, QDateTime serializers

fix QDateTime serializer on macOS

* fixup! ci: set QT_QPA_PLATFORM for running new Qt tests

install xcb-util-cursor on alpine
2026-01-11 19:23:00 -06:00
Charles Kerr
a63bbf7273 chore: bump to 4.1.0-beta.5 (#8066) 2026-01-05 18:15:23 -06:00
Elek, David
6392f0c306 fix: opening torrent opens in an new tr instance (#7629) (#7841) 2025-12-28 15:50:45 -06:00
Charles Kerr
d5314e2c44 refactor: add libtransmission-app (#7978)
* refactor: add libtransmission-app

* refactor: add libtransmission-app/display-modes.h

* refactor: use app::SortMode, app:ShowMode in Qt client

* feat: add to_variant(), to_value() in serializer

* refactor: use app::SortMode in GTK client

* refactor: use app::ShowMode in GTK client

* refactor: make naming consistent with libtransmission-app
2025-12-22 20:05:57 -06:00
Charles Kerr
833e37dab5 build: bump Qt minimum to 5.15 (#7943)
* deps: bump QT_MINIMUM from 5.6 to 5.15

* chore: remove now-obsolete qt >= 5.8 checks

* chore: remove now-obsolete qt >= 5.14 checks
2025-12-18 07:39:25 -06:00
Charles Kerr
c92b42de9c chore: bump to 4.1.0-beta.4 (#7869)
* docs: add release notes for 4.1.0-beta.4

* chore: bump to Transmission 4.1.0-beta.3
2025-12-03 17:04:08 -06:00
Yat Ho
9dd9aab902 build: bump clang tools to 20 (#7573)
* build: bump to clang-format-20

* build: bump to clang-tidy-20

* chore: revert edc59ba5d8
2025-12-01 23:18:02 -06:00
Azamat H. Hackimov
5180e3b69c Generate imported targets for MbedTLS (#7631)
* Generate imported targets for MbedTLS

This change allows to use MbedTLS 3.6 config module without significant
code alteration which simplifies integration with future versions of
MbedTLS.

Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com>

* Update MBEDTLS_MINIMUM to 2.7

Code expects API from MbedTLS 2.x or later.

Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com>

---------

Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com>
2025-11-08 08:01:43 -06:00
Charles Kerr
f20fd5e373 chore: bump transmission 4.1.0 beta.3 (#7769)
* chore: bump to Transmission 4.1.0-beta.3

* docs: add release notes for 4.1.0-beta.3

* docs: update release notes
2025-11-05 17:54:17 -06:00
Yat Ho
5c7135c319 build: define GDK_VERSION_MIN_REQUIRED (#7633)
This suppresses deprecation warnings in newer GDK versions that weren't in the version that comes with our minimum GTKMM version.
2025-10-27 09:45:03 -05:00
Yat Ho
d31e77a494 chore: update transmission-web package (#7003)
* chore: update minor versions

* chore: bump to `style-loader@4`

major version change

* refactor: combine `#mainwin-toolbar:nth-last-child(2)` rule

* refactor: cleanup scss definitions

Notes: `.single-file` is no longer used in code

* chore: bump `esbuild-sass-plugin@3` `esbuild@0.25`

* chore: uninstall unused `stylelint-config-standard`

In fact, it was never used since added to `package.json`.

* chore: bump `stylelint@16` `stylelint-config-sass-guidelines@12`

* chore: bump `eslint@9` `eslint-plugin-sonarjs@1` `eslint-plugin-unicorn@61`

* chore: enable prettier for whole `transmission-web` package

* chore: bump `@primer/stylelint-config@13`

* chore: update minor versions

* build: remove lint config files from CMake dependency

* chore: bump minor versions

* chore: bump `eslint-plugin-sonarjs@3`

* ci: use `actions/setup-node@v4` to install Node.js

So that there's no risk of the OS package manager's Node.js version being too low.

Except in Alpine, which does not work with `actions/setup-node@v4`. Ref: https://github.com/actions/setup-node/issues/387

* chore: replace `lodash.isEqual` with `fast-deep-equal`

* chore: bump minor versions

* chore: re-generate package-lock.json

* chore: fix lint errors
2025-10-25 12:09:36 -05:00
Yat Ho
0715897fc8 feat: use canonical peer priority to decide which peers to keep (#6981)
* feat: CRC32-C

* feat: canonical peer priority calculation bep-40

* test: add test cases for IPv4 canonical peer priority

* refactor: compare by canonical priority

* fix: use network byte order for peer ports

* test: more cases

* build: xcode

Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* ci: test system crc32c library

---------

Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2025-10-25 12:05:20 -05:00
Yat Ho
d83e0e20b8 build: don't add third-party submodules to user package registry (#7648) 2025-10-13 23:30:45 -05:00
Yat Ho
0659f50373 chore: bump libnatpmp (#7536) 2025-05-01 11:53:38 +01:00
Yat Ho
67762b9eb5 chore: bump cmake_minimum_required to 3.16.3 (#7576)
* chore: bump cmake_minimum_required to 3.16.3 to match wide_integer

* build: unwrap CMP0092 from if

It was added in CMake 3.14
2025-05-01 02:03:46 +01:00
Charles Kerr
ac5c9e082d chore: bump transmission 4.1.0 beta.2 (#7484)
* chore: bump to Transmission 4.1.0-beta.2

* docs: add release notes for 4.1.0-beta.2

* docs: update release notes

* docs: update release notes
2025-03-10 18:05:53 -05:00
Dzmitry Neviadomski
7e87adcd91 Fix building transmission with C++23 (#6832)
* fix: operator== should return bool in tr_strbuf

Fixes build error with C++20/C++23

error: return type 'auto' of selected 'operator==' function for rewritten '!=' comparison is not 'bool'

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix: explicitly specify Blocklist::size() return type as size_t

Fixes building with C++20/C++23
error: no matching function for call to 'size'
function 'size' with deduced return type cannot be used before it is defined

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix: wrap runtime format strings with fmt::runtime in library, daemon and cli

fmt::format_string ctor is consteval with C++20
See https://github.com/fmtlib/fmt/issues/2438

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix: wrap runtime format strings with fmt::runtime for GTK client

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix: allow to override C and CXX standard via cmdline or env

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix: add job to check if transmission compiles with C++23

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* Address code review by mikedld

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix new found fmt build errors

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* Address code review by tearfur

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* fix: make tr_net_init_mgr singleton buildable with C++23

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

---------

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-03-10 13:08:57 -05:00
Charles Kerr
c3a8106077 docs: add 4.1.0-beta.1 notes (#7288)
* docs: add 4.1.0-beta.1 notes

* chore: bump version to 4.1.0-beta.1

* fixup! docs: add 4.1.0-beta.1 notes
2024-12-12 18:16:24 -06:00
Yat Ho
27955a9c8a fix: CI errors related to REBUILD_WEB (#7252)
* ci: bump debian image from 11 to 12

debian 11 has npm 7.5.2, which is lower than our minimum required version 8.0.307.

* build: find `npm.cmd` on Windows

* chore: trigger CI

* Revert "chore: trigger CI"

This reverts commit adc8f4ec981c94c4eab3c1499ea0c555f554a1d2.

* Revert "ci: bump debian image from 11 to 12"

This reverts commit 4730d350b3789ec8ab750ff57e713a59c3389831.

* ci: use `actions/setup-node` in debian 11

* ci: don't test `REBUILD_WEB` if only `libtransmission` changed

* ci: don't test `REBUILD_WEB` if only `third-party` changed
2024-11-24 19:51:13 -06:00
Yat Ho
2315903015 build: accept false constant other than OFF for REBUILD_WEB (#7219) 2024-11-03 16:50:04 -06:00
Yat Ho
1f36458e10 build: fail if clang-tidy is not found when -DRUN_CLANG_TIDY=ON (#7210) 2024-10-30 13:29:38 -05:00
Robin Seth Ekman
5260331732 build: enable clang-tidy by default (#4821) (#6989)
* build: enable clang-tidy by default (#4821)

* Apply suggestions from code review

* Disable clang-tidy for Android CI build
2024-08-26 00:11:37 +01:00
Cœur
d9d87eddd8 Bumping MACOSX_DEPLOYMENT_TARGET to 11.0 (#6911)
* Bumping MACOSX_DEPLOYMENT_TARGET to 11.0

* removing obsolete code and resources

* Add a build action for Transmission.xcodeproj

* removing obsolete code
2024-08-22 15:07:17 -05:00
Jason Beck
3e9f5f614a fix: Qt build missing an icon (#6683)
* Create a new shared location for icons and update qt scripts to package public icons

* Move the Faenza.qrc back to original location

* Revert "Move the Faenza.qrc back to original location"

This reverts commit 963e099d65.

* Replace Faenza to its original location

* Remove attribution for an image that does not exist
2024-07-18 02:12:18 +01:00
Yat Ho
78027a8e5b refactor: cleanup build for miniupnp (#6665)
* fix: remove redundant/outdated miniupnp cmake definitions

* refactor: simplify miniupnpc includes

* fix path to miniupnp

* fix: Xcode project

* fixup! fix: Xcode project

* code review: Xcode changes from mikedld

* refactor: drop miniupnpc support below `1.7`
2024-06-01 20:10:52 +01:00
Cœur
c63c66c737 fix: Sparkle Version Comparator (#5263)
* fix: Sparkle Version Comparator

* Code review: Reducing CFBundleVersion to three components and avoiding versionComparatorForUpdater

* adding +99 when it's a non-beta release

* code review: set CFBUNDLE_VERSION and unset components

* re-adding support for ignoring beta
2024-03-17 16:23:39 -05:00
Cœur
a72a93764e deps: update miniupnp to 2.3.4 (miniupnpc 2.2.6) (#6459)
* refactor: add miniupnp 2.3.0 as a submodule

* refactor: remove miniupnpc submodule

* deps: specify the 2.3.0 branch

* build: point to miniupnp monorepo subdirectory miniupnpc

* Fix building miniupnp from Xcode

* fixed miniupnp updateminiupnpcstrings.sh usage

* updating to miniupnpc 2.2.6

* fix build for Windows

* code review: removing the header move

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-03-15 18:19:51 -05:00
Dzmitry Neviadomski
8e35e526c6 chore: fix warnings when compiling macOS client with either Xcode or CMake (#6676)
* chore: fix CGFloat comparison warnings in macOS code.

There are 2 cases:
 1. Speed comparisons.
    The lowest significant value displayed in UI is 0.1 bytes per sec.
    See [NSString stringForSpeed] and [NSString stringForSpeedCompact].
 2. Ratio limit comparison.
    The lowest significant value displayed in UI is 0.01 (no unit).
    This is based on maximumFractionDigits=2 set in related XIB file.

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* chore: fix warning about shadowed variable

CGFloat const difference was used twice in the same scope

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* chore: fix unused block parameter warnings

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* chore: disable GCC_WARN_64_TO_32_BIT_CONVERSION for libtransmission

This warnings are not reported with CMake build.

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* chore: disable CLANG_WARN_STRICT_PROTOTYPES for dht

This is third party target, warning is not enabled with CMake build.

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* chore: disable '-Wexit-time-destructors' warning with CMake.

There are two cases when this is reported in libtransmission:
1. `log_state` in anonymous namespace in `log.cc`.
2. static inline `dh_pool_mutex` in `tr_handshake` in `handshake.h`.

I don't see how this may be improved or how this affects correctness,
so don't nag about that.

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>

---------

Signed-off-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2024-03-15 00:16:26 -05:00
Geoffrey Bonneville
7030b53e2e android patches for ndk (#6024)
* android patches for ndk

* Update libtransmission/file-capacity.cc

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* TrMacros: Move common & android vars

* Build android in CI

* Use vcpkg packages for curl & openssl

* Update CI for android

* Fix ndkVersion used with gradle

* Restore actions triggers events

* CMakeLists: Remove cond where curl is not found

* Use vcpkg tag instead of commit hash

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* TrMacros.cmake: clean unused variables & add vcpkg cond

* Remove quotes around VcpkgAndroid inclusion

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>

* actions: split steps to install vcpkg packages

* Build for android arm64

* actions: add make-android condition

* Revert "Use vcpkg tag instead of commit hash"

This reverts commit 65819026b1.

* build.gradle: use cmake version 3.22.1

* actions: use vcpkg 2024.01.12

* actions: Add ninja-build dependency

---------

Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
2024-01-21 15:27:24 +00:00
Yat Ho
cf077bbba0 chore: bump libutp (#6251) 2023-11-14 13:24:18 -06:00
Mike Gelfand
1c421d6d23 Minor CMake maintainability improvements (#6186)
* Prefer `PROJECT_{SOURCE,BINARY}_DIR` to `CMAKE_` ones

* Extend use of 3rd-party dir vars to reduce duplication

* Fix typo in submodule repo name

* Remove `CURL::libcurl` target fallback

The target is always available since CMake 3.12, which is our current
minimum version.
2023-10-30 20:44:34 +03:00
Yat Ho
b7c5aca6ad feat: update TR_VCS_REVISION when git HEAD changes (#6100) 2023-10-30 02:03:40 -04:00
Yat Ho
2130eb941a refactor: drop jsonsl in favour of RapidJSON (#6138) 2023-10-21 14:00:12 -05:00
Yat Ho
a20d79a933 chore: bump minimum openssl version to 1.1.0 (#6047) 2023-09-29 23:09:10 -05:00
Mike Gelfand
586cff9506 Switch to list view for torrents list (GTK 4) (#5858)
* Add compat operator* for RefPtr

* Rename `*_tree_view_*` button handling helpers to `*_item_view_*`

* Move torrent item colors to CSS

* Switch to list view for torrents list (GTK 4)

* Bump Fedora image to 39 (current rawhide) for GTK 4.11

Enable deprecations as there're lots of them in 4.11 and I'm not keen on
fixing them all right now. Disable warnings as errors due to
-Warray-bounds issue somewhere in libfmt.
2023-08-06 04:26:29 +01:00
Charles Kerr
432fc9bafc refactor: add libsmall dependency (#5649)
* refactor: add small dependency

* refactor: use small in variant.cc

* refactor: use small in cache.h
2023-06-20 22:50:36 -05:00
Cœur
6156d90917 build: use RECOMMENDED_MACOSX_DEPLOYMENT_TARGET (#5282) 2023-04-14 15:02:52 -05:00
Cœur
97352a60ad build: cmake Xcode recommended build settings (#4931) 2023-04-14 09:57:49 -05:00
Charles Kerr
487f5d9676 chore: bump version to 4.1.0-dev (#5392) 2023-04-14 08:59:50 -05:00
Charles Kerr
6b0e49bbb2 chore: bump version to 4.0.3 2023-04-13 21:21:36 -05:00
Charles Kerr
47e141563a fixup: address 5258 code review (#5295) 2023-03-27 11:04:10 -05:00
Charles Kerr
9fc0e4ff61 fix: disable-deprecated by default for end users (#5289)
deprecations can be turned on manually and are auto-enabled in CI
2023-03-24 13:34:30 -05:00
Charles Kerr
8dccc290d7 chore: bump version to 4.0.2-dev 2023-03-16 02:51:22 -05:00
Charles Kerr
2a57b17031 chore: bump version to 4.0.2 2023-03-15 15:58:20 -05:00
Charles Kerr
487cc27e11 chore: bump version to 4.0.1-dev 2023-02-22 17:02:19 -06:00
Charles Kerr
e1c6e1be43 chore: bump version to 4.0.1 2023-02-22 16:41:35 -06:00
Thomas Weißschuh
8f8bcf720a ci: add option to disable installation of web assets (#4906)
Fixes #4864
2023-02-22 06:25:50 -06:00