Now that IDEA update is in, here is a separate patch with a couple
of tweaks:
* Fix the "stuck editor" problem caused by IDEA-79312;
* Hardcode JAVA_HOME for IDEA itself (not for stuff you build);
* Get rid of unnecessary BUILD_DEPENDS line, it's cared already;
* Use a "pax -rw" instead of two "tar" calls;
* Allow customization of IDEA configuration using @sample dance;
* Get rid on unneeded our own IDEA startup script and use the
one from upstream;
* Fix corner cases with argument handling (spaces in args etc.)
in the IDEA startup script;
* Add a few additional notes in README.
Works fine here on i386.
--
WBR,
Vadim Zhukov
Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/intellij/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- Makefile 21 Aug 2014 14:41:41 -0000 1.20
+++ Makefile 21 Aug 2014 14:57:36 -0000
@@ -8,6 +8,7 @@ V= 13.1.4b
DISTNAME= ideaIC-${V}
PKGNAME= intellij-${V}
CATEGORIES= devel
+REVISION= 0
HOMEPAGE= http://www.jetbrains.com/idea/
MAINTAINER= Vadim Zhukov <[email protected]>
@@ -20,33 +21,41 @@ MASTER_SITES= http://download.jetbrains
MODULES= java
MODJAVA_VER= 1.7
-BUILD_DEPENDS= ${MODJAVA_RUN_DEPENDS}
-
RUN_DEPENDS= devel/desktop-file-utils
NO_TEST= Yes
-SUBST_VARS+= JAVA_HOME
+SUBST_VARS= JAVA_HOME
WRKDIST= ${WRKDIR}/idea-IC-135.1230
-IJ= ${PREFIX}/intellij
+IJ= ${TRUEPREFIX}/intellij
+IJINST= ${WRKINST}${IJ}
+CONFFILES= idea.properties \
+ idea.vmoptions \
+ idea64.vmoptions
+
+pre-configure:
+ @${SUBST_CMD} ${WRKSRC}/bin/idea.sh
-# If NO_BUILD is set, JAVA_HOME doesn't get defined. So do
-# a no-op for do-build.
+# Note, if NO_BUILD is set, JAVA_HOME doesn't get defined.
do-build:
- @true
+ cd ${WRKDIR} && ${JAVA_HOME}/bin/jar xf ${WRKSRC}/lib/icons.jar icon.png
do-install:
- ${INSTALL_DATA_DIR} ${IJ}
- @tar -czf - -C ${WRKDIST} . | tar xzf - -C ${IJ}
- @${SUBST_PROGRAM} ${FILESDIR}/idea ${PREFIX}/bin/idea
- @chmod ${BINMODE} ${PREFIX}/bin/idea
- @ln -s ${TRUEPREFIX}/bin/idea ${PREFIX}/bin/intellij
+ ${INSTALL_DATA_DIR} ${IJINST}
+ cd ${WRKDIST} && pax -rw -s '/.*\.beforesubst$$//' \
+ -s '/.*\${PATCHORIG}$$//' * ${IJINST}
+ ln -sf ${IJ}/bin/idea.sh ${PREFIX}/bin/intellij
+ ln -sf ${IJ}/bin/idea.sh ${PREFIX}/bin/idea
${INSTALL_MAN} ${FILESDIR}/idea.1 ${PREFIX}/man/man1
${INSTALL_DATA_DIR} ${PREFIX}/share/applications
- cd ${WRKDIST}/lib && ${JAVA_HOME}/bin/jar xf icons.jar
- ${INSTALL_DATA} ${WRKDIST}/lib/icon.png ${IJ}/idea.png
+ ${INSTALL_DATA} ${WRKDIR}/icon.png ${IJINST}/idea.png
@${SUBST_DATA} ${FILESDIR}/intellij.desktop \
${PREFIX}/share/applications/intellij.desktop
+ ${INSTALL_DATA_DIR} ${WRKINST}${SYSCONFDIR}/idea
+.for _f in ${CONFFILES}
+ mv ${IJINST}/bin/${_f} ${IJINST}/bin/${_f}.dist
+ ln -sf ${SYSCONFDIR}/idea/${_f} ${IJINST}/bin/${_f}
+.endfor
.include <bsd.port.mk>
Index: files/idea
===================================================================
RCS file: files/idea
diff -N files/idea
--- files/idea 30 Apr 2010 19:02:17 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,28 +0,0 @@
-#!/bin/sh
-#
-# $OpenBSD: idea,v 1.2 2010/04/30 19:02:17 jasper Exp $
-#
-# OpenBSD-specific startup script for IntelliJ IDE
-
-IDEA_HOME=${TRUEPREFIX}/intellij
-
-#-----------------------------------------------------------------------------
-# Determine configuration settings
-#-----------------------------------------------------------------------------
-
-export IDEA_JDK=${JAVA_HOME}
-
-if [ ! -x "${IDEA_JDK}/bin/java" ]; then
- echo "Error: JAVA_HOME may not be defined correctly: ${IDEA_JDK}"
- echo " Unable to find Java binary ${IDEA_JDK}/bin/java"
- exit 1
-fi
-
-# Check if 'idea' executable can be found
-if [ ! -x "${IDEA_HOME}/bin/idea.sh" ]; then
- echo "Error: IDEA_HOME may not be defined correctly: ${IDEA_HOME}"
- echo " Unable to find launcher binary: ${IDEA_HOME}/bin/idea.sh"
- exit 1
-fi
-
-PATH=${IDEA_JDK}/bin:$PATH exec "${IDEA_HOME}/bin/idea.sh" $@
Index: files/intellij.desktop
===================================================================
RCS file: /cvs/ports/devel/intellij/files/intellij.desktop,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 intellij.desktop
--- files/intellij.desktop 9 Apr 2010 22:23:26 -0000 1.1.1.1
+++ files/intellij.desktop 21 Aug 2014 14:57:36 -0000
@@ -2,9 +2,9 @@
Version=1.0
Encoding=UTF-8
Type=Application
-Name=Intellij Idea
-GenericName=Intellij IDE
-Comment=Intellij Integrated Development Environment
+Name=IntelliJ IDEA
+GenericName=IntelliJ IDEA
+Comment=Integrated Development Environment for Java
Icon=${TRUEPREFIX}/intellij/idea.png
Exec=${TRUEPREFIX}/bin/intellij
Terminal=false
Index: patches/patch-bin_idea_properties
===================================================================
RCS file: patches/patch-bin_idea_properties
diff -N patches/patch-bin_idea_properties
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-bin_idea_properties 21 Aug 2014 14:57:36 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+--- bin/idea.properties.orig Thu Apr 17 12:57:17 2014
++++ bin/idea.properties Mon May 12 11:59:02 2014
+@@ -118,3 +118,9 @@ idea.xdebug.key=-Xdebug
+ # about fatal errors that happen to an IDE or plugins installed.
+ #-----------------------------------------------------------------------
+ idea.fatal.error.notification=disabled
++
++#-----------------------------------------------------------------------
++# Workaround bug IDEA-79312: text cursor gets lost on OpenJDK.
++# Actually, this happens not only on OpenJDK and mostly in Java 7.
++#-----------------------------------------------------------------------
++actionSystem.suspendFocusTransferIfApplicationInactive=false
Index: patches/patch-bin_idea_sh
===================================================================
RCS file: patches/patch-bin_idea_sh
diff -N patches/patch-bin_idea_sh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-bin_idea_sh 21 Aug 2014 14:57:36 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+Hardcode JAVA_HOME for IDEA itself.
+Unbreak readlink(1) call.
+Fixup arguments handling.
+--- bin/idea.sh.orig Thu Apr 17 12:56:35 2014
++++ bin/idea.sh Mon May 12 12:03:57 2014
+@@ -92,6 +92,8 @@ else
+ fi
+ fi
+
++JDK=${JAVA_HOME}
++
+ if [ -z "$JDK" ]; then
+ message "No JDK found. Please validate either IDEA_JDK, JDK_HOME or
JAVA_HOME environment variable points to valid JDK installation."
+ exit 1
+@@ -114,7 +116,7 @@ fi
+ SCRIPT_LOCATION=$0
+ if [ -x "$READLINK" ]; then
+ while [ -L "$SCRIPT_LOCATION" ]; do
+- SCRIPT_LOCATION=`"$READLINK" -e "$SCRIPT_LOCATION"`
++ SCRIPT_LOCATION=`"$READLINK" -f "$SCRIPT_LOCATION"`
+ done
+ fi
+
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/devel/intellij/pkg/PLIST,v
retrieving revision 1.6
diff -u -p -r1.6 PLIST
--- pkg/PLIST 21 Aug 2014 14:41:41 -0000 1.6
+++ pkg/PLIST 21 Aug 2014 14:57:36 -0000
@@ -11,9 +11,12 @@ intellij/bin/appletviewer.policy
@comment intellij/bin/fsnotifier64
intellij/bin/idea.png
intellij/bin/idea.properties
+intellij/bin/idea.properties.dist
intellij/bin/idea.sh
intellij/bin/idea.vmoptions
+intellij/bin/idea.vmoptions.dist
intellij/bin/idea64.vmoptions
+intellij/bin/idea64.vmoptions.dist
intellij/bin/inspect.sh
intellij/bin/libbreakgen.so
intellij/bin/libbreakgen64.so
Index: pkg/README
===================================================================
RCS file: /cvs/ports/devel/intellij/pkg/README,v
retrieving revision 1.2
diff -u -p -r1.2 README
--- pkg/README 2 Jun 2011 13:41:38 -0000 1.2
+++ pkg/README 21 Aug 2014 14:57:36 -0000
@@ -6,11 +6,27 @@ $OpenBSD: README,v 1.2 2011/06/02 13:41:
Windowing Problems
==================
-If the splash-screen displays but you then only see a grey main screen,
-install the wmname package and run 'wmname LG3D'. This is a problem that
-has been seen with some Java-based applications used with a non-reparenting
-window manager (e.g. cwm).
+If the splash-screen displays but you then only see a grey main screen, install
+the wmname package and run 'wmname LG3D'. This is a problem that has been seen
+with some Java-based applications used with a non-reparenting window manager
+(e.g. cwm).
Native Libraries
================
-Functionality depending on native libraries is not likely to work.
+Functionality depending on native libraries is not likely to work. This doesn't
+affect JNI-based code in your projects itself, just IDEA itself.
+
+Configuration
+=============
+To adjust the value of JVM heap size tweak one of the following files:
+
+${SYSCONFDIR}/idea/idea.vmoptions - for the 32-bit JDK
+${SYSCONFDIR}/idea/idea64.vmoptions - for 64-bit JDK
+
+... and modify the -Xms and -Xmx parameters.
+
+The official recommendation is that free space store in data cache ("system"
+directory) should be at least 1G. You can tweak it in the
+${SYSCONFDIR}/idea/idea.properties file via the "idea.system.path"
configuration
+option. You can also the configuration profile location and other options
+there, too.