Github messages for voidlinux
 help / color / mirror / Atom feed
From: oreo639 <oreo639@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] libtool: fix include paths when cross compiling
Date: Wed, 15 Feb 2023 08:04:31 +0100	[thread overview]
Message-ID: <20230215070431.Xi8cJGhpN3kXiBulLqsZ0dB0WiQnfMf2kdnmIwIq9yc@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-40606@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1324 bytes --]

There is an updated pull request by oreo639 against master on the void-packages repository

https://github.com/oreo639/void-packages libtool
https://github.com/void-linux/void-packages/pull/40606

libtool: fix include paths when cross compiling
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **NO**

@dkwo Can you test this? (whenever you are available ofc)

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/40606.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libtool-40606.patch --]
[-- Type: text/x-diff, Size: 2421 bytes --]

From b94a5d42ec5de65e4ec1b2fd6f3cd34b8f4dbc50 Mon Sep 17 00:00:00 2001
From: oreo639 <oreo6391@gmail.com>
Date: Tue, 14 Feb 2023 18:36:41 -0800
Subject: [PATCH] libtool: fix include paths when cross compiling

Fix library and object include paths.
Fix ntl build by directly assigning cc/cxx/etc instead of using := assignment.
Use g++ for CXX when cross compiling to match native.
---
 srcpkgs/libtool/template | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/libtool/template b/srcpkgs/libtool/template
index cd7c684c5945..4842aa06ee1a 100644
--- a/srcpkgs/libtool/template
+++ b/srcpkgs/libtool/template
@@ -1,7 +1,7 @@
 # Template file for 'libtool'
 pkgname=libtool
 version=2.4.7
-revision=3
+revision=4
 build_style=gnu-configure
 hostmakedepends="texinfo perl automake help2man xz gnulib tar"
 depends="tar sed grep"
@@ -22,9 +22,13 @@ post_extract() {
 }
 
 do_configure() {
+	if [ "$CROSS_BUILD" ]; then
+		CXX="${XBPS_CROSS_TRIPLET}-g++"
+	fi
+
 	./bootstrap --force --no-git --skip-po \
 		--gnulib-srcdir=/usr/share/gnulib/ --copy
-	./configure ${configure_args} SED=/bin/sed GREP=/bin/grep
+	./configure ${configure_args} SED=/bin/sed GREP=/bin/grep CXX=${CXX}
 }
 
 post_install() {
@@ -39,7 +43,7 @@ post_install() {
 	# in native environments, not in cross environments, so patch the script
 	if [ "$CROSS_BUILD" ]; then
 		# e.g. AR="armv7l-linux-gnueabihf-ar" becomes AR="${AR:=ar}"
-		vsed -i -e "s,\([A-Z]\+\)=\"${XBPS_CROSS_TRIPLET}\-\(.*\)\",\1=\$\{\1:=\2\},g" \
+		vsed -i -e "s,\([A-Z]\+\)=\"${XBPS_CROSS_TRIPLET}\-\(.*\)\",\1=\"\2\",g" \
 		 ${PKGDESTDIR}/usr/bin/libtool
 
 		# clear out any sysroot present
@@ -50,6 +54,20 @@ post_install() {
 		vsed -i -e "s,\-I${XBPS_CROSS_BASE}/usr/include,,g" \
 		 ${PKGDESTDIR}/usr/bin/libtool
 
+		# Strip cross sysroot from paths
+		vsed -i -e "s,${XBPS_CROSS_BASE},,g" \
+		 ${PKGDESTDIR}/usr/bin/libtool
+
+		if [ "$XBPS_TARGET_WORDSIZE" = "64" ]; then
+			vsed -i \
+			 -e "s,/${XBPS_CROSS_TRIPLET}/lib/../lib64,/lib64,g" \
+			 ${PKGDESTDIR}/usr/bin/libtool
+		else
+			vsed -i \
+			 -e "s,/${XBPS_CROSS_TRIPLET}/lib,/lib,g" \
+			 ${PKGDESTDIR}/usr/bin/libtool
+		fi
+
 		# canonicalize host_alias, replace build(_alias,_os)
 		_canonical_host=$(grep "^host=" ${PKGDESTDIR}/usr/bin/libtool | sed 's/host=//')
 		_host_os=$(grep "^host_os=" ${PKGDESTDIR}/usr/bin/libtool | sed 's/host_os=//')

  parent reply	other threads:[~2023-02-15  7:04 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-19  8:10 [PR PATCH] " oreo639
2022-11-19 22:17 ` dkwo
2022-11-19 22:18 ` dkwo
2022-11-19 22:18 ` dkwo
2022-11-19 22:29 ` oreo639
2022-11-19 22:30 ` oreo639
2022-11-20 14:37 ` dkwo
2022-11-20 18:41 ` paper42
2022-11-20 20:25 ` oreo639
2022-11-20 20:37 ` [PR PATCH] [Updated] " oreo639
2022-11-20 21:05 ` oreo639
2022-11-20 21:08 ` oreo639
2022-11-21 15:38 ` dkwo
2022-11-21 17:21 ` oreo639
2022-11-21 17:21 ` oreo639
2022-11-21 18:30 ` dkwo
2022-11-21 18:31 ` oreo639
2022-11-21 18:33 ` dkwo
2023-02-06 20:17 ` dkwo
2023-02-06 20:18 ` dkwo
2023-02-06 20:19 ` paper42
2023-02-15  4:21 ` [PR PATCH] [Updated] " oreo639
2023-02-15  4:29 ` oreo639
2023-02-15  4:34 ` oreo639
2023-02-15  5:26 ` oreo639
2023-02-15  6:08 ` oreo639
2023-02-15  6:20 ` oreo639
2023-02-15  6:20 ` oreo639
2023-02-15  6:23 ` [PR PATCH] [Updated] " oreo639
2023-02-15  6:24 ` oreo639
2023-02-15  6:26 ` [PR PATCH] [Updated] " oreo639
2023-02-15  6:27 ` oreo639
2023-02-15  6:56 ` oreo639
2023-02-15  7:04 ` oreo639 [this message]
2023-02-15  7:13 ` oreo639
2023-02-15  7:18 ` oreo639
2023-02-15  7:30 ` oreo639
2023-02-15  7:30 ` oreo639
2023-02-15  8:48 ` oreo639
2023-02-15 10:57 ` oreo639
2023-02-15 20:06 ` dkwo
2023-02-15 20:09 ` [PR PATCH] [Updated] " oreo639
2023-02-25  1:35 ` oreo639
2023-02-25  1:35 ` oreo639
2023-02-26 10:15 ` [PR PATCH] [Merged]: " paper42

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230215070431.Xi8cJGhpN3kXiBulLqsZ0dB0WiQnfMf2kdnmIwIq9yc@z \
    --to=oreo639@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).