Forked from AmyrAhmady/samp-node
- Only can work with infernus.
- Update
Node.jsto v22.22.3. - Both
ESModuleandCommonJSsupported, depending on the type field of package.json and the bundler output format. - Only
entry_fileis used,resourceconfig are removed. - Removed
samp.fireto avoid crashes. - Building based on
ubuntu-latestmeans you may need a higher version of glibc. - Updated github workflows.
example v22.x
- delete everything under
deps/node/include. - download
node-v22.22.3-headers.tar.gz. - decompress and copy everything under
node/v22.22.3/include/nodetodeps/node/include.
# x86 (32-bit)
git clone https://github.com/nodejs/node.git -b v22.x --depth 1
cd node
.\vcbuild x86 dll openssl-no-asm
cd out/Release # libnode.dll & libnode.lib
# x64 (64-bit)
.\vcbuild x64 dll openssl-no-asm
cd out/Release # libnode.dll & libnode.libYou need to install docker first.
Recommended to run only in a local virtual machine environment.
sudo useradd -m -s /bin/bash YOUR_NORMAL_USERNAME
sudo passwd -d YOUR_NORMAL_USERNAME
sudo usermod -aG docker YOUR_NORMAL_USERNAME
su YOUR_NORMAL_USERNAME
rm -fr ~/Devel/unofficial-builds-home
mkdir -p ~/Devel/unofficial-builds-home
cd ~/Devel/unofficial-builds-home
git clone https://github.com/dockfries/unofficial-builds
cd ~/Devel/unofficial-builds-home/unofficial-builds
chmod +x ./**/*.sh
bin/local_build.sh -r x86_22 -v v22.22.3 # don't forget startWith 'v'
cp ~/Devel/unofficial-builds-home/staging/release/v22.22.3/node-v22.22.3-linux-x86.tar.gz /tmp
su YOUR_SUDO_USER
mv /tmp/node-v22.22.3-linux-x86.tar.gz ~
# decompress it, you can see libnode.so.xxx in lib folder, that's what you need only.
# For version 22, `.so` files end with `127`git clone https://github.com/nodejs/node.git -b v22.x --depth 1
cd node
./configure --shared --openssl-no-asm
make -j$(nproc)
# out/Release/libnode.so.127 is what you needafter that, for local build samp-node, pls put your libnode into paths below.
| Arch | Windows | Linux |
|---|---|---|
| x86 (default) | deps/node/lib/Release/win/libnode.lib + libnode.dll |
deps/node/lib/Release/linux/libnode.so.127 |
| x64 | deps/node/lib/Release/win64/libnode.lib + libnode.dll |
deps/node/lib/Release/linux64/libnode.so.127 |
for build samp-node, see .github/workflows/build.yml.
git clone https://github.com/dockfries/samp-node
# or ssh
# git clone git@github.com:dockfries/samp-node.git
cd samp-node
git submodule update --init
chmod +x ./build.sh
./build.sh 22.22.3 # versioncd samp-node
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
# for 64-bit:
# cmake -DPLUGIN_ARCH=x64 -DCMAKE_BUILD_TYPE=Release ..cd samp-node
mkdir build, releases -ErrorAction SilentlyContinue
cd build
cmake .. -A Win32
cmake --build . --config Release
cpack
cd ..
Move-Item -Path "build/cpack/*" -Destination "releases/" -Force
# for 64-bit:
# cmake .. -A x64 -DPLUGIN_ARCH=x64fork and run on github actions.
- Damo for his samp.js project.
- Hual for some v8 tips
- Graber for a few suggestions and helpful advices
- pkfln (peek) for fixing and adding some samp callbacks/events in samp-node, and making @sa-mp/node
- polygxn for his changes in README.md which don't exist anymore
- JustMichael (ADRFranklin) for his contributions, including fixes, features, and any others he's going to do in future
- Alexander Plutalov (plutalov) for fixing long time crash issues and not having context running properly
- iAmir (AmyrAhmady) samp-node and omp-node developer