nxengine / nxengine-evo

nxengine refactoring
https://discord.gg/jnwmA7DhQh
GNU General Public License v3.0
491 stars 82 forks source link

build on Pi4/debian 10 buster #258

Closed Exarkuniv closed 2 years ago

Exarkuniv commented 2 years ago

im trying to see if i can get this to work on my Pi4. I know that a older version of nxengine did at some point but it now fails when it trys to compile.

i came across and though i would give it a try.

i follow the instructions on the linux link and like here https://github.com/nxengine/nxengine-evo/issues/217 i dont see the bin folder.

but i did see that the Linux/osx build instructions are outdated #252

i did try to run the AppImage.sh but i xmllint: command not found.

then i tried

# Build and install NxEngine-Evo into `build/AppData/usr`
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/AppDir/usr -Bbuild -H.
ninja -Cbuild all install

# Download, extract and add non-free assets to the install
export APP_ID=org.nxengine.nxengine_evo
build-scripts/utils/common.download-extern.sh
build-scripts/utils/common.install-extern.sh build/AppData/usr/share/nxengine build/nxextract

that also did not work.

im lost at this point any help would be great.

isage commented 2 years ago

Did you tried installing xmllint?

xordspar0 commented 2 years ago

I recently built nxengine-evo on my Raspberry Pi 3B with build-scripts/build-appimage.sh. I already had xmllint installed on my system, but you can install it with apt install libxml2-utils.

Exarkuniv commented 2 years ago

@xordspar0 thank you for that. i did not get into how to install xmllint. that was on tomorrows todo list

Exarkuniv commented 2 years ago

that helped for part of it, the other is i needed to have jq installed also. once i got these two installed i was able to run the build-scripts/build-appimage.sh

i get this error

./build-appimage.sh: line 73: extern/appimage-builder.AppImage: cannot execute binary file: Exec format error

i was able to run

# Build and install NxEngine-Evo into `build/AppData/usr`
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/AppDir/usr -Bbuild -H.
ninja -Cbuild all install

# Download, extract and add non-free assets to the install
export APP_ID=org.nxengine.nxengine_evo
build-scripts/utils/common.download-extern.sh
build-scripts/utils/common.install-extern.sh build/AppData/usr/share/nxengine build/nxextract

and that seemed to work i did not get a error. i would like to see if i can get the build-appimage.sh to work as it seems to be a all in one. again thanks for the help

xordspar0 commented 2 years ago

Oops, I forgot about that. Yes, the build-appimage.sh script specifically downloads the x86_64 binary for appimage-builder. When I built nxengine-evo for on my Raspberry Pi I built appimage-builder myself. There is no ARM binary available for appimage-builder. I should look into adding an ARM build to their CI and then updating build-appimage.sh to download the correct version for the current architecture.

Exarkuniv commented 2 years ago

@xordspar0 ahh. well that would make sense. since the manual way did seem to work ill see if i can get that to run

building appimage builder seems it might be a bit more work then what i trying to do. lol

xordspar0 commented 2 years ago

Yes, just compiling a binary with cmake is simpler and probably better if you're not trying to share the compiled game with anyone.

Exarkuniv commented 2 years ago

im working on making a install script for RetroPie. we have one for libretro core. and a old one for the original NXengine.

so im seeing if i can make one for NXEngine-evo since it is improved

xordspar0 commented 2 years ago

Oh nice, thanks for doing that! That has been on my to do list. I will definitely use it when it's ready. Since a RetroPie script basically defines a package that you can install, it might be helpful to look at distributions that package nxingine-evo: AUR, Alpine, pkgsrc

Exarkuniv commented 2 years ago

Nice thanks. that will help me alot. since i need to figure out where things need to be installed and whatnot

Exarkuniv commented 2 years ago

so far i have the download source and build working fine. now my questionis when i run

# Build and install NxEngine-Evo into `build/AppData/usr`
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=build/AppDir/usr -Bbuild -H.
ninja -Cbuild all install

# Download, extract and add non-free assets to the install
export APP_ID=org.nxengine.nxengine_evo
build-scripts/utils/common.download-extern.sh
build-scripts/utils/common.install-extern.sh build/AppData/usr/share/nxengine build/nxextract

i get two folders AppData and AppDir. they both look like they have the same things in them. do i need both of them or just one.

xordspar0 commented 2 years ago

Those are for the AppImage build process. For the RetroPie script, I wouldn't use the scripts in build-scripts. I would do something like what the AUR package does, which is basically cmake, then copy data files & run nxextract, then make install.

Here's a start. This is untested, so you will probably need to make some small modifications. I also don't know where RetroPie scripts normally install games to. If it's something other than /usr then you will need to change the INSTALL_PREFIX in the cmake command.

curl "https://github.com/isage/nxengine-evo/archive/v${_ver}.tar.gz" | tar -xf -
cd "nxengine-evo-v${_ver}"
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -Wno-dev -DCMAKE_INSTALL_PREFIX=/usr ..
make

cd ..
wget "https://www.cavestory.org/downloads/cavestoryen.zip"
unzip cavestoryen.zip
cp -r CaveStory/data/ ./

wget "https://github.com/nxengine/translations/releases/download/v${_langver}/all.zip"
mkdir translations && unzip all.zip -d translations
cp -r translations/data ./

build/nxextract

make DESTDIR=./ install # This installs everything to ./usr so you can look at everything and test it out before installing it for real. Remove the DESTDIR=./ if you want to install it to the system (requires root permissions).
Exarkuniv commented 2 years ago

oh damn. thanks. you did not need to do that. :) FYI the applmage build does work. i have it running, probably not the best way to go about it, but it does, lol

i will use what you have posted, since thats like most of the work right there

Exarkuniv commented 2 years ago

here is my script from your work so far.

function sources_nxengine() {
   git clone https://github.com/nxengine/nxengine-evo.git
}

function build_nxengine() {
     cd nxengine-evo
     mkdir build 
     cd build
     cmake -DCMAKE_BUILD_TYPE=Release -Wno-dev -DCMAKE_INSTALL_PREFIX=/opt/retropie/ports/nxengine ..
     make

     cd ..
     wget "https://www.cavestory.org/downloads/cavestoryen.zip"
     unzip cavestoryen.zip
     cp -r CaveStory/data/ ./
    cp -r CaveStory/Doukutsu.exe ./

    wget "https://github.com/nxengine/translations/releases/download/v1.14/all.zip"
    mkdir translations && unzip all.zip -d translations
    cp -r translations/data ./

    build/nxextract
}

this is how a Retropie script is layed out. i could not get curl "https://github.com/isage/nxengine-evo/archive/v${_ver}.tar.gz" | tar -xf - to work so i had to use git clone. for the most part everything else whet great.

but at the end when i run make DESTDIR=./ install

i get make: *** No rule to make target 'install'. Stop.

am i missing something since im using git instead of what you posted?

Exarkuniv commented 2 years ago

nevermind i got it

Exarkuniv commented 2 years ago

I want to say thank you for all the help. i got it to work and install perfectly.

I will update this with a link to my repo with the complete install sctipt.

UPDATE

https://github.com/Exarkuniv/Nxengine-Evo-RPi

Exarkuniv commented 2 years ago

with the help @s1eve-mcdichae1 the install script has been cleaned up. ill close the ticket