From patchwork Tue Apr 7 11:15:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 1073 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8B8F13F379 for ; Tue, 7 Apr 2020 13:15:51 +0200 (CEST) Received: by mail-pg1-f197.google.com with SMTP id o18sf2153232pgh.9 for ; Tue, 07 Apr 2020 04:15:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1586258149; cv=pass; d=google.com; s=arc-20160816; b=wQjmD7pbkljZ0z28hxziq+fIW/ACh/SnWW/FdHL46FyW7N7oifcQmFYY+Y4qRaeXj5 11HTmnJMjLN56j3oqT2X1M1LIeJLo2zQAaDYzGLqQL+Q9DlUvjiMyfPsKe+at+iEYGol MMv5AJSycs1nAv0R4lGmLmt0CSiYmPLQR83NY4nuBG7YarU/FYvkTpmFkIHF1eoYWsen v2pXwZv+jPsIssCpOqftxvZWiczg0g+5QCQ4WVQqCsjkOoyLOtck1ZBziqVpjvSlLJx0 OCf+4zK71VGpBtOHeGqnD2jKTuwbaWlKZHnEuk8xuk9MWy/7LiKPVLh6RG143idunXEp 5vsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:references:in-reply-to:message-id:date :subject:cc:to:from:mime-version:dkim-signature; bh=z8TL8jCbd2h6zh/NfaJSKt5JH4OTvNOLF5G45au8TWM=; b=XI4KKN8w/oyS1/GQxzKkLpc6aH/HEs7XfosMOJNB0TSR/nEkPGw6eMSISW7+NaW1So 9rk/OuqUEFdA4F8P8R8EA4IvbuHFl+4amjwAaJ4+W/pIqFTDKWH45CGeWJy/g6YutdnD lpTc/K6AP+sFKCasXBSr8d0broYaogP1ohsE5MyuEB+Y/9+YifWGueAXIqQ7ju6/+TfA w2Gq7Ev6g/nUfmwktKBiPc6ZHTVBoVHvRcjkh4BqCQ4kzmjZp7VeJHycSL9DShUVqdgh kONmiCOyMO3xqFd0dzRNp8cvlsrSozPHYj+sXEYIxfp5I5spPq3g16h/7Fey0eHWTFin ta6Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pRGICktr; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=z8TL8jCbd2h6zh/NfaJSKt5JH4OTvNOLF5G45au8TWM=; b=X8ypoajAUc7nR08VLKJcn8EdAlhDX/4FGHVf/SZqvAx2J/l+0tQAAgSYKgZVrC38tu 2imwqECkXfoCRxwFVH8R4/axI5wipREFS5GNWmKxKqjA3C1hMm4z0Msz8eUrc5/k9NC9 qYtEslu9II3DuJUI38T0kZY8kcGeuQKk18VsY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:to:cc:subject:date:message-id :in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=z8TL8jCbd2h6zh/NfaJSKt5JH4OTvNOLF5G45au8TWM=; b=Zap38hx4JEl8h73OBCYqsIb4yoEE2W0hclh5+wc8t6j5x3Z78wLCNQfXSa46JiVc7w Y5T0dfJW+f9Di+0Q0NSj8RLOgDB7v5re58+uVTsk+IcX9uWg/+Pf302x4d56IJpN2Xhw RqLlqeTGK1f1ttx10G9CinescE3tjiY3WCgQ/cL+8S0lVr9d1qKnysEeUtHGoBohWX/2 ZuMKpdqOu+wExUfa7A7gQqIqw37rPoDHKPBaIqi9IQxyuNIHPgl4o6rrzimB3HqbWLYo /tPZour83etHErJpKaLGH3NLyPE8kvRazH3BJPtVdg8yH2SlRB9fH/h5tjIiOLErsPiE GkUw== X-Gm-Message-State: AGi0PuY3cCwVpJ3egwRHecCtEZZFa2WHF0oEv4okC1sJvHmJlmHp5VM9 gZdOoFBid/xW4srBiY1KFz75ilzM X-Google-Smtp-Source: APiQypJ6PMcYJjMhfpqR6WhE9rPgXGXvWUpSKPtyw6zmCoTFbN3im5fcOJBRSRhsDzDbus+lEAzqjA== X-Received: by 2002:a17:90a:c583:: with SMTP id l3mr2233302pjt.84.1586258149336; Tue, 07 Apr 2020 04:15:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a62:3087:: with SMTP id w129ls1687255pfw.1.gmail; Tue, 07 Apr 2020 04:15:49 -0700 (PDT) X-Received: by 2002:aa7:990e:: with SMTP id z14mr2168787pff.274.1586258148706; Tue, 07 Apr 2020 04:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586258148; cv=none; d=google.com; s=arc-20160816; b=rLBzHEZ0g9EmIK700tJtUFpKONSEjSOaEqhVzcsUehy1jKsSN9pHxE9WGNusr6uurh fVxeDdUX2C8YvN8dvT9VWIR4hJsX9fcUW01HB5yX/G+CcvWkTqwIN7VZSIcyspT+VvuK fia0nEP4Btr6Eww96NMHXw8+42Zdufbi+DAPIvko5AYVz+OaX6aZ/APr8fA/KQH8WNAd WPZfQnAj/3Hcw/Mfn3zqk3EwVdYo4wwFK0dfNUA3DJKzO8UJ1kBo8d0c/aesPnZVVbGn shK3REfjHIgAkekJ3Av6PdJdWZDBu3dE3Ejx5fa+mwbBpZnWvoQzvF7x4OY9srhX9yAK 064A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6kh9vjUcc7UbiBXkEMeBnXaCNKghKw7ie/iR6uSjFOw=; b=WAg/qlrszOJDq7q5kuFzMOfRJFnk4+J3geYB69O4+7IBlRPc11gO9NnYP7U7yF2GIP EM3GxTEazznJ4PU6cLmhFgtJqqJhq1kFeMOd1h6vr98OIqFQ1fBBIbqjxm0sBazJ4LhW elZLttVkg8UiqJWdCAH/CiDE66yxeozRjU3HzWRuoPqPF/4qSmfQywIradpkMJWzupyH MGYqvicXAVeE9h+jMrQhYBgezrXxsskDEJvdj9ucamOaksC9pbuYv8i51kSFfhSChnEK 02e+wa9bA6+WhmsYfVz49f2cH52pmne/rf/ez52RXUFIwWBG7PGCQb1mj6f6ZZ0fd+wO 3h4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pRGICktr; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id h93sor1634100pje.31.2020.04.07.04.15.48 for (Google Transport Security); Tue, 07 Apr 2020 04:15:48 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a17:90a:868b:: with SMTP id p11mr2270707pjn.34.1586258148403; Tue, 07 Apr 2020 04:15:48 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c809:c7d5:79b0:3a91:34a5:abd7]) by smtp.gmail.com with ESMTPSA id e187sm13788802pfe.50.2020.04.07.04.15.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Apr 2020 04:15:47 -0700 (PDT) From: Jagan Teki To: buildroot@buildroot.org Cc: "Yann E . MORIN" , Angelo Compagnucci , Suniel Mahesh , Esben Haabendal , Yegor Yefremov , linux-amarula@amarulasolutions.com, Jagan Teki Subject: [PATCH v8 2/5] package/python-numpy: fixup npymath.ini for numpy extensions Date: Tue, 7 Apr 2020 16:45:12 +0530 Message-Id: <20200407111515.21131-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200407111515.21131-1-jagan@amarulasolutions.com> References: <20200407111515.21131-1-jagan@amarulasolutions.com> X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=pRGICktr; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Esben Haabendal Inorder to build the numpy distutils extension packages like python-scipy, python-numba, it require an explicit pkg-config path fixup for npymath.ini. This pkg-config path fixup would update the prefix path of npymath.ini with actual target staging area where numpy core was built, so-that numpy distutils extension packages would explicitly link this config path for their package environment. Without this extension packages cannot find -lnpymath since it uses host libraries (like libnpymath.a). So, attach the post install staging hook with pkg-config path fixup for npymath.ini. Signed-off-by: Esben Haabendal Signed-off-by: Jagan Teki --- Changes for v8: - none Changes for v7: - rephrase commit and comments of fixup npymath.ini package/python-numpy/python-numpy.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/python-numpy/python-numpy.mk b/package/python-numpy/python-numpy.mk index 3f0df7a640..4d2e852b43 100644 --- a/package/python-numpy/python-numpy.mk +++ b/package/python-numpy/python-numpy.mk @@ -32,6 +32,21 @@ define PYTHON_NUMPY_CONFIGURE_CMDS echo "include_dirs = $(STAGING_DIR)/usr/include" >> $(@D)/site.cfg endef +# Fixup the npymath.ini prefix path with actual target staging area where +# numpy core was built. Without this, target builds using numpy distutils +# extensions like python-scipy, python-numba cannot find -lnpymath since +# it uses host libraries (like libnpymath.a). +# So, the numpy distutils extension packages would explicitly link this +# config path for their package environment. +PYTHON_NUMPY_STAGING_DIR = $(STAGING_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages/numpy +PYTHON_NUMPY_NPY_PKG_CONFIG_PATH=$(PYTHON_NUMPY_STAGING_DIR)/core/lib/npy-pkg-config +define PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES + sed -e '/^pkgdir=/d' \ + -e '/^prefix=/i pkgdir=$(PYTHON_NUMPY_STAGING_DIR)/core' \ + -i $(PYTHON_NUMPY_NPY_PKG_CONFIG_PATH)/npymath.ini +endef +PYTHON_NUMPY_POST_INSTALL_STAGING_HOOKS += PYTHON_NUMPY_FIXUP_NPY_PKG_CONFIG_FILES + # Some package may include few headers from NumPy, so let's install it # in the staging area. PYTHON_NUMPY_INSTALL_STAGING = YES