Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] vsrcextract
@ 2023-07-11 17:11 sgn
  2023-07-11 23:43 ` [PR REVIEW] vsrcextract classabbyamp
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: sgn @ 2023-07-11 17:11 UTC (permalink / raw)
  To: ml

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

There is a new pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages vsrcextract
https://github.com/void-linux/void-packages/pull/44982

vsrcextract
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

<!--
#### 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/44982.patch is attached

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

From c4d2520c323c505b7aac9c169f9e5bc90f280c03 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 11 Jul 2023 23:02:44 +0700
Subject: [PATCH 1/5] do-extract: move main logic into helper function

---
 common/environment/setup/extract.sh     | 168 ++++++++++++++++++++++++
 common/hooks/do-extract/00-distfiles.sh | 123 +----------------
 2 files changed, 169 insertions(+), 122 deletions(-)
 create mode 100644 common/environment/setup/extract.sh

diff --git a/common/environment/setup/extract.sh b/common/environment/setup/extract.sh
new file mode 100644
index 000000000000..f73aeb5f601c
--- /dev/null
+++ b/common/environment/setup/extract.sh
@@ -0,0 +1,168 @@
+vextract() {
+	local sc=--strip-components=1
+	local dst=
+	while [ "$#" -ne 1 ]; do
+		case "$1" in
+		-C)
+			dst="$2"
+			mkdir -p "$dst"
+			shift 2
+			;;
+		--no-strip-components)
+			sc=
+			shift
+			;;
+		--strip-components=*)
+			sc="$1"
+			shift
+			;;
+		--strip-components)
+			sc="--strip-components=$2"
+			shift 2
+			;;
+		esac
+	done
+
+	local TAR_CMD sfx
+	local archive="$1"
+	local ret=0
+
+	TAR_CMD="$(command -v bsdtar)"
+	[ -z "$TAR_CMD" ] && TAR_CMD="$(command -v tar)"
+	[ -z "$TAR_CMD" ] && msg_error "xbps-src: no suitable tar cmd (bsdtar, tar)\n"
+	case "$archive" in
+	*.tar.lzma)   sfx="txz";;
+	*.tar.lz)     sfx="tlz";;
+	*.tlz)        sfx="tlz";;
+	*.tar.xz)     sfx="txz";;
+	*.txz)        sfx="txz";;
+	*.tar.bz2)    sfx="tbz";;
+	*.tbz)        sfx="tbz";;
+	*.tar.gz)     sfx="tgz";;
+	*.tgz)        sfx="tgz";;
+	*.tar.zst)    sfx="tzst";;
+	*.tzst)       sfx="tzst";;
+	*.gz)         sfx="gz";;
+	*.xz)         sfx="xz";;
+	*.bz2)        sfx="bz2";;
+	*.zst)        sfx="zst";;
+	*.tar)        sfx="tar";;
+	*.zip)        sfx="zip";;
+	*.rpm)        sfx="rpm";;
+	*.deb)        sfx="deb";;
+	*.patch)      sfx="txt";;
+	*.diff)       sfx="txt";;
+	*.txt)        sfx="txt";;
+	*.sh)         sfx="txt";;
+	*.7z)	      sfx="7z";;
+	*.gem)	      sfx="gem";;
+	*.crate)      sfx="crate";;
+	*) msg_error "$pkgver: unknown distfile suffix for $archive.\n";;
+	esac
+
+	case ${sfx} in
+	tar|txz|tbz|tlz|tgz|tzst|crate)
+		$TAR_CMD ${sc:+"$sc"} ${dst:+-C "$dst"} -x \
+			--no-same-permissions --no-same-owner \
+			-f $archive
+		;;
+	gz|bz2|xz|zst)
+		cp -f $archive "$dst"
+		(
+			if [ "$dst" ]; then cd "$dst"; fi
+			case ${sfx} in
+			gz)
+				gunzip -f $archive
+				;;
+			bz2)
+				bunzip2 -f $archive
+				;;
+			xz)
+				unxz -f $archive
+				;;
+			zst)
+				unzstd $archive
+				;;
+			esac
+		)
+		;;
+	zip)
+		if command -v unzip &>/dev/null; then
+			unzip -o -q $archive ${dst:+-d "$dst"}
+		elif command -v bsdtar &>/dev/null; then
+			bsdtar ${sc:+"$sc"} ${dst:+-C "$dst"} -xf $archive
+		else
+			msg_error "$pkgver: cannot find unzip or bsdtar bin for extraction.\n"
+		fi
+		;;
+	rpm)
+		if ! command -v bsdtar &>/dev/null; then
+			msg_error "$pkgver: cannot find bsdtar for extraction.\n"
+		fi
+		bsdtar ${sc:+"$sc"} ${dst:+-C "$dst"} -x \
+			--no-same-permissions --no-same-owner -f $archive
+		;;
+	deb)
+		if command -v bsdtar &>/dev/null; then
+			bsdtar -x -O -f "$archive" "data.tar.*" |
+			bsdtar ${sc:+"$sc"} ${dst:+-C "$dst"} -x \
+				--no-same-permissions --no-same-owner -f -
+		else
+			msg_error "$pkgver: cannot find bsdtar for extraction.\n"
+		fi
+		;;
+	txt)
+		cp -f $archive "$dst"
+		;;
+	7z)
+		if command -v 7z &>/dev/null; then
+			7z x $archive -o"$dst"
+		elif command -v bsdtar &>/dev/null; then
+			bsdtar ${sc:+"$sc"} ${dst:+-C "$dst"} -xf $archive
+		else
+			msg_error "$pkgver: cannot find 7z or bsdtar bin for extraction.\n"
+		fi
+		;;
+	gem)
+		$TAR_CMD -xOf $archive data.tar.gz |
+			$TAR_CMD ${sc:+"$sc"} ${dst:+-C "$dst"} -xz -f -
+		;;
+	*)
+		msg_error "$pkgver: cannot guess $archive extract suffix. ($sfx)\n"
+		;;
+	esac
+	if [ "$?" -ne 0 ]; then
+		msg_error "$pkgver: extracting $archive.\n"
+	fi
+}
+
+vsrcextract() {
+	local sc=--strip-components=1
+	local dst=
+	while [ "$#" -ne 1 ]; do
+		case "$1" in
+		-C)
+			dst="$2"
+			shift 2
+			;;
+		--no-strip-components|--strip-components=*)
+			sc="$1"
+			shift
+			;;
+		--strip-components)
+			sc="--strip-components=$2"
+			shift 2
+			;;
+		esac
+	done
+	vextract "$sc" ${dst:+-C "$dst"} \
+		"${XBPS_SRCDISTDIR}/${pkgname}-${version}/$1"
+}
+
+vsrccopy() {
+	if [ "$#" -ne 2 ]; then
+		msg_error "vsrcextract <file> <target>"
+	fi
+	mkdir -p "$2"
+	cp -a "${XBPS_SRCDISTDIR}/${pkgname}-${version}/$1" "$2"
+}
diff --git a/common/hooks/do-extract/00-distfiles.sh b/common/hooks/do-extract/00-distfiles.sh
index 07e987a6862b..445346299e34 100644
--- a/common/hooks/do-extract/00-distfiles.sh
+++ b/common/hooks/do-extract/00-distfiles.sh
@@ -45,128 +45,7 @@ hook() {
 			unset found
 			continue
 		fi
-
-		case $curfile in
-		*.tar.lzma)   cursufx="txz";;
-		*.tar.lz)     cursufx="tlz";;
-		*.tlz)        cursufx="tlz";;
-		*.tar.xz)     cursufx="txz";;
-		*.txz)        cursufx="txz";;
-		*.tar.bz2)    cursufx="tbz";;
-		*.tbz)        cursufx="tbz";;
-		*.tar.gz)     cursufx="tgz";;
-		*.tgz)        cursufx="tgz";;
-		*.tar.zst)    cursufx="tzst";;
-		*.tzst)       cursufx="tzst";;
-		*.gz)         cursufx="gz";;
-		*.xz)         cursufx="xz";;
-		*.bz2)        cursufx="bz2";;
-		*.zst)        cursufx="zst";;
-		*.tar)        cursufx="tar";;
-		*.zip)        cursufx="zip";;
-		*.rpm)        cursufx="rpm";;
-		*.deb)        cursufx="deb";;
-		*.patch)      cursufx="txt";;
-		*.diff)       cursufx="txt";;
-		*.txt)        cursufx="txt";;
-		*.sh)         cursufx="txt";;
-		*.7z)	      cursufx="7z";;
-		*.gem)	      cursufx="gem";;
-		*.crate)      cursufx="crate";;
-		*) msg_error "$pkgver: unknown distfile suffix for $curfile.\n";;
-		esac
-
-		case ${cursufx} in
-		tar|txz|tbz|tlz|tgz|tzst|crate)
-			$TAR_CMD -x --no-same-permissions --no-same-owner -f $srcdir/$curfile -C "$extractdir"
-			if [ $? -ne 0 ]; then
-				msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
-			fi
-			;;
-		gz|bz2|xz|zst)
-			cp -f $srcdir/$curfile "$extractdir"
-			cd "$extractdir"
-			case ${cursufx} in
-			gz)
-				gunzip -f $curfile
-				;;
-			bz2)
-				bunzip2 -f $curfile
-				;;
-			xz)
-				unxz -f $curfile
-				;;
-			zst)
-				unzstd $curfile
-				;;
-			esac
-			;;
-		zip)
-			if command -v unzip &>/dev/null; then
-				unzip -o -q $srcdir/$curfile -d "$extractdir"
-				if [ $? -ne 0 ]; then
-					msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
-				fi
-			elif command -v bsdtar &>/dev/null; then
-				bsdtar -xf $srcdir/$curfile -C "$extractdir"
-				if [ $? -ne 0 ]; then
-					msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
-				fi
-			else
-				msg_error "$pkgver: cannot find unzip or bsdtar bin for extraction.\n"
-			fi
-			;;
-		rpm)
-			if ! command -v bsdtar &>/dev/null; then
-				msg_error "$pkgver: cannot find bsdtar for extraction.\n"
-			fi
-			bsdtar -x --no-same-permissions --no-same-owner -f $srcdir/$curfile -C "$extractdir"
-			if [ $? -ne 0 ]; then
-				msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
-			fi
-			;;
-		deb)
-			if command -v bsdtar &>/dev/null; then
-				bsdtar -x -O -f "$srcdir/$curfile" "data.tar.*" |
-				bsdtar -C "$extractdir" -x --no-same-permissions --no-same-owner
-				if [ $? -ne 0 ]; then
-					msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
-				fi
-			else
-				msg_error "$pkgver: cannot find bsdtar for extraction.\n"
-			fi
-			;;
-		txt)
-			cp -f $srcdir/$curfile "$extractdir"
-			;;
-		7z)
-			if command -v 7z &>/dev/null; then
-				7z x $srcdir/$curfile -o"$extractdir"
-				if [ $? -ne 0 ]; then
-					msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
-				fi
-			elif command -v bsdtar &>/dev/null; then
-				bsdtar -xf $srcdir/$curfile -C "$extractdir"
-				if [ $? -ne 0 ]; then
-					msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
-				fi
-			else
-				msg_error "$pkgver: cannot find 7z or bsdtar bin for extraction.\n"
-			fi
-			;;
-		gem)
-			innerdir="$extractdir/${wrksrc##*/}"
-			mkdir -p "$innerdir"
-			$TAR_CMD -xOf $srcdir/$curfile data.tar.gz |
-				$TAR_CMD -xz -C "$innerdir" -f -
-			if [ $? -ne 0 ]; then
-				msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
-			fi
-			;;
-		*)
-			msg_error "$pkgver: cannot guess $curfile extract suffix. ($cursufx)\n"
-			;;
-		esac
+		vsrcextract --no-strip-components -C "$extractdir" "$curfile"
 	done
 
 	cd "$extractdir"

From c0a72c9cfcb69e43d004fc16532295c0c59c31ab Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 11 Jul 2023 23:13:54 +0700
Subject: [PATCH 2/5] kexec-tools: drop custom do_extract

---
 common/environment/setup/extract.sh |  7 ++++++-
 srcpkgs/kexec-tools/template        | 10 ----------
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/common/environment/setup/extract.sh b/common/environment/setup/extract.sh
index f73aeb5f601c..883c130ac8aa 100644
--- a/common/environment/setup/extract.sh
+++ b/common/environment/setup/extract.sh
@@ -27,7 +27,12 @@ vextract() {
 	local archive="$1"
 	local ret=0
 
-	TAR_CMD="$(command -v bsdtar)"
+	# When tar is explicitly put in hostmakedepends
+	# not supported in multiline hostmakedepends and tar is eol
+	case " $hostmakedepends " in
+	*" tar "*)   TAR_CMD="tar" ;;
+	esac
+	[ -z "$TAR_CMD" ] && TAR_CMD="$(command -v bsdtar)"
 	[ -z "$TAR_CMD" ] && TAR_CMD="$(command -v tar)"
 	[ -z "$TAR_CMD" ] && msg_error "xbps-src: no suitable tar cmd (bsdtar, tar)\n"
 	case "$archive" in
diff --git a/srcpkgs/kexec-tools/template b/srcpkgs/kexec-tools/template
index 6bd5b65e1820..aa68b6f60a56 100644
--- a/srcpkgs/kexec-tools/template
+++ b/srcpkgs/kexec-tools/template
@@ -2,7 +2,6 @@
 pkgname=kexec-tools
 version=2.0.26
 revision=1
-create_wrksrc=yes
 build_style=gnu-configure
 hostmakedepends="tar xz"
 makedepends="zlib-devel liblzma-devel"
@@ -12,7 +11,6 @@ license="GPL-2.0-only"
 homepage="http://kernel.org/pub/linux/utils/kernel/kexec/"
 distfiles="${KERNEL_SITE}/utils/kernel/kexec/${pkgname}-${version}.tar.xz"
 checksum=7fe36a064101cd5c515e41b2be393dce3ca88adce59d6ee668e0af7c0c4570cd
-skip_extraction="${pkgname}-${version}.tar.xz"
 
 CFLAGS="-fcommon"
 
@@ -20,14 +18,6 @@ case "$XBPS_TARGET_MACHINE" in
 	ppc-musl) nopie=yes;; # textrels not supported
 esac
 
-do_extract() {
-	# bsdtar fails to extract version 2.0.20 tarball which
-	# contains (buggy) hard links from files to themselves.
-	tar --strip-components 1 --no-same-owner --extract --file \
-		${XBPS_SRCDISTDIR}/${pkgname}-${version}/${pkgname}-${version}.tar.xz \
-		--directory ${wrksrc}
-}
-
 pre_build() {
 	rm ${XBPS_WRAPPERDIR}/strip
 	case "$XBPS_TARGET_MACHINE" in

From be55b71cef2e08896717efabb50c5e5e9356d8ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 11 Jul 2023 23:46:41 +0700
Subject: [PATCH 3/5] epson-inkjet-printer-escpr2: abstract bsdtar usage

---
 srcpkgs/epson-inkjet-printer-escpr2/template | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/srcpkgs/epson-inkjet-printer-escpr2/template b/srcpkgs/epson-inkjet-printer-escpr2/template
index 6fa318254b1e..818217056b92 100644
--- a/srcpkgs/epson-inkjet-printer-escpr2/template
+++ b/srcpkgs/epson-inkjet-printer-escpr2/template
@@ -18,8 +18,7 @@ restricted=yes
 repository=nonfree
 
 post_extract() {
-	bsdtar --strip-components=1 -xf \
-		epson-inkjet-printer-escpr2-${version}-1lsb3.2.tar.gz
+	vextract epson-inkjet-printer-escpr2-${version}-1lsb3.2.tar.gz
 }
 
 post_install() {

From fdeb37cf5ef5669d14defce87626c9bbcc621e0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Tue, 11 Jul 2023 23:47:16 +0700
Subject: [PATCH 4/5] qbittorrent: hide bsdtar usage

---
 srcpkgs/qbittorrent/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/qbittorrent/template b/srcpkgs/qbittorrent/template
index c5067b733ac4..87d58e8a502e 100644
--- a/srcpkgs/qbittorrent/template
+++ b/srcpkgs/qbittorrent/template
@@ -22,8 +22,8 @@ CXXFLAGS=-std=gnu++17
 do_extract() {
 	local n=${pkgname}-${version}
 	mkdir -p build-nox build-x11
-	bsdtar xf ${XBPS_SRCDISTDIR}/${n}/${n}.tar.xz --strip-components=1 -C build-x11
-	bsdtar xf ${XBPS_SRCDISTDIR}/${n}/${n}.tar.xz --strip-components=1 -C build-nox
+	vsrcextract -C build-x11 ${n}.tar.xz
+	vsrcextract -C build-nox ${n}.tar.xz
 }
 
 do_configure() {

From 7b60d068633f375ee9ca184eeef7c003e2de6bcd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 12 Jul 2023 00:08:14 +0700
Subject: [PATCH 5/5] mozc: use new vsrcextract

---
 srcpkgs/mozc/patches/abseil.patch      | 12 +++++-----
 srcpkgs/mozc/patches/common.patch      |  4 ++--
 srcpkgs/mozc/patches/cross.patch       |  4 ++--
 srcpkgs/mozc/patches/cxx-stdlib.patch  |  4 ++--
 srcpkgs/mozc/patches/fcitx.patch       |  4 ++--
 srcpkgs/mozc/patches/latomic.patch     | 32 +++++++++++++-------------
 srcpkgs/mozc/patches/no-parallel.patch |  4 ++--
 srcpkgs/mozc/template                  | 25 ++++++++------------
 8 files changed, 42 insertions(+), 47 deletions(-)

diff --git a/srcpkgs/mozc/patches/abseil.patch b/srcpkgs/mozc/patches/abseil.patch
index a41507550f95..2702158f3b48 100644
--- a/srcpkgs/mozc/patches/abseil.patch
+++ b/srcpkgs/mozc/patches/abseil.patch
@@ -7,8 +7,8 @@ An all-in-one patch that fixes several issues:
 2) powerpc stacktrace implementation only works on glibc (disabled on musl)
 4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
 
---- a/abseil-cpp/absl/base/internal/unscaledcycleclock.h
-+++ b/abseil-cpp/absl/base/internal/unscaledcycleclock.h
+--- a/src/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
++++ b/src/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h
 @@ -46,8 +46,8 @@
  
  // The following platforms have an implementation of a hardware counter.
@@ -20,8 +20,8 @@ An all-in-one patch that fixes several issues:
  #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
  #else
  #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 0
---- a/abseil-cpp/absl/debugging/internal/examine_stack.cc
-+++ b/abseil-cpp/absl/debugging/internal/examine_stack.cc
+--- a/src/third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc
++++ b/src/third_party/abseil-cpp/absl/debugging/internal/examine_stack.cc
 @@ -27,6 +27,10 @@
  #include <csignal>
  #include <cstdio>
@@ -45,8 +45,8 @@ An all-in-one patch that fixes several issues:
  #elif defined(__riscv)
      return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
  #elif defined(__s390__) && !defined(__s390x__)
---- a/abseil-cpp/absl/debugging/internal/stacktrace_config.h
-+++ b/abseil-cpp/absl/debugging/internal/stacktrace_config.h
+--- a/src/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h
++++ b/src/third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h
 @@ -59,7 +59,7 @@
  #elif defined(__i386__) || defined(__x86_64__)
  #define ABSL_STACKTRACE_INL_HEADER \
diff --git a/srcpkgs/mozc/patches/common.patch b/srcpkgs/mozc/patches/common.patch
index 1b7bb395948b..2754cf469431 100644
--- a/srcpkgs/mozc/patches/common.patch
+++ b/srcpkgs/mozc/patches/common.patch
@@ -1,5 +1,5 @@
---- a/mozc/src/config.bzl
-+++ b/mozc/src/config.bzl
+--- a/src/config.bzl
++++ b/src/config.bzl
 @@ -34,7 +34,7 @@ LINUX_MOZC_SERVER_DIR = "/usr/lib/mozc"
  LINUX_MOZC_DOCUMENT_DIR = LINUX_MOZC_SERVER_DIR + "/documents"
  IBUS_MOZC_INSTALL_DIR = "/usr/share/ibus-mozc"
diff --git a/srcpkgs/mozc/patches/cross.patch b/srcpkgs/mozc/patches/cross.patch
index a7e38fd9b346..c4b5cba7dd28 100644
--- a/srcpkgs/mozc/patches/cross.patch
+++ b/srcpkgs/mozc/patches/cross.patch
@@ -1,5 +1,5 @@
---- a/mozc/src/gyp/common.gypi
-+++ b/mozc/src/gyp/common.gypi
+--- a/src/gyp/common.gypi
++++ b/src/gyp/common.gypi
 @@ -409,12 +409,12 @@
    'conditions': [
      ['target_platform=="Linux"', {
diff --git a/srcpkgs/mozc/patches/cxx-stdlib.patch b/srcpkgs/mozc/patches/cxx-stdlib.patch
index 0b77ea1f052c..6c61061a2bde 100644
--- a/srcpkgs/mozc/patches/cxx-stdlib.patch
+++ b/srcpkgs/mozc/patches/cxx-stdlib.patch
@@ -1,5 +1,5 @@
---- a/mozc/src/gyp/common.gypi
-+++ b/mozc/src/gyp/common.gypi
+--- a/src/gyp/common.gypi
++++ b/src/gyp/common.gypi
 @@ -73,9 +73,6 @@
        '-Wno-deprecated-declarations',
        '-Wwrite-strings',
diff --git a/srcpkgs/mozc/patches/fcitx.patch b/srcpkgs/mozc/patches/fcitx.patch
index 720e6b2c2c27..01f85749d541 100644
--- a/srcpkgs/mozc/patches/fcitx.patch
+++ b/srcpkgs/mozc/patches/fcitx.patch
@@ -1,5 +1,5 @@
---- a/mozc/src/unix/fcitx/fcitx.gyp
-+++ b/mozc/src/unix/fcitx/fcitx.gyp
+--- a/src/unix/fcitx/fcitx.gyp
++++ b/src/unix/fcitx/fcitx.gyp
 @@ -96,7 +96,7 @@
          '<@(fcitx_dep_include_dirs)',
        ],
diff --git a/srcpkgs/mozc/patches/latomic.patch b/srcpkgs/mozc/patches/latomic.patch
index 1d3aab9ab904..99d979ed3616 100644
--- a/srcpkgs/mozc/patches/latomic.patch
+++ b/srcpkgs/mozc/patches/latomic.patch
@@ -1,5 +1,5 @@
---- a/mozc/src/gui/gui.gyp
-+++ b/mozc/src/gui/gui.gyp
+--- a/src/gui/gui.gyp
++++ b/src/gui/gui.gyp
 @@ -794,6 +794,13 @@
              'tool/mozc_tool_main_noqt.cc',
            ],
@@ -14,8 +14,8 @@
          # For Mac, ConfigDialog is the host app for necessary frameworks.
          ['OS=="win"', {
            'product_name': '<(tool_product_name_win)',
---- a/mozc/src/gyp/defines.gypi
-+++ b/mozc/src/gyp/defines.gypi
+--- a/src/gyp/defines.gypi
++++ b/src/gyp/defines.gypi
 @@ -68,6 +68,9 @@
      # use_libibus represents if ibus library is used or not.
      # This option is only for Linux.
@@ -26,8 +26,8 @@
    },
    'target_defaults': {
      'defines': [
---- a/mozc/src/renderer/renderer.gyp
-+++ b/mozc/src/renderer/renderer.gyp
+--- a/src/renderer/renderer.gyp
++++ b/src/renderer/renderer.gyp
 @@ -600,6 +600,15 @@
              '../base/base.gyp:crash_report_handler',
              'mozc_renderer_lib',
@@ -44,8 +44,8 @@
          },
          {
            'target_name': 'gtk_renderer_test',
---- a/mozc/src/server/server.gyp
-+++ b/mozc/src/server/server.gyp
+--- a/src/server/server.gyp
++++ b/src/server/server.gyp
 @@ -55,6 +55,13 @@
          'mozc_server_lib',
        ],
@@ -60,8 +60,8 @@
          ['OS=="mac"', {
            'product_name': '<(branding)Converter',
            'sources': [
---- a/mozc/src/unix/emacs/emacs.gyp
-+++ b/mozc/src/unix/emacs/emacs.gyp
+--- a/src/unix/emacs/emacs.gyp
++++ b/src/unix/emacs/emacs.gyp
 @@ -47,6 +47,15 @@
          '../../protocol/protocol.gyp:config_proto',
          'mozc_emacs_helper_lib',
@@ -78,8 +78,8 @@
      },
      {
        'target_name': 'mozc_emacs_helper_lib',
---- a/mozc/src/unix/fcitx/fcitx.gyp
-+++ b/mozc/src/unix/fcitx/fcitx.gyp
+--- a/src/unix/fcitx/fcitx.gyp
++++ b/src/unix/fcitx/fcitx.gyp
 @@ -98,6 +98,15 @@
        'defines': [
          'LOCALEDIR="/usr/share/locale/"',
@@ -96,8 +96,8 @@
      },
    ],
    }, {
---- a/mozc/src/unix/fcitx5/fcitx5.gyp
-+++ b/mozc/src/unix/fcitx5/fcitx5.gyp
+--- a/src/unix/fcitx5/fcitx5.gyp
++++ b/src/unix/fcitx5/fcitx5.gyp
 @@ -105,6 +105,15 @@
        'defines': [
          'FCITX_GETTEXT_DOMAIN="fcitx5-mozc"',
@@ -114,8 +114,8 @@
      },
    ],
    }, {
---- a/mozc/src/unix/ibus/ibus.gyp
-+++ b/mozc/src/unix/ibus/ibus.gyp
+--- a/src/unix/ibus/ibus.gyp
++++ b/src/unix/ibus/ibus.gyp
 @@ -241,6 +241,15 @@
          'ibus_mozc_lib',
          'ibus_mozc_metadata',
diff --git a/srcpkgs/mozc/patches/no-parallel.patch b/srcpkgs/mozc/patches/no-parallel.patch
index 9220808c9b31..54a5a76dae65 100644
--- a/srcpkgs/mozc/patches/no-parallel.patch
+++ b/srcpkgs/mozc/patches/no-parallel.patch
@@ -1,5 +1,5 @@
---- a/mozc/src/build_mozc.py
-+++ b/mozc/src/build_mozc.py
+--- a/src/build_mozc.py
++++ b/src/build_mozc.py
 @@ -494,6 +494,7 @@ def GypMain(options, unused_args):
    gyp_options.extend(['--generator-output=.'])
    short_basename = GetBuildShortBaseName(target_platform)
diff --git a/srcpkgs/mozc/template b/srcpkgs/mozc/template
index 3fdb986b3213..4c4e67baa440 100644
--- a/srcpkgs/mozc/template
+++ b/srcpkgs/mozc/template
@@ -8,8 +8,7 @@ _commit=056163a5fddbb261b258beb8444998e4882f0cc5
 _abseil=20211102.0
 _gyp=0.1+20220404git9ecf45e
 _jpn_dict=e5b3425575734c323e1d947009dd74709437b684
-create_wrksrc=yes
-build_wrksrc=mozc/src
+build_wrksrc=src
 hostmakedepends="gettext ninja pkg-config protobuf protobuf-devel
  python3-six which qt5-qmake qt5-host-tools"
 makedepends="gtk+-devel ibus-devel libzinnia-devel protobuf-devel qt5-devel
@@ -32,6 +31,11 @@ checksum="259d87bfd7535ad03bd554185677d7345a90166353a6db0b6a3606183ad2923d
 
 CXXFLAGS="-D_GNU_SOURCE"
 lib32disabled=yes
+skip_extraction="
+ $_abseil.tar.gz
+ gyp_$_gyp.orig.tar.xz
+ $_jpn_dict.tar.gz
+"
 
 if [ "$XBPS_TARGET_ENDIAN" = "be" ]; then
 	broken="Does not build"
@@ -42,19 +46,10 @@ if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
 fi
 
 post_extract() {
-	mv mozc-* mozc
-
-	# symlink "submodules" into place
-	for _src_dest in gyp \
-		abseil-cpp \
-		japanese-usage-dictionary:japanese_usage_dictionary
-	do
-		_src=${_src_dest%:*}
-		_dst=${_src_dest#*:}
-		mv $_src-* $_dst
-		rmdir mozc/src/third_party/$_dst
-		ln -sr $_dst mozc/src/third_party
-	done
+	vsrcextract -C src/third_party/abseil-cpp "$_abseil.tar.gz"
+	vsrcextract -C src/third_party/gyp "gyp_$_gyp.orig.tar.xz"
+	vsrcextract -C src/third_party/japanese_usage_dictionary \
+		"$_jpn_dict.tar.gz"
 }
 
 do_configure() {

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-08-21  4:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-11 17:11 [PR PATCH] vsrcextract sgn
2023-07-11 23:43 ` [PR REVIEW] vsrcextract classabbyamp
2023-07-11 23:44 ` classabbyamp
2023-07-12  6:00 ` [PR PATCH] [Updated] vsrcextract sgn
2023-07-12 18:37 ` [PR REVIEW] vsrcextract classabbyamp
2023-07-17  3:01 ` [PR PATCH] [Updated] vsrcextract sgn
2023-07-28 16:04 ` sgn
2023-08-01 13:32 ` sgn
2023-08-21  4:27 ` [PR PATCH] [Merged]: vsrcextract sgn

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).