1 |
commit: 403a49314fc5375fd7f775581c7868d3b0d5c41b |
2 |
Author: Huang Rui <vowstar <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Jun 24 07:58:30 2022 +0000 |
4 |
Commit: Florian Schmaus <flow <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 24 07:58:30 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=403a4931 |
7 |
|
8 |
media-gfx/zwcad: add 2023.23.0.3.4 |
9 |
|
10 |
Signed-off-by: Huang Rui <vowstar <AT> gmail.com> |
11 |
|
12 |
media-gfx/zwcad/Manifest | 1 + |
13 |
media-gfx/zwcad/zwcad-2023.23.0.3.4.ebuild | 129 +++++++++++++++++++++++++++++ |
14 |
2 files changed, 130 insertions(+) |
15 |
|
16 |
diff --git a/media-gfx/zwcad/Manifest b/media-gfx/zwcad/Manifest |
17 |
index d159e473d..2fe1ceda9 100644 |
18 |
--- a/media-gfx/zwcad/Manifest |
19 |
+++ b/media-gfx/zwcad/Manifest |
20 |
@@ -1,2 +1,3 @@ |
21 |
DIST zwcad-2022.22.2.2.3.deb 159631816 BLAKE2B 39892032de774e85b472c238caed6c3f09992bc55c967a954099275925bb5c967c887d0bdf3b03d7cdb6cedb6725089a98828dbfdb6aebe82f34c3688373b0c7 SHA512 9d5e9a694f459643a7ad2d20cbafbb5847a39e88ab7fef4c7d6c5cbcc61628dda7138b537c3a9b5aec36b430289dd0814395e0e89cc1aacaef75bb5029c5d10d |
22 |
+DIST zwcad-2023.23.0.3.4.deb 187029904 BLAKE2B 257c0ff67718d56fadd63e01c47e249d999f5ba1f1425f010ad295009aabfe2d8a6df5fadd78726bbc80efa6d01aa5ee4addba39a19018f0e099de504c4fc30b SHA512 95be727f0474b1c649ea714ec937ea70bac614f86036729b092edd9e5f6d944a8054601743734e54337eaa4b6251c15acd36b8f853f25e0d0bb66e208947ecae |
23 |
DIST zwcad-python-3.7.13.tar.bz2 56117484 BLAKE2B b81d58d4c8854c4c014276ef7e03e7a2cc16cd6e5aa50c69ac63346087d527e7083f36ab489530aea59a8e07828e315f53bd5075223471471134842f3c09c084 SHA512 22eaff6624f6dacbc903a033e99738f67faf2e221ba75cd13f201dfb0ec6f1d09e31e7fe82677d8f1f4f5ae732306213c9864c2615d61827316b782dfacceac4 |
24 |
|
25 |
diff --git a/media-gfx/zwcad/zwcad-2023.23.0.3.4.ebuild b/media-gfx/zwcad/zwcad-2023.23.0.3.4.ebuild |
26 |
new file mode 100644 |
27 |
index 000000000..e1cec7c63 |
28 |
--- /dev/null |
29 |
+++ b/media-gfx/zwcad/zwcad-2023.23.0.3.4.ebuild |
30 |
@@ -0,0 +1,129 @@ |
31 |
+# Copyright 1999-2022 Gentoo Authors |
32 |
+# Distributed under the terms of the GNU General Public License v2 |
33 |
+ |
34 |
+EAPI=8 |
35 |
+ |
36 |
+MY_PV_YEAR="$(ver_cut 1)" |
37 |
+MY_PV="$(ver_cut 2).$(ver_cut 3).$(ver_cut 4).$(ver_cut 5)" |
38 |
+MY_PGK_NAME="com.zwsoft.${PN}${MY_PV_YEAR}" |
39 |
+inherit desktop unpacker xdg |
40 |
+ |
41 |
+DESCRIPTION="CAD software for 2D drawing, reviewing and printing work" |
42 |
+HOMEPAGE="https://www.zwsoft.cn/product/zwcad/linux" |
43 |
+ |
44 |
+SRC_URI=" |
45 |
+ https://home-store-packages.uniontech.com/appstore/pool/appstore/c/${MY_PGK_NAME}/${MY_PGK_NAME}_${MY_PV}_amd64.deb -> ${P}.deb |
46 |
+ https://anaconda.org/anaconda/python/3.7.13/download/linux-64/python-3.7.13-h12debd9_0.tar.bz2 -> ${PN}-python-3.7.13.tar.bz2 |
47 |
+" |
48 |
+ |
49 |
+LICENSE="all-rights-reserved" |
50 |
+SLOT="0" |
51 |
+KEYWORDS="-* ~amd64" |
52 |
+ |
53 |
+RESTRICT="strip mirror bindist" |
54 |
+ |
55 |
+RDEPEND=" |
56 |
+ media-libs/fontconfig |
57 |
+ media-libs/libglvnd |
58 |
+ sys-apps/util-linux |
59 |
+ sys-libs/zlib |
60 |
+ virtual/libcrypt:= |
61 |
+" |
62 |
+ |
63 |
+DEPEND="${RDEPEND}" |
64 |
+ |
65 |
+BDEPEND="dev-util/patchelf" |
66 |
+ |
67 |
+S=${WORKDIR} |
68 |
+ |
69 |
+QA_PREBUILT="*" |
70 |
+ |
71 |
+src_unpack() { |
72 |
+ unpack_deb "${DISTDIR}/${P}.deb" |
73 |
+ tar -xf "${DISTDIR}/${PN}-python-3.7.13.tar.bz2" -C "${S}/opt/apps/"${MY_PGK_NAME}"/files/ZwPyRuntime/python3.7/" || die |
74 |
+} |
75 |
+ |
76 |
+src_install() { |
77 |
+ # Install scalable icons |
78 |
+ doicon -s scalable "${S}"/opt/apps/${MY_PGK_NAME}/files/Icons/ZWCAD.svg |
79 |
+ |
80 |
+ # Fix python and QA problems about python |
81 |
+ rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/ZwPyRuntime/python3.6/" || die |
82 |
+ rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/libZwPythonLoad6.so" || die |
83 |
+ rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/ZwPyRuntime/python3.5/" || die |
84 |
+ rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/libZwPythonLoad5.so" || die |
85 |
+ rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/ZwPyRuntime/python3.4/" || die |
86 |
+ rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/libZwPythonLoad4.so" || die |
87 |
+ rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/ZwPyRuntime/python3.7/compiler_compat" || die |
88 |
+ |
89 |
+ # Set RPATH for preserve-libs handling |
90 |
+ pushd "${S}"/opt/apps/${MY_PGK_NAME}/files || die |
91 |
+ local x |
92 |
+ for x in $(find) ; do |
93 |
+ # Use \x7fELF header to separate ELF executables and libraries |
94 |
+ [[ -f "${x}" && "${x: -2}" != ".o" && $(od -t x1 -N 4 "${x}") == *"7f 45 4c 46"* ]] || continue |
95 |
+ local RPATH_ROOT="/opt/apps/${MY_PGK_NAME}/files" |
96 |
+ local RPATH_S="${RPATH_ROOT}/:${RPATH_ROOT}/lib/:${RPATH_ROOT}/lib/mono/lib/:${RPATH_ROOT}/plugins/:${RPATH_ROOT}/zh-CN/:${RPATH_ROOT}/ZwPyRuntime/python3.7/lib" |
97 |
+ patchelf --set-rpath "${RPATH_S}" "${x}" || \ |
98 |
+ die "patchelf failed on ${x}" |
99 |
+ done |
100 |
+ popd || die |
101 |
+ |
102 |
+ # Fix desktop files |
103 |
+ sed -E -i 's/^Exec=.*$/Exec=zwcad %F/g' "${S}/opt/apps/${MY_PGK_NAME}/entries/applications/${MY_PGK_NAME}.desktop" || die |
104 |
+ sed -E -i 's/^Icon=.*$/Icon=ZWCAD/g' "${S}/opt/apps/${MY_PGK_NAME}/entries/applications/${MY_PGK_NAME}.desktop" || die |
105 |
+ sed -E -i 's/Application;//g' "${S}/opt/apps/${MY_PGK_NAME}/entries/applications/${MY_PGK_NAME}.desktop" || die |
106 |
+ # The Version entry in a .desktop file doesn't refer to the version of the |
107 |
+ # target program. It's the version of the desktop file specification that |
108 |
+ # this desktop file conforms to. |
109 |
+ sed -E -i 's/^Version=.*$/Version=1.0/g' "${S}/opt/apps/${MY_PGK_NAME}/entries/applications/${MY_PGK_NAME}.desktop" || die |
110 |
+ sed -E -i 's/^Categories=.*$/Categories=Graphics;VectorGraphics;Engineering;Construction;2DGraphics;/g' "${S}/opt/apps/${MY_PGK_NAME}/entries/applications/${MY_PGK_NAME}.desktop" || die |
111 |
+ domenu "${S}/opt/apps/${MY_PGK_NAME}/entries/applications/${MY_PGK_NAME}.desktop" |
112 |
+ |
113 |
+ sed -i "1i\\export MONO_PATH=/opt/apps/${MY_PGK_NAME}/files/lib/mono/lib/mono/4.5\n" "${S}/opt/apps/${MY_PGK_NAME}/files/ZWCADRUN.sh" || die |
114 |
+ sed -E -i 's/export QT_IM_MODULE=fcitx//g' "${S}/opt/apps/${MY_PGK_NAME}/files/ZWCADRUN.sh" || die |
115 |
+ |
116 |
+ # Add zw3d command |
117 |
+ mkdir -p "${S}"/usr/bin/ || die |
118 |
+ |
119 |
+ cat >> "${S}"/opt/apps/${MY_PGK_NAME}/zwcad <<- EOF || die |
120 |
+#!/bin/sh |
121 |
+if [ -z "\${QT_IM_MODULE}" ] |
122 |
+then |
123 |
+ if [ -n "\$(pidof fcitx5)" ] |
124 |
+ then |
125 |
+ export XMODIFIERS="@im=fcitx" |
126 |
+ export QT_IM_MODULE=fcitx |
127 |
+ elif [ -n "\$(pidof ibus-daemon)" ] |
128 |
+ then |
129 |
+ export XMODIFIERS="@im=ibus" |
130 |
+ export QT_IM_MODULE=ibus |
131 |
+ elif [ -n "\$(pidof fcitx)" ] |
132 |
+ then |
133 |
+ export XMODIFIERS="@im=fcitx" |
134 |
+ export QT_IM_MODULE=fcitx |
135 |
+ fi |
136 |
+fi |
137 |
+export MONO_PATH=/opt/apps/${MY_PGK_NAME}/files/lib/mono/lib/mono/4.5 |
138 |
+sh /opt/apps/${MY_PGK_NAME}/files/ZWCADRUN.sh \$* |
139 |
+ EOF |
140 |
+ |
141 |
+ ln -s /opt/apps/${MY_PGK_NAME}/zwcad "${S}"/usr/bin/zwcad || die |
142 |
+ |
143 |
+ # Install package and fix permissions |
144 |
+ insinto /opt/apps/ |
145 |
+ doins -r opt/apps/${MY_PGK_NAME} |
146 |
+ insinto /usr |
147 |
+ doins -r usr/* |
148 |
+ |
149 |
+ fperms 0755 /opt/apps/${MY_PGK_NAME}/zwcad |
150 |
+ |
151 |
+ pushd "${S}" || die |
152 |
+ for x in $(find "opt/apps/${MY_PGK_NAME}") ; do |
153 |
+ # Fix shell script permissions |
154 |
+ [[ "${x: -3}" == ".sh" ]] && fperms 0755 "/${x}" |
155 |
+ # Use \x7fELF header to separate ELF executables and libraries |
156 |
+ [[ -f ${x} && $(od -t x1 -N 4 "${x}") == *"7f 45 4c 46"* ]] && fperms 0755 "/${x}" |
157 |
+ done |
158 |
+ popd || die |
159 |
+} |