summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 40b3f5a3b0ed9d7b26bb6e5e075465500e6b1878 (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
# Maintainer:  dreieck (https://aur.archlinux.org/account/dreieck)
# Contributor: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: György Balló <ballogy@freestart.hu>

_pkgbase=gssdp
pkgbase="${_pkgbase}-1.2"
pkgname=(
  "${_pkgbase}-1.2"
)
pkgver=1.4.1 # YES!, even though version is '1.4.x', it is still 'gssdp-1.2'.
pkgrel=1
pkgdesc="GObject-based API for handling resource discovery and announcement over SSDP. Legacy 1.2 variant for compatibility with old software."
url="https://wiki.gnome.org/Projects/GUPnP"
arch=(
  'aarch64'
  'x86_64'
  'i686'
  'pentium4'
  'armv5h'
  'armv6h'
  'armv7h'
)
license=(LGPL-2.1-or-later)
depends=(
  'glib2'
  'glibc'
  'libsoup>=2'
  'libsoup<3'
)
makedepends=(
  'glib2-devel'
  'gobject-introspection'
  'gtk4'
  'meson'
  'vala'
)
optdepends=(
  'gtk4: For gssdp-1.2-device-sniffer'
)
source=(
  "${_pkgbase}-${pkgver}.tar.bz2::https://gitlab.gnome.org/GNOME/${_pkgbase}/-/archive/${_pkgbase}-${pkgver}/${_pkgbase}-${_pkgbase}-${pkgver}.tar.bz2"
)
sha256sums=(
  '62c28d6a346c2254fbd026ad994d34109b06288dac1750629a127e8cf7ecdfa8'  # Upstream source.
)
validpgpkeys=(
  'AC9CD4E32D7C7F6357BA8ADD10F6E970175D29E1'  # Jens Georg <mail@jensge.org>
)

_CFLAGSADDITIONS="-w -Wno-error=deprecated-declarations"

prepare() {
  CFLAGS+=" ${_CFLAGSADDITIONS}"
  CXXFLAGS+=" ${_CFLAGSADDITIONS}"
  export CFLAGS
  export CXXFLAGS

  cd "${srcdir}"
  if [ -e "${_pkgbase}" ]; then
    rm -Rf "${_pkgbase}"
  fi
  ln -s "${_pkgbase}-${_pkgbase}-${pkgver}" "${_pkgbase}" # Provide a generic directory name that we use later.

  cd "${srcdir}"

  local meson_options=(
    -Dgtk_doc=false
    -Dsniffer=true
    -Dintrospection=true
    -Dvapi=true
    -Dexamples=false
  )

  # meson subprojects download --sourcedir="${_pkgname}"

  # meson setup --prefix /usr --libexecdir lib --sbindir bin --buildtype plain --auto-features enabled --wrap-mode nodownload -D b_pie=true -D python.bytecompile=1 "${_pkgbase}" build --reconfigure "${meson_options[@]}"
  arch-meson "${_pkgbase}" build --reconfigure "${meson_options[@]}"

}

build() {
  CFLAGS+=" ${_CFLAGSADDITIONS}"
  CXXFLAGS+=" ${_CFLAGSADDITIONS}"
  export CFLAGS
  export CXXFLAGS

  cd "${srcdir}"

  meson compile -C build
}

check() {
  CFLAGS+=" ${_CFLAGSADDITIONS}"
  CXXFLAGS+=" ${_CFLAGSADDITIONS}"
  export CFLAGS
  export CXXFLAGS

  cd "${srcdir}"

  meson test -C build --print-errorlogs
}

package_gssdp-1.2() {
  CFLAGS+=" ${_CFLAGSADDITIONS}"
  CXXFLAGS+=" ${_CFLAGSADDITIONS}"
  export CFLAGS
  export CXXFLAGS

  provides=(libgssdp-1.2.so)

  meson install -C build --destdir "$pkgdir"

  mv -v "${pkgdir}/usr/bin/gssdp-device-sniffer"  "${pkgdir}/usr/bin/gssdp-1.2-device-sniffer"

  cd "${srcdir}/${_pkgbase}"
  install -Dvm644 -t "${pkgdir}/usr/share/doc/${pkgbase}"       AUTHORS NEWS README.md
  install -Dvm644 -t "${pkgdir}/usr/share/licenses/${pkgname}"  "COPYING"
}