summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 95bbb142da8ec3046605c602f533822c22007ec6 (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
# Maintainer: Mario Finelli <mario at finel dot li>
# Contributor: Tom Richards <tom at tomrichards dot net>
# Contributor: Alexsandr Pavlov <kidoz at mail dot ru>
# Contributor: Ernie Brodeur <ebrodeur at ujami dotnet>
# Contributor: Rogof <fake dot bios at gmail dot com>
# Contributor: m4.rc0 <m4 dot rc0 at o2 dot pl>

pkgname=rubymine
_pkgname=RubyMine
pkgver=2017.3.2
pkgrel=1
pkgdesc="Ruby and Rails IDE with the full stack of essential developer tools."
arch=('i686' 'x86_64')
options=(!strip)
url="https://www.jetbrains.com/ruby/"
license=('custom')
depends=('desktop-file-utils' 'gtk-update-icon-cache')
optdepends=('ruby: Ruby run/debug support')
install=rubymine.install
source=(https://download.jetbrains.com/ruby/${_pkgname}-${pkgver}.tar.gz
        rubymine.desktop
        rubymine.install)
sha256sums=('be2d42ca0ce86215f64c591e4464129ab2feb1f6701409e29fd05910cf2481b5'
            '72df0e7c605caf7b6c98e9335f4eee9c8bfe8fcc24523634fd8c1ebe019534d6'
            '7ecadddf2b315b22df3a5c7b90e18be7ea69e2a0d869ee18bf0e031b2c508f76')

prepare() {
    cd "${srcdir}/${_pkgname}-${pkgver}"

    # Remove junk
    rm "build.txt"
    rm "Install-Linux-tar.txt"

    #Remove non-linux libs
    rm -rf "lib/libpty/macosx"
    rm -rf "lib/libpty/win"

    #Remove bin/libs if architecture doesn't match
    if [[ $CARCH = 'i686' ]]; then
        rm -f "bin/fsnotifier64"
        rm -f "bin/libbreakgen64.so"
        rm -f "bin/libyjpagent-linux64.so"
        rm -f "bin/rubymine64.vmoptions"
        rm -rf "lib/libpty/linux/x86_64"
    fi
    if [[ $CARCH = 'x86_64' ]]; then
        rm -f "bin/fsnotifier"
        rm -f "bin/libbreakgen.so"
        rm -f "bin/libyjpagent-linux.so"
        rm -f "bin/rubymine.vmoptions"
        rm -rf "lib/libpty/linux/x86"
    fi
}

package() {
    cd "${srcdir}"
    [ $CARCH == "x86_64" ] && SUFFIX=64

    #Pre-packaged program files
    install -d -m 755 "${pkgdir}/usr/share"
    cp -a "${srcdir}/${_pkgname}-${pkgver}" "${pkgdir}/usr/share/${pkgname}"

    #Desktop application
    install -Dm644 "${pkgdir}/usr/share/${pkgname}/bin/RMlogo.svg" "${pkgdir}/usr/share/icons/hicolor/scalable/apps/${pkgname}.svg"
    install -Dm644 "rubymine.desktop" "${pkgdir}/usr/share/applications/rubymine.desktop"
    install -d -m 755 "${pkgdir}/usr/bin"
    ln -s "/usr/share/${pkgname}/bin/${pkgname}.sh" "${pkgdir}/usr/bin/jetbrains-${pkgname}"

    #License
    #install -Dm644 "${srcdir}/${_pkgname}-${pkgver}/license/${_pkgname}_license.txt" "${pkgdir}/usr/share/licenses/${pkgname}/license.txt"
    install -Dm644 "${srcdir}/${_pkgname}-${pkgver}/license/debug-commons_license.txt" "${pkgdir}/usr/share/licenses/${pkgname}/debug-commons_license.txt"
    install -Dm644 "${srcdir}/${_pkgname}-${pkgver}/license/LLDB-license.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LLDB-license.txt"

    #Java config
    sed -i 's/lcd/on/' "${pkgdir}/usr/share/rubymine/bin/rubymine${SUFFIX}.vmoptions"
    echo "-Dswing.aatext=true" >> "${pkgdir}/usr/share/rubymine/bin/rubymine${SUFFIX}.vmoptions"
}