Skip to contentSkip to conversation

rhash: new package

PATCH Superseded Vicente Olivert Riera 3 participants 6 messages May 9, 2017 – May 17, 2017

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/2 rhash: new package

---
Changes v3 -> v4:
- Add a comment explaining why we install the console utility to the staging directory. (Baruch)
- Perform the installation of the console utility to the staging directory into a post-install-staginig-hook. (Yann)
Changes v2 -> v3:
- Nothing
Changes v1 -> v2:
- Rename package to rhash
- Take the help text of the library instead of the console utility
- Sub-config option for the rhash binary starts with the package name
- Conditionals for shared/static/shared-static reordered
- Put make options into a make_opts variable
- Install the console utility to staging as well
(All suggestions by Arnout)

---
 package/Config.in        |  1 +
 package/rhash/Config.in  | 24 ++++++++++++++++
 package/rhash/rhash.hash |  3 ++
 package/rhash/rhash.mk   | 73 ++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 101 insertions(+)
 create mode 100644 package/rhash/Config.in
 create mode 100644 package/rhash/rhash.hash
 create mode 100644 package/rhash/rhash.mk
package/Config.in +1 -0
index d57813c..9b64ce2 100644
@@ -964,6 +964,7 @@ menu "Crypto"
 	source "package/mbedtls/Config.in"
 	source "package/nettle/Config.in"
 	source "package/openssl/Config.in"
+	source "package/rhash/Config.in"
 	source "package/tinydtls/Config.in"
 	source "package/trousers/Config.in"
 	source "package/ustream-ssl/Config.in"
package/rhash/Config.in new file +24 -0
new file mode 100644
index 0000000..6581243
@@ -0,0 +1,24 @@
+config BR2_PACKAGE_RHASH
+	bool "rhash"
+	select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT_IF_LOCALE
+	help
+	  LibRHash is a professional,  portable,  thread-safe  C library for
+	  computing a wide variety of hash sums, such as  CRC32, MD4, MD5,
+	  SHA1, SHA256, SHA512, SHA3, AICH, ED2K, Tiger, DC++ TTH, BitTorrent
+	  BTIH,  GOST R 34.11-94, RIPEMD-160, HAS-160, EDON-R, Whirlpool and
+	  Snefru.
+
+	  https://github.com/rhash/RHash
+
+if BR2_PACKAGE_RHASH
+
+config BR2_PACKAGE_RHASH_BIN
+	bool "rhash binary"
+	depends on !BR2_STATIC_LIBS
+	help
+	  Install rhash console utility
+
+comment "rhash binary needs a toolchain w/ dynamic library"
+	depends on BR2_STATIC_LIBS
+
+endif
package/rhash/rhash.hash new file +3 -0
new file mode 100644
index 0000000..5efc3a6
@@ -0,0 +1,3 @@
+# From https://sourceforge.net/projects/rhash/files/rhash/1.3.4/
+md5 0b51010604659e9e99f6307b053ba13b  rhash-1.3.4-src.tar.gz
+sha1 411d8c7ba84fa9763bc49fa2fd3a7587712fd52c  rhash-1.3.4-src.tar.gz
package/rhash/rhash.mk new file +73 -0

73 lines not on this page · raw message

Signature · 1 line
2.10.2
#1 lore raw

PATCH v4 2/2 cmake: bump version to 3.8.1

cmake depends on rhash, but host-cmake doesn't. This is because we use the bundled dependencies for host-cmake but not for target.

---
Changes v3 -> v4:
- Nothing
Changes v2 -> v3:
- Bump version to 3.8.1
- Change LIBRHASH references to RHASH
Changes v1 -> v2:
- Added explanation in the commit log about why rhash dependency is needed for cmake but not for host-cmake. (Arnout)

---
 package/cmake/Config.in  | 1 +
 package/cmake/cmake.hash | 4 ++--
 package/cmake/cmake.mk   | 6 +++---
 3 files changed, 6 insertions(+), 5 deletions(-)
package/cmake/Config.in +1 -0
index 64ab154..e7bd14e 100644
@@ -29,6 +29,7 @@ config BR2_PACKAGE_CMAKE_CTEST
 	select BR2_PACKAGE_BZIP2
 	select BR2_PACKAGE_XZ
 	select BR2_PACKAGE_LIBUV
+	select BR2_PACKAGE_RHASH
 	help
 	  CTest is a testing tool distributed as a part of CMake. It
 	  can be used to automate updating (using CVS for example),
