Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
pkg-scripts/igv-2.17.1-0.build.sh
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
123 lines (91 sloc)
2.91 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# http://software.broadinstitute.org/software/igv/ | |
## https://data.broadinstitute.org/igv/projects/downloads/2.17/IGV_2.17.1.zip | |
set -xe | |
PKG=igv | |
VERSION=2.17.1 | |
BUILD=0 | |
PREFIX=/pkg/$PKG-$VERSION-$BUILD | |
if [ -n "$TESTING" ]; then PREFIX=/scratch/local2/$USER/$PKG-$VERSION-$BUILD ; fi | |
mkdir -p $PREFIX | |
cat >$PREFIX/profile <<-EOF | |
. /pkg/openjdk-21.0.0.35-0/profile | |
PATH=$PREFIX:\$PATH | |
if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH ; fi | |
EOF | |
. $PREFIX/profile | |
BUILDDIR=$PREFIX/build | |
mkdir -p $BUILDDIR | |
cd $BUILDDIR | |
BEEHIVE=https://beehive.molgen.mpg.de/03ac0b25031175a2a6c3f01a7990c3ce/IGV_2.17.1.zip | |
test -e IGV_$VERSION.zip || wget -nv $BEEHIVE | |
test -d IGV_$VERSION || bsdtar -xf IGV_$VERSION.zip | |
mv IGV_$VERSION/* $PREFIX | |
# intentionally fail if not empty | |
rmdir IGV_$VERSION | |
cd $PREFIX | |
cat >igv <<-'EOF' | |
#!/bin/sh | |
die() { echo $1; exit 1; } | |
parse_mem() { | |
case $1 in | |
[1-9]g | [1-9][0-9]g | [1-2][0-9][0-9]g) | |
IGVXMX=$1 ;; | |
*) | |
die "# Error: need a proper value for memory to use, eg. 8g" ;; | |
esac | |
} | |
script=`basename $0` | |
IGVXMX=${IGVXMX:-8g} | |
export IGVXMX | |
case "$script" in | |
igvxmem_hidpi) | |
parse_mem $1; shift | |
exec igv_hidpi.sh "$@" ;; | |
igvxmem) | |
parse_mem $1; shift | |
exec igv.sh "$@" ;; | |
esac | |
MEM_KB=$(grep -m1 'MemTotal:' /proc/meminfo | rev | cut -d' ' -f2 | rev) | |
MEM_GB=$(( $MEM_KB/1024/1024 )) | |
CONSIDER="# Consider using 'igvxmem XYZg' to start igv with proper memory setup." | |
if test $MEM_GB -lt 7; then | |
MSG="# This is fairly below the suitable amount of 8 GB.\n$CONSIDER" | |
elif test $MEM_GB -gt 17 ; then | |
MSG="$CONSIDER\n# To gain better performance you may increase the memory in sane steps." | |
fi | |
if test -n "$MSG"; then | |
echo '# NOTE:' | |
echo "# found approx. $MEM_GB GB of Memory on your host." | |
echo '#' | |
echo -e "$MSG" | |
echo '#' | |
echo '# igv with default settings will start in 3 seconds ...' | |
sleep 3 | |
fi | |
case "$script" in | |
igv_hidpi) | |
exec igv_hidpi.sh "$@" ;; | |
*) | |
exec igv.sh "$@" ;; | |
esac | |
EOF | |
chmod 755 igv | |
ln -s igv igvxmem | |
ln -s igv igv_hidpi | |
ln -s igv igvxmem_hidpi | |
# delivered igv.args are not up to date, yielding several disturbing warnings like | |
# WARNING: Unknown module: jide.common specified to --add-exports, fix it ... | |
cat >igv.args <<- EOF | |
# from https://openjdk.org/jeps/261 | |
# The --add-exports and --add-opens options must be used with great care. | |
# You can use them to gain access to an internal API of a library module | |
--add-exports java.desktop/javax.swing.plaf.synth=ALL-UNNAMED | |
--add-exports java.desktop/sun.swing=ALL-UNNAMED | |
--add-exports java.desktop/sun.awt=ALL-UNNAMED | |
--add-exports java.desktop/sun.awt.image=ALL-UNNAMED | |
--add-exports java.desktop/sun.awt.shell=ALL-UNNAMED | |
--add-exports java.desktop/sun.awt.dnd=ALL-UNNAMED | |
--add-exports java.base/sun.security.action=ALL-UNNAMED | |
EOF | |
exit |