| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0-only |
| 2 | # |
| 3 | # Copyright (C) 2023 Luca Barbato |
| 4 | |
| 5 | include $(TOPDIR)/rules.mk |
| 6 | |
| 7 | PKG_NAME:=libnvme |
| 8 | PKG_VERSION:=1.9 |
| 9 | PKG_RELEASE:=1 |
| 10 | |
| 11 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz |
| 12 | PKG_SOURCE_URL:=https://github.com/linux-nvme/libnvme/archive/refs/tags/v$(PKG_VERSION) |
| 13 | PKG_HASH:=455867060d2b7563eab59fe21779dff469d98465028997178c7efbe4b8763206 |
| 14 | |
| 15 | PKG_LICENSE:=GPL-2.0-or-later |
| 16 | PKG_LICENSE_FILES:=LICENSE |
| 17 | PKG_MAINTAINER:=Luca Barbato <lu_zero@luminem.org> |
| 18 | |
| 19 | include $(INCLUDE_DIR)/package.mk |
| 20 | include $(INCLUDE_DIR)/meson.mk |
| 21 | |
| 22 | define Package/libnvme |
| 23 | SECTION:=libs |
| 24 | CATEGORY:=Libraries |
| 25 | TITLE:=C Library for NVM Express on Linux |
| 26 | URL:=https://github.com/linux-nvme/libnvme |
| 27 | DEPENDS:=+libjson-c |
| 28 | endef |
| 29 | |
| 30 | define Package/libnvme/description |
| 31 | This is the libnvme development C library. libnvme provides type |
| 32 | definitions for NVMe specification structures, enumerations, and |
| 33 | bit fields, helper functions to construct, dispatch, and decode |
| 34 | commands and payloads, and utilities to connect, scan, and manage |
| 35 | nvme devices on a Linux system. |
| 36 | endef |
| 37 | |
| 38 | MESON_ARGS += \ |
| 39 | -Dopenssl=disabled -Dpython=disabled -Dkeyutils=disabled |
| 40 | |
| 41 | define Package/libnvme/install |
| 42 | $(INSTALL_DIR) $(1)/usr/lib |
| 43 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnvme*.so* $(1)/usr/lib/ |
| 44 | endef |
| 45 | |
| 46 | define Build/InstallDev |
| 47 | $(INSTALL_DIR) $(1)/usr/include/nvme |
| 48 | $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/nvme/*.h $(1)/usr/include/nvme |
| 49 | $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ |
| 50 | $(INSTALL_DIR) $(1)/usr/lib |
| 51 | $(CP) $(PKG_INSTALL_DIR)/usr/lib/libnvme*.so* $(1)/usr/lib/ |
| 52 | $(INSTALL_DIR) $(1)/usr/lib/pkgconfig |
| 53 | $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libnvme*.pc $(1)/usr/lib/pkgconfig/ |
| 54 | endef |
| 55 | |
| 56 | $(eval $(call BuildPackage,libnvme)) |