1SUMMARY="A graphics and text mode web browser"
2DESCRIPTION="Links is a multi-platform web browser you can run in Terminal."
3HOMEPAGE="http://links.twibright.com/"
4COPYRIGHT="1999-2020 Mikulas Patocka
5	2000-2011 Petr Kulhavy, Karel Kulhavy, Martin Pergel"
6LICENSE="GNU GPL v2"
7REVISION="2"
8SOURCE_URI="http://links.twibright.com/download/links-$portVersion.tar.bz2"
9CHECKSUM_SHA256="2fd5499b13dee59457c132c167b8495c40deda75389489c6cccb683193f454b4"
10
11PATCHES="links-$portVersion.patchset"
12ADDITIONAL_FILES="links.rdef.in"
13
14ARCHITECTURES="all !x86_gcc2"
15SECONDARY_ARCHITECTURES="x86"
16
17commandSuffix=$secondaryArchSuffix
18commandBinDir=$binDir
19if [ "$targetArchitecture" = x86_gcc2 ]; then
20	commandSuffix=
21	commandBinDir=$prefix/bin
22fi
23
24USER_SETTINGS_FILES="
25	settings/links directory
26	"
27
28PROVIDES="
29	links$secondaryArchSuffix = $portVersion
30	cmd:links$commandSuffix = $portVersion
31	"
32REQUIRES="
33	haiku$secondaryArchSuffix
34	lib:libbrotlicommon$secondaryArchSuffix
35	lib:libbz2$secondaryArchSuffix
36	lib:libcrypto$secondaryArchSuffix
37	lib:libevent_2.1$secondaryArchSuffix
38	lib:libfontconfig$secondaryArchSuffix
39	lib:libfreetype$secondaryArchSuffix
40	lib:libgomp$secondaryArchSuffix
41	lib:libjpeg$secondaryArchSuffix
42	lib:liblzma$secondaryArchSuffix
43	lib:libpng16$secondaryArchSuffix
44	lib:libssl$secondaryArchSuffix
45	lib:libtiff$secondaryArchSuffix
46	lib:libz$secondaryArchSuffix
47	"
48
49BUILD_REQUIRES="
50	haiku${secondaryArchSuffix}_devel
51	devel:libbrotlicommon$secondaryArchSuffix
52	devel:libbz2$secondaryArchSuffix
53	devel:libcrypto$secondaryArchSuffix
54	devel:libevent_2.1$secondaryArchSuffix
55	devel:libfontconfig$secondaryArchSuffix
56	devel:libfreetype$secondaryArchSuffix
57	devel:libglu$secondaryArchSuffix
58	devel:libjpeg$secondaryArchSuffix
59	devel:liblzma$secondaryArchSuffix
60	devel:libpng16$secondaryArchSuffix
61	devel:libssl$secondaryArchSuffix
62	devel:libtiff$secondaryArchSuffix
63	devel:libz$secondaryArchSuffix
64	"
65BUILD_PREREQUIRES="
66	cmd:aclocal
67	cmd:autoreconf
68	cmd:gcc$secondaryArchSuffix
69	cmd:ld$secondaryArchSuffix
70	cmd:make
71	cmd:pkg_config$secondaryArchSuffix
72	"
73
74defineDebugInfoPackage links$secondaryArchSuffix \
75	"$commandBinDir"/links
76
77BUILD()
78{
79	autoreconf -vfi
80
81	if [ $effectiveTargetArchitecture == 'x86' ]; then
82		export CFLAGS="-DTIFF_DISABLE_DEPRECATED -g -O2 -fopenmp"
83	fi
84
85	runConfigure --omit-dirs binDir ./configure \
86		--bindir="$commandBinDir" \
87		--without-x \
88		--with-haiku \
89		--with-ssl \
90		--enable-graphics
91
92	make $jobArgs
93}
94
95INSTALL()
96{
97	make install
98
99	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
100	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
101	local MINOR="0"
102	sed \
103		-e "s|@MAJOR@|$MAJOR|" \
104		-e "s|@MIDDLE@|$MIDDLE|" \
105		-e "s|@MINOR@|$MINOR|" \
106		$portDir/additional-files/links.rdef.in > links.rdef
107
108	addResourcesToBinaries links.rdef $commandBinDir/links
109	addAppDeskbarSymlink $commandBinDir/links Links
110}
111