From patchwork Fri Oct 20 20:08:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adam Duskett X-Patchwork-Id: 828790 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.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.b="OFC41yeG"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yJcMF29Vjz9t1t for ; Sat, 21 Oct 2017 07:09:12 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7466D89058; Fri, 20 Oct 2017 20:09:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZqaG0ZAXkWzu; Fri, 20 Oct 2017 20:09:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id AB30889031; Fri, 20 Oct 2017 20:09:05 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id C5D771CEB0E for ; Fri, 20 Oct 2017 20:09:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BC8092EF01 for ; Fri, 20 Oct 2017 20:09:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0by9witMN00f for ; Fri, 20 Oct 2017 20:09:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-yw0-f195.google.com (mail-yw0-f195.google.com [209.85.161.195]) by silver.osuosl.org (Postfix) with ESMTPS id 9AC7526DE9 for ; Fri, 20 Oct 2017 20:09:01 +0000 (UTC) Received: by mail-yw0-f195.google.com with SMTP id y75so7357930ywg.0 for ; Fri, 20 Oct 2017 13:09:01 -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; bh=I7Y07pH2XB+V/yVbi37ofaS5nqaSlh5w7k+LRB/9sQk=; b=OFC41yeG/cMb49qMWI7NK2jFDldVnTGQxcbTqQ5TnRw3N7EFXvEA8BN40uN+q9M0O7 2OfKuWvRPGSeyvSADIT1/t71GWRdWaFa3N4lio2bKGyd7bF4MVxsD/l/fbjbAprQdyXQ euZOnTM4/+TIQxvbCCS5mDeK7jYk/ZbZ2jodbeoxAO9nBUPoB4lFvGAT21x7h8s2ENGA 48Jhw9SLQ074VtMIL5tEE+heQ4gWHheqV99aaFiZYN2ZpftCEOSX0R7RVc+pTGzHPrsM q51ZKjgPrXWRBu/m5byGyId8AadcGKCwuuK0PtdQEtfRBP5vCQTy+gUQxfbbrKo/aVZ7 WMGA== 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; bh=I7Y07pH2XB+V/yVbi37ofaS5nqaSlh5w7k+LRB/9sQk=; b=OnRKsfPu+MBPqwaupTfPB/bBshcEEl0WNQxP2l9xL9PKTyAAqtF0ll6BPV9VL0hT/H R/3qo8EwByCB94sczxnKulpLxdJ3+73ZnkPuwzY2gXWxkWzMdDJ/h1k71ipZJLvZG7Se obw/MYkKMrHKT9zUuusQFeAb/dM3LI+okzyiQboqbJbpsR0PUVN+FWuJHWtnQQV93jJW YsTBmZ69e+90RYLsMHjdqP/qnMS8QuxfT6BRpvyEEQL+SiZrAkK0e15OxyGxRRHqYJ6l jINsDkgJj4oIs29hhuniVU0isvDUWgtc7o8OuQdNMtWMjxxE+yke5qULbUIYwixHW3hk EzTQ== X-Gm-Message-State: AMCzsaVGxtb4Mdo+4jJcaorJCc+Bfcm8we++yjzprpKeVS1ihGaRsfC3 vi2rNgMU6AreHACZNykRA6j9Zsrd X-Google-Smtp-Source: ABhQp+RqbZvV86ssKVX1kBeg0697lKWpDOsp59b3oGGpu+6rnNRsGZTXgzmZA5aXMveJb8JRa7ZnHw== X-Received: by 10.37.171.101 with SMTP id u92mr3875579ybi.324.1508530140126; Fri, 20 Oct 2017 13:09:00 -0700 (PDT) Received: from aduskett.duskett (2600-6c4a-767f-ff91-be5f-f4ff-feef-f9a2.dhcp6.chtrptr.net. [2600:6c4a:767f:ff91:be5f:f4ff:feef:f9a2]) by smtp.gmail.com with ESMTPSA id i5sm814004ywi.65.2017.10.20.13.08.59 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 20 Oct 2017 13:08:59 -0700 (PDT) From: Adam Duskett X-Google-Original-From: Adam Duskett To: buildroot@buildroot.org Date: Fri, 20 Oct 2017 16:08:54 -0400 Message-Id: <20171020200856.19406-1-Adamduskett@outlook.com> X-Mailer: git-send-email 2.13.6 Cc: Adam Duskett Subject: [Buildroot] [WIP 0/2] gobject-introspection X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Preface: For the several days straight I have taken it upon myself to try to get gobject-introspection integrated with BuildRoot. This is no light undertaking. Through multiple discussions with Yann, Thomas, and Arnout, staring at the bitbake recipe, I have managed to cobble together what I believe a fairly decent starting point. However; I am at the point where I need help to cross the finish line and to put this beast to bed, and that's where I am going to rely on the rest of the maintainers to help me. Thomas, Arnout, Yanni, and anybody else who dare look upon the horrors of gobject-introspection, I caution you, this is for people with a strong iron will and a hearty constitution. Why do you ask? What could possibly be so bad about this library? A multitude of things. However; let me just paste a quote from a developer: "Basically, we produce a binary that contains an array of ints with constant expression initialisers (sizeof, struct offsets, etc). We put magic values on either side of that array and then we scan the resulting compiler output for those magic values in order to discover the values of the expressions we put in." To top it all off: This program requires host-qemu to run. There isn't a good way for us to bypass it either. This means that several wrappers are needed that call host-qemu-$(arch) and then the real program that reads the binary and produces a .gir and a .typelib file. If it's so bad, why does BuildRoot need it? Good question! Because several prominent programs and libraries depend on gobject-introspection to compile. This also means that buildroot is stuck a very very old version of python-gobject (2.28.6) because anything newer requires this library to build. This also means that a very prominent and juicy library that is sorely lacking from BuildRoot is missing. gst1-python. This would be a very very nice library to have. WHAT WORKS: Currently, this patch series does the following: - builds the latest host-gobject-introspection. - Installs the wrapper programs. - builds the latest target gobject-introspection - After the target system is built, removes all the .gir files from the target directory. (.gir files are for development, typelib is for runtime.) WHAT DOESNT WORK: This is where I am hung up and need help! Anybody wanting to help, I urge you to do the following: - Apply the patch series - Build gobject-introspection - build gstreamer Gstreamer will now fail to build! Why? Gstreamer looks for an introspection library during the configure stage, and if it finds it, attempts to use it. Because some library paths not being making it to the introspection compiler, it will now fail to build with linking errors! Oh no! In Yocto, you can call out: export GIR_EXTRA_LIBS_PATH="path" (see meta/recipes-multimedia/gstreamer/gstreamer1.0.inc for an example) in the recipe file, which will be then get passed to g-ir-scanner-qemuwrapper, which will then set the environment variable LD_LIBRARY_PATH to the value of GIR_EXTRA_LIBS_PATH, whcih will then call g-ir-scanner, which will then call the functions in the script entitled "ccompiler.py" in the host directory. which will then resolve the library paths properly based off of the LD_LIBRARY_PATH variable. It's a very easy and clean solution to the problem. However, this isn't possible with BuildRoot because a script called from a GNU Makefile can't change the parent environment, and so the build will fail miserably. (Granted we could just disable introspection for gstreamer, but then it be possible to later add gst1-python) I hope there is a clean solution to this problem that will make it easier to add the library paths to programs in the future that isn't more patches. I really would appreciate a good discussion on this, as what you see here is around 40 hours of work in 3.5 days. Thanks for the help! Adam Adam Duskett (2): qemu: add BR2_PACKAGE_HOST_QEMU_ARCH_SUPPORTS gobject-introspection: new package DEVELOPERS | 1 + Makefile | 1 + package/Config.in | 1 + ...ncomplete-upstream-attempt-at-cross-compi.patch | 50 +++ ...c-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch | 203 ++++++++++++ ...3-giscanner-add-use-binary-wrapper-option.patch | 52 +++ ...04-giscanner-add-a-use-ldd-wrapper-option.patch | 48 +++ ...config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch | 97 ++++++ .../0006-add-PYTHON_INCLUDES-override.patch | 39 +++ package/gobject-introspection/Config.in | 29 ++ package/gobject-introspection/cross-ldd | 362 +++++++++++++++++++++ .../gobject-introspection/g-ir-compiler-wrapper.in | 2 + .../g-ir-scanner-lddwrapper.in | 2 + .../g-ir-scanner-qemuwrapper.in | 10 + .../gobject-introspection/g-ir-scanner-wrapper.in | 3 + .../gobject-introspection.hash | 4 + .../gobject-introspection/gobject-introspection.mk | 83 +++++ package/qemu/Config.in.host | 13 +- 18 files changed, 996 insertions(+), 4 deletions(-) create mode 100644 package/gobject-introspection/0001-Revert-an-incomplete-upstream-attempt-at-cross-compi.patch create mode 100644 package/gobject-introspection/0002-configure.ac-add-host-gi-gi-cross-wrapper-gi-ldd-wra.patch create mode 100644 package/gobject-introspection/0003-giscanner-add-use-binary-wrapper-option.patch create mode 100644 package/gobject-introspection/0004-giscanner-add-a-use-ldd-wrapper-option.patch create mode 100644 package/gobject-introspection/0005-Prefix-pkg-config-paths-with-PKG_CONFIG_SYSROOT_DIR-.patch create mode 100644 package/gobject-introspection/0006-add-PYTHON_INCLUDES-override.patch create mode 100644 package/gobject-introspection/Config.in create mode 100755 package/gobject-introspection/cross-ldd create mode 100644 package/gobject-introspection/g-ir-compiler-wrapper.in create mode 100644 package/gobject-introspection/g-ir-scanner-lddwrapper.in create mode 100644 package/gobject-introspection/g-ir-scanner-qemuwrapper.in create mode 100644 package/gobject-introspection/g-ir-scanner-wrapper.in create mode 100644 package/gobject-introspection/gobject-introspection.hash create mode 100644 package/gobject-introspection/gobject-introspection.mk