diff mbox

[v2] kmsxx: new package

Message ID 1462783135-16131-1-git-send-email-maxime.ripard@free-electrons.com
State Changes Requested
Headers show

Commit Message

Maxime Ripard May 9, 2016, 8:38 a.m. UTC
KMS++ is a suite of library and test tools to interact with KMS drivers in
the linux kernel.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
Changes from v2:
  - Added support for the python bindings
  - Added extra dependencies (gcc 4.8, libstdc++ installation)

 package/Config.in       |  1 +
 package/kmsxx/Config.in | 32 ++++++++++++++++++++++++++++
 package/kmsxx/kmsxx.mk  | 55 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 88 insertions(+)
 create mode 100644 package/kmsxx/Config.in
 create mode 100644 package/kmsxx/kmsxx.mk

Comments

Maxime Ripard June 2, 2016, 7:17 a.m. UTC | #1
On Mon, May 09, 2016 at 10:38:55AM +0200, Maxime Ripard wrote:
> KMS++ is a suite of library and test tools to interact with KMS drivers in
> the linux kernel.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Ping?
Yegor Yefremov June 8, 2016, 10:11 a.m. UTC | #2
Hi Maxime ,

On Thu, Jun 2, 2016 at 9:17 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> On Mon, May 09, 2016 at 10:38:55AM +0200, Maxime Ripard wrote:
>> KMS++ is a suite of library and test tools to interact with KMS drivers in
>> the linux kernel.
>>
>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>
> Ping?

What about removing Python bindings config option and just check if
Python 3 is activated in *.mk file? See package/libcec/libcec.mk for
reference.

Though libdrm already requires host-pkgconf, should this dependency
appear in kms.mk?

I've looked at CMakeLIsts.txt in master branch of the project and I
cannot see swig invocation. They just seem to compile some cpp files
in py folder.

Could also ask project maintainers to add some cpack stuff?

Yegor
Yegor Yefremov June 8, 2016, 10:27 a.m. UTC | #3
On Wed, Jun 8, 2016 at 12:18 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Yegor,
>
> On Wednesday 08 Jun 2016 12:11:10 Yegor Yefremov wrote:
>> On Thu, Jun 2, 2016 at 9:17 AM, Maxime Ripard wrote:
>> > On Mon, May 09, 2016 at 10:38:55AM +0200, Maxime Ripard wrote:
>> >> KMS++ is a suite of library and test tools to interact with KMS drivers
>> >> in the linux kernel.
>> >>
>> >> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>> >
>> > Ping?
>>
>> What about removing Python bindings config option and just check if
>> Python 3 is activated in *.mk file? See package/libcec/libcec.mk for
>> reference.
>>
>> Though libdrm already requires host-pkgconf, should this dependency
>> appear in kms.mk?
>>
>> I've looked at CMakeLIsts.txt in master branch of the project and I
>> cannot see swig invocation. They just seem to compile some cpp files
>> in py folder.
>
> The dependency on swig got removed recently, they now use pybind11.

In other words we need https://pypi.python.org/pypi/pybind11 as a host package?

Yegor
Yegor Yefremov June 8, 2016, 2:19 p.m. UTC | #4
On Wed, Jun 8, 2016 at 4:16 PM, Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
> Hi Yegor,
>
> On Wednesday 08 Jun 2016 12:27:21 Yegor Yefremov wrote:
>> On Wed, Jun 8, 2016 at 12:18 PM, Laurent Pinchart wrote:
>> > On Wednesday 08 Jun 2016 12:11:10 Yegor Yefremov wrote:
>> >> On Thu, Jun 2, 2016 at 9:17 AM, Maxime Ripard wrote:
>> >>> On Mon, May 09, 2016 at 10:38:55AM +0200, Maxime Ripard wrote:
>> >>>> KMS++ is a suite of library and test tools to interact with KMS
>> >>>> drivers in the linux kernel.
>> >>>>
>> >>>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>> >>>
>> >>> Ping?
>> >>
>> >> What about removing Python bindings config option and just check if
>> >> Python 3 is activated in *.mk file? See package/libcec/libcec.mk for
>> >> reference.
>> >>
>> >> Though libdrm already requires host-pkgconf, should this dependency
>> >> appear in kms.mk?
>> >>
>> >> I've looked at CMakeLIsts.txt in master branch of the project and I
>> >> cannot see swig invocation. They just seem to compile some cpp files
>> >> in py folder.
>> >
>> > The dependency on swig got removed recently, they now use pybind11.
>>
>> In other words we need https://pypi.python.org/pypi/pybind11 as a host
>> package?
>
> I don't think so, kmsxx includes pybind11 as a submodule.

