From patchwork Tue Mar 24 17:38:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 1260842 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.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com 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=guhstPMo; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48mz5752J4z9sPR for ; Wed, 25 Mar 2020 04:39:07 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 191448869F; Tue, 24 Mar 2020 17:39:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VXCBgJPNpcrT; Tue, 24 Mar 2020 17:39:02 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E66AC88650; Tue, 24 Mar 2020 17:39:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 58C4E1BF344 for ; Tue, 24 Mar 2020 17:39:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 560D984789 for ; Tue, 24 Mar 2020 17:39:00 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VfSIVtJwyoL3 for ; Tue, 24 Mar 2020 17:38:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pj1-f65.google.com (mail-pj1-f65.google.com [209.85.216.65]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 254E5844B7 for ; Tue, 24 Mar 2020 17:38:59 +0000 (UTC) Received: by mail-pj1-f65.google.com with SMTP id mj6so1891950pjb.5 for ; Tue, 24 Mar 2020 10:38:59 -0700 (PDT) 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=j1aBhpPreuw4ql1KSrnAuf9ntkbEqNkvBjKrSVCFFik=; b=guhstPMol3x8D6y+iuwQdm64M/IQpv0dpa5ejnTMsYzTmO1qIFN8EqIimolmlCwCFa YPqoxZc7wKnLm1t6BdEMYIPHcrTY5sh1Ysr/Xa/AnOT2E6FRqJTQWjJ0ikILcXr9sbWw oGIZsKDK/wgkn7NVD50gEadq6BK1dU3tM2JQ2lTQ9gskOLam6GPorSyL0VGfFztmLxCo p37ZBcUriXQLq1+vHYcCHQJWk6M9/1MQ3JFxzv9TGyo+MeYWs+qq8xbiNqD+g54dgsKO b8gBeiwUm9o6yBdIAjm/hDaf09JOuJbIH0mJnp7e8o+nVVmMrp8aDZ3w/Cp85iFUCGPd NRPg== 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=j1aBhpPreuw4ql1KSrnAuf9ntkbEqNkvBjKrSVCFFik=; b=lxBZsq1CCrjcaTaxcxIUMZISnyGShQ7eI+AXO1KR6jD3DbM46+cbxncbWnOQiEszFo neBv8i6KkJstugT3r3wu/iPOlGcI8KF+2ogAnGEbDZdwmWrUJ79vb6+RAQYMnE7nhVd7 HnEXQacgk2SXi6GxBqA91EOjFzInM4ydTIazesKitbGsMNPk6T1EPSPbwOPGnMvSvsd9 CHRUo4w/we6qqIMFId2GKkBd5Qgx/FEgBgdQJ2n+C6BUeL4MKNBh+DEm70SdzpsG6+Dm 9C+TqXRLpTx0f/+QB7SfOR2l9nkjlvdqo865oC6Mr9lyMI6iUcq12EmgKPKkznt6zOaj lH6A== X-Gm-Message-State: ANhLgQ2csQl5um/6gNlgbNWZtJNmPgwz7WvwhPxIVUoJj5JWQ3lqvGjt cCmqPkB3QWC7HKWZWn070jlJ7nLa X-Google-Smtp-Source: ADFU+vtLDW9C4z7Lh4BAJ0bhY9gTidgA/II0iLh0jPxAnO0wshVZ8A6O2H0LJAyRUunWpJs/K6Fnfw== X-Received: by 2002:a17:902:b785:: with SMTP id e5mr11320300pls.175.1585071538155; Tue, 24 Mar 2020 10:38:58 -0700 (PDT) Received: from localhost.localdomain ([47.149.8.172]) by smtp.gmail.com with ESMTPSA id v25sm12194425pgl.55.2020.03.24.10.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 10:38:57 -0700 (PDT) From: aduskett@gmail.com To: buildroot@buildroot.org Date: Tue, 24 Mar 2020 10:38:52 -0700 Message-Id: <20200324173855.747054-1-aduskett@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/3] package/gstreamer1/gst1-python: fix libpython-dir path 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: Adam Duskett , Ricardo Martincoski Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Adam Duskett Due to the CONF_ENV options set in the gst1-python.mk file, libpython-dir must be set manually or else the error: "Python dynamic library path could not be determined" occurs. Previously the libpython-dir option was set to $(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR), however, this breaks the resulting .so because the above full path is baked into the resulting .so. which results in the error: Couldn't g_module_open libpython. Reason: /full/path/to/host/lib/python3.8/libpython3.8.so: cannot open shared object file: No such file or directory To fix this error, set the libpython-dir to /usr/lib. Because we provide PYTHONPATH=$(PYTHON3_PATH) in the GST1_PYTHON_CONF_ENV, the logic in the meson file uses the above python3 provided by the PYTHONPATH variable to determine /usr/lib/ has the proper python$(PYTHON3_VERSION_MAJOR).so file. Because Buildroot provides the appropriate paths, the meson file finds the correct .so file and the resulting compiled library has the appropriate path of /usr/lib/python3.$(PYTHON3_VERSION_MAJOR).so This change has been tested on the following distributions: - Debian 9 and 10 - Debian 9 without python3 installed on the host. - Centos7 - Fedora 31 Signed-off-by: Adam Duskett --- package/gstreamer1/gst1-python/gst1-python.mk | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/package/gstreamer1/gst1-python/gst1-python.mk b/package/gstreamer1/gst1-python/gst1-python.mk index 23b4bbd900..122c3dd997 100644 --- a/package/gstreamer1/gst1-python/gst1-python.mk +++ b/package/gstreamer1/gst1-python/gst1-python.mk @@ -23,10 +23,16 @@ GST1_PYTHON_CONF_ENV += \ _PYTHON_SYSCONFIGDATA_NAME=$(PKG_PYTHON_SYSCONFIGDATA_NAME) \ PYTHONPATH=$(PYTHON3_PATH) -# Due to the CONF_ENV options, libpython-dir must be set to the host directory +# Due to the CONF_ENV options, libpython-dir must be set manually # or else the error: "Python dynamic library path could not be determined" -# will occure +# occurs. We set the libpython-dir to /usr/lib as this path is hard-coded +# into the resulting .so file as /usr/lib/python3.$(PYTHON3_VERSION_MAJOR).so. +# Because we provide PYTHONPATH=$(PYTHON3_PATH) above, the logic in the meson +# file uses the above python path to determine if /usr/lib/ has the proper .so +# file. Because Buildroot provides the appropriate paths, the meson file finds +# the correct .so file, and the resulting compiled library has the appropriate +# path of /usr/lib/python3.$(PYTHON3_VERSION_MAJOR).so GST1_PYTHON_CONF_OPTS += \ - -Dlibpython-dir=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR) + -Dlibpython-dir=/usr/lib/ $(eval $(meson-package))