summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: cb970a889bc0bb2ad5d38839d7f13eb7068e8eaa (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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Maintainer:  dreieck (https://aur.archlinux.org/account/dreieck)

_pkgname="meshcore"
pkgname="${_pkgname}-bin"
## For up to date releases, see https://files.liamcottle.net/MeshCore/.
## Upstream versioning: e.g. `1.40.0+64-1abed0d` -- break down the individual elements to reference them later, too.
_releasever=1.49.0
_buildno=77
_githash=ac8ed11
pkgver="${_releasever}${_buildno:+.build"${_buildno}"}.${_githash}"
pkgrel=1
pkgdesc="Closed source reference companion app by Liam Cottle for MeshCore, a LoRa text messaging protocol."
groups=('meshcore')
arch=(
  'x86_64'
)
url="https://meshcore.co.uk/"


license=(
  "LicenseRef-Proprietary" # App itself.
  "CC-BY-SA-4.0"           # MeshCore_Quick_Start_Guide.pdf
  # Licenses of included libraries. They are in `data/flutter_assets/NOTICES.Z`.
  "Apache-2.0"
  "BSD-2-Clause"
  "BSD-3-Clause"
  "MIT"
  "MPL-2.0"
  "OpenSSL"
  "SSLeay-standalone"
)
depends=(
  # glib2
  libglib-2.0.so
  libgio-2.0.so
  libgobject-2.0.so

  # gtk3
  libgdk-3.so
  libgtk-3.so

  glibc
  libgcc_s.so
  libgdk_pixbuf-2.0.so
  libatk-1.0.so  # at-spi2-core
  libfontconfig.so
  libstdc++.so
  libcairo.so
  libcairo-gobject.so
  libharfbuzz.so
  libepoxy.so
  libpango-1.0.so
  libpangocairo-1.0.so
)
makedepends=(
  # To reduce the size of PNG images
  'parallel'
  'zopfli'
)
optdepends=(
  'hicolor-icon-theme: For hicolor theme hierarchy.'
)
provides=(
  "${_pkgname}=${pkgver}"
)
conflicts=(
  "${_pkgname}"
)

source=(
  "https://files.liamcottle.net/MeshCore/v${_releasever}/MeshCore-v${_releasever}${_buildno:++"${_buildno}"}-${_githash}-linux-${CARCH}.zip"
  "https://files.liamcottle.net/MeshCore/Documentation/MeshCore_Quick_Start_Guide.pdf"
  "${_pkgname}.desktop"
  "license-info.md"
)
sha256sums=(
  '18426a2d756a5b4bab49b1b0db72f2a1aaaea33f7cfcc659441868707f6e8ec6'  # Binary software package.
  'a8bcb2a147746b1b0a3879220f5d55aac79c6b5f2b100fbc6b1ccea6c9946ca7'  # MeshCore_Quick_Start_Guide.pdf
  '3c212412360ca59e73a11af24b85db2d5414f2d5851f1a60267fca701077c921'  # meshcore.desktop
  '138cfaf059ef5c3fb860d3132291570179bf74cb77e1aaa7927fa766a93ad957'  # license-info.md
)

build() {
  cd "${srcdir}"

  printf '%s\n' " --> size-optimising PNG files ..."
  find -name '*.png' -type f | parallel -j`nproc` zopflipng -m -y {} {}
}

package() {
  printf '%s\n' " --> installing ..."

  cd "${srcdir}"

  install -vm755 -d "${pkgdir}/usr/lib/meshcore"
  cp -rv data lib MeshCore "${pkgdir}/usr/lib/meshcore"/
  install -vm755 -d "${pkgdir}/usr/bin"
  cd "${pkgdir}/usr/bin"
  ln -sv /usr/lib/meshcore/MeshCore MeshCore
  ln -sv MeshCore meshcore


  printf '%s\n' " --> installing icon and desktop file ..."

  cd "${srcdir}"

  install -Dvm644  data/flutter_assets/assets/images/icon.png    "${pkgdir}/usr/share/icons/hicolor/512x512/apps/${_pkgname}.png"
  install -dvm755  "${pkgdir}/usr/share/pixmaps"
  ln -sv "/usr/share/icons/hicolor/512x512/apps/${_pkgname}.png"  "${pkgdir}/usr/share/pixmaps/${_pkgname}.png"
  install -Dvm644 "${srcdir}/${_pkgname}.desktop" "${pkgdir}/usr/share/applications/${_pkgname}.desktop"

  _docfiles=(
    MeshCore_Quick_Start_Guide.pdf
    data/flutter_assets/CHANGELOG.md
  )
  _docdirs=()
  _manfiles=()
  _infofiles=()
  _licensefiles=(
    license-info.md
    data/flutter_assets/NOTICES.Z  # License for included libraries, not for the software itself.
  )
  printf '%s\n' " --> installing documentation ..."
  for _docfile in "${_docfiles[@]}"; do
    install -D -v -m644 "${_docfile}" "${pkgdir}/usr/share/doc/${_pkgname}/$(basename "${_docfile}")"
  done
  for _docdir in "${_docdirs[@]}"; do
    cp -rv "${_docdir}" "${pkgdir}/usr/share/doc/${_pkgname}/$(basename "${_docdir}")"
  done
  for _manfile in "${_manfiles[@]}"; do
    _section="$(basename "${_manfile}" .gz | sed -E -e 's|^.*\.([^.]*)$|\1|')"
    install -D -v -m644 "docs/build/man/${_manfile}" "${pkgdir}/usr/share/man/man${_section}/$(basename "${_manfile}")"
  done
  for _infofile in "${_infofiles[@]}"; do
    install -D -v -m644 "${_infofile}" "${pkgdir}/usr/share/info/$(basename "${_infofile}")"
  done
  printf '%s\n' " --> installing license ..."
  for _licensefile in "${_licensefiles[@]}"; do
    install -D -v -m644 "${_licensefile[@]}" "${pkgdir}/usr/share/licenses/${pkgname}/$(basename "${_licensefile}")"
    ln -svr "${pkgdir}/usr/share/licenses/${pkgname}/$(basename "${_licensefile}")" "${pkgdir}/usr/share/doc/${_pkgname}/$(basename "${_licensefile}")"
  done
}

# vim: set sw=2 ts=2 et: