From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] package/libtorrent-rasterbar: new package
Date: Thu, 11 Oct 2018 21:19:29 +0200 [thread overview]
Message-ID: <20181011211929.22af5bfc@windsurf> (raw)
In-Reply-To: <20180911085024.14648-1-richterphilipp.pops@gmail.com>
Hello Philipp,
Thanks for your submission, and sorry for the slow response. I have to
say that for a first contribution, it looks very good. Still, I have a
number of comments, see below.
On Tue, 11 Sep 2018 10:50:23 +0200, Philipp Richter wrote:
> diff --git a/package/libtorrent-rasterbar/Config.in b/package/libtorrent-rasterbar/Config.in
> new file mode 100644
> index 0000000000..0ce9496b70
> --- /dev/null
> +++ b/package/libtorrent-rasterbar/Config.in
> @@ -0,0 +1,133 @@
> +comment "libtorrent-rasterbar needs a toolchain w/ C++"
> + depends on !BR2_INSTALL_LIBSTDCPP
> +
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR
> + bool "libtorrent-rasterbar"
> + depends on BR2_INSTALL_LIBSTDCPP
> + select BR2_PACKAGE_HOST_PKGCONF
You don't need to select this option. Currently, we don't care about
selecting Config.in options for host packages, so for consistency, we
also shouldn't do it here.
In the future, we might add Config.in options for all host packages,
and if/when we do this, we'll add the necessary selects. But for the
time being, I'd rather not have any of them.
> + select BR2_PACKAGE_BOOST
> + select BR2_PACKAGE_BOOST_CHRONO
> + select BR2_PACKAGE_BOOST_SYSTEM
> + select BR2_PACKAGE_BOOST_RANDOM
Since you select boost, you must inherit all its dependencies, i.e:
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_USE_WCHAR
> +if BR2_PACKAGE_LIBTORRENT_RASTERBAR
> +
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR_LOGGING
> + bool "Logging alerts"
> + default y
> + help
> + Enable support for logging alerts,
> + like log_alert, torrent_log_alert and peer_log_alert.
> +
> + Default: yes
Drop those "Default: XYZ" from the help text, we don't have them
anywhere, and it's already pretty explicit from the Config.in text.
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR_DEBUG
> + bool "Debug"
> + help
> + Enable debug build.
> +
> + Default: no
What does --enable-debug/--disable-debug does? We have a global
BR2_ENABLE_DEBUG boolean that enables building with debugging symbols.
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR_DHT
> + bool "DHT"
> + default y
> + help
> + Enable support for trackerless torrents.
> +
> + Default: yes
> +
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR_ENCRYPTION
> + bool "Encryption"
> + default y
> + select BR2_PACKAGE_OPENSSL
> + help
> + Enable encryption support.
> + Encryption support is the encrypted peer connection
> + supported by clients such as uTorrent, Azureus and KTorrent.
> +
> + Default: yes
> +
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR_EXPORT_ALL_SYMBOLS
> + bool "Export all symbols"
> + help
> + Export all symbols from libtorrent, including non-public ones.
> +
> + Default: no
Do we really need an option for this ?
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR_POOL_ALLOCATORS
> + bool "Pool allocators"
> + default y
> + help
> + Enable pool allocators for send buffers using boost::pool<>.
> +
> + Default: yes
And this ?
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR_INVARIANT_CHECKS
> + bool "Invariant checks"
> + default y
> + depends on BR2_PACKAGE_LIBTORRENT_RASTERBAR_DEBUG
> + help
> + Enable invariant checks.
> +
> + Default: yes
This clearly seems like a developer-oriented option, I don't think we
should support it in Buildroot.
> +
> +comment "Invariant checks need debug build"
> + depends on !BR2_PACKAGE_LIBTORRENT_RASTERBAR_DEBUG
> +
> +if BR2_PACKAGE_LIBTORRENT_RASTERBAR_INVARIANT_CHECKS
> +
> +choice
> + prompt "Invariant checks type"
> + default BR2_PACKAGE_LIBTORRENT_RASTERBAR_INVARIANT_CHECKS_YES
> + help
> + Select the type of invariant checks to use.
> +
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR_INVARIANT_CHECKS_YES
> + bool "yes"
> + help
> + Standard invariant checks.
> +
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR_INVARIANT_CHECKS_FULL
> + bool "full"
> + help
> + Turn on extra expensive invariant checks.
> +
> +endchoice
... and therefore we can remove all of this.
> +
> +endif
> +
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR_DEPRECATED_FUNCTIONS
> + bool "Deprecated functions"
> + default y
> + help
> + Enable deprecated functions in the API.
> +
> + Default: yes
Ditto, why would we want this option ?
In general, it feels like you have taken every --enable/--disable of
the configure script, and added a Buildroot Config.in option for each
of them. I don't think we necessarily want to support each and every
configuration option of the upstream package.
> +
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR_DISK_STATS
> + bool "Disk stats"
> + help
> + Enable disk activity logging feature.
> +
> + Default: no
> +
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR_EXAMPLES
> + bool "Examples"
> + help
> + Build example files.
> +
> + Default: no
> +
> +config BR2_PACKAGE_LIBTORRENT_RASTERBAR_TESTS
> + bool "Tests"
> + help
> + Build test files.
> +
> + Default: no
We generally don't build tests in the context of Buildroot, so just
disable them unconditionally.
> diff --git a/package/libtorrent-rasterbar/libtorrent-rasterbar.mk b/package/libtorrent-rasterbar/libtorrent-rasterbar.mk
> new file mode 100644
> index 0000000000..19f0a9304d
> --- /dev/null
> +++ b/package/libtorrent-rasterbar/libtorrent-rasterbar.mk
> @@ -0,0 +1,95 @@
> +################################################################################
> +#
> +# libtorrent-rasterbar
> +#
> +################################################################################
> +
> +LIBTORRENT_RASTERBAR_VERSION = 1.1.9
> +LIBTORRENT_RASTERBAR_SITE = https://github.com/arvidn/libtorrent/releases/download/libtorrent-$(subst .,_,$(LIBTORRENT_RASTERBAR_VERSION))
> +LIBTORRENT_RASTERBAR_LICENSE = BSD-2-Clause
> +LIBTORRENT_RASTERBAR_LICENSE_FILES = COPYING
> +LIBTORRENT_RASTERBAR_DEPENDENCIES = host-pkgconf boost $(if $(BR2_PACKAGE_LIBICONV),libiconv)
I would move the $(if $(BR2_PACKAGE_LIBICONV),libiconv) part inside the
iconv condition.
> +LIBTORRENT_RASTERBAR_INSTALL_STAGING = YES
> +LIBTORRENT_RASTERBAR_CONF_OPTS += --with-boost-libdir="$(STAGING_DIR)/usr/lib"
You can drop the double quotes here.
> +LIBTORRENT_RASTERBAR_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -std=c++11"
So, you need C++11, so your package should have a dependency on gcc >=
4.8.
> +ifeq ($(BR2_ENABLE_LOCALE)$(BR2_PACKAGE_LIBICONV),y)
> +LIBTORRENT_RASTERBAR_CONF_OPTS += --with-libiconv
This is where I'd prefer to see:
LIBTORRENT_RASTERBAR_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBICONV),libiconv)
Could you rework the package according to those comments?
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2018-10-11 19:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-11 8:50 [Buildroot] [PATCH 1/2] package/libtorrent-rasterbar: new package Philipp Richter
2018-09-11 8:50 ` [Buildroot] [PATCH 2/2] package/qbittorrent: " Philipp Richter
2018-10-11 19:40 ` Thomas Petazzoni
2018-10-11 19:19 ` Thomas Petazzoni [this message]
[not found] ` <CA+Vb7hrYyCfVAq=nk8a9GfGW10Fatw3WXZ5=wsJuVqba6MPnYg@mail.gmail.com>
2018-10-12 8:25 ` [Buildroot] [PATCH 1/2] package/libtorrent-rasterbar: " Philipp Richter
2018-10-13 15:32 ` Arnout Vandecappelle
-- strict thread matches above, loose matches on Subject: below --
2018-11-23 18:14 Philipp Richter
2018-11-23 18:37 ` Philipp Richter
2018-12-01 22:21 ` Thomas Petazzoni
2018-12-02 13:37 ` Philipp Richter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181011211929.22af5bfc@windsurf \
--to=thomas.petazzoni@bootlin.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox