Skip to content

Commit

Permalink
Merge pull request #24 from cfriedt/issue/23/grenv-sh-do-not-set-pyth…
Browse files Browse the repository at this point in the history
…on-path-for-directories-under-python-site-packages

Issue/23/grenv sh do not set python path for directories under python site packages
  • Loading branch information
cfriedt authored May 7, 2017
2 parents 92facf4 + e6c4daf commit c9ae86d
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1707,36 +1707,33 @@ build_and_install_cmake \

P=scripts

if [ -f ${TMP_DIR}/.${P}.done ]; then
I already installed ${P}
else
# always recreate scripts
if [ 1 -eq 1 ]; then

I creating grenv.sh script
cat > ${INSTALL_DIR}/usr/bin/grenv.sh << EOF
PYTHON=${PYTHON}
INSTALL_DIR=${INSTALL_DIR}
ULPP=\${INSTALL_DIR}/usr/lib/\${PYTHON}/site-packages
PYTHONPATH=\${ULPP}:\${PYTHONPATH}
GRSHARE=\${INSTALL_DIR}/usr/share/gnuradio
GRPP=\${GRSHARE}/python/site-packages
PYTHONPATH=\${GRPP}:\${PYTHONPATH}
PATH=\${INSTALL_DIR}/usr/bin:/opt/X11/bin:\${PATH}
PYTHON=${PYTHON}
INSTALL_DIR=${INSTALL_DIR}
ULPP=\${INSTALL_DIR}/usr/lib/\${PYTHON}/site-packages
PYTHONPATH=\${ULPP}:\${PYTHONPATH}
GRSHARE=\${INSTALL_DIR}/usr/share/gnuradio
GRPP=\${GRSHARE}/python/site-packages
PYTHONPATH=\${GRPP}:\${PYTHONPATH}
PATH=\${INSTALL_DIR}/usr/bin:/opt/X11/bin:\${PATH}
EOF

if [ $? -ne 0 ]; then
E unable to create grenv.sh script
fi

cd ${INSTALL_DIR}/usr/lib/${PTYHON}/site-packages \
cd ${INSTALL_DIR}/usr/lib/${PYTHON}/site-packages \
&& \
for j in $(for i in $(find * -name '*.so'); do dirname $i; done | sort -u); do \
echo "DYLD_LIBRARY_PATH=\"\${ULPP}/${j}:\${DYLD_LIBRARY_PATH}\"" >> ${INSTALL_DIR}/usr/bin/grenv.sh; \
echo "PYTHONPATH=\"\${ULPP}/${j}:\${PYTHONPATH}\"" >> ${INSTALL_DIR}/usr/bin/grenv.sh; \
done \
&& echo "export DYLD_LIBRARY_PATH" >> ${INSTALL_DIR}/usr/bin/grenv.sh \
&& echo "export PYTHONPATH" >> ${INSTALL_DIR}/usr/bin/grenv.sh \
&& echo "export PATH" >> ${INSTALL_DIR}/usr/bin/grenv.sh \
|| E failed to create grenv.sh
&& echo "" >> ${INSTALL_DIR}/usr/bin/grenv.sh \
|| E failed to create grenv.sh;

cd ${INSTALL_DIR}/usr/share/gnuradio/python/site-packages \
&& \
Expand Down Expand Up @@ -1764,8 +1761,7 @@ EOF
> ${INSTALL_DIR}/usr/bin/run-grc \
&& chmod +x ${INSTALL_DIR}/usr/bin/run-grc \
|| E "failed to install 'run-grc' script"

touch ${TMP_DIR}/.${P}.done

fi

#
Expand Down

0 comments on commit c9ae86d

Please sign in to comment.