aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 641baf13a07271f9d19d585b0e01bd62ef04ac92 (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
# Maintainer: Aleksej Kovura <aur-b1a3 at mekboy dot ru>

pkgname=organicmaps
pkgver=2025.07.13_9
tag="${pkgver%%_*}-${pkgver##*_}-android"
pkgrel=1
pkgdesc="Organic Maps: Offline Hike, Bike, Trails and Navigation"
arch=(x86_64)
makedepends=("cmake<=3.31.6" git jq gcc ninja)
depends=(mesa libglvnd freetype2 sqlite icu qt6-svg qt6-base zlib libpng glibc
  qt6-positioning gcc-libs harfbuzz libxrandr libxi libxcursor)
optdepends=("ccache: faster re-compilation" "qt6-wayland: for Wayland users")
license=("Apache")
url="https://organicmaps.app"
source_url="https://github.com/organicmaps/organicmaps.git"
source=(organicmaps.desktop)
sha256sums=('8205a6abb2c053380940d5c2e83cf10b5b889544e2d36c1c777778bf35772729')
conflicts=("${pkgname}-bin" "${pkgname}-git")
prepare() {
  avail=$(df -P -B 1048576 $srcdir|awk 'NR>1 {print $4}')
  if [ $avail -le 5120 ]; then
    printf "need at least 5 GiB of free space\n"
    exit 1
  fi
  src_url=$source_url
  if [ -n "$SOURCE_URL_REWRITER" ]; then
    src_url=$($SOURCE_URL_REWRITER $source_url)
    case $src_url in
      file://*)
        git -C ${src_url#file://} fetch --depth=1 origin "$tag"
        ;;
    esac
  fi
  if [ ! -d $pkgname ]; then
    git clone --depth=1 --single-branch -b "$tag" --filter=blob:limit=128k \
      $src_url $pkgname
  fi
  if [ -n "$SOURCE_URL_REWRITER" ]; then
    for submodule_path in $(git -C $pkgname submodule status|
        awk '/icu/ || /harfbuzz/ || /expat/ {print $2}');
    do
      pin_commit=$(git -C $pkgname submodule status --cached $submodule_path|
        awk '{sub("^-",""); print $1}')
      remote=$(git -C $pkgname config --file=.gitmodules submodule.${submodule_path}.url)
      local_remote=$($SOURCE_URL_REWRITER $remote)
      case "$local_remote" in
        file://*)
          git -C ${local_remote#file://} fetch --depth=1 origin "$pin_commit"
          git -C $pkgname submodule set-url $submodule_path "$local_remote"
          ;;
      esac
    done
  fi
  cd $pkgname
  git -c protocol.file.allow=always submodule update --init --recursive --depth=1
  rm -f 3party/boost/b2
  bash ./configure.sh
}
build() {
  cd $pkgname
  env CC=gcc CXX=g++ tools/unix/build_omim.sh -n $(nproc) -c -r desktop
}
package() {
 install -dm755 "$pkgdir/usr/share/${pkgname}"
 cp -Lr "${pkgname}/data" "$pkgdir/usr/share/${pkgname}/"
 install -dm777 "$pkgdir/usr/share/${pkgname}/data/$(jq '.v' $pkgname/data/countries.txt)"
 install -Dm644 "${pkgname}/android/.idea/icon.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/${pkgname}.svg"
 install -Dm755 "omim-build-release/OMaps" "$pkgdir/usr/bin/OMaps"
 install -Dm644 "organicmaps.desktop" -t "$pkgdir/usr/share/applications"
}