I mean for the future. And if pybind11 would also supply pybin11.pc,
then CMake could even automatically find it.
Yegor Yefremov June 8, 2016, 2:34 p.m. UTC | #5
On Wed, Jun 8, 2016 at 4:19 PM, Yegor Yefremov
<yegorslists@googlemail.com> wrote:
> On Wed, Jun 8, 2016 at 4:16 PM, Laurent Pinchart
> <laurent.pinchart@ideasonboard.com> wrote:
>> Hi Yegor,
>>
>> On Wednesday 08 Jun 2016 12:27:21 Yegor Yefremov wrote:
>>> On Wed, Jun 8, 2016 at 12:18 PM, Laurent Pinchart wrote:
>>> > On Wednesday 08 Jun 2016 12:11:10 Yegor Yefremov wrote:
>>> >> On Thu, Jun 2, 2016 at 9:17 AM, Maxime Ripard wrote:
>>> >>> On Mon, May 09, 2016 at 10:38:55AM +0200, Maxime Ripard wrote:
>>> >>>> KMS++ is a suite of library and test tools to interact with KMS
>>> >>>> drivers in the linux kernel.
>>> >>>>
>>> >>>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
>>> >>>
>>> >>> Ping?
>>> >>
>>> >> What about removing Python bindings config option and just check if
>>> >> Python 3 is activated in *.mk file? See package/libcec/libcec.mk for
>>> >> reference.
>>> >>
>>> >> Though libdrm already requires host-pkgconf, should this dependency
>>> >> appear in kms.mk?
>>> >>
>>> >> I've looked at CMakeLIsts.txt in master branch of the project and I
>>> >> cannot see swig invocation. They just seem to compile some cpp files
>>> >> in py folder.
>>> >
>>> > The dependency on swig got removed recently, they now use pybind11.
>>>
>>> In other words we need https://pypi.python.org/pypi/pybind11 as a host
>>> package?
>>
>> I don't think so, kmsxx includes pybind11 as a submodule.
>
> I mean for the future. And if pybind11 would also supply pybin11.pc,
> then CMake could even automatically find it.

As to pkg-config support it won't happen any time soon :-(

https://github.com/pybind/pybind11/issues/230
Maxime Ripard June 8, 2016, 7:04 p.m. UTC | #6
On Wed, Jun 08, 2016 at 04:34:10PM +0200, Yegor Yefremov wrote:
> On Wed, Jun 8, 2016 at 4:19 PM, Yegor Yefremov
> <yegorslists@googlemail.com> wrote:
> > On Wed, Jun 8, 2016 at 4:16 PM, Laurent Pinchart
> > <laurent.pinchart@ideasonboard.com> wrote:
> >> Hi Yegor,
> >>
> >> On Wednesday 08 Jun 2016 12:27:21 Yegor Yefremov wrote:
> >>> On Wed, Jun 8, 2016 at 12:18 PM, Laurent Pinchart wrote:
> >>> > On Wednesday 08 Jun 2016 12:11:10 Yegor Yefremov wrote:
> >>> >> On Thu, Jun 2, 2016 at 9:17 AM, Maxime Ripard wrote:
> >>> >>> On Mon, May 09, 2016 at 10:38:55AM +0200, Maxime Ripard wrote:
> >>> >>>> KMS++ is a suite of library and test tools to interact with KMS
> >>> >>>> drivers in the linux kernel.
> >>> >>>>
> >>> >>>> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
> >>> >>>
> >>> >>> Ping?
> >>> >>
> >>> >> What about removing Python bindings config option and just check if
> >>> >> Python 3 is activated in *.mk file? See package/libcec/libcec.mk for
> >>> >> reference.
> >>> >>
> >>> >> Though libdrm already requires host-pkgconf, should this dependency
> >>> >> appear in kms.mk?
> >>> >>
> >>> >> I've looked at CMakeLIsts.txt in master branch of the project and I
> >>> >> cannot see swig invocation. They just seem to compile some cpp files
> >>> >> in py folder.
> >>> >
> >>> > The dependency on swig got removed recently, they now use pybind11.
> >>>
> >>> In other words we need https://pypi.python.org/pypi/pybind11 as a host
> >>> package?
> >>
> >> I don't think so, kmsxx includes pybind11 as a submodule.
> >
> > I mean for the future. And if pybind11 would also supply pybin11.pc,
> > then CMake could even automatically find it.
> 
> As to pkg-config support it won't happen any time soon :-(
> 
> https://github.com/pybind/pybind11/issues/230

Honestly, I don't care at all about the python bindings.

I'll remove support for that in the v3, and if anyone is ever
interested in adding support for it, he'll work on it (and things will
have settled down hopefully)

Maxime
Thomas Petazzoni June 8, 2016, 7:57 p.m. UTC | #7
Hello,

On Wed, 8 Jun 2016 21:04:24 +0200, Maxime Ripard wrote:

> Honestly, I don't care at all about the python bindings.
> 
> I'll remove support for that in the v3, and if anyone is ever
> interested in adding support for it, he'll work on it (and things will
> have settled down hopefully)

