2 # Copyright (C) 2022 Julien Malik <julien.malik@paraiso.me>
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 # initial implementation kindly stolen from (and then updated) :
9 # https://forum.openwrt.org/t/xxhash-makefile/118426
11 include $(TOPDIR
)/rules.mk
17 PKG_SOURCE
:=$(PKG_NAME
)_
$(PKG_VERSION
).
tar.gz
18 PKG_SOURCE_URL
:=https
://github.com
/Cyan4973
/xxHash
/archive
/v
$(PKG_VERSION
)
19 PKG_HASH
:=3bb6b7d6f30c591dd65aaaff1c8b7a5b94d81687998ca9400082c739a690436c
21 # The source for the library (xxhash.c and xxhash.h) is BSD
22 # The source for the command line tool (xxhsum.c) is GPLv2+
23 PKG_LICENSE
:=BSD-2-Clause GPL-2.0
-or-later
24 PKG_LICENSE_FILES
:=LICENSE cli
/COPYING
25 PKG_MAINTAINER
:=Julien Malik
<julien.malik@paraiso.me
>
29 include $(INCLUDE_DIR
)/package.mk
31 PKG_UNPACK
:=$(HOST_TAR
) -C
"$(PKG_BUILD_DIR)" --strip-components
=1 -xzf
"$(DL_DIR)/$(PKG_SOURCE)"
33 define Package
/xxhash
/Default
34 TITLE
:=Extremely fast hash algorithm
35 URL
:=https
://cyan4973.github.io
/xxHash
/
38 define Package
/xxhash
/Default
/description
39 xxHash is an Extremely fast Hash algorithm
, running at RAM speed
40 limits. It successfully completes the SMHasher
test suite which
41 evaluates collision
, dispersion and randomness qualities of hash
42 functions. Code is highly portable
, and hashes are identical on
all
43 platforms
(little
/ big endian
).
46 define Package
/libxxhash
47 $(call Package
/xxhash
/Default
)
52 define Package
/libxxhash
/description
53 $(call Package
/xxhash
/Default
/description
)
55 This package contains the shared library.
59 $(call Package
/xxhash
/Default
)
65 define Package
/xxhash
/description
66 $(call Package
/xxhash
/Default
/description
)
68 This package contains the executables.
71 MAKE_FLAGS
+= PREFIX
=/usr
73 define Build
/InstallDev
74 $(INSTALL_DIR
) $(1)/usr
/include
75 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/*.h
$(1)/usr
/include/
76 $(INSTALL_DIR
) $(1)/usr
/lib
77 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libxxhash.
{a
,so
*} $(1)/usr
/lib
/
78 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
79 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libxxhash.
pc $(1)/usr
/lib
/pkgconfig
/
82 define Package
/libxxhash
/install
83 $(INSTALL_DIR
) $(1)/usr
/lib
84 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libxxhash.so.
* $(1)/usr
/lib
/
87 define Package
/xxhash
/install
88 $(INSTALL_DIR
) $(1)/usr
/bin
89 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/xxh
*sum
$(1)/usr
/bin
/
92 $(eval
$(call BuildPackage
,libxxhash
))
93 $(eval
$(call BuildPackage
,xxhash
))