summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2b9e3167ab6e3e9458f5de1b05860f6c166b9824 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Maintainer: taotieren <admin@taotieren.com>
# Co-Maintainer: Misaka13514 <Misaka13514 at gmail dot com>

pkgname=lceda-pro-bin
_pkgname=${pkgname%-bin}
pkgver=2.2.32.3.1
pkgrel=1
pkgdesc="免费、专业、强大的国产PCB设计工具"
arch=('x86_64' 'aarch64')
url="https://pro.lceda.cn/"
license=('LicenseRef-LCEDA-Proprietary')
provides=(${_pkgname})
conflicts=(${_pkgname} ${_pkgname}-git)
depends=('gtk3' 'nss' 'alsa-lib')
install=${pkgname}.install
source=("LICENSE-$pkgver.html::https://lceda.cn/page/legal"
        "${pkgname}.install")
source_x86_64=("${_pkgname}-x86_64-${pkgver}.zip::https://image.lceda.cn/files/lceda-pro-linux-x64-${pkgver}.zip")
source_aarch64=("${_pkgname}-aarch64-${pkgver}.zip::https://image.lceda.cn/files/lceda-pro-linux-arm64-${pkgver}.zip")
# source_loong64=("${_pkgname}-loong64-${pkgver}.zip::https://image.lceda.cn/files/lceda-pro-linux-loong64-${pkgver}.zip")
sha256sums=('SKIP'
            'afba3c6712227a37c08783b3cc1a97ae71e90dc2f575409213d2773372220697')
sha256sums_x86_64=('8d7610a8f85eccd57c37ff5455705054e6d1adf05301d869f27a11001da769be')
sha256sums_aarch64=('806dd77bc6cec72ade29a6db34a9c13dd9eef7d0116a8b948ebc8491ea4a599d')
# sha256sums_loong64=('SKIP')

package() {
    export LC_CTYPE="zh_CN.UTF-8"
    install -dm0755 "${pkgdir}/opt/${_pkgname}/"

    cd "${srcdir}/${_pkgname}"
    mv * "${pkgdir}/opt/${_pkgname}/"

    cd "${pkgdir}/opt/${_pkgname}/"
    # icon
    local _icon
    for _icon in 16 32 64 128 256 512; do
        install -Dm0644 "icon/icon_${_icon}x${_icon}.png" \
                        "${pkgdir}/usr/share/icons/hicolor/${_icon}x${_icon}/apps/${_pkgname}.png"
    done
    if [ -f icon/icon_512x512@2x.png ]; then
        install -Dm0644 "icon/icon_512x512@2x.png" \
                       "${pkgdir}/usr/share/icons/hicolor/1024x1024/apps/${_pkgname}.png"
    fi
    rm -rf icon

    # desktop entry
    if [ -f lceda-pro.dkt ]; then
        install -Dm0644 lceda-pro.dkt \
                        "${pkgdir}/usr/share/applications/${_pkgname}.desktop"

        sed -i 's|/opt/lceda-pro/icon/icon_128x128.png|lceda-pro|g' \
            "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
        sed -i 's|/opt/lceda-pro/||g' \
            "${pkgdir}/usr/share/applications/${_pkgname}.desktop"
        rm -rf lceda-pro.dkt
    else
        install -Dm644 /dev/stdin $pkgdir/usr/share/applications/$_pkgname.desktop << "EOF"
[Desktop Entry]
Categories=Development;Electronics;
Comment=免费、强大、易用的在线电路设计软件
Exec=lceda-pro %f
Keywords=PCB;LCEDA;嘉立创EDA;LC;EDA
GenericName=嘉立创EDA(专业版)
Icon=lceda-pro
Name=嘉立创EDA(专业版)
Type=Application
Name[en_US]=嘉立创EDA(专业版)
MimeType=application/eprj
EOF
    fi

    # fix permissions
    find "${pkgdir}/opt/${_pkgname}/" -type f -exec chmod 644 {} \;
    find "${pkgdir}/opt/${_pkgname}/" -type d -exec chmod 755 {} \;
    chmod 0755 "${pkgdir}/opt/${_pkgname}/${_pkgname}"
    chmod 0755 "${pkgdir}/opt/${_pkgname}/chrome_crashpad_handler"

    # soft link
    install -dm0755 "${pkgdir}/usr/bin/"
    ln -s "/opt/${_pkgname}/${_pkgname}" \
          "${pkgdir}/usr/bin/${_pkgname}"

    # LICENSE
    install -Dm0644 ${srcdir}/LICENSE-$pkgver.html ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.html
}