package/cmake/cmake.hash +2 -2
index 13c0237..2aea9bc 100644
@@ -1,2 +1,2 @@
-# From http://www.cmake.org/files/v3.7/cmake-3.7.2-SHA-256.txt
-sha256 dc1246c4e6d168ea4d6e042cfba577c1acd65feea27e56f5ff37df920c30cae0  cmake-3.7.2.tar.gz
+# From http://www.cmake.org/files/v3.8/cmake-3.8.1-SHA-256.txt
+sha256 ce5d9161396e06501b00e52933783150a87c33080d4bdcef461b5b7fd24ac228  cmake-3.8.1.tar.gz
package/cmake/cmake.mk +3 -3
index d9eea32..10af415 100644
@@ -4,8 +4,8 @@
 #
 ################################################################################
 
-CMAKE_VERSION_MAJOR = 3.7
-CMAKE_VERSION = $(CMAKE_VERSION_MAJOR).2
+CMAKE_VERSION_MAJOR = 3.8
+CMAKE_VERSION = $(CMAKE_VERSION_MAJOR).1
 CMAKE_SITE = https://cmake.org/files/v$(CMAKE_VERSION_MAJOR)
 CMAKE_LICENSE = BSD-3-Clause
 CMAKE_LICENSE_FILES = Copyright.txt
@@ -22,7 +22,7 @@ CMAKE_LICENSE_FILES = Copyright.txt
 #   the system-wide libraries instead of rebuilding and statically
 #   linking with the ones bundled into the CMake sources.
 
-CMAKE_DEPENDENCIES = zlib jsoncpp libcurl libarchive expat bzip2 xz libuv
+CMAKE_DEPENDENCIES = zlib jsoncpp libcurl libarchive expat bzip2 xz libuv rhash
 
 CMAKE_CONF_OPTS = \
 	-DKWSYS_LFS_WORKS=TRUE \
Signature · 1 line
2.10.2
#2 lore raw

PATCH v4 1/2 rhash: new package

In reply to Vicente Olivert Riera

Hi Vicente,

package/rhash/rhash.mk line 60

Quoted 3 lines · Vicente Olivert Riera
package/rhash/rhash.mk new file +3 -0
+ifeq ($(BR2_PACKAGE_RHASH_BIN),y)
+# We also install the rhash console utility to the staging directory
+# since we want it to be a superset of the target directory.

And why is that?

package/rhash/rhash.mk line 71

Quoted 11 lines
package/rhash/rhash.mk new file +11 -0
+define RHASH_INSTALL_STAGING_RHASH_BIN
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+		DESTDIR="$(STAGING_DIR)" $(RHASH_MAKE_OPTS) install-shared
+endef
+RHASH_POST_INSTALL_STAGING_HOOKS += RHASH_INSTALL_STAGING_RHASH_BIN
+define RHASH_INSTALL_TARGET_RHASH_BIN
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+		DESTDIR="$(TARGET_DIR)" $(RHASH_MAKE_OPTS) install-shared
+endef
+RHASH_POST_INSTALL_TARGET_HOOKS += RHASH_INSTALL_TARGET_RHASH_BIN
+endif

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#3 lore raw

PATCH v4 1/2 rhash: new package

Hi Baruch,

Quoted 8 lines · Baruch Siach

Hi Vicente,

package/rhash/rhash.mk line 60

Quoted 3 lines · Vicente Olivert Riera
package/rhash/rhash.mk new file +3 -0
+ifeq ($(BR2_PACKAGE_RHASH_BIN),y)
+# We also install the rhash console utility to the staging directory
+# since we want it to be a superset of the target directory.

And why is that?

http://lists.busybox.net/pipermail/buildroot/2017-April/189827.html

"And of course it doesn't matter if you install the program in staging as well - in fact I prefer it, ideally staging is a superset of target."

Personally, since we are now doing the installation of the rhash console utility manually via post-install-hooks, I wouldn't install it to staging. But Arnout said that he prefer it to be installed to staging because ideally is a superset of target. Nobody said the opposite so I modified the patch following Arnout's advice.

Vincent

Quoted 15 lines

package/rhash/rhash.mk line 71

Quoted 12 lines
package/rhash/rhash.mk new file +11 -0
+define RHASH_INSTALL_STAGING_RHASH_BIN
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+		DESTDIR="$(STAGING_DIR)" $(RHASH_MAKE_OPTS) install-shared
+endef
+RHASH_POST_INSTALL_STAGING_HOOKS += RHASH_INSTALL_STAGING_RHASH_BIN
+define RHASH_INSTALL_TARGET_RHASH_BIN
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+		DESTDIR="$(TARGET_DIR)" $(RHASH_MAKE_OPTS) install-shared
+endef
+RHASH_POST_INSTALL_TARGET_HOOKS += RHASH_INSTALL_TARGET_RHASH_BIN
+endif

baruch

#4 lore raw

PATCH v4 1/2 rhash: new package

Hi Vicente,

Quoted 10 lines · Vicente Olivert Riera
Quoted 6 lines · Baruch Siach

