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
18 PKG_SOURCE_VERSION
:=v
$(PKG_VERSION
)
19 PKG_SOURCE_URL
:=https
://github.com
/Cyan4973
/xxHash
20 PKG_MIRROR_HASH
:=0602a12e9ecd009f97a2a845fb5e46af69a60f96547952e5b00228f33bed5cdd
22 # The source for the library (xxhash.c and xxhash.h) is BSD
23 # The source for the command line tool (xxhsum.c) is GPLv2+
24 PKG_LICENSE
:=BSD-2-Clause GPL-2.0
-or-later
25 PKG_LICENSE_FILES
:=LICENSE cli
/COPYING
26 PKG_MAINTAINER
:=Julien Malik
<julien.malik@paraiso.me
>
30 include $(INCLUDE_DIR
)/package.mk
32 define Package
/xxhash
/Default
33 TITLE
:=Extremely fast hash algorithm
34 URL
:=https
://xxhash.com
/
37 define Package
/xxhash
/Default
/description
38 xxHash is an Extremely fast Hash algorithm
, running at RAM speed
39 limits. It successfully completes the SMHasher
test suite which
40 evaluates collision
, dispersion and randomness qualities of hash
41 functions. Code is highly portable
, and hashes are identical on
all
42 platforms
(little
/ big endian
).
45 define Package
/libxxhash
46 $(call Package
/xxhash
/Default
)
51 define Package
/libxxhash
/description
52 $(call Package
/xxhash
/Default
/description
)
54 This package contains the shared library.
58 $(call Package
/xxhash
/Default
)
64 define Package
/xxhash
/description
65 $(call Package
/xxhash
/Default
/description
)
67 This package contains the executables.
70 MAKE_FLAGS
+= PREFIX
=/usr
72 define Build
/InstallDev
73 $(INSTALL_DIR
) $(1)/usr
/include
74 $(CP
) $(PKG_INSTALL_DIR
)/usr
/include/*.h
$(1)/usr
/include/
75 $(INSTALL_DIR
) $(1)/usr
/lib
76 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libxxhash.
{a
,so
*} $(1)/usr
/lib
/
77 $(INSTALL_DIR
) $(1)/usr
/lib
/pkgconfig
78 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/pkgconfig
/libxxhash.
pc $(1)/usr
/lib
/pkgconfig
/
81 define Package
/libxxhash
/install
82 $(INSTALL_DIR
) $(1)/usr
/lib
83 $(CP
) $(PKG_INSTALL_DIR
)/usr
/lib
/libxxhash.so.
* $(1)/usr
/lib
/
86 define Package
/xxhash
/install
87 $(INSTALL_DIR
) $(1)/usr
/bin
88 $(INSTALL_BIN
) $(PKG_INSTALL_DIR
)/usr
/bin
/xxh
*sum
$(1)/usr
/bin
/
91 $(eval
$(call BuildPackage
,libxxhash
))
92 $(eval
$(call BuildPackage
,xxhash
))