| 1 | DESCRIPTION="openjdk" |
|---|
| 2 | HOMEPAGE="http://openjdk.java.net/" |
|---|
| 3 | SRC_URI="http://ports-space.haiku-files.org/source/openjdk/j2sdk-april-2013.tar" |
|---|
| 4 | REVISION="3" |
|---|
| 5 | STATUS_HAIKU="stable" |
|---|
| 6 | DEPEND="app-arch/cpio = 2.10 |
|---|
| 7 | media-libs/freetype >= 2.4.9" |
|---|
| 8 | |
|---|
| 9 | CHECKSUM_MD5="e38b939c34b04427336245397fa43c9c" |
|---|
| 10 | |
|---|
| 11 | BUILD { |
|---|
| 12 | OPENJDK_DIR=`haikuporter -t`/dev-lang/openjdk/work |
|---|
| 13 | |
|---|
| 14 | # Get and build Apache Ant. |
|---|
| 15 | # Making a separate .bep file for it wasn't such a good idea. |
|---|
| 16 | |
|---|
| 17 | wget -nc http://archive.apache.org/dist/ant/source/apache-ant-1.8.4-src.tar.gz |
|---|
| 18 | tar xvfz apache-ant-1.8.4-src.tar.gz |
|---|
| 19 | export LIBRARY_PATH=${OPENJDK_DIR}/j2sdk-image/jre/lib/i386/:$LIBRARY_PATH |
|---|
| 20 | export JAVA_HOME=${OPENJDK_DIR}/j2sdk-image |
|---|
| 21 | export ANT_HOME=${OPENJDK_DIR}/ant |
|---|
| 22 | cd apache-ant-1.8.4 |
|---|
| 23 | sed -i 's/depends=\"jars,test-jar\"/depends=\"jars\"/' build.xml |
|---|
| 24 | sh build.sh install-lite |
|---|
| 25 | unset JAVA_HOME |
|---|
| 26 | cd .. |
|---|
| 27 | |
|---|
| 28 | # Clone latest JDK repositories. |
|---|
| 29 | if [ "$(ls -A jdk)" ]; then |
|---|
| 30 | echo "jdk directory is not empty" |
|---|
| 31 | else |
|---|
| 32 | hg clone http://hg.openjdk.java.net/haiku/haiku jdk --debug |
|---|
| 33 | fi |
|---|
| 34 | |
|---|
| 35 | if [ "$(ls -A jdk/corba)" ]; then |
|---|
| 36 | echo "jdk/corba directory is not empty" |
|---|
| 37 | else |
|---|
| 38 | hg clone http://hg.openjdk.java.net/haiku/haiku/corba jdk/corba --debug |
|---|
| 39 | fi |
|---|
| 40 | |
|---|
| 41 | if [ "$(ls -A jdk/hotspot)" ]; then |
|---|
| 42 | echo "jdk/hotspot directory is not empty" |
|---|
| 43 | else |
|---|
| 44 | hg clone http://hg.openjdk.java.net/haiku/haiku/hotspot jdk/hotspot --debug |
|---|
| 45 | fi |
|---|
| 46 | |
|---|
| 47 | if [ "$(ls -A jdk/jaxp)" ]; then |
|---|
| 48 | echo "jdk/jaxp directory is not empty" |
|---|
| 49 | else |
|---|
| 50 | hg clone http://hg.openjdk.java.net/haiku/haiku/jaxp jdk/jaxp --debug |
|---|
| 51 | fi |
|---|
| 52 | |
|---|
| 53 | if [ "$(ls -A jdk/jaxws)" ]; then |
|---|
| 54 | echo "jdk/jaxws directory is not empty" |
|---|
| 55 | else |
|---|
| 56 | hg clone http://hg.openjdk.java.net/haiku/haiku/jaxws jdk/jaxws --debug |
|---|
| 57 | fi |
|---|
| 58 | |
|---|
| 59 | if [ "$(ls -A jdk/jdk)" ]; then |
|---|
| 60 | echo "jdk/jdk directory is not empty" |
|---|
| 61 | else |
|---|
| 62 | hg clone http://hg.openjdk.java.net/haiku/haiku/jdk jdk/jdk --debug |
|---|
| 63 | fi |
|---|
| 64 | |
|---|
| 65 | if [ "$(ls -A jdk/langtools)" ]; then |
|---|
| 66 | echo "jdk/langtools directory is not empty" |
|---|
| 67 | else |
|---|
| 68 | hg clone http://hg.openjdk.java.net/haiku/haiku/langtools jdk/langtools --debug |
|---|
| 69 | fi |
|---|
| 70 | |
|---|
| 71 | export ALT_BOOTDIR=${OPENJDK_DIR}/j2sdk-image |
|---|
| 72 | |
|---|
| 73 | # don't set ALT_JDK_IMPORT for a full build |
|---|
| 74 | # set jdk/README-build.html |
|---|
| 75 | # export ALT_JDK_IMPORT_PATH=${OPENJDK_DIR}/j2sdk-image |
|---|
| 76 | |
|---|
| 77 | export ANT=${OPENJDK_DIR}/ant |
|---|
| 78 | export ALT_OUTPUTDIR=${OPENJDK_DIR}/output |
|---|
| 79 | |
|---|
| 80 | # set jdk/README-build.html |
|---|
| 81 | export LANG=C |
|---|
| 82 | |
|---|
| 83 | # add $ANT_HOME/bin to PATH |
|---|
| 84 | export PATH=$PATH:$ANT_HOME/bin |
|---|
| 85 | |
|---|
| 86 | # use PATH to search commands rather than explicitly set path for each commands |
|---|
| 87 | # so that grep, egrep & readelf are automaticly found |
|---|
| 88 | # see Defs-haiku.gmk |
|---|
| 89 | export ALT_UNIXCOMMAND_PATH= |
|---|
| 90 | |
|---|
| 91 | # mandatory GCC4 [requires at least 4.5.3] |
|---|
| 92 | setgcc gcc4 |
|---|
| 93 | |
|---|
| 94 | mkdir -p ${ALT_OUTPUTDIR} |
|---|
| 95 | |
|---|
| 96 | # some sources downloaded while building have moved |
|---|
| 97 | # so we have to provide a directory where they have to reside to |
|---|
| 98 | export ALT_DROPS_DIR=${OPENJDK_DIR}/drop |
|---|
| 99 | mkdir -p ${ALT_DROPS_DIR} |
|---|
| 100 | export ALLOW_DOWNLOADS=false |
|---|
| 101 | |
|---|
| 102 | # grab relocated sources |
|---|
| 103 | cd ${ALT_DROPS_DIR} |
|---|
| 104 | wget -nc http://ports-space.haiku-files.org/source/openjdk/jaxp145_01.zip |
|---|
| 105 | wget -nc http://ports-space.haiku-files.org/source/openjdk/jdk7-jaf-2010_08_19.zip |
|---|
| 106 | wget -nc http://ports-space.haiku-files.org/source/openjdk/jdk7-jaxws2_2_4-b03-2011_05_27.zip |
|---|
| 107 | cd .. |
|---|
| 108 | |
|---|
| 109 | # Deploy certain headers, if they are missing. |
|---|
| 110 | |
|---|
| 111 | HEADERS_DIR=`finddir B_SYSTEM_HEADERS_DIRECTORY` |
|---|
| 112 | MEDIA_DIR=${HEADERS_DIR}/os/media |
|---|
| 113 | |
|---|
| 114 | if [ -e ${MEDIA_DIR}/SoundConsumer.h ] ; |
|---|
| 115 | then |
|---|
| 116 | echo SoundConsumer.h exists. |
|---|
| 117 | else |
|---|
| 118 | cp SoundConsumer.h ${MEDIA_DIR}/SoundConsumer.h |
|---|
| 119 | SOUND_CONSUMER_H=1 |
|---|
| 120 | echo SoundConsumer.h was not found. Deployed private file instead. |
|---|
| 121 | fi |
|---|
| 122 | |
|---|
| 123 | if [ -e ${MEDIA_DIR}/SoundUtils.h ] ; |
|---|
| 124 | then |
|---|
| 125 | echo SoundUtils.h exists. |
|---|
| 126 | else |
|---|
| 127 | cp SoundUtils.h ${MEDIA_DIR}/SoundUtils.h |
|---|
| 128 | declare SOUND_UTILS_H=1 |
|---|
| 129 | echo SoundUtils.h was not found. Deployed private file instead. |
|---|
| 130 | fi |
|---|
| 131 | |
|---|
| 132 | # small patch allowing to finish build without errors |
|---|
| 133 | # this modification already exists in another dev branch |
|---|
| 134 | # if someone fix it in current branch, using sed rathan than patch should not brake |
|---|
| 135 | # the whole build |
|---|
| 136 | if [ -e jdk/make/Defs-internal.gmk.org ]; |
|---|
| 137 | then |
|---|
| 138 | echo Defs-internal exists. |
|---|
| 139 | else |
|---|
| 140 | mv jdk/make/Defs-internal.gmk jdk/make/Defs-internal.gmk.org |
|---|
| 141 | fi |
|---|
| 142 | cat jdk/make/Defs-internal.gmk.org | sed s/'$(PRINTF) "--'/'$(PRINTF) -- "--'/ >jdk/make/Defs-internal.gmk |
|---|
| 143 | |
|---|
| 144 | # Build. |
|---|
| 145 | cd jdk |
|---|
| 146 | make |
|---|
| 147 | |
|---|
| 148 | # Cleanup private files, if any were deployed. |
|---|
| 149 | # I don't really think it would harm anyone if we don't clean them up after compiling. |
|---|
| 150 | |
|---|
| 151 | # if [ ${SOUND_CONSUMER_H} == 1 ] ; |
|---|
| 152 | # then |
|---|
| 153 | # rm -f ${MEDIA_DIR}/SoundConsumer.h |
|---|
| 154 | # echo Removed private SoundConsumer.h |
|---|
| 155 | # fi |
|---|
| 156 | # |
|---|
| 157 | # if [ ${SOUND_UTILS_H} == 1 ] ; |
|---|
| 158 | # then |
|---|
| 159 | # rm -f ${MEDIA_DIR}/SoundUtils.h |
|---|
| 160 | # echo Removed private SoundUtils.h |
|---|
| 161 | # fi |
|---|
| 162 | } |
|---|
| 163 | |
|---|
| 164 | INSTALL { |
|---|
| 165 | # install |
|---|
| 166 | mkdir -p `finddir B_COMMON_DIRECTORY`/jdk |
|---|
| 167 | cp -r -f -v output/j2sdk-image/* `finddir B_COMMON_DIRECTORY`/jdk |
|---|
| 168 | # setup env |
|---|
| 169 | $(haikuporter -t)/dev-lang/openjdk/openjdk_setup_env.sh |
|---|
| 170 | |
|---|
| 171 | # build distro |
|---|
| 172 | mkdir -p ${DESTDIR}`finddir B_COMMON_DIRECTORY`/jdk |
|---|
| 173 | cp -r -f -v output/j2sdk-image/* ${DESTDIR}`finddir B_COMMON_DIRECTORY`/jdk |
|---|
| 174 | mkdir -p ${DESTDIR}/boot/common/boot/post_install |
|---|
| 175 | cp -f $(haikuporter -t)/dev-lang/openjdk/openjdk_setup_env.sh ${DESTDIR}/boot/common/boot/post_install |
|---|
| 176 | } |
|---|
| 177 | |
|---|
| 178 | TEST { |
|---|
| 179 | echo "OpenJDK tests are not yet ported to Haiku." |
|---|
| 180 | } |
|---|
| 181 | |
|---|
| 182 | LICENSE="GNU GPL v2" |
|---|
| 183 | COPYRIGHT="2005, 2006, Oracle and/or its affiliates" |
|---|