media-gfx/zwcad: new package, add 2022.22.2.2.3

Signed-off-by: Huang Rui <vowstar@gmail.com>
This commit is contained in:
Huang Rui
2022-06-02 15:34:18 +08:00
parent 1a5ee32da7
commit 3eb98fd2a9
3 changed files with 130 additions and 0 deletions

2
media-gfx/zwcad/Manifest Normal file
View File

@@ -0,0 +1,2 @@
DIST zwcad-2022.22.2.2.3.deb 159649900 BLAKE2B 7584f2e4ed61b4f29a75a613ba51494230a4f4db9c3ca73ca25656b058bf45ed2ad66cd92ee9238afc1a3dca649d4e90bcb5fef022c65887d3991f2a5c0de246 SHA512 dc9c415bb9d4c66ad943a5b237c3a52ba1f783ae54a37a586942da47b6b68be9e46146716750f181dfc5a4678d71234a0b18f8b216fc619498d4ebd497553fdf
DIST zwcad-python-3.7.13.tar.bz2 56117484 BLAKE2B b81d58d4c8854c4c014276ef7e03e7a2cc16cd6e5aa50c69ac63346087d527e7083f36ab489530aea59a8e07828e315f53bd5075223471471134842f3c09c084 SHA512 22eaff6624f6dacbc903a033e99738f67faf2e221ba75cd13f201dfb0ec6f1d09e31e7fe82677d8f1f4f5ae732306213c9864c2615d61827316b782dfacceac4

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>vowstar@gmail.com</email>
<name>Huang Rui</name>
</maintainer>
<longdescription lang="en">
The visual computer-aided drawing software based on Linux system developed
by Zhongwang Software is compatible with various versions of
DWG/DXF/DWF/DWFX files, providing powerful drawing browsing, drawing,
editing, marking and printing, as well as intelligent voice,
mouse gestures, two-dimensional code functions.
</longdescription>
<longdescription lang="zh">
中望CAD是由中望软件研发的基于Linux系统的可视化计算机辅助绘图软件可兼容查看各种版本
的DWG/DXF/DWF/DWFX文件提供了强大的图纸浏览、绘制、编辑、标注和打印以及
智能语音、鼠标手势、二维码功能是目前国内首款基于Linux系统的国产CAD产品
填补了目前国内无基于Linux系统的纯国产CAD产品的空白。
</longdescription>
</pkgmetadata>

View File

@@ -0,0 +1,107 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PGK_NAME="com.zwsoft.zwcad2022"
inherit desktop unpacker xdg
DESCRIPTION="CAD software for 2D drawing, reviewing and printing work"
HOMEPAGE="https://www.zwsoft.cn/product/zwcad/linux"
SRC_URI="
https://download.zwcad.com/zwcad/cad_linux/2022/SP2/signed_com.zwsoft.zwcad2022_22.2.2.3_amd64.deb -> ${P}.deb
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
"
LICENSE="all-rights-reserved"
SLOT="0"
KEYWORDS="-* ~amd64"
RESTRICT="strip mirror bindist"
RDEPEND="
media-libs/fontconfig
media-libs/libglvnd
sys-apps/util-linux
sys-libs/zlib
virtual/libcrypt:=
"
DEPEND="${RDEPEND}"
BDEPEND="dev-util/patchelf"
S=${WORKDIR}
QA_PREBUILT="*"
src_unpack() {
unpack_deb "${DISTDIR}/${P}.deb"
tar -xf "${DISTDIR}/${PN}-python-3.7.13.tar.bz2" -C "${S}/opt/apps/"${MY_PGK_NAME}"/files/ZwPyRuntime/python3.7/" || die
}
src_install() {
# Install scalable icons
doicon -s scalable "${S}"/opt/apps/${MY_PGK_NAME}/files/Icons/ZWCAD.svg
# Fix python and QA problems about python
rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/ZwPyRuntime/python3.6/" || die
rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/libZwPythonLoad6.so" || die
rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/ZwPyRuntime/python3.5/" || die
rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/libZwPythonLoad5.so" || die
rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/ZwPyRuntime/python3.4/" || die
rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/libZwPythonLoad4.so" || die
rm -rf "${S}/opt/apps/"${MY_PGK_NAME}"/files/ZwPyRuntime/python3.7/compiler_compat" || die
# Set RPATH for preserve-libs handling
pushd "${S}"/opt/apps/${MY_PGK_NAME}/files || die
local x
for x in $(find) ; do
# Use \x7fELF header to separate ELF executables and libraries
[[ -f "${x}" && "${x: -2}" != ".o" && $(od -t x1 -N 4 "${x}") == *"7f 45 4c 46"* ]] || continue
local RPATH_ROOT="/opt/apps/${MY_PGK_NAME}/files"
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"
patchelf --set-rpath "${RPATH_S}" "${x}" || \
die "patchelf failed on ${x}"
done
popd || die
# Fix desktop files
sed -E -i 's/^Exec=.*$/Exec=zwcad %F/g' "${S}/opt/apps/${MY_PGK_NAME}/entries/applications/com.zwsoft.zwcad.desktop" || die
sed -E -i 's/^Icon=.*$/Icon=ZWCAD/g' "${S}/opt/apps/${MY_PGK_NAME}/entries/applications/com.zwsoft.zwcad.desktop" || die
sed -E -i 's/Application;//g' "${S}/opt/apps/${MY_PGK_NAME}/entries/applications/com.zwsoft.zwcad.desktop" || die
# The Version entry in a .desktop file doesn't refer to the version of the
# target program. It's the version of the desktop file specification that
# this desktop file conforms to.
sed -E -i 's/^Version=.*$/Version=1.0/g' "${S}/opt/apps/${MY_PGK_NAME}/entries/applications/com.zwsoft.zwcad.desktop" || die
sed -E -i 's/^Categories=.*$/Categories=Graphics;VectorGraphics;Engineering;Construction;2DGraphics;/g' "${S}/opt/apps/${MY_PGK_NAME}/entries/applications/com.zwsoft.zwcad.desktop" || die
domenu "${S}/opt/apps/${MY_PGK_NAME}/entries/applications/com.zwsoft.zwcad.desktop"
# Add zw3d command
mkdir -p "${S}"/usr/bin/ || die
cat >> "${S}"/opt/apps/${MY_PGK_NAME}/zwcad <<- EOF || die
#!/bin/sh
export MONO_PATH=/opt/apps/${MY_PGK_NAME}/files/lib/mono/lib/mono/4.5
sh /opt/apps/${MY_PGK_NAME}/files/ZWCADRUN.sh \$*
EOF
ln -s /opt/apps/${MY_PGK_NAME}/zwcad "${S}"/usr/bin/zwcad || die
# Install package and fix permissions
insinto /opt/apps/
doins -r opt/apps/${MY_PGK_NAME}
insinto /usr
doins -r usr/*
fperms 0755 /opt/apps/${MY_PGK_NAME}/zwcad
pushd "${S}" || die
for x in $(find "opt/apps/${MY_PGK_NAME}") ; do
# Fix shell script permissions
[[ "${x: -3}" == ".sh" ]] && fperms 0755 "/${x}"
# Use \x7fELF header to separate ELF executables and libraries
[[ -f ${x} && $(od -t x1 -N 4 "${x}") == *"7f 45 4c 46"* ]] && fperms 0755 "/${x}"
done
popd || die
}