build: update dependency versions (#3853)

* build: rename GTK_MINIMUM, etc as GTKMM_MINIMUM in CMakeLists

* build: bump glibmm depdency min version to 2.60.0

https://github.com/transmission/transmission/issues/3846\#issuecomment-1263782526

for extraclassinit.h

* build: fix duplicated version number for deflate dependency

* build: sort dependency list in CMakeLists.txt

no functional changes, just housekeeping

* refactor: remove gtr_get_ptr()
This commit is contained in:
Charles Kerr 2022-09-30 17:15:21 -05:00 committed by GitHub
parent 1cd6c0464c
commit 3f44076e23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 33 additions and 43 deletions

View File

@ -25,6 +25,19 @@ include(ExternalProject)
include(GNUInstallDirs)
include(TrMacros)
set(CURL_MINIMUM 7.28.0)
set(CYASSL_MINIMUM 3.0)
set(DEFLATE_MINIMUM 1.10)
set(EVENT2_MINIMUM 2.1.0)
set(GIOMM_MINIMUM 2.26.0)
set(GLIBMM_MINIMUM 2.60.0)
set(GTKMM_MINIMUM 3.24.0)
set(LIBAPPINDICATOR_MINIMUM 0.4.90)
set(OPENSSL_MINIMUM 0.9.7)
set(POLARSSL_MINIMUM 1.3)
set(PSL_MINIMUM 0.21.1)
set(QT_MINIMUM 5.6)
option(ENABLE_DAEMON "Build daemon" ON)
tr_auto_option(ENABLE_GTK "Build GTK+ client" AUTO)
tr_auto_option(ENABLE_QT "Build Qt client" AUTO)
@ -115,19 +128,6 @@ string(SUBSTRING "${TR_VCS_REVISION}" 0 10 TR_VCS_REVISION)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(PSL_MINIMUM 0.21.1)
set(CURL_MINIMUM 7.28.0)
set(CYASSL_MINIMUM 3.0)
set(DEFLATE_MINIMUM 1.10)
set(EVENT2_MINIMUM 2.1.0)
set(GIO_MINIMUM 2.26.0)
set(GLIB_MINIMUM 2.50.1)
set(GTK_MINIMUM 3.24.0)
set(LIBAPPINDICATOR_MINIMUM 0.4.90)
set(OPENSSL_MINIMUM 0.9.7)
set(POLARSSL_MINIMUM 1.3)
set(QT_MINIMUM 5.6)
if(WIN32)
foreach(L C CXX)
set(CMAKE_${L}_FLAGS "${CMAKE_${L}_FLAGS} -DWIN32")
@ -223,9 +223,9 @@ if(ENABLE_GTK)
tr_get_required_flag(ENABLE_GTK GTK_IS_REQUIRED)
pkg_check_modules(GTK ${GTK_IS_REQUIRED}
gtkmm-3.0>=${GTK_MINIMUM}
glibmm-2.4>=${GLIB_MINIMUM}
giomm-2.4>=${GIO_MINIMUM})
gtkmm-3.0>=${GTKMM_MINIMUM}
glibmm-2.4>=${GLIBMM_MINIMUM}
giomm-2.4>=${GIOMM_MINIMUM})
tr_fixup_auto_option(ENABLE_GTK GTK_FOUND GTK_IS_REQUIRED)
@ -330,7 +330,7 @@ set(THIRD_PARTY_DIR ${CMAKE_SOURCE_DIR}/third-party)
tr_add_external_auto_library(DEFLATE libdeflate deflate)
if(NOT USE_SYSTEM_DEFLATE)
set(DEFLATE_VERSION 1.10)
set(DEFLATE_VERSION ${DEFLATE_MINIMUM})
endif()
tr_add_external_auto_library(EVENT2 libevent event

View File

@ -102,12 +102,12 @@ std::unordered_map<Glib::ustring, Glib::RefPtr<Gio::SimpleAction>> key_to_action
void gtr_actions_set_core(Glib::RefPtr<Session> const& core)
{
myCore = gtr_get_ptr(core);
myCore = core.get();
}
Glib::RefPtr<Gio::SimpleActionGroup> gtr_actions_init(Glib::RefPtr<Gtk::Builder> const& builder, gpointer callback_user_data)
{
myBuilder = gtr_get_ptr(builder);
myBuilder = builder.get();
auto const action_group = Gio::SimpleActionGroup::create();
@ -116,7 +116,7 @@ Glib::RefPtr<Gio::SimpleActionGroup> gtr_actions_init(Glib::RefPtr<Gtk::Builder>
{
auto const action_name = Glib::ustring("sort-torrents");
auto const action = Gio::SimpleAction::create_radio_string(action_name, match);
action->signal_activate().connect([a = gtr_get_ptr(action), callback_user_data](auto const& value)
action->signal_activate().connect([a = action.get(), callback_user_data](auto const& value)
{ sort_changed_cb(*a, value, callback_user_data); });
action_group->add_action(action);
key_to_action.try_emplace(action_name, action);
@ -126,7 +126,7 @@ Glib::RefPtr<Gio::SimpleActionGroup> gtr_actions_init(Glib::RefPtr<Gtk::Builder>
{
auto const action_name = Glib::ustring(std::string(action_name_view));
auto const action = Gio::SimpleAction::create_bool(action_name);
action->signal_activate().connect([a = gtr_get_ptr(action), callback_user_data](auto const& /*value*/)
action->signal_activate().connect([a = action.get(), callback_user_data](auto const& /*value*/)
{ action_cb(*a, callback_user_data); });
action_group->add_action(action);
key_to_action.try_emplace(action_name, action);
@ -136,7 +136,7 @@ Glib::RefPtr<Gio::SimpleActionGroup> gtr_actions_init(Glib::RefPtr<Gtk::Builder>
{
auto const action_name = Glib::ustring(std::string(action_name_view));
auto const action = Gio::SimpleAction::create_bool(action_name, gtr_pref_flag_get(tr_quark_new(action_name_view)));
action->signal_activate().connect([a = gtr_get_ptr(action), callback_user_data](auto const& /*value*/)
action->signal_activate().connect([a = action.get(), callback_user_data](auto const& /*value*/)
{ toggle_pref_cb(*a, callback_user_data); });
action_group->add_action(action);
key_to_action.try_emplace(action_name, action);
@ -146,7 +146,7 @@ Glib::RefPtr<Gio::SimpleActionGroup> gtr_actions_init(Glib::RefPtr<Gtk::Builder>
{
auto const action_name = Glib::ustring(std::string(action_name_view));
auto const action = Gio::SimpleAction::create(action_name);
action->signal_activate().connect([a = gtr_get_ptr(action), callback_user_data](auto const& /*value*/)
action->signal_activate().connect([a = action.get(), callback_user_data](auto const& /*value*/)
{ action_cb(*a, callback_user_data); });
action_group->add_action(action);
key_to_action.try_emplace(action_name, action);

View File

@ -289,7 +289,7 @@ Glib::RefPtr<Gtk::TreeStore> tracker_filter_model_new(Glib::RefPtr<Gtk::TreeMode
iter = store->append();
iter->set_value(tracker_filter_cols.type, static_cast<int>(TRACKER_FILTER_TYPE_SEPARATOR));
store->set_data(TORRENT_MODEL_KEY, gtr_get_ptr(tmodel));
store->set_data(TORRENT_MODEL_KEY, tmodel.get());
tracker_filter_model_update(store);
return store;
}
@ -534,7 +534,7 @@ Glib::RefPtr<Gtk::ListStore> activity_filter_model_new(Glib::RefPtr<Gtk::TreeMod
iter->set_value(activity_filter_cols.icon_name, type.icon_name);
}
store->set_data(TORRENT_MODEL_KEY, gtr_get_ptr(tmodel));
store->set_data(TORRENT_MODEL_KEY, tmodel.get());
activity_filter_model_update(store);
return store;
}
@ -791,7 +791,7 @@ FilterBar::Impl::Impl(FilterBar& widget, tr_session* session, Glib::RefPtr<Gtk::
filter_model_->signal_row_inserted().connect([this](auto const& /*path*/, auto const& /*iter*/)
{ update_count_label_idle(); });
static_cast<Gtk::TreeStore*>(gtr_get_ptr(tracker_->get_model()))->set_data(SESSION_KEY, session);
static_cast<Gtk::TreeStore*>(tracker_->get_model().get())->set_data(SESSION_KEY, session);
filter_model_->set_visible_func(sigc::mem_fun(*this, &Impl::is_row_visible));

View File

@ -103,12 +103,12 @@ Glib::RefPtr<Gdk::Pixbuf> _get_icon_pixbuf(Glib::RefPtr<Gio::Icon> const& icon,
return {};
}
if (auto* const ticon = dynamic_cast<Gio::ThemedIcon*>(gtr_get_ptr(icon)); ticon != nullptr)
if (auto* const ticon = dynamic_cast<Gio::ThemedIcon*>(icon.get()); ticon != nullptr)
{
return get_themed_icon_pixbuf(*ticon, size, theme);
}
if (auto* const ficon = dynamic_cast<Gio::FileIcon*>(gtr_get_ptr(icon)); ficon != nullptr)
if (auto* const ficon = dynamic_cast<Gio::FileIcon*>(icon.get()); ficon != nullptr)
{
return get_file_icon_pixbuf(*ficon, size);
}
@ -127,7 +127,7 @@ Glib::RefPtr<Gdk::Pixbuf> icon_cache_get_mime_type_icon(IconCache& icons, std::s
auto mime_type_str = std::string{ mime_type };
auto icon = Gio::content_type_get_icon(mime_type_str);
auto pixbuf = _get_icon_pixbuf(icon, icons.icon_size, *gtr_get_ptr(icons.icon_theme));
auto pixbuf = _get_icon_pixbuf(icon, icons.icon_size, *icons.icon_theme.get());
if (pixbuf != nullptr)
{
cache.try_emplace(std::move(mime_type_str), pixbuf);

View File

@ -467,7 +467,7 @@ MessageLogWindow::Impl::Impl(
action_group->add_action(clear_action);
auto const pause_action = Gio::SimpleAction::create_bool("pause-message-log");
pause_action->signal_activate().connect([this, &action = *gtr_get_ptr(pause_action)](auto const& /*value*/)
pause_action->signal_activate().connect([this, &action = *pause_action.get()](auto const& /*value*/)
{ onPauseToggled(action); });
action_group->add_action(pause_action);

View File

@ -966,7 +966,7 @@ bool is_torrent_active(tr_stat const* st)
void Session::add_torrent(tr_torrent* tor, bool do_notify)
{
ScopedModelSortBlocker disable_sort(*gtr_get_ptr(impl_->get_model()));
ScopedModelSortBlocker disable_sort(*impl_->get_model().get());
impl_->add_torrent(tor, do_notify);
}
@ -1056,7 +1056,7 @@ int Session::Impl::add_ctor(tr_ctor* ctor, bool do_prompt, bool do_notify)
if (!do_prompt)
{
ScopedModelSortBlocker disable_sort(*gtr_get_ptr(sorted_model_));
ScopedModelSortBlocker disable_sort(*sorted_model_.get());
add_torrent(create_new_torrent(ctor), do_notify);
tr_ctorFree(ctor);
return 0;
@ -1284,7 +1284,7 @@ void Session::load(bool force_paused)
auto const n_torrents = tr_sessionLoadTorrents(session, ctor);
tr_ctorFree(ctor);
ScopedModelSortBlocker disable_sort(*gtr_get_ptr(impl_->get_model()));
ScopedModelSortBlocker disable_sort(*impl_->get_model().get());
auto torrents = std::vector<tr_torrent*>{};
torrents.resize(n_torrents);

View File

@ -266,16 +266,6 @@ inline Glib::ustring gtr_sprintf(Glib::ustring const& fmt, Ts const&... args)
#endif
}
template<typename T>
inline T* gtr_get_ptr(Glib::RefPtr<T> const& ptr)
{
#if G_ENCODE_VERSION(GLIBMM_MAJOR_VERSION, GLIBMM_MINOR_VERSION) < G_ENCODE_VERSION(2, 56)
return ptr.operator->();
#else
return ptr.get();
#endif
}
template<typename T, typename U>
inline Glib::RefPtr<T> gtr_ptr_static_cast(Glib::RefPtr<U> const& ptr)
{