76d7c1ffa0068d1ac67d384f519fb0ec7eec2b25
[feed/packages.git] / libs / libfmt / Makefile
1 #
2 # Copyright (C) 2018 Othmar Truniger
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libfmt
11 PKG_VERSION:=10.2.1
12 PKG_RELEASE:=1
13
14 PKG_SOURCE_NAME:=fmt
15 PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.gz
16 PKG_SOURCE_URL:=https://codeload.github.com/fmtlib/$(PKG_SOURCE_NAME)/tar.gz/$(PKG_VERSION)?
17 PKG_HASH:=1250e4cc58bf06ee631567523f48848dc4596133e163f02615c97f78bab6c811
18 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
19
20 PKG_MAINTAINER:=Othmar Truniger <github@truniger.ch>
21 PKG_LICENSE:=MIT
22 PKG_LICENSE_FILES:=LICENSE.rst
23 PKG_CPE_ID:=cpe:/a:fmt:fmt
24
25 CMAKE_INSTALL:=1
26
27 include $(INCLUDE_DIR)/package.mk
28 include $(INCLUDE_DIR)/cmake.mk
29
30 CMAKE_OPTIONS += -DBUILD_SHARED_LIBS=ON
31 CMAKE_OPTIONS += -DFMT_DOC=OFF
32 CMAKE_OPTIONS += -DFMT_TEST=OFF
33
34 define Package/libfmt
35 SECTION:=libs
36 CATEGORY:=Libraries
37 TITLE:=Small, safe and fast formatting library
38 URL:=https://github.com/fmtlib/fmt
39 DEPENDS:=+libstdcpp
40 endef
41
42 define Package/libfmt/description
43 fmt is an open-source formatting library for C++.
44 It can be used as a safe alternative to printf or as a fast alternative to IOStreams.
45 endef
46
47 define Build/InstallDev
48 $(call Build/InstallDev/cmake,$(1))
49 $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/fmt.pc
50 $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/fmt.pc
51 endef
52
53 define Package/libfmt/install
54 $(INSTALL_DIR) $(1)/usr/lib
55 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libfmt.so* $(1)/usr/lib/
56 endef
57
58 $(eval $(call BuildPackage,libfmt))