summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 54780d73d22fcad08316c223477f0a541efc68b6 (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#Maintainer: sukanka <su975853527 AT gmail.com>

_pkgname=jasp
_pkgver=0.17.0
pkgname=jasp-desktop
pkgver=0.17.0
pkgrel=7
pkgdesc="A complete statistical package for both Bayesian and Frequentist statistical methods"
arch=('x86_64' 'aarch64')
url="https://github.com/jasp-stats/jasp-desktop"
license=('AGPL3')
makedepends=("cmake" 'boost' 'jsoncpp'
'openssl'
'autoconf'
'zlib'
'bison'
'flex'
'jags'
'gcc-fortran'
'qtcreator'
'git'
'patchelf'
'ninja'
)
depends=('r'
'qt6-5compat'
'readstat'
'libarchive'
'r-rinside'
'qt6-base'
'qt6-webengine'
'qt6-shadertools'

# jaspBase
"r-jaspbase"
"r-jaspgraphs"
"r-jasptools"

#jaspCommon
"r-jaspdescriptives"
"r-jaspttests"
"r-jaspanova"
"r-jaspmixedmodels"
"r-jaspregression"
"r-jaspfrequencies"
"r-jaspfactor"

#jaspExtra
"r-jaspaudit"
"r-jaspbain"
"r-jaspbsts"
"r-jaspcircular"
"r-jaspcochrane"
"r-jaspdistributions"
"r-jaspequivalencettests"
"r-jaspjags"
"r-jasplearnbayes"
"r-jaspmachinelearning"
"r-jaspmetaanalysis"
"r-jaspnetwork"
"r-jaspprophet"
"r-jaspreliability"
"r-jaspsem"
"r-jaspsummarystatistics"
"r-jaspvisualmodeling"
"r-jaspacceptancesampling"
"r-jaspqualitycontrol"
)
provides=($_pkgname)
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/jasp-stats/jasp-desktop/archive/refs/tags/v${pkgver}.tar.gz"
'jasp.sh'
)
sha256sums=('6f4a8496e54a77daeae1e3826581559b7d122dde1cae67e08a30cc9b4842c239'
            'e0714d980e7549b4c7dcbae50370e95b6ad2e7f0cf21a534ceb3a5a83ee583fd')

prepare(){
    cd $srcdir/${pkgname}-${pkgver}

    find Tools/CMake -name *.cmake -print0 | xargs -0 sed -i "s|/usr/local|/usr|g"
    sed -i "s|lib='\${R_LIBRARY_PATH}'|lib='${srcdir}/usr/lib/R'|g"  Tools/CMake/R.cmake

    # Do NOT install modules here, they are listed in dependencies
    find Modules/ -name '*.in' -print0 | xargs -0 sed -i '1,$d;1a print("I am OK!")'
}


build(){
    cd $srcdir/${pkgname}-${pkgver}
    # this makes non-sense, but we need it.
    export GITHUB_PAT="None"

    mkdir -p ${srcdir}/usr/lib/R
    cmake -S . -B build -DCUSTOM_R_PATH=/usr/lib/R -DLINUX_LOCAL_BUILD=OFF -DINSTALL_R_MODULES=OFF \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr/lib/${pkgname} -DCMAKE_INSTALL_LIBDIR=lib \
        -GNinja

        # -DBUILD_TESTS=ON does not work on linux.
    cd build
    ninja
}

package() {
    cd $srcdir/${pkgname}-${pkgver}/build
    DESTDIR=${pkgdir} ninja -C . install
    install -Dm755 $srcdir/jasp.sh ${pkgdir}/usr/bin/jasp

    cd ${pkgdir}/usr/lib/${pkgname}
    mv share ${pkgdir}/usr
    mv Resources ${pkgdir}/usr/share/${pkgname}
    ln -s /usr/share/${pkgname} ${pkgdir}/usr/lib/${pkgname}/Resources

    rm -rf lib64
    rm -rf Modules/{renv-cache,*.log}


    # fix RPATH
    patchelf --add-rpath /usr/lib/R/library/RInside/lib/ \
        ${pkgdir}/usr/lib/jasp-desktop/bin/JASPEngine
    sed -i "s|^Exec.*|Exec=jasp %f|g" \
        ${pkgdir}/usr/share/applications/org.jaspstats.JASP.desktop

    rm -rf ${pkgdir}/usr/lib/jasp-desktop/{renv-root,renv-cache,bin/org.jaspstats.JASP}
}