apothecary icon indicating copy to clipboard operation
apothecary copied to clipboard

[update emscripten] opencv formula fails if emsdk on custom path

Open themancalledjakob opened this issue 3 years ago • 2 comments
trafficstars

the formula tries to source emsdk from /emsdk this fails, if emsdk is installed somewhere else, even if it is properly installed and already sourced.

user@computer:/openFrameworks/scripts/apothecary$ source /home/user/git/tools/emsdk/emsdk_env.sh 
Setting up EMSDK environment (suppress these messages with EMSDK_QUIET=1)
Adding directories to PATH:
PATH += /home/user/git/tools/emsdk
PATH += /home/user/git/tools/emsdk/upstream/emscripten
PATH += /home/user/git/tools/emsdk/node/14.18.2_64bit/bin

Setting environment variables:
PATH = /home/user/git/tools/emsdk:/home/user/git/tools/emsdk/upstream/emscripten:/home/user/git/tools/emsdk/node/14.18.2_64bit/bin:/home/user/.nvm/versions/node/v18.12.1/bin:/home/user/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
EMSDK = /home/user/git/tools/emsdk
EMSDK_NODE = /home/user/git/tools/emsdk/node/14.18.2_64bit/bin/node

user@computer:/openFrameworks/scripts/apothecary$ ./apothecary/apothecary -t emscripten update opencv
OF: /openFrameworks/scripts/apothecary/apothecary/../../../
APOTHECARY: /openFrameworks/scripts/apothecary/apothecary
FORMULAS: /openFrameworks/scripts/apothecary/apothecary/formulas
BUILD: /openFrameworks/scripts/apothecary/apothecary/build
LIBS_DIR: /openFrameworks/scripts/apothecary/apothecary/../
ADDONS: /openFrameworks/scripts/apothecary/apothecary/../../../addons
REL_ADDONS_DIR: /openFrameworks/scripts/apothecary/apothecary/../../../addons

 ----- opencv -----

 Downloading "opencv"

... skipping, opencv src dir already exists in /openFrameworks/scripts/apothecary/apothecary/build/opencv

 Preparing "opencv"


 Building "opencv"

/openFrameworks/scripts/apothecary/apothecary/formulas/opencv/opencv.sh: line 471: /emsdk/emsdk_env.sh: No such file or directory

this can be fixed as proposed in PR #252 by using EMSDK environment variable, which is present since at least 1.38.33 (the oldest version that can be installed via the official repository) and should be therefore a solid alternative.

[edit] just realise this is technically not an update-emscripten issue, but generally a problem for any emscripten version. the PR #252 is directed at update-emscripten though... is that stupid?

themancalledjakob avatar Nov 15 '22 15:11 themancalledjakob

Thanks @themancalledjakob! I can rebase it to master as I am not entirely sure about the other branch right now.

ofTheo avatar Nov 16 '22 02:11 ofTheo

sure, i don't know how to properly rebase a PR, so I just made a new one based on master: #259

themancalledjakob avatar Nov 17 '22 09:11 themancalledjakob

All fixed

danoli3 avatar Jul 23 '24 13:07 danoli3