Closed jtlz2 closed 5 years ago
My sed -i
trick didn't work in fact
I fixed this by installing GNU sed a la https://stackoverflow.com/a/30047931/1021819 - rather than using macOS's BSD flavour:
brew install gsed
Then changing the makefile sed
-> gsed
.
sudo make install
then completes without error.
I have also had to update the macOS default bash shell to make the scripts execute... (v3 -> v>=4):
See https://apple.stackexchange.com/a/292760/310129
Then hack ocr-validate, ocr-transform and lib.sh to point to /usr/bin/env bash
rather than /bin/bash
Rationale:
https://stackoverflow.com/questions/6047648/bash-4-associative-arrays-error-declare-a-invalid-option
Final hack:
brew install coreutils
Then change readlink
to greadlink
in ocr-validate
Thanks for investigating. We do rely on bash >= 4 and coreutils. It wouldn't be too hard to adapt the installation to account for the slight differences between BSD/Mac OS and coreutils but I don't have an OSX machine to test it with.
From brew info coreutils
:
==> Caveats Commands also provided by macOS have been installed with the prefix "g". If you need to use these commands with their normal names, you can add a "gnubin" directory to your PATH from your bashrc like: PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
This fixes sed, readlink, etc.
Thanks. @jmechnich @jtlz2 If you want to document that in the README, I'd be happy to merge a PR.
Is there actually a good reason to use bash for those scripts? Maybe it would make sense to convert them to python as this is another dependency that ocr-fileformat has anyway (and is available on MacOS by default).
Python 3 would be fine for me.
Thanks for the great tool.
Right now when I run
sudo make install
I get the following output:The Docker image runs fine however.
What am I doing wrong?
Thanks again