Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation on OpenBSD #377

Open
4c656554 opened this issue May 16, 2023 · 2 comments
Open

Installation on OpenBSD #377

4c656554 opened this issue May 16, 2023 · 2 comments

Comments

@4c656554
Copy link

4c656554 commented May 16, 2023

Below is a command line (ksh) procedure for installing hypercore on OpenBSD 7.3 amd64:

pkg_add git
pkg_add libsodium
pkg_add libtool
pkg_add autoconf
pkg_add node
npm install node-gyp -g
export CFLAGS="-mssse3 -msse4.1"
export CXXFLAGS="-mssse3 -msse4.1"
mkdir proj
npm init proj
git clone --recursive --branch main https://github.com/4c656554/fs-native-extensions
cd fs*
node-gyp rebuild
npm run test
npm install -g
cd ..

git clone --recursive --branch master https://github.com/sodium-friends/sodium-native
cd sodium-native
npm link fs-native-extensions
node-gyp rebuild
npm run test
echo "Expect 90 test failures, this is ok for hypercore install"
npm install -g
cd ..

git clone --recursive --branch master https://github.com/sodium-friends/sodium-universal
cd sodium-universal
npm link sodium-native
npm link fs-native-extensions
npm install
npm install -g
cd ..

git clone --recursive --branch master https://github.com/holepunchto/hypercore
cd hypercore
npm link sodium-universal
npm link sodium-native
npm link fs-native-extensions
npm install
npm install -g
npm run test

All hypercore tests pass :-)

The simple npm install hypercore fails due to build issues in the fs-native-extensions dependency. (PR fix here ). Also related; this issue.

Wondering if anyone can see an easier way of doing the above, or if there is something obvious I missed?

@4c656554
Copy link
Author

4c656554 commented Jun 10, 2023

I had a couple of transcription errors in the above script. This is what works:

pkg_add git
pkg_add libsodium
pkg_add libtool
pkg_add autoconf-2.71
pkg_add node
npm install node-gyp -g 
export CFLAGS="-mssse3 -msse4.1"
export CXXFLAGS="-mssse3 -msse4.1"
export C=clang
export CXX=clang++
npm install -g napi-macros
npm install -g node-gyp-build

git clone --recursive --branch main https://github.com/4c656554/fs-native-extensions
cd fs*
node-gyp rebuild
npm run test
npm install -g
cd ..

git clone --recursive --branch master https://github.com/sodium-friends/sodium-native
cd sodium-native
npm link fs-native-extensions
node-gyp rebuild
//npm run test
echo "Expect 90 test failures, this is ok for hypercore install"
npm install -g
cd ..

git clone --recursive --branch master https://github.com/sodium-friends/sodium-universal
cd sodium-universal
npm link sodium-native
npm link fs-native-extensions
echo 'installing sodium-universal'
npm install
npm install -g
cd ..

git clone --recursive --branch main https://github.com/holepunchto/hypercore
cd hypercore
npm link sodium-universal
npm link sodium-native
npm link fs-native-extensions
echo 'Installing hypercore...'
npm install
npm install -g
npm run test

@4c656554
Copy link
Author

4c656554 commented Feb 8, 2024

Since version 10.17.0 : --omit=dev flags are needed on the npm installs and most npm links in the above. This is because the build of the dev dependency udx-native fails (added 10.17.0). This means the testing capability is lost though so the npm run test must also be dropped. Confirmed for OpenBSD 7.4.

It's possible a similar approach to the above could work for udx-native but I've not had time to try that yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant