Skip to content

Commit

Permalink
r-ngsplot: patch all scripts, avoid activation script
Browse files Browse the repository at this point in the history
  • Loading branch information
mbargull committed Jun 9, 2018
1 parent 9b168e6 commit 7977757
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
26 changes: 10 additions & 16 deletions recipes/r-ngsplot/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,17 @@ outdir=$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM
mkdir -p $outdir
mkdir -p $PREFIX/bin
cp -R {bin,database,example,galaxy,lib,LICENSE} ${outdir}/
#Set up links for
# Set up links for
for f in ${outdir}/bin/*; do
ln -s ${f} ${PREFIX}/bin
done

#Activate/Deactivate dir
ACTIVATE_DIR=$PREFIX/etc/conda/activate.d
DEACTIVATE_DIR=$PREFIX/etc/conda/deactivate.d
mkdir -p $ACTIVATE_DIR
mkdir -p $DEACTIVATE_DIR
cp $RECIPE_DIR/scripts/deactivate.sh $DEACTIVATE_DIR/${PKG_NAME}-deactivate.sh
#Create activate.sh script
echo > "${ACTIVATE_DIR}/${PKG_NAME}-activate.sh" <<EOF
#!/bin/bash
export NGSPLOT="${outdir}"
export _CONDA_SET_NGSPLOT_ENV=1
EOF

#Patch ngs.plot.R to use proper path
sed -i "s#^progpath.*#progpath=$outdir#g" ${outdir}/bin/ngs.plot.r
# Patch scripts to use proper path and not depend on NGSPLOT env variable
for f in "${outdir}"/bin/*.py ; do
sed -Ei.bak "s|os\.environ\[\"NGSPLOT\"\]|\"${outdir}\"|g" "${f}"
rm "${f}.bak"
done
for f in "${outdir}"/bin/{,backup}/*.r ; do
sed -Ei.bak "s|Sys\.getenv\('NGSPLOT'\)|\"${outdir}\"|g" "${f}"
rm "${f}.bak"
done
4 changes: 0 additions & 4 deletions recipes/r-ngsplot/scripts/deactivate.sh

This file was deleted.

0 comments on commit 7977757

Please sign in to comment.