netbeans-nb-8.1.ebuild 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="4"
  4. inherit eutils java-pkg-2 java-ant-2
  5. DESCRIPTION="Netbeans IDE Branding"
  6. HOMEPAGE="http://netbeans.org/"
  7. SLOT="8.1"
  8. SOURCE_URL="http://download.netbeans.org/netbeans/8.1/final/zip/netbeans-8.1-201510222201-src.zip"
  9. SRC_URI="${SOURCE_URL}
  10. http://dev.gentoo.org/~fordfrog/distfiles/netbeans-8.1-build.xml.patch.bz2
  11. http://dev.gentoo.org/~fordfrog/distfiles/netbeans-7.0.png"
  12. LICENSE="|| ( CDDL GPL-2-with-classpath-exception )"
  13. KEYWORDS="~amd64 ~x86"
  14. IUSE=""
  15. S="${WORKDIR}"
  16. CDEPEND="~dev-java/netbeans-platform-${PV}
  17. ~dev-java/netbeans-harness-${PV}
  18. ~dev-java/netbeans-ide-${PV}"
  19. DEPEND=">=virtual/jdk-1.7
  20. app-arch/unzip
  21. ${CDEPEND}
  22. dev-java/javahelp:0"
  23. RDEPEND=">=virtual/jdk-1.7
  24. ${CDEPEND}"
  25. INSTALL_DIR="/usr/share/${PN}-${SLOT}"
  26. EANT_BUILD_XML="nbbuild/build.xml"
  27. EANT_BUILD_TARGET="rebuild-cluster create-netbeans-import finish-build"
  28. EANT_EXTRA_ARGS="-Drebuild.cluster.name=nb.cluster.nb -Dext.binaries.downloaded=true -Dpermit.jdk8.builds=true"
  29. EANT_FILTER_COMPILER="ecj-3.3 ecj-3.4 ecj-3.5 ecj-3.6 ecj-3.7"
  30. JAVA_PKG_BSFIX="off"
  31. src_unpack() {
  32. unpack $(basename ${SOURCE_URL})
  33. einfo "Deleting bundled jars..."
  34. find -name "*.jar" -type f -delete
  35. unpack netbeans-8.1-build.xml.patch.bz2
  36. }
  37. src_prepare() {
  38. einfo "Deleting bundled class files..."
  39. find -name "*.class" -type f | xargs rm -vf
  40. epatch netbeans-8.1-build.xml.patch
  41. # Support for custom patches
  42. if [ -n "${NETBEANS9999_PATCHES_DIR}" -a -d "${NETBEANS9999_PATCHES_DIR}" ] ; then
  43. local files=`find "${NETBEANS9999_PATCHES_DIR}" -type f`
  44. if [ -n "${files}" ] ; then
  45. einfo "Applying custom patches:"
  46. for file in ${files} ; do
  47. epatch "${file}"
  48. done
  49. fi
  50. fi
  51. einfo "Symlinking external libraries..."
  52. java-pkg_jar-from --build-only --into javahelp/external javahelp jhall.jar jhall-2.0_05.jar
  53. einfo "Linking in other clusters..."
  54. mkdir "${S}"/nbbuild/netbeans || die
  55. pushd "${S}"/nbbuild/netbeans >/dev/null || die
  56. ln -s /usr/share/netbeans-platform-${SLOT} platform || die
  57. cat /usr/share/netbeans-platform-${SLOT}/moduleCluster.properties >> moduleCluster.properties || die
  58. touch nb.cluster.platform.built
  59. ln -s /usr/share/netbeans-harness-${SLOT} harness || die
  60. cat /usr/share/netbeans-harness-${SLOT}/moduleCluster.properties >> moduleCluster.properties || die
  61. touch nb.cluster.harness.built
  62. ln -s /usr/share/netbeans-ide-${SLOT} ide || die
  63. cat /usr/share/netbeans-ide-${SLOT}/moduleCluster.properties >> moduleCluster.properties || die
  64. touch nb.cluster.ide.built
  65. popd >/dev/null || die
  66. java-pkg-2_src_prepare
  67. }
  68. src_install() {
  69. pushd nbbuild/netbeans >/dev/null || die
  70. insinto ${INSTALL_DIR}/nb
  71. grep -E "/nb$" moduleCluster.properties > "${D}"/${INSTALL_DIR}/nb/moduleCluster.properties || die
  72. insinto ${INSTALL_DIR}
  73. doins -r nb
  74. dodoc *.txt
  75. dohtml *.html *.css
  76. insinto ${INSTALL_DIR}/bin
  77. doins bin/netbeans
  78. dosym ${INSTALL_DIR}/bin/netbeans /usr/bin/netbeans-${SLOT}
  79. fperms 755 ${INSTALL_DIR}/bin/netbeans
  80. insinto /etc/netbeans-${SLOT}
  81. doins etc/*
  82. dosym /etc/netbeans-${SLOT} ${INSTALL_DIR}/etc
  83. # fix paths per bug# 163483
  84. if [[ -e "${D}"/${INSTALL_DIR}/bin/netbeans ]]; then
  85. sed -i -e "s:\"\$progdir\"/../etc/:/etc/netbeans-${SLOT}/:" "${D}"/${INSTALL_DIR}/bin/netbeans
  86. sed -i -e "s:\"\${userdir}\"/etc/:/etc/netbeans-${SLOT}/:" "${D}"/${INSTALL_DIR}/bin/netbeans
  87. fi
  88. dodir /usr/share/icons/hicolor/32x32/apps
  89. dosym ${INSTALL_DIR}/nb/netbeans.png /usr/share/icons/hicolor/32x32/apps/netbeans-${SLOT}.png
  90. dodir /usr/share/icons/hicolor/128x128/apps
  91. cp "${DISTDIR}"/netbeans-7.0.png "${D}"/usr/share/icons/hicolor/128x128/apps/netbeans-${SLOT}.png || die
  92. dosym /usr/share/icons/hicolor/128x128/apps/netbeans-${SLOT}.png /usr/share/pixmaps/netbeans-${SLOT}.png
  93. popd >/dev/null || die
  94. make_desktop_entry netbeans-${SLOT} "Netbeans ${PV}" netbeans-${SLOT} Development
  95. mkdir -p "${D}"/${INSTALL_DIR}/nb/config || die
  96. echo "NBGNT" > "${D}"/${INSTALL_DIR}/nb/config/productid || die
  97. }