-
Notifications
You must be signed in to change notification settings - Fork 483
/
PKGBUILD
53 lines (43 loc) · 1.53 KB
/
PKGBUILD
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
# Maintainer: Andy Gross <andy.gross@linaro.org>
pkgname=dtc
pkgver=1.7.0
pkgrel=3
pkgdesc="Device Tree Compiler"
arch=('i686' 'x86_64')
url="https://git.kernel.org/pub/scm/utils/dtc/dtc/git"
msys2_references=(
"anitya: 16911"
"cpe: cpe:2.3:a:dtc_project:dtc"
)
license=('GPL2')
depends=('libyaml')
makedepends=('python-devel' 'swig' 'libyaml-devel' 'gcc' 'python-setuptools-scm')
source=("https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/${pkgname}-${pkgver}.tar.gz"
01-correct-shared-library-extension.patch
02-pyext-install.patch)
sha256sums=('70d9c156ec86d63de0f7bdae50540ffa492b25ec1d69491c7520845c860b9a62'
'c0dd05748bac0d5fd859c9684da58b44acdbc2ac359642c630c75bcec8cbb84d'
'0135724ce6f5a30a381d2097bc6afa561168bdc16c42608fcc34c3990fa5b990')
prepare() {
cd "${srcdir}/${pkgname}-${pkgver}"
sed -i 's/python\b/python3/' tests/run_tests.sh
# to make check work
sed -i 's/__attribute__((weak))//' tests/testutils.c
patch -p1 -i "${srcdir}/01-correct-shared-library-extension.patch"
patch -p1 -i "${srcdir}/02-pyext-install.patch"
}
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
export SETUPTOOLS_SCM_PRETEND_VERSION="${pkgver}"
make
}
check() {
cd "${srcdir}/${pkgname}-${pkgver}"
$ PATH=$PWD/libfdt:$PATH/pylibfdt:$PATH make check || true
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make -j1 PREFIX=/usr DESTDIR="${pkgdir}" install
# license
install -Dm644 ${srcdir}/${pkgname}-${pkgver}/README.license ${pkgdir}/usr/share/licenses/${pkgname}/README.license
}