Hello, I’m new to OF and i’ve been trying to install ofxIO addon.
So far I cloned the repo to ~/openframeworks/addons/ofxIO and run the /scripts/.bootstrap.sh in terminal as instructed in the addon’s readme.
When i run the script i get:
~/openframeworks/scripts/ofx/ofx: No such file or directory
And indeed when i look at the ofx folder there’s no executable named ofx.
I suspect that the problem is with the last line of the bootstrap.sh script which might be outdated and not working with the latest version of apothecary. Maybe it should point to ~/openframeworks/scripts/ofx/apothecary/apothecary instead of the path it points to? Thanks for help in advance
#!/usr/bin/env bash
set -e
# We assume we are in the `openFrameworks/addons/ofxAddon/scripts` directory.
OF_ROOT=${OF_ROOT:-$(cd "$( dirname "${BASH_SOURCE[0]}" )/../../../" && pwd)}
OPTIND=1
while getopts o: opt ; do
case "$opt" in
o) OF_ROOT=$OPTARG ; ;;
esac
done
shift "$((OPTIND-1))"
if [ ! -d $OF_ROOT ]; then
echo "The \"${OF_ROOT}\" directory doesn't exist. Please set the correct OF_ROOT using the -o option (e.g. ./bootstrap -o /user/foo/openFrameworks)."
fi
if [ ! -d $OF_ROOT/scripts ]; then
echo "The \"${OF_ROOT}\" directory exists, but \"${OF_ROOT}/scripts\" doesn't exist. Please set the correct OF_ROOT using the -o option (e.g. ./bootstrap -o /user/foo/openFrameworks)."
fi
OFX_PATH=${OF_ROOT}/scripts/ofx
if ! [ -f ${OFX_PATH}/ofx ] ; then
echo "ofx if not installed, pulling latest version."
git clone https://github.com/openframeworks/apothecary.git ${OFX_PATH}
else
pushd "${OFX_PATH}" > /dev/null
if git rev-parse --is-inside-work-tree ; then
echo "ofx is under git control, updating."
git pull origin master
else
echo "ofx is not under git control, so it may not be up-to-date."
fi
popd > /dev/null
fi
# Get the path of this addon.
THIS_ADDON_PATH=$(cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd)
# Bootstrap using ofx
/usr/bin/env bash ${OFX_PATH}/ofx -o ${OF_ROOT} bootstrap ${THIS_ADDON_PATH}
I partially solved the issue, the part of the script that was meant to install ofx library was installing apothecary instead, below is adjusted boostrap.sh. I added comments where i made the adjustments. The new issue is that building fails for some reason…
#!/usr/bin/env bash
set -e
# We assume we are in the `openFrameworks/addons/ofxAddon/scripts` directory.
OF_ROOT=${OF_ROOT:-$(cd "$( dirname "${BASH_SOURCE[0]}" )/../../../" && pwd)}
OPTIND=1
while getopts o: opt ; do
case "$opt" in
o) OF_ROOT=$OPTARG ; ;;
esac
done
shift "$((OPTIND-1))"
if [ ! -d $OF_ROOT ]; then
echo "The \"${OF_ROOT}\" directory doesn't exist. Please set the correct OF_ROOT using the -o option (e.g. ./bootstrap -o /user/foo/openFrameworks)."
fi
if [ ! -d $OF_ROOT/scripts ]; then
echo "The \"${OF_ROOT}\" directory exists, but \"${OF_ROOT}/scripts\" doesn't exist. Please set the correct OF_ROOT using the -o option (e.g. ./bootstrap -o /user/foo/openFrameworks)."
fi
OFX_PATH=${OF_ROOT}/scripts/ofx/ofx # ! add additional /ofx to the path !
if ! [ -f ${OFX_PATH}/ofx ] ; then
echo "ofx if not installed, pulling latest version."
git clone https://github.com/bakercp/ofx.git ${OFX_PATH} # ! the original script was pointing to apothecary.git, instead of this custom ofx addon installer !
else
pushd "${OFX_PATH}" > /dev/null
if git rev-parse --is-inside-work-tree ; then
echo "ofx is under git control, updating."
git pull origin master
else
echo "ofx is not under git control, so it may not be up-to-date."
fi
popd > /dev/null
fi
# Get the path of this addon.
THIS_ADDON_PATH=$(cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd)
# Bootstrap using ofx
/usr/bin/env bash ${OFX_PATH}/ofx -o ${OF_ROOT} bootstrap ${THIS_ADDON_PATH}
I made it work. Last thing that was missing was the build target on the last line of the script.
/usr/bin/env bash ${OFX_PATH}/ofx -t linux -o ${OF_ROOT} bootstrap ${THIS_ADDON_PATH}
I still get a non critical error after the build is done:
If TARGET_PLATFORM linux != HOST_PLATFORM linuxaarch64, projectGenerator is needed
It prevents examples from working, you will need to create a new project manually and then copy the code from examples folders manually.
entire adjusted bootstrap.sh
#!/usr/bin/env bash
set -e
# We assume we are in the `openFrameworks/addons/ofxAddon/scripts` directory.
OF_ROOT=${OF_ROOT:-$(cd "$( dirname "${BASH_SOURCE[0]}" )/../../../" && pwd)}
OPTIND=1
while getopts o: opt ; do
case "$opt" in
o) OF_ROOT=$OPTARG ; ;;
esac
done
shift "$((OPTIND-1))"
if [ ! -d $OF_ROOT ]; then
echo "The \"${OF_ROOT}\" directory doesn't exist. Please set the correct OF_ROOT using the -o option (e.g. ./bootstrap -o /user/foo/openFrameworks)."
fi
if [ ! -d $OF_ROOT/scripts ]; then
echo "The \"${OF_ROOT}\" directory exists, but \"${OF_ROOT}/scripts\" doesn't exist. Please set the correct OF_ROOT using the -o option (e.g. ./bootstrap -o /user/foo/openFrameworks)."
fi
OFX_PATH=${OF_ROOT}/scripts/ofx/ofx # ! added additionak /ofx to the path !
if ! [ -f ${OFX_PATH}/ofx ] ; then
echo "ofx if not installed, pulling latest version."
git clone https://github.com/bakercp/ofx.git ${OFX_PATH} # ! the original script was pointing to apothecary.git, instead of this custom ofx addon installer !
else
pushd "${OFX_PATH}" > /dev/null
if git rev-parse --is-inside-work-tree ; then
echo "ofx is under git control, updating."
git pull origin master
else
echo "ofx is not under git control, so it may not be up-to-date."
fi
popd > /dev/null
fi
# Get the path of this addon.
THIS_ADDON_PATH=$(cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd)
# Bootstrap using ofx
/usr/bin/env bash ${OFX_PATH}/ofx -t linux -o ${OF_ROOT} bootstrap ${THIS_ADDON_PATH} # ! added build argument -t linux !