aboutsummaryrefslogtreecommitdiff
path: root/libs/inih/Makefile
blob: dacdb007d22b7ea1f30ba633c1441b10ebe47c8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
include $(TOPDIR)/rules.mk

PKG_NAME:=inih
PKG_VERSION:=r58
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/benhoyt/inih/tar.gz/$(PKG_VERSION)?
PKG_HASH:=e79216260d5dffe809bda840be48ab0eec7737b2bb9f02d2275c1b46344ea7b7

PKG_MAINTAINER:=Tianling Shen <cnsztl@immortalwrt.org>
PKG_LICENSE:=BSD-3-Clause
PKG_LICENSE_FILES:=LICENSE.txt

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/meson.mk

define Package/libinih/Default
  SECTION:=libs
  CATEGORY:=Libraries
  URL:=https://github.com/benhoyt/inih
endef

define Package/libinih
  $(call Package/libinih/Default)
  TITLE:=Simple .INI file parser in C
endef

define Package/libinireader
  $(call Package/libinih/Default)
  TITLE:=C++ library and API for inih
  DEPENDS:=+libinih +libstdcpp
endef

define Package/libinih/description
  inih (INI Not Invented Here) is a simple .INI file parser written
  in C. It's only a couple of pages of code, and it was designed to
  be small and simple, so it's good for embedded systems. It's also
  more or less compatible with Python's ConfigParser style of .INI
  files, including RFC 822-style multi-line syntax and name: value
  entries.
endef

Package/libinireader/description = $(Package/libinih/description)

MESON_ARGS += \
	-Ddefault_library=both \
	-Ddistro_install=true \
	-Dwith_INIReader=true \
	-Dmulti-line_entries=true \
	-Dutf-8_bom=true \
	-Dinline_comments=true \
	-Duse_heap=false

define Build/InstallDev
	$(INSTALL_DIR) $(1)/usr/include
	$(CP) $(PKG_INSTALL_DIR)/usr/include/{ini,INIReader}.h $(1)/usr/include
	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/{inih,INIReader}.pc $(1)/usr/lib/pkgconfig
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{inih,INIReader}.a $(1)/usr/lib/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{inih,INIReader}.so* $(1)/usr/lib/
endef

define Package/libinih/install
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libinih.so* $(1)/usr/lib/
endef

define Package/libinireader/install
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libINIReader.so* $(1)/usr/lib/
endef

$(eval $(call BuildPackage,libinih))
$(eval $(call BuildPackage,libinireader))