1SUMMARY="An IDE for Java"
2DESCRIPTION="NetBeans IDE lets you quickly and easily develop Java desktop, \
3mobile, and web applications, as well as HTML5 applications with HTML, \
4JavaScript, and CSS. The IDE also provides a great set of tools for PHP and \
5C/C++ developers.
6It is free and open source and has a large community of users and developers \
7around the world."
8HOMEPAGE="https://netbeans.org/"
9COPYRIGHT="1997,2024 Oracle and/or its affiliates"
10LICENSE="Apache v2"
11REVISION="1"
12SOURCE_URI="https://dlcdn.apache.org/netbeans/netbeans/$portVersion/netbeans-$portVersion-bin.zip#noarchive"
13CHECKSUM_SHA256="7a71a9683c526a847c1ff43bc9403d5c01c50b739e3c5170feffb2aa7fbaf7fd"
14ADDITIONAL_FILES="netbeans-ide.rdef.in"
15
16ARCHITECTURES="?all x86_64"
17DISABLE_SOURCE_PACKAGE="true"
18
19PROVIDES="
20	netbeans_bin = $portVersion
21	app:netbeans = $portVersion
22	"
23REQUIRES="
24	haiku
25	java:environment == 17
26	"
27
28BUILD_PREREQUIRES="
29	cmd:find
30	cmd:unzip
31	cmd:xargs
32	"
33
34INSTALL()
35{
36	mkdir -p $appsDir
37	cd $appsDir
38	unzip $sourceDir/netbeans-$portVersion-bin.zip
39
40	cd netbeans
41	rm -rf profiler {cnd,dlight,ide}/bin \
42		platform/modules/lib/{amd64,i386,x86}
43	find . -name "*.dll" -o -name "*.exe" -o -name "*.cmd" \
44		-o -name "*.bat" -o -name ".lastModified" | xargs rm
45
46	sed -i 's,\${HOME}/.netbeans,\${HOME}/config/settings/netbeans,g' bin/netbeans
47	sed -i 's,\${HOME}/.cache/netbeans,\${HOME}/config/settings/cache/netbeans,g' bin/netbeans
48
49	cat << EOF > $appsDir/netbeans/netbeans.sh
50#!/bin/sh -l
51export PATH=\$JDK17_HOME/bin:\$PATH
52exec $appsDir/netbeans/bin/netbeans
53EOF
54	chmod 755 $appsDir/netbeans/netbeans.sh
55
56	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
57	local MIDDLE="0"
58	local MINOR="0"
59	local APP_NAME="NetBeans"
60	local LONG_INFO="$SUMMARY"
61	local APP_SIGNATURE="application/x-vnd.netbeans"
62	sed \
63		-e "s|@MAJOR@|$MAJOR|" \
64		-e "s|@MIDDLE@|$MIDDLE|" \
65		-e "s|@MINOR@|$MINOR|" \
66		-e "s|@LONG_INFO@|$LONG_INFO|" \
67		-e "s|@APP_NAME@|$APP_NAME|" \
68		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
69		$portDir/additional-files/netbeans-ide.rdef.in > netbeans-ide.rdef
70
71	rc netbeans-ide.rdef
72	settype -t application/x-vnd.Be-elfexecutable "$appsDir/netbeans/netbeans.sh"
73	resattr -o "$appsDir/netbeans/netbeans.sh" netbeans-ide.rsrc
74
75	addAppDeskbarSymlink $appsDir/netbeans/netbeans.sh 'NetBeans'
76}
77