Files
haikuports/dev-util/netbeans/netbeans_bin-26.recipe
2025-07-28 17:05:55 +00:00

77 lines
2.2 KiB
Bash

SUMMARY="An IDE for Java"
DESCRIPTION="NetBeans IDE lets you quickly and easily develop Java desktop, \
mobile, and web applications, as well as HTML5 applications with HTML, \
JavaScript, and CSS. The IDE also provides a great set of tools for PHP and \
C/C++ developers.
It is free and open source and has a large community of users and developers \
around the world."
HOMEPAGE="https://netbeans.org/"
COPYRIGHT="1997,2024 Oracle and/or its affiliates"
LICENSE="Apache v2"
REVISION="2"
SOURCE_URI="https://dlcdn.apache.org/netbeans/netbeans/$portVersion/netbeans-$portVersion-bin.zip#noarchive"
CHECKSUM_SHA256="555ef79767315ef08ae41ca8ad9acf6f44c80618e11e9bd693827d7cf4cb340c"
ADDITIONAL_FILES="netbeans-ide.rdef.in"
ARCHITECTURES="?all x86_64"
DISABLE_SOURCE_PACKAGE="true"
PROVIDES="
netbeans_bin = $portVersion
app:netbeans = $portVersion
"
REQUIRES="
haiku
java:environment == 21
"
BUILD_PREREQUIRES="
cmd:find
cmd:unzip
cmd:xargs
"
INSTALL()
{
mkdir -p $appsDir
cd $appsDir
unzip $sourceDir/netbeans-$portVersion-bin.zip
cd netbeans
rm -rf profiler {cnd,dlight,ide}/bin \
platform/modules/lib/{amd64,i386,x86}
find . -name "*.dll" -o -name "*.exe" -o -name "*.cmd" \
-o -name "*.bat" -o -name ".lastModified" | xargs rm
sed -i 's,\${HOME}/.netbeans,\${HOME}/config/settings/netbeans,g' bin/netbeans
sed -i 's,\${HOME}/.cache/netbeans,\${HOME}/config/settings/cache/netbeans,g' bin/netbeans
cat << EOF > $appsDir/netbeans/netbeans.sh
#!/bin/sh -l
export PATH=\$JDK17_HOME/bin:\$PATH
exec $appsDir/netbeans/bin/netbeans
EOF
chmod 755 $appsDir/netbeans/netbeans.sh
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="0"
local MINOR="0"
local APP_NAME="NetBeans"
local LONG_INFO="$SUMMARY"
local APP_SIGNATURE="application/x-vnd.netbeans"
sed \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
-e "s|@APP_NAME@|$APP_NAME|" \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
$portDir/additional-files/netbeans-ide.rdef.in > netbeans-ide.rdef
rc netbeans-ide.rdef
settype -t application/x-vnd.Be-elfexecutable "$appsDir/netbeans/netbeans.sh"
resattr -o "$appsDir/netbeans/netbeans.sh" netbeans-ide.rsrc
addAppDeskbarSymlink $appsDir/netbeans/netbeans.sh 'NetBeans'
}