1 # Copyright 1999-2021 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit desktop multilib unpacker xdg
9 HOMEPAGE
="https://gov.dingtalk.com"
10 SRC_URI
="com.alibabainc.${PN}_${PV}_amd64.deb"
12 LICENSE
="all-rights-reserved"
16 RESTRICT
="strip mirror bindist fetch"
26 BDEPEND
="dev-util/patchelf"
40 # Remove the libraries that break compatibility in modern systems
41 # Dingtalk will use the system libs instead
42 version
=$
(cat opt
/apps
/com.alibabainc.dingtalk
/files
/version
)
44 rm opt
/apps
/com.alibabainc.dingtalk
/files
/${version}/libstdc
++* || die
46 rm opt
/apps
/com.alibabainc.dingtalk
/files
/${version}/libm.so
* || die
48 rm opt
/apps
/com.alibabainc.dingtalk
/files
/${version}/libz
* || die
50 # Set RPATH for preserve-libs handling
51 pushd "opt/apps/com.alibabainc.dingtalk/files/${version}/" || die
54 # Use \x7fELF header to separate ELF executables and libraries
55 [[ -f ${x} && $
(od -t x1
-N 4 "${x}") == *"7f 45 4c 46"* ]] ||
continue
56 local rpath_root
="/opt/apps/com.alibabainc.dingtalk/files/${version}"
57 patchelf
--set-rpath "${rpath_root}/:${rpath_root}/swiftshader/:${rpath_root}/platforminputcontexts/:${rpath_root}/imageformats/" "${x}" || \
58 die
"patchelf failed on ${x}"
62 sed -i "s/export XMODIFIERS/#export XMODIFIERS/g" opt
/apps
/com.alibabainc.dingtalk
/files
/Elevator.sh || die
63 sed -i "s/export QT_IM_MODULE/#export QT_IM_MODULE/g" opt
/apps
/com.alibabainc.dingtalk
/files
/Elevator.sh || die
65 cat >> opt
/apps
/com.alibabainc.dingtalk
/files
/Elevator.sh.
head <<- EOF || die
67 if [ -z "\$(pidof fcitx5)" ]
69 export XMODIFIERS="@im=fcitx5"
70 export QT_IM_MODULE=fcitx5
71 elif [ -z "\$(pidof ibus-daemon)" ]
73 export XMODIFIERS="@im=ibus"
74 export QT_IM_MODULE=ibus
76 export XMODIFIERS="@im=fcitx"
77 export QT_IM_MODULE=fcitx
81 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
82 cat opt
/apps
/com.alibabainc.dingtalk
/files
/Elevator.sh.new
> opt
/apps
/com.alibabainc.dingtalk
/files
/Elevator.sh || die
83 rm opt
/apps
/com.alibabainc.dingtalk
/files
/Elevator.sh.
head opt
/apps
/com.alibabainc.dingtalk
/files
/Elevator.sh.new || die
85 mkdir
-p usr
/share
/applications || die
86 cp opt
/apps
/com.alibabainc.dingtalk
/entries
/applications
/com.alibabainc.dingtalk.desktop usr
/share
/applications
/ || die
90 einfo
"Please follow https://h5.dingtalk.com/circle/healthCheckin.html?corpId=dingdc75e6471f48e6171a5c74e782e240c4&c003e554-f=3edf7be3-a&cbdbhh=qwertyuiop and download"
91 einfo
"${DISTFILE_BIN}"
92 einfo
"and place it in your DISTDIR directory."