From patchwork Sat Feb 27 10:09:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume Bres X-Patchwork-Id: 1445156 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=tv41Fk/x; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Dnj2Z6BGPz9sRN for ; Sat, 27 Feb 2021 21:10:26 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id B52B7842E7; Sat, 27 Feb 2021 10:10:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eArC4zAhCvgv; Sat, 27 Feb 2021 10:10:23 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp1.osuosl.org (Postfix) with ESMTP id C74CE842D1; Sat, 27 Feb 2021 10:10:22 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 354B41BF5A5 for ; Sat, 27 Feb 2021 10:10:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 24202842D1 for ; Sat, 27 Feb 2021 10:10:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8-h5eAbGEGdd for ; Sat, 27 Feb 2021 10:10:20 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by smtp1.osuosl.org (Postfix) with ESMTPS id 081268429D for ; Sat, 27 Feb 2021 10:10:19 +0000 (UTC) Received: by mail-wm1-f42.google.com with SMTP id u125so9796005wmg.4 for ; Sat, 27 Feb 2021 02:10:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=duODDTkai6sVHnuwElAfEBAMRh+k1mmPtXIjDfTA2FE=; b=tv41Fk/xTlyi5ezisp5G7YWZnhMxhlcVf5e8UhxQ1vcaxoibGxtS54IRJdDYXCkJWk 2BTCMwWmKiDJxghIgsca4chPGdgUKrMytpCT3s4L2YUsNHcpHsTP9PpZQmuB/Zc4a4tn LkHLENutFR4iGFKzCzjs6XXi6LGP2FrP7b2CrZhYri1Uch809sxamb8ZPqJiJBL4V6mi iWYyxoU9awHOVuDk5Oo5R2aOxIwe9ZmtNfy9jHuHgcXDBWPVJXt8v8lwyXQK7hSM+ZWw dkgDuRsIWgqk9k322mJVUiCAs9iNmKmEkrrEsUJxjY/dmWW16DbUsVA7uHU8xVvjYB3U cA+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=duODDTkai6sVHnuwElAfEBAMRh+k1mmPtXIjDfTA2FE=; b=hxFLLsHK7BypV+zFUUzDTkG3824s7LNtG55zLNHnxeH/vHuLwGLPZqazUgxNIhe0Js tOUdTHRqsC3ksGoxerAQO8Da587lrzv9a56iQYZ9z5prAu+2cDq2NKGK1F1XYS0Iy3Oc 8c5LRwE6vjJWp8LscbInMrvn98ZhdHi36DnvBUKwNAv6Oghc+nid4IioBDrB53NVyA2L gnDB9nrppxKVN9skhA4P2myZZzPpYxIrIxHg01zBjSCgItm3VXkI2IyXtr89eODhM2YB +hdwuyg2T1NEA5e37azmPAQa/NAb6+3gLKysW3gq02yhNMJhR7EQeOxdGJROUKYGEe3N VSjw== X-Gm-Message-State: AOAM533JKdDlPOeNnTs+7aUhOqg7X4MZS1JoVXm2Rrpt6RCGEtqSegXK sbse7mF/2YlsKH3b9U7IIH0EBYAuumQ/gw== X-Google-Smtp-Source: ABdhPJy/3uHH1RrC0A/sN//FiGMyb2hJbyFBG51PmZ8BXO5PJvXk/Fo/sof+Du1B8O98nofgUXQbjA== X-Received: by 2002:a1c:4386:: with SMTP id q128mr6786633wma.184.1614420618087; Sat, 27 Feb 2021 02:10:18 -0800 (PST) Received: from pc-140.home ([2a01:cb15:81d3:300:7285:c2ff:fea6:cc85]) by smtp.gmail.com with ESMTPSA id j26sm10435498wrh.57.2021.02.27.02.10.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Feb 2021 02:10:17 -0800 (PST) From: guillaume.bressaix@gmail.com To: buildroot@busybox.net, yann.morin.1998@free.fr, gwen@trabucayre.com, thomas.petazzoni@bootlin.com Date: Sat, 27 Feb 2021 11:09:59 +0100 Message-Id: <20210227100959.28281-1-guillaume.bressaix@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/pybind11: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Guillaume W. Bres" Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: "Guillaume W. Bres" Pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code. Signed-off-by: Guillaume W. Bres --- Warning!!: this new package and its internal BR2_PACKAGE_PYBIND11_WITH_PYTHON option intends to replace package/python-pybind which is totally broken since upgrade to v2.6.1 in ->next. The python build now requires a previous cmake build: + python-pybind only is not possible and will not build by itself + python setup.py requires cmake to install within $(@D) a couple files (in $(@D)/pybind11 exactly) to properly work. See my message in BR digest 17/02: cc to Thomas, Gwen & Peter, entitled: "Python-pybind we need to discuss this package" => If this package is merged, package/python-pybind is deprecated => package/python-pybind v2.6.1+ in ->next must be removed, python-build by itself cannot work anymore Pybind11 is a host only package Signed-off-by: Guillaume W. Bres --- DEVELOPERS | 1 + package/pybind11/Config.in | 25 ++++++++++++++++++++ package/pybind11/pybind11.hash | 3 +++ package/pybind11/pybind11.mk | 42 ++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 package/pybind11/Config.in create mode 100644 package/pybind11/pybind11.hash create mode 100644 package/pybind11/pybind11.mk diff --git a/DEVELOPERS b/DEVELOPERS index b019fe04d5..98e8b329ed 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1057,6 +1057,7 @@ N: Guillaume William Brs F: package/libnids/ F: package/liquid-dsp/ F: package/pixiewps/ +F: package/pybind11/ F: package/python-pybind/ F: package/reaver/ diff --git a/package/pybind11/Config.in b/package/pybind11/Config.in new file mode 100644 index 0000000000..883bf8cc09 --- /dev/null +++ b/package/pybind11/Config.in @@ -0,0 +1,25 @@ +comment "pybind11 needs a toolchain w/ C++, wchar" + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR + +config BR2_PACKAGE_PYBIND11 + bool "pybind11" + depends on BR2_INSTALL_LIBSTDCPP # boost + depends on BR2_USE_WCHAR # boost + depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # boost-thread + select BR2_PACKAGE_BOOST + help + Pybind11 is a lightweight header-only library that exposes C++ + types in Python and vice versa, mainly to create Python + bindings of existing C++ code. + + http://pybind11.readthedocs.org/en/master + +if BR2_PACKAGE_PYBIND11 + +config BR2_PACKAGE_PYBIND11_WITH_PYTHON + bool "pybind11-python" + depends on BR2_PACKAGE_PYTHON3 + help + Activate support for python-pybind + +endif diff --git a/package/pybind11/pybind11.hash b/package/pybind11/pybind11.hash new file mode 100644 index 0000000000..e703519a22 --- /dev/null +++ b/package/pybind11/pybind11.hash @@ -0,0 +1,3 @@ +# Locally calculated +sha256 8ff2fff22df038f5cd02cea8af56622bc67f5b64534f1b83b9f133b8366acff2 pybind11-2.6.2.tar.gz +sha256 83965b843b98f670d3a85bd041ed4b372c8ec50d7b4a5995a83ac697ba675dcb LICENSE diff --git a/package/pybind11/pybind11.mk b/package/pybind11/pybind11.mk new file mode 100644 index 0000000000..c8d69e1dd4 --- /dev/null +++ b/package/pybind11/pybind11.mk @@ -0,0 +1,42 @@ +################################################################################ +# +# pybind11 +# +################################################################################ + +PYBIND11_VERSION = 2.6.2 +PYBIND11_SITE = $(call github,pybind,pybind11,v$(PYBIND11_VERSION)) +PYBIND11_LICENSE = BSD-3-Clause +PYBIND11_LICENSE_FILES = LICENSE +PYBIND11_INSTALL_STAGING = YES +PYBIND11_SUPPORTS_IN_SOURCE_BUILD = YES + +HOST_PYBIND11_CONF_OPTS = \ + -DBUILD_DOCS=OFF \ + -DDOWNLOAD_EIGEN=OFF \ + -DPYTHON=$(TARGET_DIR)/usr/bin/python \ + -DPYTHON_PREFIX=$(STAGING_DIR)/usr + +# pybind11-python support activation +# this requires the cmake build installed within $(@D) +ifeq ($(BR2_PACKAGE_PYBIND11_WITH_PYTHON),y) + +HOST_PYBIND11_DEPENDENCIES += host-python3 + +HOST_PYBIND11_CONF_OPTS += -DCMAKE_INSTALL_PREFIX=$(@D)/pybind11 + +define PYBIND11_PYTHON_BUILD + cd $(@D) && $(HOST_DIR)/bin/python setup.py install +endef + +HOST_PYBIND11_POST_INSTALL_HOOKS += PYBIND11_PYTHON_BUILD + +else + +HOST_PYBIND11_CONF_OPTS += \ + -DPYBIND_FINDPYTHON=OFF \ + -DPYBIND11_NOPYTHON=ON + +endif + +$(eval $(host-cmake-package))