[beignet] 02/03: Add AppStream metadata

Rebecca Palmer rnpalmer-guest at moszumanska.debian.org
Sun Jan 15 15:06:16 UTC 2017


This is an automated email from the git hooks/post-receive script.

rnpalmer-guest pushed a commit to branch master
in repository beignet.

commit b09d8a59a78f7e8811d37fec18697e8d136999a4
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Date:   Sun Jan 15 12:31:10 2017 +0000

    Add AppStream metadata
---
 debian/beignet-opencl-icd.install           |  1 +
 debian/changelog                            |  1 +
 debian/patches/add-appstream-metadata.patch | 76 +++++++++++++++++++++++++++++
 debian/patches/series                       |  1 +
 4 files changed, 79 insertions(+)

diff --git a/debian/beignet-opencl-icd.install b/debian/beignet-opencl-icd.install
index 075600e..1b547c1 100644
--- a/debian/beignet-opencl-icd.install
+++ b/debian/beignet-opencl-icd.install
@@ -5,3 +5,4 @@ usr/lib/*/beignet/libcl.so
 usr/lib/*/beignet/include
 usr/lib/*/beignet/beignet.pch
 usr/lib/*/beignet/beignet.bc
+usr/share/metainfo/*.metainfo.xml
diff --git a/debian/changelog b/debian/changelog
index 89fc9c1..878d1f6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,7 @@ beignet (1.2.1-2) UNRELEASED; urgency=medium
   * Fail, don't assert, on failed context creation.  (Closes: #848792)
   * Better document #848368 workarounds.
   * Fix pocl link in documentation.
+  * Add AppStream metadata.
 
  -- Rebecca N. Palmer <rebecca_palmer at zoho.com>  Tue, 03 Jan 2017 21:52:36 +0000
 
diff --git a/debian/patches/add-appstream-metadata.patch b/debian/patches/add-appstream-metadata.patch
new file mode 100644
index 0000000..8b01554
--- /dev/null
+++ b/debian/patches/add-appstream-metadata.patch
@@ -0,0 +1,76 @@
+Description: Add Appstream metadata listing supported hardware
+
+http://people.skolelinux.org/pere/blog/Using_appstream_with_isenkram_to_install_hardware_related_packages_in_Debian.html
+https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html#sect-Metadata-GenericComponent
+
+Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+Forwarded: todo
+
+--- beignet-1.2.1.orig/CMakeLists.txt
++++ beignet-1.2.1/CMakeLists.txt
+@@ -287,6 +287,10 @@ IF(BUILD_EXAMPLES)
+ ADD_SUBDIRECTORY(examples)
+ ENDIF(BUILD_EXAMPLES)
+ 
++add_custom_target(metainfo ALL
++                  COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/update_metainfo_xml.py "${LIBCL_DRIVER_VERSION_MAJOR}.${LIBCL_DRIVER_VERSION_MINOR}.${LIBCL_DRIVER_VERSION_PATCH}" ${CMAKE_CURRENT_BINARY_DIR})
++install (FILES ${CMAKE_CURRENT_BINARY_DIR}/com.intel.beignet.metainfo.xml DESTINATION /usr/share/metainfo)
++
+ SET(CPACK_SET_DESTDIR ON)
+ SET(CPACK_PACKAGE_VERSION_MAJOR "${LIBCL_DRIVER_VERSION_MAJOR}")
+ SET(CPACK_PACKAGE_VERSION_MINOR "${LIBCL_DRIVER_VERSION_MINOR}")
+--- /dev/null
++++ beignet-1.2.1/com.intel.beignet.metainfo.xml.in
+@@ -0,0 +1,17 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<component type="driver">
++<id>com.intel.beignet</id>
++<name>Beignet</name>
++<summary>OpenCL (GPU compute) driver for Intel GPUs</summary>
++<description>This allows using Intel integrated GPUs for general computation, speeding up some applications.</description>
++<provides>
++ at modalias_list@
++</provides>
++<metadata_license>LGPL-2.1+</metadata_license>
++<project_license>LGPL-2.1+</project_license>
++<url type="homepage">https://www.freedesktop.org/wiki/Software/Beignet/</url>
++<developer_name>Intel</developer_name>
++<releases>
++<release version="@version@"></release>
++</releases>
++</component>
+--- /dev/null
++++ beignet-1.2.1/update_metainfo_xml.py
+@@ -0,0 +1,32 @@
++#!/usr/bin/python3
++
++import re
++import sys
++import os.path
++
++if len(sys.argv)!=3:
++    raise TypeError("requires version_string and output_directory")
++version_string=sys.argv[1]
++output_directory=sys.argv[2]
++source_directory=os.path.dirname(sys.argv[0])
++source_file=open(os.path.join(source_directory,"src/cl_device_data.h"),"r",encoding='utf-8')
++device_ids=[]
++supported=False#first few devices in the file aren't supported
++for line in source_file:
++    device_id=re.match(r"#define\s+PCI_CHIP_([A-Za-z0-9_]+)\s+0x([0-9A-Fa-f]+)",line)
++    if device_id is None:
++        continue
++    if "IVYBRIDGE" in device_id.group(1):
++        supported=True#start of supported devices
++    if supported:
++        device_ids.append(device_id.group(2).upper())
++source_file.close()
++modalias_list_string="\n".join("<modalias>pci:v00008086d0000{}*</modalias>".format(device_id) for device_id in sorted(device_ids))
++metadata_file_in=open(os.path.join(source_directory,"com.intel.beignet.metainfo.xml.in"),"r",encoding='utf-8')
++metadata_string=metadata_file_in.read()
++metadata_file_in.close()
++metadata_string=metadata_string.replace("@modalias_list@",modalias_list_string).replace("@version@",version_string)
++metadata_file_out=open(os.path.join(output_directory,"com.intel.beignet.metainfo.xml"),"w",encoding='utf-8')
++metadata_file_out.write(metadata_string)
++metadata_file_out.close()
++
diff --git a/debian/patches/series b/debian/patches/series
index 396ec2c..8dcd0c0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,3 +11,4 @@ cl_accelerator_intel.patch
 llvm39-support.patch
 avoid-invalid-iterator.patch
 noassert-failed-context.patch
+add-appstream-metadata.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/beignet.git



More information about the Pkg-opencl-commits mailing list