summaryrefslogtreecommitdiffstats
path: root/linhes/mythtv/PKGBUILD
blob: 97a27a9058b56d6ef117b2479906afd361da1c05 (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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# Maintainer: James Bunton <jamesbunton@delx.net.au>
# Contributor: Taijian <taijian@posteo.de>
# Contributor: Jonathan Conder <jonno.conder@gmail.com>
# Contributor: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Juergen Hoetzel <juergen@archlinux.org>
# Contributor: <kleptophobiac@gmail.com>
# Contributor: dorphell <dorphell@archlinux.org>

pkgname=mythtv
pkgver=33+fixes.20230926.26e76a39
pkgrel=2
pkgdesc="A Homebrew PVR project"
arch=('x86_64')
url="https://www.mythtv.org/"
license=('GPL')
depends=(
    'exiv2'
    'lame'
    'libass'
    'libavc1394'
    'libbluray'
    'libhdhomerun'
    'libiec61883'
    'libpulse'
    'libsamplerate'
    'libva'
    'libvdpau'
    'libvpx'
    'libxinerama'
    'libxml2'
    'libxrandr'
    'libzip'
    'qt5-script'
    'soundtouch'
    'taglib'
    'x264'
    'x265'
    'glew'
    'libcec'
    'mariadb'
    'mariadb-clients'
    'perl-dbd-mysql'
    'perl-io-socket-inet6'
    'perl-json-xs'
    'perl-libwww'
    'perl-net-upnp'
    'perl-xml-simple'
    'perl-xml-xpath'
    'python-future'
    'python-lxml'
    'python-mysqlclient'
    'python-pyqt5-webengine'
    'python-requests'
    'python-requests-cache'
    'python-simplejson'
    'xmltv'
)
makedepends=(
    'git'
    'help2man'
    'libcdio'
    'libcec'
    'libmariadbclient'
    'libxml2'
    'lirc'
    'perl-dbd-mysql'
    'perl-io-socket-inet6'
    'perl-libwww'
    'perl-net-upnp'
    'perl-xml-simple'
    'perl-xml-xpath'
    'python-future'
    'python-lxml'
    'python-mysqlclient'
    'python-requests'
    'python-setuptools'
    'python-simplejson'
    'qt5-tools'
    'yasm'
)

conflicts=('myththemes' 'mythplugins-mythvideo' 'mythtv-git')
replaces=('myththemes' 'mythplugins-mythvideo' 'mythtv-git')

patches="0031-UPnP-Reduce-startup-latency-by-moving-blocking-code-to-own-thread.patch
         0059-portchecker-speedup.patch
         0227-OSD-Add-interlaced-status-to-OSD-debug-screen.patch
         autoskip_reduce_commskip_jumpback.patch
         defaultThemeLinHES.patch"

source=(
    "git+https://github.com/MythTV/mythtv#branch=fixes/33"
    'mythbackend.service'
    'mythfrontend.desktop'
    'mythtv-setup.desktop'
    'mythtv.png'
    '99-mythbackend.rules'
    'sysusers.d'
    $patches
)
sha256sums=('SKIP'
            '6adb9d3370111c7d0000b215ae2d83a07a19c1bef5c22657f8caa9593c8efda5'
            'ec4f2330f77f0ac92acf228a4afa3b480cdd2de913cdabedfd43d40b03507557'
            'e7965a0d232aefcf8e5e89a96f46b7582a9590d2ae9b4f5b8ee9ab2baa913527'
            '12cb52bf9b084a4f16419c9370fef0450ce6a11308b0c3f7240f4f83df7e2ab6'
            'ecfd02bbbef5de9773f4de2c52e9b2b382ce8137735f249d7900270d304fd333'
            '470de0a4050c16c7af11a0e5cfe2810b7daae42df4acf5456c7eae274dc7c5ae'
            '276f87058edc6197ab3a53faf6b4c485ef0d2b8447b9caa02ca7234f09ab473f'
            '1ed4be912cd1ebd73553306958b7a2bc98e466b947dfb5d90ad7c0590a5a3747'
            '630c80c588a9b278c4421d356c5cbaa0debf149524bc896656b580b89d8fae88'
            '8a81e724d902976056dc824e7304df343c230ce67ec6ce1d18e110c5ef818ef6'
            'ef1d0053d862a9c714093d375e20c96418d665fa504a5b8f30621a271d416dd8')

prepare() {
  msg2 "PKGBUILD pkgver: $pkgver"
  cd "${srcdir}/mythtv/mythtv"
  gitsrcver=`echo "33+fixes.$(git show -s --format=%cd --date=short | tr -d -).$(git rev-parse --short=8 HEAD)"`
  msg2 "GIT SOURCE pkgver: $gitsrcver"
  if [ $pkgver = $gitsrcver ]; then
    warning "pkgver did NOT change. Consider increasing pkgrel ($pkgrel)."
  fi

  msg "--------------------------applying patches------------------------------"
  for i in `echo ${patches[@]:0}`
  do
      echo applying $i
      patch -Np2 -i ${srcdir}/$i || return 1
      echo "-----------------------------"
  done
  msg "--------------------------done applying patches-------------------------"

  msg "Updating en_us Translation"
  lrelease -removeidentical i18n/mythfrontend_en_us.ts
}

pkgver() {
  cd "${srcdir}/mythtv/mythtv"
  echo -n "33+fixes.$(git show -s --format=%cd --date=short | tr -d -).$(git rev-parse --short=8 HEAD)"
}

build() {
  cd "${srcdir}/mythtv/mythtv"

CFLAGS="-march=x86-64 -mtune=amdfam10 -O2 -pipe -fno-plt -fexceptions \
        -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \
        -fstack-clash-protection -fcf-protection"
#  CFLAGS="${CFLAGS/flto=auto/fPIC}"
#  CXXFLAGS="${CXXFLAGS/flto=auto/fPIC}"
#  LDFLAGS="${LDFLAGS/flto=auto/fPIC}"

  ARCH="${CARCH/_/-}"
  ./configure --prefix=/usr \
              --cpu="$ARCH" \
              --disable-altivec \
              --disable-audio-jack \
              --disable-distcc \
              --enable-libdav1d \
              --enable-libmp3lame \
              --enable-libvpx \
              --enable-libx264 \
              --enable-libx265 \
              --enable-vaapi \
              --with-bindings=python \
              --with-bindings=perl \
              --perl-config-opts=INSTALLDIRS=vendor
  echo "###### STARTING MAKE ####"
  make
}

package() {
  cd "${srcdir}/mythtv/mythtv"
  make INSTALL_ROOT="$pkgdir" install

  install -D -m644 "$srcdir/mythbackend.service" "$pkgdir/usr/lib/systemd/system/mythbackend.service"
  install -D -m644 'database/mc.sql' "$pkgdir/usr/share/mythtv/mc.sql"
  install -D -m644 "$srcdir/sysusers.d" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf"

  mkdir -p "$pkgdir/usr/share/mythtv"
  cp -R 'contrib' "$pkgdir/usr/share/mythtv"
  mkdir -p "$pkgdir/var/log/mythtv"

  # Install udev rules https://www.mythtv.org/wiki/Systemd_mythbackend_Configuration#Delay_starting_the_backend_until_tuners_have_initialized
  install -Dm644 "$srcdir/99-mythbackend.rules" "$pkgdir/usr/lib/udev/rules.d/99-mythbackend.rules"

  # Install desktop file
  install -Dm644 "$srcdir/mythtv.png" "$pkgdir/usr/share/pixmaps/mythtv.png"
  install -Dm644 "$srcdir/mythfrontend.desktop" "$pkgdir/usr/share/applications/mythfrontend.desktop"
  install -Dm644 "$srcdir/mythtv-setup.desktop" "$pkgdir/usr/share/applications/mythtv-setup.desktop"
}