From 73e49657f80b27598edf0ed6bdce747526f81a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Sat, 1 May 2021 10:07:53 +0700 Subject: [PATCH] mozc: fix build with platform not have atomic8_* --- srcpkgs/mozc/patches/latomic.patch | 150 +++++++++++++++++++++++++++++ srcpkgs/mozc/template | 5 + 2 files changed, 155 insertions(+) create mode 100644 srcpkgs/mozc/patches/latomic.patch diff --git a/srcpkgs/mozc/patches/latomic.patch b/srcpkgs/mozc/patches/latomic.patch new file mode 100644 index 00000000000..2a30432a821 --- /dev/null +++ b/srcpkgs/mozc/patches/latomic.patch @@ -0,0 +1,150 @@ +Index: mozc/src/gui/gui.gyp +=================================================================== +--- mozc/src/gui/gui.gyp.orig ++++ mozc/src/gui/gui.gyp +@@ -790,6 +790,13 @@ + 'tool/mozc_tool_main_noqt.cc', + ], + }], ++ ['use_libatomic==1', { ++ 'link_settings': { ++ 'libraries': [ ++ '-latomic', ++ ], ++ }, ++ }], + # For Mac, ConfigDialog is the host app for necessary frameworks. + ['OS=="win"', { + 'product_name': '<(tool_product_name_win)', +Index: mozc/src/gyp/defines.gypi +=================================================================== +--- mozc/src/gyp/defines.gypi.orig ++++ mozc/src/gyp/defines.gypi +@@ -68,6 +68,9 @@ + # use_libibus represents if ibus library is used or not. + # This option is only for Linux. + 'use_libibus%': '0', ++ ++ # use_libatomic represents if libatomic is required or not ++ 'use_libatomic%': '0', + }, + 'target_defaults': { + 'defines': [ +Index: mozc/src/renderer/renderer.gyp +=================================================================== +--- mozc/src/renderer/renderer.gyp.orig ++++ mozc/src/renderer/renderer.gyp +@@ -592,6 +592,15 @@ + '../base/base.gyp:crash_report_handler', + 'mozc_renderer_lib', + ], ++ 'conditions': [ ++ ['use_libatomic==1', { ++ 'link_settings': { ++ 'libraries': [ ++ '-latomic', ++ ], ++ }, ++ }], ++ ], + }, + { + 'target_name': 'gtk_renderer_test', +Index: mozc/src/server/server.gyp +=================================================================== +--- mozc/src/server/server.gyp.orig ++++ mozc/src/server/server.gyp +@@ -55,6 +55,13 @@ + 'mozc_server_lib', + ], + 'conditions': [ ++ ['use_libatomic==1', { ++ 'link_settings': { ++ 'libraries': [ ++ '-latomic', ++ ], ++ }, ++ }], + ['OS=="mac"', { + 'product_name': '<(branding)Converter', + 'sources': [ +Index: mozc/src/unix/emacs/emacs.gyp +=================================================================== +--- mozc/src/unix/emacs/emacs.gyp.orig ++++ mozc/src/unix/emacs/emacs.gyp +@@ -46,6 +46,15 @@ + '../../protocol/protocol.gyp:config_proto', + 'mozc_emacs_helper_lib', + ], ++ 'conditions': [ ++ ['use_libatomic==1', { ++ 'link_settings': { ++ 'libraries': [ ++ '-latomic', ++ ], ++ }, ++ }], ++ ], + }, + { + 'target_name': 'mozc_emacs_helper_lib', +Index: mozc/src/unix/fcitx/fcitx.gyp +=================================================================== +--- mozc/src/unix/fcitx/fcitx.gyp.orig ++++ mozc/src/unix/fcitx/fcitx.gyp +@@ -98,6 +98,15 @@ + 'defines': [ + 'LOCALEDIR="/usr/share/locale/"', + ], ++ 'conditions': [ ++ ['use_libatomic==1', { ++ 'link_settings': { ++ 'libraries': [ ++ '-latomic', ++ ], ++ }, ++ }], ++ ], + }, + ], + }, { +Index: mozc/src/unix/fcitx5/fcitx5.gyp +=================================================================== +--- mozc/src/unix/fcitx5/fcitx5.gyp.orig ++++ mozc/src/unix/fcitx5/fcitx5.gyp +@@ -105,6 +105,15 @@ + 'defines': [ + 'FCITX_GETTEXT_DOMAIN="fcitx5-mozc"', + ], ++ 'conditions': [ ++ ['use_libatomic==1', { ++ 'link_settings': { ++ 'libraries': [ ++ '-latomic', ++ ], ++ }, ++ }], ++ ], + }, + ], + }, { +Index: mozc/src/unix/ibus/ibus.gyp +=================================================================== +--- mozc/src/unix/ibus/ibus.gyp.orig ++++ mozc/src/unix/ibus/ibus.gyp +@@ -239,6 +239,15 @@ + 'ibus_mozc_lib', + 'ibus_mozc_metadata', + ], ++ 'conditions': [ ++ ['use_libatomic==1', { ++ 'link_settings': { ++ 'libraries': [ ++ '-latomic', ++ ], ++ }, ++ }], ++ ], + }, + { + 'target_name': 'ibus_mozc_test', diff --git a/srcpkgs/mozc/template b/srcpkgs/mozc/template index 1a78d407f47..bcab66eeaf1 100644 --- a/srcpkgs/mozc/template +++ b/srcpkgs/mozc/template @@ -37,6 +37,10 @@ if [ "$XBPS_TARGET_ENDIAN" = "be" ]; then broken="Does not build" fi +if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then + makedepends+=" libatomic-devel" +fi + post_extract() { mv mozc-* mozc @@ -63,6 +67,7 @@ do_configure() { document_dir=/usr/share/licenses/${pkgname} use_libprotobuf=1 use_libzinnia=1 + ${XBPS_TARGET_NO_ATOMIC8:+use_libatomic=1} " python3 build_mozc.py gyp --target_platform=Linux }