package/jpeg-turbo: allow installing tools
authorClément Péron <peron.clem@gmail.com>
Sun, 12 Apr 2020 11:06:32 +0000 (13:06 +0200)
committerYann E. MORIN <yann.morin.1998@free.fr>
Sun, 12 Apr 2020 13:30:58 +0000 (15:30 +0200)
Currently, the jpeg-turbo tools are forcibly removed, but they can be
usefull (e.g. to test performance on the target, or to script batch
conversions).

Add an option to allow keeping them.

Signed-off-by: Clément Péron <peron.clem@gmail.com>
[yann.morin.1998@free.fr
  - move the option out of the choice
  - move the option to a Config.in.options
  - drop the default 'n', which is ... the default
  - use positive logic to define the hook
  - move definition of the hook in the conditional block
  - don't indent the hook assignment
]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
package/jpeg-turbo/Config.in.options [new file with mode: 0644]
package/jpeg-turbo/jpeg-turbo.mk
package/jpeg/Config.in

diff --git a/package/jpeg-turbo/Config.in.options b/package/jpeg-turbo/Config.in.options
new file mode 100644 (file)
index 0000000..8654b30
--- /dev/null
@@ -0,0 +1,11 @@
+if BR2_PACKAGE_JPEG_TURBO
+
+config BR2_PACKAGE_JPEG_TURBO_TOOLS
+       bool "jpeg-turbo tools"
+       help
+         Libjpeg-turbo can also provide some tools like cjpeg,
+         djpeg, jpegtran, rdjpgcom, tjbench and wrjpgcom.
+
+         If you want to keep them enable this option.
+
+endif
index 126b470630b2f7764e21a84efbc84390e1cde419..65debb2510490cf68131bef42984456e9b77a880 100644 (file)
@@ -41,10 +41,11 @@ ifeq ($(BR2_STATIC_LIBS),)
 JPEG_TURBO_CONF_OPTS += -DCMAKE_POSITION_INDEPENDENT_CODE=ON
 endif
 
-define JPEG_TURBO_REMOVE_USELESS_TOOLS
+ifeq ($(BR2_PACKAGE_JPEG_TURBO_TOOLS),)
+define JPEG_TURBO_REMOVE_TOOLS
        rm -f $(addprefix $(TARGET_DIR)/usr/bin/,cjpeg djpeg jpegtran rdjpgcom tjbench wrjpgcom)
 endef
-
-JPEG_TURBO_POST_INSTALL_TARGET_HOOKS += JPEG_TURBO_REMOVE_USELESS_TOOLS
+JPEG_TURBO_POST_INSTALL_TARGET_HOOKS += JPEG_TURBO_REMOVE_TOOLS
+endif
 
 $(eval $(cmake-package))
index 97139c78496196306dfa890fc00c596740f15f27..0a786060d7bd3dd045fd03ab9543e6fc565db35b 100644 (file)
@@ -43,6 +43,8 @@ source "$BR2_BASE_DIR/.br2-external.in.jpeg"
 
 endchoice
 
+source "package/jpeg-turbo/Config.in.options"
+
 config BR2_PACKAGE_HAS_JPEG
        bool