xxhash: switch to local git tarballs
[feed/packages.git] / utils / xxhash / Makefile
1 #
2 # Copyright (C) 2022 Julien Malik <julien.malik@paraiso.me>
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 # initial implementation kindly stolen from (and then updated) :
9 # https://forum.openwrt.org/t/xxhash-makefile/118426
10
11 include $(TOPDIR)/rules.mk
12
13 PKG_NAME:=xxhash
14 PKG_VERSION:=0.8.2
15 PKG_RELEASE:=2
16
17 PKG_SOURCE_PROTO:=git
18 PKG_SOURCE_VERSION:=v$(PKG_VERSION)
19 PKG_SOURCE_URL:=https://github.com/Cyan4973/xxHash
20 PKG_MIRROR_HASH:=0602a12e9ecd009f97a2a845fb5e46af69a60f96547952e5b00228f33bed5cdd
21
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>
27
28 PKG_INSTALL:=1
29
30 include $(INCLUDE_DIR)/package.mk
31
32 define Package/xxhash/Default
33 TITLE:=Extremely fast hash algorithm
34 URL:=https://xxhash.com/
35 endef
36
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).
43 endef
44
45 define Package/libxxhash
46 $(call Package/xxhash/Default)
47 SECTION:=libs
48 CATEGORY:=Libraries
49 endef
50
51 define Package/libxxhash/description
52 $(call Package/xxhash/Default/description)
53
54 This package contains the shared library.
55 endef
56
57 define Package/xxhash
58 $(call Package/xxhash/Default)
59 SECTION:=utils
60 CATEGORY:=Utilities
61 DEPENDS:= +libxxhash
62 endef
63
64 define Package/xxhash/description
65 $(call Package/xxhash/Default/description)
66
67 This package contains the executables.
68 endef
69
70 MAKE_FLAGS += PREFIX=/usr
71
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/
79 endef
80
81 define Package/libxxhash/install
82 $(INSTALL_DIR) $(1)/usr/lib
83 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libxxhash.so.* $(1)/usr/lib/
84 endef
85
86 define Package/xxhash/install
87 $(INSTALL_DIR) $(1)/usr/bin
88 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xxh*sum $(1)/usr/bin/
89 endef
90
91 $(eval $(call BuildPackage,libxxhash))
92 $(eval $(call BuildPackage,xxhash))