summaryrefslogtreecommitdiffstats
path: root/libs/libxmlb/Makefile
blob: e9201d0e478aebac9c0e4d860c3cf41127c3a3c6 (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
76
77
#
# Copyright (C) 2024 TDT AG <development@tdt.de>
#
# This is free software, licensed under the GNU General Public License v2.
# See https://www.gnu.org/licenses/gpl-2.0.txt for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=libxmlb
PKG_VERSION:=0.3.23
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/hughsie/libxmlb/releases/download/$(PKG_VERSION)
PKG_HASH:=ab86eb2073592448a4e0263ab56e222de092c0a3964b66a8d696cac071c8ee3c

PKG_MAINTAINER:=Lukas Voegl <lvoegl@tdt.de>
PKG_LICENSE:=LGPL-2.1-or-later
PKG_LICENSE_FILES:=LICENSE

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

define Package/libxmlb
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=libxmlb
  URL:=https://github.com/hughsie/libxmlb
  DEPENDS:= \
	+glib2 \
	+LIBXMLB_LZMA:liblzma \
	+LIBXMLB_ZSTD:libzstd
endef

define Package/libxmlb/description
  Library to help create and query binary XML blobs.
endef

define Package/libxmlb/config
	source "$(SOURCE)/Config.in"
endef

MESON_ARGS += \
	-Dgtkdoc=false \
	-Dintrospection=false \
	-Dtests=false \
	-Dstemmer=false \
	-Dcli=$(if $(CONFIG_LIBXMLB_CLI),true,false) \
	-Dlzma=$(if $(CONFIG_LIBXMLB_LZMA),enabled,disabled) \
	-Dzstd=$(if $(CONFIG_LIBXMLB_ZSTD),enabled,disabled)

define Build/InstallDev
	$(INSTALL_DIR) $(1)/usr/include/libxmlb-2
	$(CP) $(PKG_INSTALL_DIR)/usr/include/libxmlb-2/xmlb.h $(1)/usr/include/libxmlb-2

	$(INSTALL_DIR) $(1)/usr/include/libxmlb-2/libxmlb
	$(CP) $(PKG_INSTALL_DIR)/usr/include/libxmlb-2/libxmlb/*.h $(1)/usr/include/libxmlb-2/libxmlb

	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libxmlb.so* $(1)/usr/lib

	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/xmlb.pc $(1)/usr/lib/pkgconfig
endef

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

	$(if $(CONFIG_LIBXMLB_CLI), \
		$(INSTALL_DIR) $(1)/usr/bin; \
		$(CP) $(PKG_INSTALL_DIR)/usr/bin/xb-tool $(1)/usr/bin)
endef

$(eval $(call BuildPackage,libxmlb))