summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 636c56055ccfe76fee9d6573e139bf05331d5201 (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
# Maintainer: Jens Staal <staal1978@gmail.com>
pkgname=qtjambi
pkgver=6.4.1
_pkg2="$(echo ${pkgver} | cut -d. -f-2)" 
_pkg1="$(echo ${pkgver} | cut -d. -f1)"
##change these variables if needed##
_qtver=qt6
_javaver=19
####################################
pkgrel=2
pkgdesc="QtJambi is Qt bindings for the Java programming language originally developed by Trolltech"
arch=(x86_64)
url="https://github.com/OmixVisualization/qtjambi"
license=('LGPL' 'GPL')
depends=('chrpath' 'jdk-openjdk' "${_qtver}-base" "${_qtver}-remoteobjects")
makedepends=('ant' 'apache-ant-contrib')
source=(https://github.com/OmixVisualization/qtjambi/archive/refs/tags/v${pkgver}.tar.gz)
sha256sums=(280e9f49b11cfbe3fb5461e5a21f2c52aedd903596ea97ac312e1b3eeca4e90b) 

prepare() {
	cd "${srcdir}/${pkgname}-${pkgver}"
    #generate fake qtdir. 
    #Build expects directory structure from QT installer.
    rm -rf qtdir #clean up from older build
    mkdir -p qtdir/include
    for i in {bin,qml,plugins,mkspecs}; do
        ln -s "/usr/lib/${_qtver}/$i" qtdir/$i
    done
    #Hack: qtdir/include need to contain qt6 dir from /usr/include/qt6
    # and the content of /usr/include/qt6 because weird cpp issues
        cp -r /usr/include/${_qtver} qtdir/include/${_qtver}
        cp -r /usr/include/${_qtver}/* qtdir/include/
    #end hack
    ln -s qtdir/bin qtdir/libexec
    ln -s /usr/lib qtdir/lib
    ln -s "/usr/share/${_qtver}/modules" qtdir/modules
    #this should enable use of system qt

}

build() {
	cd "${srcdir}/${pkgname}-${pkgver}"
    export QTDIR="${srcdir}/${pkgname}-${pkgver}/qtdir"
    export JAVA_HOME_TARGET="/usr/lib/jvm/java-${_javaver}-openjdk"
	ant all
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver}"
    mkdir -p ${pkgdir}/usr/share/java/qtjambi
    install ${pkgver}/deployment/*.jar ${pkgdir}/usr/share/java/qtjambi/
    install ${pkgver}/deployment/native/linux-x64/release/plugins/sqldrivers/*.jar ${pkgdir}/usr/share/java/qtjambi/
    mkdir -p ${pkgdir}/usr/{lib,bin}
    install ${pkgver}/deployment/native/linux-x64/release/utilities/*.so ${pkgdir}/usr/lib/
    install ${pkgver}/deployment/native/linux-x64/release/lib/* ${pkgdir}/usr/lib/
    install ${pkgver}/deployment/native/linux-x64/release/plugins/sqldrivers/*.so ${pkgdir}/usr/lib/
    install ${pkgver}/deployment/native/linux-x64/release/utilities/QtJambiLauncher ${pkgdir}/usr/bin/
    mkdir -p ${pkgdir}/usr/share/licenses/qtjambi
    cp LICENSE.* ${pkgdir}/usr/share/licenses/qtjambi/

    #libraries get installed as copies instead of as symlinks. Fix up
    _pkg2="$(echo ${pkgver} | cut -d. -f-2)" 
    _pkg1="$(echo ${pkgver} | cut -d. -f1)"
    cd ${pkgdir}/usr/lib
    for j in $(ls libQtJambi*.so.${pkgver}); do
        k=$(echo ${j}| cut -d. -f-2)
        rm ${k}.${_pkg1}
        rm ${k}.${_pkg2}
        ln -s ${j} ${k}.${_pkg1}
        ln -s ${j} ${k}.${_pkg2}
    done
    #Hopefully will this ugly hack only be temporary...
}