FWIW: I discussed this topic with Maxime today. I very much prefer
having a basic kmsxx package merged, with the features that Maxime
uses/needs, rather than waiting endlessly to resolve all the Python
bindings issues. So let's merge a simpler version of kmsxx that doesn't
have the Python bindings, and when someone is interested enough to have
the Python bindings, this someone can submit follow-up patches.

So, yes, Maxime: please send a simpler version of the patch.

Thomas
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 529ad3364994..4bb60ead530b 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -867,6 +867,7 @@  menu "Graphics"
 	source "package/imlib2/Config.in"
 	source "package/jasper/Config.in"
 	source "package/jpeg/Config.in"
+	source "package/kmsxx/Config.in"
 	source "package/lcms2/Config.in"
 	source "package/lesstif/Config.in"
 	source "package/libart/Config.in"
diff --git a/package/kmsxx/Config.in b/package/kmsxx/Config.in
new file mode 100644
index 000000000000..748f65342f3d
--- /dev/null
+++ b/package/kmsxx/Config.in
@@ -0,0 +1,32 @@ 
+config BR2_PACKAGE_KMSXX
+	bool "kmsxx"
+	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libpthread-stubs
+	select BR2_PACKAGE_LIBDRM
+	help
+	  libkms++ is a C++11 library for kernel mode setting.
+
+	  Also included are simple test tools for KMS and python wrapper for
+	  libkms++.
+
+	  https://github.com/tomba/kmsxx
+
+if BR2_PACKAGE_KMSXX
+
+config BR2_PACKAGE_KMSXX_INSTALL_TESTS
+	bool "Install test programs"
+	help
+	  This option allows to install the kmsxx test programs.
+
+config BR2_PACKAGE_KMSXX_BINDINGS_PYTHON
+	bool "Install Python bindings"
+	depends on BR2_PACKAGE_PYTHON3
+	help
+	  Install the python bindings
+
+endif
+
+comment "kmsxx needs a toolchain w/ threads"
+        depends on !BR2_TOOLCHAIN_HAS_THREADS
+
diff --git a/package/kmsxx/kmsxx.mk b/package/kmsxx/kmsxx.mk
new file mode 100644
index 000000000000..218a2a5e710a
--- /dev/null
+++ b/package/kmsxx/kmsxx.mk
@@ -0,0 +1,55 @@ 
+################################################################################
+#
+# kmsxx
+#
+################################################################################
+
+KMSXX_VERSION = bef0109aa93971dd6cc6040661dc6494533e6bee
+KMSXX_SITE = $(call github,tomba,kmsxx,$(KMSXX_VERSION))
+KMSXX_LICENSE = MPLv2.0
+KMSXX_LICENSE_FILES = LICENSE
+
+KMSXX_DEPENDENCIES += libdrm
+
+ifeq ($(BR2_PACKAGE_KMSXX_BINDINGS_PYTHON),y)
+KMSXX_DEPENDENCIES += python3 host-swig
+KMSXX_CONF_OPTS += -DLIBKMS_ENABLE_PYTHON=ON
+
+define KMSXX_INSTALL_TARGET_BINDINGS
+	$(INSTALL) -D -m 0755 $(@D)/py/_pykms.so \
+		$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/_pykms.so
+	$(INSTALL) -D -m 0755 $(@D)/py/pykms.py \
+		$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/pykms.py
+endef
+else
+KMSXX_CONF_OPTS += -DLIBKMS_ENABLE_PYTHON=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_KMSXX_INSTALL_TESTS),y)
+define KMSXX_INSTALL_TARGET_TESTS
+	$(INSTALL) -D -m 0755 $(@D)/tests/db \
+		$(TARGET_DIR)/usr/bin/db
+	$(INSTALL) -D -m 0755 $(@D)/tests/fbtestpat \
+		$(TARGET_DIR)/usr/bin/fbtestpat
+	$(INSTALL) -D -m 0755 $(@D)/tests/kmscapture \
+		$(TARGET_DIR)/usr/bin/kmscapture
+	$(INSTALL) -D -m 0755 $(@D)/tests/kmsprint \
+		$(TARGET_DIR)/usr/bin/kmsprint
+	$(INSTALL) -D -m 0755 $(@D)/tests/kmsview \
+		$(TARGET_DIR)/usr/bin/kmsview
+	$(INSTALL) -D -m 0755 $(@D)/tests/testpat \
+		$(TARGET_DIR)/usr/bin/testpat
+endef
+endif
+
+define KMSXX_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/libkms++/libkms++.so \
+		$(TARGET_DIR)/usr/lib/libkms++.so
+	$(INSTALL) -D -m 0755 $(@D)/libkmstest/libkmstest.so \
+		$(TARGET_DIR)/usr/lib/libkmstest.so
+
+	$(KMSXX_INSTALL_TARGET_TESTS)
+	$(KMSXX_INSTALL_TARGET_BINDINGS)
+endef
+
+$(eval $(cmake-package))