assimp: add package
authorDaniel Golle <daniel@makrotopia.org>
Mon, 25 Nov 2024 21:36:18 +0000 (22:36 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 5 Dec 2024 01:19:32 +0000 (01:19 +0000)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
libs/assimp/Makefile [new file with mode: 0644]

diff --git a/libs/assimp/Makefile b/libs/assimp/Makefile
new file mode 100644 (file)
index 0000000..4f76298
--- /dev/null
@@ -0,0 +1,49 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=assimp
+PKG_VERSION:=5.4.3
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/$(PKG_NAME)/$(PKG_NAME)/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=66dfbaee288f2bc43172440a55d0235dfc7bf885dda6435c038e8000e79582cb
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+PKG_LICENSE:=BSD-3-Clause
+
+CMAKE_INSTALL:=1
+PKG_BUILD_FLAGS:=gc-sections lto
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/cmake.mk
+
+define Package/libassimp
+  SECTION:=libs
+  CATEGORY:=Libraries
+  SUBMENU:=Video
+  TITLE:=Open Asset Importer Library
+  URL:=https://github.com/assimp/assimp
+  DEPENDS:=+libstdcpp +zlib
+endef
+
+define Package/libassimp/description
+Open Asset Import Library is a library that loads various 3D file formats
+into a shared, in-memory format. It supports more than 40 file formats
+for import and a growing selection of file formats for export.
+endef
+
+CMAKE_OPTIONS += \
+       -DBUILD_SHARED_LIBS=ON
+
+define Build/InstallDev
+       $(call Build/InstallDev/cmake,$(1))
+       $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/assimp.pc
+       $(SED) 's,/usr/lib,$$$${prefix}/lib,g' $(1)/usr/lib/pkgconfig/assimp.pc
+endef
+
+define Package/libassimp/install
+       $(INSTALL_DIR) $(1)/usr/lib
+       $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib
+endef
+
+$(eval $(call BuildPackage,libassimp))