|
#!/bin/bash |
|
|
|
#filename specified |
|
if [ $# != 3 ]; then |
|
echo "usage: $0 distroUrl maven_repo version" |
|
exit |
|
else |
|
echo "Processing: $1" |
|
fi |
|
|
|
|
|
BASEURL=$1 |
|
MVN_REPO=$2 |
|
VERSION=$3 |
|
|
|
TEMPFILE=./download/jogamp/$VERSION |
|
mkdir -p "$TEMPFILE" |
|
echo "using temp directory $TEMPFILE" |
|
|
|
# base jogl class jar |
|
echo "installing core jogl deps" |
|
wget -nc $BASEURL/jar/jogl.all.jar.gz -O "$TEMPFILE/jogl.all.jar.gz" |
|
gunzip "$TEMPFILE/jogl.all.jar.gz" |
|
mvn install:install-file -Dversion=$VERSION -DlocalRepositoryPath="$MVN_REPO" -DgroupId=com.jogamp.jogl -DartifactId=jogl-all -Dpackaging=jar -Dfile="$TEMPFILE/jogl.all.jar" -DgeneratePom=true |
|
|
|
echo "installing gluegen" |
|
wget -nc $BASEURL/jar/gluegen-rt.jar -O "$TEMPFILE/gluegen-rt.jar" |
|
mvn install:install-file -Dversion=$VERSION -DlocalRepositoryPath="$MVN_REPO" -DgroupId=com.jogamp.gluegen -DartifactId=gluegen-rt -Dpackaging=jar -Dfile="$TEMPFILE/gluegen-rt.jar" -DgeneratePom=true |
|
|
|
# native jars |
|
echo "installing native libs" |
|
NATIVE_PLATFORMS="linux-amd64 linux-i586 macosx-universal solaris-amd64 solaris-i586 windows-amd64 windows-i586" |
|
for platform in $NATIVE_PLATFORMS; do |
|
echo " -> installing native lib for $platform" |
|
|
|
wget -nc $BASEURL/jar/jogl-all-natives-$platform.jar -O "$TEMPFILE/jogl-all-natives-$platform.jar" |
|
mvn install:install-file -DlocalRepositoryPath="$MVN_REPO" -Dclassifier="$platform" -Dversion=$VERSION -DgroupId=com.jogamp.jogl -DartifactId=jogl-natives -Dpackaging=jar -Dfile="$TEMPFILE/jogl-all-natives-$platform.jar" -DgeneratePom=true |
|
|
|
wget -nc $BASEURL/jar/gluegen-rt-natives-$platform.jar -O "$TEMPFILE/gluegen-rt-natives-$platform.jar" |
|
mvn install:install-file -DlocalRepositoryPath="$MVN_REPO" -Dclassifier="$platform" -Dversion=$VERSION -DgroupId=com.jogamp.gluegen -DartifactId=gluegen-natives -Dpackaging=jar -Dfile="$TEMPFILE/gluegen-rt-natives-$platform.jar" -DgeneratePom=true |
|
done |
Thanks for posting this. Maven support has gotten better. You don't have to manually install the jogl and gluegen .jars any longer. The dependencies work to get all the native binaries too (I'm doing some WorldWind tutorials but you can leave those out if you're just using jogl.)
A problem with this is that all native .jars get included which you wouldn't want. For production use you would want to have platform specific build logic in maven (maybe a maven profile) to only include the correct native .jars for each platform.