summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 944ac0b3344c4bd02859c226452b1c3cbc974aa7 (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
87
88
# Maintainer: Leonidas Spyropoulos <artafinde at gmail dot com>

### BUILD OPTIONS
# Set these variables to ANYTHING that is not null to enable them

# Optional select if you would like to use NO-JBR. You can override the JJDK used from Idea with
# a file `idea.sh` at `~/.config/JetBrains/IntelliJIdea${_veryear}.${_verrelease}/
# Note - available options:
# 1. <empty> JBR 11 (default)
# 2. no-jbr No bundled JBR included (make sure you provide a Java runtime)
_JBR=

### Do no edit below this line unless you know what you're doing

pkgname=intellij-idea-ce-eap
_pkgname=idea-IC
_buildver=211.6222.4
_veryear=2021
_verrelease=1
_verextra=
pkgver=${_veryear}.${_verrelease}.${_buildver}
pkgrel=1
pkgdesc="Early access version of the upcoming version of Intellij Idea IDE (community version)"
arch=('any')
options=(!strip)
url="http://www.jetbrains.com/idea/nextversion"
license=('Apache2')
depends=('java-environment' 'giflib' 'libxtst' 'libdbusmenu-glib')
if [ -n "${_JBR}" ]; then
    source=("https://download.jetbrains.com/idea/ideaIC-${_buildver}-${_JBR}.tar.gz"
            'idea-ce-eap.sh')
    sha256sums=($(curl -s "${source}.sha256" | cut -f1 -d" ")
                'e555e32b96cc0de501f77c17417e77fb9b98aab5887a204f95be5c993cb3694c')
else
    source=("https://download.jetbrains.com/idea/ideaIC-${_buildver}.tar.gz"
            'idea-ce-eap.sh')
    sha256sums=($(curl -s "${source}.sha256" | cut -f1 -d" ")
                'e555e32b96cc0de501f77c17417e77fb9b98aab5887a204f95be5c993cb3694c')
fi

prepare() {
    cd "${srcdir}/${_pkgname}-${_buildver}"
    # Remove bin/libs of non-matching architectures
    if [[ $CARCH = 'i686' ]]; then
        rm bin/libyjpagent-linux64.so
        rm bin/fsnotifier64
        rm bin/idea64.vmoptions
        rm -rf lib/pty4j-native/linux/x86_64
    fi
    if [[ $CARCH = 'x86_64' ]]; then
        rm bin/fsnotifier
        rm bin/idea.vmoptions
        rm -rf lib/pty4j-native/linux/x86
   fi
}

package() {
    cd "$srcdir"
    mkdir -p "${pkgdir}/opt/${pkgname}"
    cp -R "${srcdir}/${_pkgname}-${_buildver}/"* "${pkgdir}/opt/${pkgname}"
(
cat <<EOF
[Desktop Entry]
Version=$pkgver
Type=Application
Name=IntelliJ IDEA Community EAP
Comment=Intelligent Java IDE - EAP version
Exec="/opt/$pkgname/bin/idea.sh" %f
Icon=/opt/$pkgname/bin/idea.png
Comment=$pkgdesc
Categories=Development;IDE;
Terminal=false
StartupNotify=true
StartupWMClass=jetbrains-idea-ce
EOF
) > "${srcdir}/${pkgname}.desktop"

    mkdir -p "${pkgdir}/usr/bin/"
    mkdir -p "${pkgdir}/usr/share/applications/"
    mkdir -p "${pkgdir}/usr/share/licenses/${pkgname}/"
    install -Dm644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/"
    for i in $(ls $srcdir/${_pkgname}-$_buildver/license/ ); do
      ln -sf "${srcdir}/${_pkgname}-${_buildver}/license/$i" "${pkgdir}/usr/share/licenses/${pkgname}/$i"
    done
    install -Dm 755 "idea-ce-eap.sh" "${pkgdir}/usr/bin/idea-ce-eap"
}

# vim:set ts=4 sw=4 et: