1 # Copyright 1999-2022 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
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"
16 RESTRICT
="strip mirror bindist"
22 media-sound/pulseaudio
29 x11-libs/libXScrnSaver
32 BDEPEND
="dev-util/patchelf"
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
)
52 rm opt
/apps
/com.alibabainc.dingtalk
/files
/${version}/libstdc
++* || die
54 rm opt
/apps
/com.alibabainc.dingtalk
/files
/${version}/libm.so
* || die
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
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}"
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
77 if [ -z "\${QT_IM_MODULE}" ]
79 if [ -n "\$(pidof fcitx5)" ]
81 export XMODIFIERS="@im=fcitx5"
82 export QT_IM_MODULE=fcitx5
83 elif [ -n "\$(pidof ibus-daemon)" ]
85 export XMODIFIERS="@im=ibus"
86 export QT_IM_MODULE=ibus
88 export XMODIFIERS="@im=fcitx"
89 export QT_IM_MODULE=fcitx
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