package/rhash/rhash.mk line 60

Quoted 3 lines · Vicente Olivert Riera
package/rhash/rhash.mk new file +3 -0
+ifeq ($(BR2_PACKAGE_RHASH_BIN),y)
+# We also install the rhash console utility to the staging directory
+# since we want it to be a superset of the target directory.

And why is that?

http://lists.busybox.net/pipermail/buildroot/2017-April/189827.html

Quoted 8 lines

"And of course it doesn't matter if you install the program in staging as well - in fact I prefer it, ideally staging is a superset of target."

Personally, since we are now doing the installation of the rhash console utility manually via post-install-hooks, I wouldn't install it to staging. But Arnout said that he prefer it to be installed to staging because ideally is a superset of target. Nobody said the opposite so I modified the patch following Arnout's advice.

I remember that discussion now. It somehow made sense to me at the time, but not anymore. As I understand it, staging is a build time facility. Why would we like target only binaries installed there?

Quoted 11 lines
Quoted 11 lines

package/rhash/rhash.mk line 71

Quoted 11 lines
package/rhash/rhash.mk new file +11 -0
+define RHASH_INSTALL_STAGING_RHASH_BIN
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+		DESTDIR="$(STAGING_DIR)" $(RHASH_MAKE_OPTS) install-shared
+endef
+RHASH_POST_INSTALL_STAGING_HOOKS += RHASH_INSTALL_STAGING_RHASH_BIN
+define RHASH_INSTALL_TARGET_RHASH_BIN
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+		DESTDIR="$(TARGET_DIR)" $(RHASH_MAKE_OPTS) install-shared
+endef
+RHASH_POST_INSTALL_TARGET_HOOKS += RHASH_INSTALL_TARGET_RHASH_BIN
+endif

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#5 lore raw

PATCH v4 1/2 rhash: new package

[Still catching up with a couple of weeks of BR mails...]

Quoted 22 lines · Baruch Siach

Hi Vicente,

Quoted 10 lines · Vicente Olivert Riera
Quoted 6 lines · Baruch Siach

package/rhash/rhash.mk line 60

Quoted 3 lines · Vicente Olivert Riera
package/rhash/rhash.mk new file +3 -0
+ifeq ($(BR2_PACKAGE_RHASH_BIN),y)
+# We also install the rhash console utility to the staging directory
+# since we want it to be a superset of the target directory.

And why is that?

http://lists.busybox.net/pipermail/buildroot/2017-April/189827.html

Quoted 8 lines

"And of course it doesn't matter if you install the program in staging as well - in fact I prefer it, ideally staging is a superset of target."

Personally, since we are now doing the installation of the rhash console utility manually via post-install-hooks, I wouldn't install it to staging. But Arnout said that he prefer it to be installed to staging because ideally is a superset of target. Nobody said the opposite so I modified the patch following Arnout's advice.

Quoted 3 lines

I remember that discussion now. It somehow made sense to me at the time, but not anymore. As I understand it, staging is a build time facility. Why would we like target only binaries installed there?

What I wrote is:

"From a quick look at the Makefile, it looked like those install targets also work from the top-level."

So what I meant is, have a single install command, no hooks:

define RHASH_INSTALL_TARGET_CMDS

	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
		DESTDIR="$(TARGET_DIR)" $(RHASH_MAKE_OPTS) $(RHASH_INSTALL_TARGETS)

endef

(not the -C $(@D) instead of -C $(@D)/librhash)

and just do

ifeq ($(BR2_PACKAGE_RHASH_BIN),y)
RHASH_INSTALL_TARGETS += install-shared
endif

This would have as a side effect that the binaries are also installed in
staging even if they are not needed there. So to that I reacted with "in fact I prefer it, ideally staging is a superset of target"

Adding a POST_INSTALL_STAGING hook to uselessly install binaries to staging is
definitely NOT what I meant.

Regards,
Arnout

Quoted 15 lines
Quoted 12 lines
Quoted 12 lines

package/rhash/rhash.mk line 71

Quoted 12 lines
package/rhash/rhash.mk new file +11 -0
+define RHASH_INSTALL_STAGING_RHASH_BIN
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+		DESTDIR="$(STAGING_DIR)" $(RHASH_MAKE_OPTS) install-shared
+endef
+RHASH_POST_INSTALL_STAGING_HOOKS += RHASH_INSTALL_STAGING_RHASH_BIN
+define RHASH_INSTALL_TARGET_RHASH_BIN
+	$(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) \
+		DESTDIR="$(TARGET_DIR)" $(RHASH_MAKE_OPTS) install-shared
+endef
+RHASH_POST_INSTALL_TARGET_HOOKS += RHASH_INSTALL_TARGET_RHASH_BIN
+endif

baruch

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF