media-sound/feeluown: fix mpv option does not exist
[gentoo-zh.git] / net-im / dingtalk / dingtalk-1.4.0.20422.ebuild
blobeeb4dc1a2847030e49d4a5bc354dbb5f2f577754
1 # Copyright 1999-2022 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=7
6 inherit unpacker xdg
8 DESCRIPTION="DingTalk is an intelligent working platform created by Alibaba Group"
9 HOMEPAGE="https://gov.dingtalk.com"
10 SRC_URI="https://dtapp-pub.dingtalk.com/dingtalk-desktop/xc_dingtalk_update/linux_deb/Release/com.alibabainc.${PN}_${PV}_amd64.deb"
12 LICENSE="all-rights-reserved"
13 KEYWORDS="-* ~amd64"
14 SLOT="0"
16 RESTRICT="strip mirror bindist"
18 RDEPEND="
19 dev-libs/libthai
20 dev-qt/qtgui
21 net-nds/openldap
22 media-sound/pulseaudio
23 media-video/rtmpdump
24 sys-libs/glibc
25 sys-libs/zlib
26 sys-process/procps
27 x11-libs/gtk+:2
28 x11-libs/gtk+:3
29 x11-libs/libXScrnSaver
32 BDEPEND="dev-util/patchelf"
34 DEPEND="${RDEPEND}"
36 QA_PREBUILT="*"
38 S=${WORKDIR}
40 src_unpack() {
44 src_install() {
45 dodir /
46 cd "${ED}" || die
47 unpacker
48 # Remove the libraries that break compatibility in modern systems
49 # Dingtalk will use the system libs instead
50 version=$(cat opt/apps/com.alibabainc.dingtalk/files/version)
51 # Use system stdc++
52 rm opt/apps/com.alibabainc.dingtalk/files/${version}/libstdc++* || die
53 # Use system glibc
54 rm opt/apps/com.alibabainc.dingtalk/files/${version}/libm.so* || die
55 # Use system zlib
56 rm opt/apps/com.alibabainc.dingtalk/files/${version}/libz* || die
57 # Use system gtk+, or it can't be switch input method on popup window
58 #rm opt/apps/com.alibabainc.dingtalk/files/${version}/libgtk-x11* || die
60 # Set RPATH for preserve-libs handling
61 pushd "opt/apps/com.alibabainc.dingtalk/files/${version}/" || die
62 local x
63 for x in $(find) ; do
64 # Use \x7fELF header to separate ELF executables and libraries
65 [[ -f ${x} && $(od -t x1 -N 4 "${x}") == *"7f 45 4c 46"* ]] || continue
66 local rpath_root="/opt/apps/com.alibabainc.dingtalk/files/${version}"
67 patchelf --set-rpath "${rpath_root}/:${rpath_root}/swiftshader/:${rpath_root}/platforminputcontexts/:${rpath_root}/imageformats/" "${x}" || \
68 die "patchelf failed on ${x}"
69 done
70 popd || die
71 # Fix fcitx5
72 sed -i "s/export XMODIFIERS/#export XMODIFIERS/g" opt/apps/com.alibabainc.dingtalk/files/Elevator.sh || die
73 sed -i "s/export QT_IM_MODULE/#export QT_IM_MODULE/g" opt/apps/com.alibabainc.dingtalk/files/Elevator.sh || die
75 cat >> opt/apps/com.alibabainc.dingtalk/files/Elevator.sh.head <<- EOF || die
76 #!/bin/sh
77 if [ -z "\${QT_IM_MODULE}" ]
78 then
79 if [ -n "\$(pidof fcitx5)" ]
80 then
81 export XMODIFIERS="@im=fcitx5"
82 export QT_IM_MODULE=fcitx5
83 elif [ -n "\$(pidof ibus-daemon)" ]
84 then
85 export XMODIFIERS="@im=ibus"
86 export QT_IM_MODULE=ibus
87 else
88 export XMODIFIERS="@im=fcitx"
89 export QT_IM_MODULE=fcitx
92 EOF
94 cat opt/apps/com.alibabainc.dingtalk/files/Elevator.sh.head opt/apps/com.alibabainc.dingtalk/files/Elevator.sh > opt/apps/com.alibabainc.dingtalk/files/Elevator.sh.new || die
95 cat opt/apps/com.alibabainc.dingtalk/files/Elevator.sh.new > opt/apps/com.alibabainc.dingtalk/files/Elevator.sh || die
96 rm opt/apps/com.alibabainc.dingtalk/files/Elevator.sh.head opt/apps/com.alibabainc.dingtalk/files/Elevator.sh.new || die
98 mkdir -p usr/share/applications || die
99 cp opt/apps/com.alibabainc.dingtalk/entries/applications/com.alibabainc.dingtalk.desktop usr/share/applications/ || die