summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c0a0c67150df6a0a210ad343cd385e9ab462165b (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
# Maintainer: Ivan Shapovalov <intelfx@intelfx.name>
# Contributor: Serge K <arch@phnx47.net>

pkgbase=rustrover-eap
pkgname=("${pkgbase}" "${pkgbase}-jre")
_buildver=
_pkgver=2024.1.4
if ! [[ $_buildver ]]; then _dlver=${_pkgver}; pkgver=${_pkgver}
else _dlver=${_buildver}; pkgver=${_pkgver}pre+${_buildver}
fi
pkgrel=1
pkgdesc='JetBrains IDE for Rust Developers (EAP)'
arch=('x86_64' 'aarch64')
url='https://www.jetbrains.com/rust/nextversion/'
license=('custom:jetbrains')
options=('!strip')
source=(
  "jetbrains-${pkgbase}.desktop"
  'LICENSE'
)
source_x86_64=("RustRover-${_dlver}-${arch[0]}.tar.gz::https://download-cdn.jetbrains.com/rustrover/RustRover-${_dlver}.tar.gz")
source_aarch64=("RustRover-${_dlver}-${arch[1]}.tar.gz::https://download-cdn.jetbrains.com/rustrover/RustRover-${_dlver}-${arch[1]}.tar.gz")
sha256sums=('cd4f42c4d3f9c0fb967a96da2c0c71884df55fe21409a97d12690e8a4c878a06'
            'db26ca1fd026fbacfeb87f4bad42d78b3512bb733ce1c566bdd5b751e77d7bb3')
sha256sums_x86_64=('ad5af1dbd43d45afa98cbefce1fe095b14c5177286ab90e41f8fa10898fc0105')
sha256sums_aarch64=('3eaf2880e019bbcbc7250c4d4c3ef4bf14822f592d4b5db11dd93cb229fefb0b')

package_rustrover-eap() {
  depends=(
    'libdbusmenu-glib'
  )
  optdepends=(
    "${pkgbase}-jre: JetBrains custom Java Runtime (Recommended)"
    "java-runtime=17: JRE - Required if ${pkgbase}-jre is not installed"
    'rust-src: Rust toolchain'
  )
  backup=(
    "opt/${pkgbase}/bin/rustrover64.vmoptions"
    "opt/${pkgbase}/bin/idea.properties"
  )

  for _dir in RustRover-{${_dlver},${_pkgver}}; do
    [[ -d ${_dir} ]] && break
  done

  install -dm755 "${pkgdir}/opt/${pkgbase}"
  cp -a "${_dir}" -T "${pkgdir}/opt/${pkgbase}"
  rm -rf "${pkgdir}/opt/${pkgbase}/jbr"

  install -dm755 "${pkgdir}/usr/bin"
  ln -rs "${pkgdir}/opt/${pkgbase}/bin/${pkgbase%-*}.sh" "${pkgdir}/usr/bin/${pkgbase}"

  install -Dm644 "jetbrains-${pkgbase}.desktop" -t "${pkgdir}/usr/share/applications"
  install -Dm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgbase}"

  install -dm755 "${pkgdir}/usr/share/pixmaps"
  ln -rs "${pkgdir}/opt/${pkgbase}/bin/${pkgbase%-*}.png" "${pkgdir}/usr/share/pixmaps/${pkgbase}.png"
  ln -rs "${pkgdir}/opt/${pkgbase}/bin/${pkgbase%-*}.svg" "${pkgdir}/usr/share/pixmaps/${pkgbase}.svg"
}

package_rustrover-eap-jre() {
  license=('GPL2')
  pkgdesc='JBR (JetBrains Runtime) for RustRover (EAP) - a patched JRE'
  url='https://github.com/JetBrains/JetBrainsRuntime'

  for _dir in RustRover-{${_dlver},${_pkgver}}; do
    [[ -d ${_dir} ]] && break
  done

  install -dm755 "${pkgdir}/opt/${pkgbase}"
  cp -a "${_dir}/jbr" -t "${pkgdir}/opt/${pkgbase}"
}