From cdd43edffb5cc4e1328b7c97c8e0eaad6ee2425b Mon Sep 17 00:00:00 2001 From: thomas Date: Tue, 31 Oct 2023 12:54:49 +0100 Subject: [PATCH] nextflow: add version 23.10.0 A tool similar to snakemake, installed as stable package. The package contains two popular plugins now, so nf-core workflows should run 'out of the box'. More info: - https://www.nextflow.io/ - https://www.nextflow.io/docs/latest/index.html - https://nf-co.re/ --- nextflow-23.10.0-0.build.sh | 105 ++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100755 nextflow-23.10.0-0.build.sh diff --git a/nextflow-23.10.0-0.build.sh b/nextflow-23.10.0-0.build.sh new file mode 100755 index 0000000..2626d55 --- /dev/null +++ b/nextflow-23.10.0-0.build.sh @@ -0,0 +1,105 @@ +#! /bin/bash + +set -e +umask 022 + +PKG=nextflow +VERSION=23.10.0 +BUILD=0 +JDK=/pkg/openjdk-21.0.0.35-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 + PATH=$PREFIX/bin:\$PATH + if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH ; fi + export NXF_PLUGINS_MODE=prod + export NXF_PLUGINS_DIR=$PREFIX/lib/plugins +EOF +. $PREFIX/profile + +BUILD_TMPDIR=/scratch/local2/$PKG-$VERSION-$BUILD-$USER.build.tmp +test -d $BUILD_TMPDIR && rm -r $BUILD_TMPDIR +export TMPDIR=$BUILD_TMPDIR +export HOME=$BUILD_TMPDIR/home +mkdir -p $HOME + +BUILDDIR=$PREFIX/build +mkdir -p $BUILDDIR + +cd $BUILDDIR + +source $JDK/profile + +# the '-all' file is a zip archive ... +# orig: https://github.com/nextflow-io/nextflow/releases/download/v23.10.0/nextflow-23.10.0-all +BEEHIVE=https://beehive.molgen.mpg.de/b1ece372a2c4db0c57a204d5a6175eb9/nextflow-23.10.0-all +test -e nextflow-$VERSION-all || wget -nv $BEEHIVE + +# effect: this extracts to $HOME/.nextflow/capsule/apps/nextflow-all_'version' +bash nextflow-$VERSION-all info + +# 'install' jars under $PREFIX/lib +cd $PREFIX +rm -fr bin lib +mkdir bin lib +# get rid of '.lock', '.extracted' +rm -v $HOME/.nextflow/capsule/apps/nextflow-all_$VERSION/.[a-z]* +mv $HOME/.nextflow/capsule/apps/nextflow-all_$VERSION lib + +# create a straightforward launcher + +# Reflection, and migrating from Java-8 upwards: +# [... use] --add-opens to open a package, which makes all its types and members accessible + +cat <<- LAUNCHER > bin/nextflow + #! /bin/bash + + NF_XTMPDIR=\${NF_XTMPDIR:-/scratch/local2/\$USER/nextflow_tmp} + + mkdir -vp "\$NF_XTMPDIR" + + exec $JDK/bin/java \\ + --add-opens=java.base/java.lang=ALL-UNNAMED \\ + --add-opens=java.base/java.io=ALL-UNNAMED \\ + --add-opens=java.base/java.nio=ALL-UNNAMED \\ + --add-opens=java.base/java.net=ALL-UNNAMED \\ + --add-opens=java.base/java.util=ALL-UNNAMED \\ + --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED \\ + --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED \\ + --add-opens=java.base/java.nio.file.spi=ALL-UNNAMED \\ + --add-opens=java.base/sun.nio.ch=ALL-UNNAMED \\ + --add-opens=java.base/sun.nio.fs=ALL-UNNAMED \\ + --add-opens=java.base/sun.net.www.protocol.http=ALL-UNNAMED \\ + --add-opens=java.base/sun.net.www.protocol.https=ALL-UNNAMED \\ + --add-opens=java.base/sun.net.www.protocol.ftp=ALL-UNNAMED \\ + --add-opens=java.base/sun.net.www.protocol.file=ALL-UNNAMED \\ + --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED \\ + --add-opens=java.base/java.util.regex=ALL-UNNAMED \\ + \\ + -Djava.io.tmpdir="\$NF_XTMPDIR" \\ + -Dfile.encoding=UTF-8 \\ + -Djava.awt.headless=true \\ + -Dcom.sun.security.enableAIAcaIssuers=true \\ + -classpath '$PREFIX/lib/nextflow-all_$VERSION/*' \\ + nextflow.cli.Launcher \\ + "\${@+\$@}" + +LAUNCHER + +chmod -c +x bin/nextflow + +# FINALLY: some plugins, these are used by nf-core. +# (calling nextflow here needs '/scratch/local/build_home', reason unknown) +rm -vrf /scratch/local/build_home +ln -vs $HOME /scratch/local/build_home + +mkdir -vp $NXF_PLUGINS_DIR +nextflow plugin install nf-console +nextflow plugin install nf-validation +rm -vr .nextflow +rm -v /scratch/local/build_home + +exit