summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5bc9dcea167ea764871354ed28631bf13a468192 (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
# Maintainer: Achmad Fathoni <fathoniDOTidATgmailDOTcom>
# Contributor: Yu-Hsuan Tu <dobe0331 at gmail dot com>
_pkgname=RTKLIB
pkgname=rtklib-qt-git
provides=("rtklib-qt")
pkgver=r203.1be8be2
pkgrel=1
pkgdesc="An Open Source Program Package for GNSS Positioning. QT port."
arch=('x86_64')
url="http://www.rtklib.com/"
license=('BSD')
groups=('GNSS')
depends=('glibc')
makedepends=('git' 'gcc-fortran' 'qt5-base' 'imagemagick')
source=("${_pkgname}::git+https://github.com/JensReimann/RTKLIB.git#branch=rtklib_2.4.3")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgname"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare(){
    cd "${srcdir}/${_pkgname}"
    find . -name "*_qt.pro*" -exec sed -i '$ a target.path = /usr/bin\nINSTALLS += target' {} \;

    # Create pro file for qmake
    echo \
"TEMPLATE = subdirs

SUBDIRS= src \\
         app/qtapp \\
         lib

app.depends = src

" > "${srcdir}/${_pkgname}/RTKLib.pro"

}

build() {
    cd "${srcdir}/${_pkgname}"
    qmake -recursive
    make sub-src

    # Prepare icons
    convert "${srcdir}/${_pkgname}/app/qtapp/rtklaunch_qt/rtklaunch_Icon.ico" "${srcdir}/rtklaunch.png"

    # Create Desktop entry
    echo "[Desktop Entry]
Type=Application
Name=RTKLIB Launcher
Comment=RTKLIB Launcher
Exec=rtklaunch_qt
Icon=rtklaunch
Terminal=false
Categories=Science" > "${srcdir}/rtklaunch.desktop"

}

package() {
    make -C ${srcdir}/${_pkgname} sub-app-qtapp-install_subtargets INSTALL_ROOT="${pkgdir}"

    # Move desktop entries
    mkdir -p "${pkgdir}/usr/share/applications/"
    mv "${srcdir}/rtklaunch.desktop" "${pkgdir}/usr/share/applications/"

    # Move icon
    mkdir -p "${pkgdir}/usr/share/icons/hicolor/64x64/apps/"
    mv "${srcdir}/rtklaunch.png" "${pkgdir}/usr/share/icons/hicolor/64x64/apps/rtklaunch.png"

    # Install licence
    install -Dm644 "${srcdir}"/"${_pkgname}"/LICENSE.txt "${pkgdir}/usr/share/licenses/${_pkgname}/LICENSE.txt"
}