summaryrefslogtreecommitdiff
path: root/archlinux/PKGBUILD
blob: a90dfffc2f2f230e24038d97dc050c7ed1a4946e (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
# Maintainer: Cyrille Bagard <nocbos@gmail.com>

pkgname=chrysalide
pkgver=r0
pkgrel=1

pkgdesc="Reverse Engineering Factory focused on embedded systems"
url='https://www.chrysalide.re/'
license=('GPL3')

arch=("$CARCH")

# base-devel: autoconf automake bison flex gettext libtool
makedepends=('git', 'pygobject-devel')

depends=('gtk3' 'libxml2' 'python' 'python-gobject' 'libarchive' 'sqlite' 'openssl')

source=('git+http://git.0xdeadc0de.fr/chrysalide.git')
md5sums=('SKIP')


pkgver() {

	cd "$pkgname"

	printf "r%s" "$(( $(git rev-list --count HEAD) + 4))"

}


prepare() {

	# XXX can not be optional and used as intermediate value at the same time!

	sed -i 's#result = false#//result = false#' "$pkgname/tools/d2c/conv/manager.c"

	# /usr/include/string.h includes /usr/include/strings.h:

	# In file included from /usr/include/string.h:431,
	#                  from /usr/include/glib-2.0/glib/gtestutils.h:30,
	#                  from /usr/include/glib-2.0/glib.h:85,
	#                  from /usr/include/glib-2.0/gobject/gbinding.h:28,
	#                  from /usr/include/glib-2.0/glib-object.h:23,
	#                  from ../editem.h:29,
	#                  from panel.h:32,
	#                  from panel.c:25:

	sed -i '1i\DEFAULT_INCLUDES = -I$(top_builddir)' "$pkgname/src/gui/panels/Makefile.am"

	sed -i '1i\DEFAULT_INCLUDES = -I$(top_builddir)' "$pkgname/plugins/elf/Makefile.am"

}


build() {

	cd "$pkgname"

	./tools/ipf/init_potfiles.sh

	autopoint

	sed -i 's/po\/Makefile.in \(po\/Makefile.in *\)*/po\/Makefile.in /' configure.ac
	sed -i 's/EXTRA_DIST.*$/EXTRA_DIST = config.rpath  ChangeLog/' Makefile.am

   	rm po/Makevars.template
	cp /usr/share/gettext/gettext.h .

	# Create a timestamp mark
	echo "timestamp" > stamp-h.in

	# As some Makefiles expect an external fragment built dynamically, ensure these files exist
	touch plugins/arm/v7/opcodes/gencode.mk
	touch plugins/dalvik/v35/opcodes/gencode.mk

	touch ChangeLog

	# Run the GNU tools
	libtoolize --force
	aclocal -Im4
	autoheader
	automake --add-missing --copy
	autoconf

	# Define the way the program will be built
	./configure -prefix=/usr --enable-silent-rules --disable-rpath --without-local-resources

	make -j$(nproc)

}


package() {

	cd "$pkgname"

	make DESTDIR="$pkgdir" install

}