xxhash: Fix pkg-config metadata file

Currently, Build/InstallDev installs libxxhash.pc.in, which is the
template for libxxhash.pc and does not contain the correct information.
(pkg-config also does not recognize this file name.)

This uses PKG_INSTALL:=1 so that libxxhash.pc is generated (by 'make
install').

This also removes the need to override Build/Prepare by setting the
correct command in PKG_UNPACK.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
This commit is contained in:
Jeffery To 2023-02-17 12:02:58 +08:00
parent fbbe30622a
commit 2f4b161e28
No known key found for this signature in database
GPG Key ID: C616D9E719E868E4
1 changed files with 11 additions and 11 deletions

View File

@ -12,7 +12,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=xxhash
PKG_VERSION:=0.8.1
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://github.com/Cyan4973/xxHash/archive/v$(PKG_VERSION)
@ -24,8 +24,12 @@ PKG_LICENSE:=BSD-2-Clause,GPL-2.0-or-later
PKG_LICENSE_FILES:=LICENSE,cli/COPYING
PKG_MAINTAINER:=Julien Malik <julien.malik@paraiso.me>
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
PKG_UNPACK:=$(HOST_TAR) -C "$(PKG_BUILD_DIR)" --strip-components=1 -xzf "$(DL_DIR)/$(PKG_SOURCE)"
define Package/xxhash/Default
TITLE:=Extremely fast hash algorithm
URL:=https://cyan4973.github.io/xxHash/
@ -64,29 +68,25 @@ define Package/xxhash/description
This package contains the executables.
endef
define Build/Prepare
rm -rf $(PKG_BUILD_DIR)/
mkdir -p $(PKG_BUILD_DIR)/
$(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip 1
endef
MAKE_FLAGS += PREFIX=/usr
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_BUILD_DIR)/*.h $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libxxhash.so* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libxxhash.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_BUILD_DIR)/libxxhash.pc.in $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libxxhash.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libxxhash/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/libxxhash.so.* $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libxxhash.so.* $(1)/usr/lib/
endef
define Package/xxhash/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/xxh*sum $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xxh*sum $(1)/usr/bin/
endef
$(eval $(call BuildPackage,libxxhash))