Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v5] package/dlib: new package
@ 2024-09-15  4:54 Roy Kollen Svendsen
  2024-09-15  9:32 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Roy Kollen Svendsen @ 2024-09-15  4:54 UTC (permalink / raw)
  To: buildroot; +Cc: Roy Kollen Svendsen, Thomas Petazzoni

Signed-off-by: Roy Kollen Svendsen <roykollensvendsen@gmail.com>
---
Changes v4 -> v5:
  - drop all sub-options, and instead rely on automatic dependencies  (suggested by Thomas)
  - sort the ifeq's
  - add entry in the DEVELOPERS file as part of the patch adding the package  (suggested by Thomas)
  - convert 'OR' to lowercase in DLIB_LICENSES
  - use the most common patterns for comments in hash-files

 DEVELOPERS             |  1 +
 package/Config.in      |  1 +
 package/dlib/Config.in | 14 ++++++
 package/dlib/dlib.hash | 13 ++++++
 package/dlib/dlib.mk   | 99 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 128 insertions(+)
 create mode 100644 package/dlib/Config.in
 create mode 100644 package/dlib/dlib.hash
 create mode 100644 package/dlib/dlib.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 1f887e161c..6e5f47466e 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2886,6 +2886,7 @@ F:	support/testing/tests/package/test_python_mako.py
 F:	toolchain/
 
 N:	Roy Kollen Svendsen <roykollensvendsen@gmail.com>
+F:	package/dlib/
 F:	package/qt6/
 
 N:	Rufus Segar <rhs@riseup.net>
diff --git a/package/Config.in b/package/Config.in
index 269a8cae6f..04dfca4289 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2153,6 +2153,7 @@ menu "Other"
 	source "package/cracklib/Config.in"
 	source "package/dawgdic/Config.in"
 	source "package/ding-libs/Config.in"
+	source "package/dlib/Config.in"
 	source "package/dotconf/Config.in"
 	source "package/double-conversion/Config.in"
 	source "package/eigen/Config.in"
diff --git a/package/dlib/Config.in b/package/dlib/Config.in
new file mode 100644
index 0000000000..2419af967b
--- /dev/null
+++ b/package/dlib/Config.in
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_DLIB
+	bool "dlib"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  Dlib is a modern C++ toolkit containing machine learning
+	  algorithms and tools for creating complex software in C++ to
+	  solve real world problems.
+
+	  http://dlib.net
+
+comment "dlib needs a toolchain w/ C++, threads"
+	depends on !BR2_INSTALL_LIBSTDCPP || \
+		!BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/dlib/dlib.hash b/package/dlib/dlib.hash
new file mode 100644
index 0000000000..af206386b8
--- /dev/null
+++ b/package/dlib/dlib.hash
@@ -0,0 +1,13 @@
+# Locally computed
+sha256  22513c353ec9c153300c394050c96ca9d088e02966ac0f639e989e50318c82d6  dlib-19.24.6.tar.gz
+
+# Hashes for license files
+sha256  50c1c5978d490c7f13062d91c4b89affc83774f87bc4568a714f748b62a5b216  dlib/external/libjpeg/README
+sha256  debfae299fa4118b0a586af4cf7ac8d38aae81ac4e9995c935862aaee6eb0362  dlib/external/libpng/LICENSE
+sha256  83965b843b98f670d3a85bd041ed4b372c8ec50d7b4a5995a83ac697ba675dcb  dlib/external/pybind11/LICENSE
+sha256  8d8291caf1cee26d23acf3eb67c9f9a2d58f1c681b16a4fbe8cbfb9e3c0b5a9b  dlib/LICENSE.txt
+sha256  908b0b565ae9bf61b7b41447cb0b83564f320375723bcc884ec30e5537a0d5dc  dlib/test/ffmpeg_data/LICENSE.TXT
+sha256  78515536a4b0d896745b6483fccc561987e8e2f2d014dc81d7c2e97c497a0a69  examples/LICENSE_FOR_EXAMPLE_PROGRAMS.txt
+sha256  a0e7b40719ba74630debe9fae1cb847ee436215451123254a690171d09fb036e  examples/video_frames/license.txt
+sha256  8d8291caf1cee26d23acf3eb67c9f9a2d58f1c681b16a4fbe8cbfb9e3c0b5a9b  LICENSE.txt
+sha256  8acb12b218fdb5e071f25eda9ac990d04888388b65095867d9007c278a9f993b  python_examples/LICENSE_FOR_EXAMPLE_PROGRAMS.txt
diff --git a/package/dlib/dlib.mk b/package/dlib/dlib.mk
new file mode 100644
index 0000000000..4eb0002775
--- /dev/null
+++ b/package/dlib/dlib.mk
@@ -0,0 +1,99 @@
+################################################################################
+#
+# dlib
+#
+################################################################################
+
+DLIB_VERSION = 19.24.6
+DLIB_SITE = $(call github,davisking,dlib,v$(DLIB_VERSION))
+DLIB_CMAKE_BACKEND = ninja
+DLIB_INSTALL_STAGING = YES
+DLIB_SUPPORTS_IN_SOURCE_BUILD = NO
+
+DLIB_LICENSE = \
+	BSD-3-Clause (kissfft, pybind11) \
+	BSL-1.0 (dlib, tools) \
+	CC0-1.0 (examples) \
+	libpng-2.0 (libpng) \
+	MIT or CC0-1.0 (JoinPaths.cmake)
+
+DLIB_LICENSE_FILES = \
+	dlib/external/libjpeg/README \
+	dlib/external/libpng/LICENSE \
+	dlib/external/pybind11/LICENSE \
+	dlib/LICENSE.txt \
+	dlib/test/ffmpeg_data/LICENSE.TXT \
+	examples/LICENSE_FOR_EXAMPLE_PROGRAMS.txt \
+	examples/video_frames/license.txt \
+	LICENSE.txt \
+	python_examples/LICENSE_FOR_EXAMPLE_PROGRAMS.txt
+
+DLIB_CONF_OPTS = \
+	-DDLIB_LINK_WITH_SQLITE3=OFF \
+	-DDLIB_USE_CUDA=OFF \
+	-DDLIB_USE_MKL_FFT=OFF
+
+ifeq ($(BR2_PACKAGE_FFMPEG)$(BR2_PACKAGE_FFMPEG_SWSCALE),yy)
+DLIB_CONF_OPTS += -DDLIB_USE_FFMPEG=ON
+DLIB_DEPENDENCIES += ffmpeg
+else
+DLIB_CONF_OPTS += -DDLIB_USE_FFMPEG=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_GIFLIB),y)
+DLIB_CONF_OPTS += -DDLIB_GIF_SUPPORT=ON
+DLIB_DEPENDENCIES += giflib
+else
+DLIB_CONF_OPTS += -DDLIB_GIF_SUPPORT=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_JPEG),y)
+DLIB_CONF_OPTS += -DDLIB_JPEG_SUPPORT=ON
+DLIB_DEPENDENCIES += jpeg
+else
+DLIB_CONF_OPTS += -DDLIB_JPEG_SUPPORT=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_LAPACK),y)
+DLIB_CONF_OPTS += -DDLIB_USE_LAPACK=ON
+DLIB_DEPENDENCIES += lapack
+else
+DLIB_CONF_OPTS += -DDLIB_USE_LAPACK=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_LIBJXL),y)
+DLIB_CONF_OPTS += -DDLIB_JXL_SUPPORT=ON
+DLIB_DEPENDENCIES += libjxl
+else
+DLIB_CONF_OPTS += -DDLIB_JXL_SUPPORT=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_LIBPNG),y)
+DLIB_CONF_OPTS += -DDLIB_PNG_SUPPORT=ON
+DLIB_DEPENDENCIES += libpng
+else
+DLIB_CONF_OPTS += -DDLIB_PNG_SUPPORT=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_OPENBLAS),y)
+DLIB_CONF_OPTS += -DDLIB_USE_BLAS=ON
+DLIB_DEPENDENCIES += openblas
+else
+DLIB_CONF_OPTS += -DDLIB_USE_BLAS=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_WEBP),y)
+DLIB_CONF_OPTS += -DDLIB_WEBP_SUPPORT=ON
+DLIB_DEPENDENCIES += webp
+else
+DLIB_CONF_OPTS += -DDLIB_WEBP_SUPPORT=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y)
+DLIB_CONF_OPTS += -DDLIB_NO_GUI_SUPPORT=OFF
+DLIB_DEPENDENCIES += xlib_libX11
+else
+DLIB_CONF_OPTS += -DDLIB_NO_GUI_SUPPORT=ON
+endif
+
+$(eval $(cmake-package))
-- 
2.46.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH v5] package/dlib: new package
  2024-09-15  4:54 [Buildroot] [PATCH v5] package/dlib: new package Roy Kollen Svendsen
