commit:     4f59fffef1fd0000a27203f4dc0ef76fce712997
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 14 10:17:36 2022 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Tue Jun 14 10:17:36 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4f59fffe

sci-libs/foxi: add to tree

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 sci-libs/foxi/Manifest                           |  1 +
 sci-libs/foxi/files/foxi-2021.05.27-gentoo.patch | 73 ++++++++++++++++++++++++
 sci-libs/foxi/foxi-2021.05.27.ebuild             | 28 +++++++++
 sci-libs/foxi/metadata.xml                       | 11 ++++
 4 files changed, 113 insertions(+)

diff --git a/sci-libs/foxi/Manifest b/sci-libs/foxi/Manifest
new file mode 100644
index 000000000000..9186a3d04fb8
--- /dev/null
+++ b/sci-libs/foxi/Manifest
@@ -0,0 +1 @@
+DIST foxi-2021.05.27.tar.gz 28960 BLAKE2B 
06c960f829b090eec4fe9e8c981e119578f358724e0b63991173bb7e318d23654261b901d1e15efeb6240bba75cc05fd45ab32fb30bbdf48369e139cf152f398
 SHA512 
ad42cfd70e40ba0f0a9187b34ae9e3bd361c8c0038669f4c1591c4f7421d12ad93f76f42b33c2575eea1a3ddb3ff781da2895cdc636df5b60422598f450203c7

diff --git a/sci-libs/foxi/files/foxi-2021.05.27-gentoo.patch 
b/sci-libs/foxi/files/foxi-2021.05.27-gentoo.patch
new file mode 100644
index 000000000000..f252ae4fcdb2
--- /dev/null
+++ b/sci-libs/foxi/files/foxi-2021.05.27-gentoo.patch
@@ -0,0 +1,73 @@
+--- a/CMakeLists.txt   2022-06-13 21:42:28.197087591 +0200
++++ b/CMakeLists.txt   2022-06-13 21:44:49.787170054 +0200
+@@ -77,6 +77,7 @@
+     OUTPUT_NAME "foxi"
+     POSITION_INDEPENDENT_CODE YES)
+   target_link_libraries(foxi_wrapper PRIVATE foxi_loader foxi)
++  target_link_options(foxi_wrapper PUBLIC "-Wl,-soname=libfoxi.so")
+   if(DEFINED FOXI_SEARCH_DIR)
+     target_compile_definitions(foxi_wrapper PRIVATE 
"FOXI_SEARCH_DIR=\"${FOXI_SEARCH_DIR}\"")
+   endif()
+@@ -115,11 +116,11 @@
+ 
+ install(TARGETS
+   foxi foxi_dummy foxi_loader
+-  EXPORT ONNXTargets DESTINATION lib)
++  EXPORT ONNXTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+ if(NOT ANDROID AND NOT IOS)
+   install(TARGETS foxi_wrapper
+-    EXPORT ONNXTargets DESTINATION lib)
++    EXPORT ONNXTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ endif()
+ 
+ set(FOXI_INCLUDE_DIRS "${FOXI_ROOT}" "${CMAKE_CURRENT_BINARY_DIR}")
+--- a/foxi/onnxifi_wrapper.c   2022-06-14 08:07:07.351585673 +0200
++++ b/foxi/onnxifi_wrapper.c   2022-06-14 08:11:21.680855591 +0200
+@@ -761,7 +761,9 @@
+     const void* onnxModel,
+     uint32_t weightsCount,
+     const onnxTensorDescriptorV1* weightDescriptors,
+-    onnxGraph* graph)
++    onnxGraph* graph,
++    uint32_t maxSeqLength,
++    void* deferredWeightReader)
+ {
+   if (graph == NULL) {
+     return ONNXIFI_STATUS_INVALID_POINTER;
+@@ -797,7 +799,9 @@
+     onnxModel,
+     weightsCount,
+     weightDescriptors,
+-    &graph_wrapper->graph);
++    &graph_wrapper->graph,
++    maxSeqLength,
++    deferredWeightReader);
+   switch (status) {
+     case ONNXIFI_STATUS_SUCCESS:
+     case ONNXIFI_STATUS_FALLBACK:
+--- a/foxi/onnxifi_dummy.c     2022-06-14 08:14:02.484503254 +0200
++++ b/foxi/onnxifi_dummy.c     2022-06-14 08:17:01.408891030 +0200
+@@ -103,7 +103,9 @@
+     const void* onnxModel,
+     uint32_t weightCount,
+     const onnxTensorDescriptorV1* weightDescriptors,
+-    onnxGraph* graph) {
++    onnxGraph* graph,
++    uint32_t maxSeqLength,
++    void* deferredWeightReader) {
+   if (graph == NULL) {
+     return ONNXIFI_STATUS_INVALID_POINTER;
+   }
+@@ -215,6 +217,8 @@
+ onnxWaitEventFor(onnxEvent event,
+                  uint32_t timeoutMs,
+                  onnxEventState* eventState,
+-                 onnxStatus* eventStatus) {
++                 onnxStatus* eventStatus,
++                 char* message,
++                 size_t* messageLength) {
+   return ONNXIFI_STATUS_SUCCESS;
+-}
+\ No newline at end of file
++}

diff --git a/sci-libs/foxi/foxi-2021.05.27.ebuild 
b/sci-libs/foxi/foxi-2021.05.27.ebuild
new file mode 100644
index 000000000000..5a3d59c25fd3
--- /dev/null
+++ b/sci-libs/foxi/foxi-2021.05.27.ebuild
@@ -0,0 +1,28 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+inherit cmake
+
+CommitId=c278588e34e535f0bb8f00df3880d26928038cad
+
+DESCRIPTION="ONNXIFI with Facebook Extension"
+HOMEPAGE="https://github.com/houseroad/foxi/";
+SRC_URI="https://github.com/houseroad/${PN}/archive/${CommitId}.tar.gz
+       -> ${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND=""
+RDEPEND="
+       ${DEPEND}
+"
+RESTRICT="test" # No test available
+
+S="${WORKDIR}"/${PN}-${CommitId}
+
+PATCHES=(
+       "${FILESDIR}"/${P}-gentoo.patch
+)

diff --git a/sci-libs/foxi/metadata.xml b/sci-libs/foxi/metadata.xml
new file mode 100644
index 000000000000..2b6c8e44882d
--- /dev/null
+++ b/sci-libs/foxi/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Tupone Alfredo</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">houseroad/foxi</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to