packages/libs/measurement-kit/Makefile
Jeffery To 19694767f2 measurement-kit: Add static build dependencies
When measurement-kit is a build dependency (in PKG_BUILD_DEPENDS) of
another package, this package's build dependencies (in DEPENDS) may not
be selected and so may not be built.

(This package does not produce a shared library; the measurement-kit
target package contains a program that is statically linked to the
measurement-kit library. Other packages may include measurement-kit in
their PKG_BUILD_DEPENDS to link to the static library but not include
measurement-kit as a run-time dependency.)

This adds PKG_BUILD_DEPENDS to this package to ensure that its
dependencies are built in this case.

This also adds MEASUREMENT_KIT_BUILD_DEPENDS that dependant packages
should select to ensure that this package's dependencies are correctly
built. (libevent2-openssl and libevent2-pthreads need to be selected for
the necessary functionality to be enabled when compiling libevent2.)

This also adds openssl as an explicit dependency; it appears to be used
directly by this package.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-05-19 17:44:14 +08:00

78 lines
2.2 KiB
Makefile

#
# Copyright (C) 2019-2020 CZ.NIC z.s.p.o. (http://www.nic.cz/)
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=measurement-kit
PKG_VERSION:=0.10.11
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/measurement-kit/measurement-kit/tar.gz/v$(PKG_VERSION)?
PKG_HASH:=f9dbf5f721516fd709c13ac5011737b3622076299e3c899a1f70861901ec1b40
PKG_MAINTAINER:=Jan Pavlinec <jan.pavlinec@nic.cz>
PKG_LICENSE:=BSD-2-Clause
PKG_LICENSE_FILES:=LICENSE
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PKG_BUILD_DEPENDS:=curl libevent2 libmaxminddb openssl
PKG_BUILD_PARALLEL:=1
PKG_CONFIG_DEPENDS:=MEASUREMENT_KIT_BUILD_DEPENDS
include $(INCLUDE_DIR)/package.mk
define Package/measurement-kit
SECTION:=libs
CATEGORY:=Libraries
TITLE:=library for open network measurement
URL:=https://measurement-kit.github.io/
DEPENDS:=+libstdcpp +libcurl +libevent2-pthreads +libevent2-extra +libevent2-openssl +libevent2-core +libmaxminddb +libopenssl +ca-bundle
endef
define Package/measurement-kit/description
Measurement Kit is a C++14 library that implements open network measurement methodologies (performance, censorship, etc.)
endef
define Package/measurement-kit/config
config MEASUREMENT_KIT_BUILD_DEPENDS
bool
default PACKAGE_measurement-kit
config MEASUREMENT_KIT_BUILD_SELECT
tristate
default m if MEASUREMENT_KIT_BUILD_DEPENDS
select PACKAGE_libevent2-openssl
select PACKAGE_libevent2-pthreads
endef
CONFIGURE_ARGS+= --with-ca-bundle=/etc/ssl/cert.pem
TARGET_CFLAGS += $(if $(CONFIG_USE_UCLIBC),-DCATCH_CONFIG_GLOBAL_NEXTAFTER)
define Build/Configure
( cd $(PKG_BUILD_DIR); ./autogen.sh )
$(call Build/Configure/Default)
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
endef
define Package/measurement-kit/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/measurement_kit $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/measurement_kit
$(CP) $(PKG_BUILD_DIR)/*.mmdb $(1)/etc/measurement_kit
endef
$(eval $(call BuildPackage,measurement-kit))