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?= Date: Wed, 12 Jul 2023 00:08:14 +0700 Subject: [PATCH] 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 a41507550f950b..2702158f3b4839 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 #include @@ -45,8 +45,8 @@ An all-in-one patch that fixes several issues: #elif defined(__riscv) return reinterpret_cast(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 1b7bb395948bf0..2754cf46943196 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 a7e38fd9b346e2..c4b5cba7dd28a9 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 0b77ea1f052c5c..6c61061a2bde52 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 720e6b2c2c27a6..01f85749d54192 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 1d3aab9ab9049d..99d979ed3616bf 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 9220808c9b319b..54a5a76dae650d 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 3fdb986b3213c0..4c4e67baa440f6 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() {