@ 2024-09-15  9:32 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-09-15  9:32 UTC (permalink / raw)
  To: Roy Kollen Svendsen; +Cc: buildroot

On Sun, 15 Sep 2024 06:54:53 +0200
Roy Kollen Svendsen <roykollensvendsen@gmail.com> wrote:

> Signed-off-by: Roy Kollen Svendsen <roykollensvendsen@gmail.com>
> ---
> Changes v4 -> v5:
>   - drop all sub-options, and instead rely on automatic dependencies  (suggested by Thomas)
>   - sort the ifeq's
>   - add entry in the DEVELOPERS file as part of the patch adding the package  (suggested by Thomas)
>   - convert 'OR' to lowercase in DLIB_LICENSES
>   - use the most common patterns for comments in hash-files

Thanks for this v5 that we have applied. I just have one comment below.

> +DLIB_LICENSE = \
> +	BSD-3-Clause (kissfft, pybind11) \
> +	BSL-1.0 (dlib, tools) \
> +	CC0-1.0 (examples) \
> +	libpng-2.0 (libpng) \
> +	MIT or CC0-1.0 (JoinPaths.cmake)

Since some of us are grouped in a Buildroot Hackathon this week-end, we
had a discussion about licenses. Two different aspects were discussed:

- Should we list all licenses, or only the licenses of things that
  really go into the target? For example above you list libpng-2.0 in
  fact we never use the bundled libpng code. You list MIT or CC0-1.0
  for JoinPaths.cmake but that never goes to the target. Or the
  pybind11 code under BSD-3-Clause is most likely never built with your
  current packaging of dlib.

  It looks like the consensus was that <pkg>_LICENSE should only list
  the licenses of things that really go into the target. But that
  semantic should be discussed and clarified in our documentation.

  An issue that was raised was about licensing of the SDK, if the SDK
  is distributed, but it looks like the consensus was that this is less
  "relevant" than what goes on the target, and for the SDK, sharing the
  full source code of everything ensures that all license texts are
  provided.

- Should we list all the licenses of "integrated code" or only the
  main, final license. For example here there's some BSD-3-Clause code
  that's integrated, but the final license chosen by the dlib
  maintainers is BSL-1.0.

  It looks like the consensus was that <pkg>_LICENSE should probably
  only list licenses the "main" license, for example BSL-1.0 in this
  case.

I'm not really sure how to move forward with these topics though.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-09-15  9:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-15  4:54 [Buildroot] [PATCH v5] package/dlib: new package Roy Kollen Svendsen
2024-09-15  9:32 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox