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

"Linux Air Combat for Raspberry Pi-5", an Install based App #2565

Open
4 tasks done
rjbosen opened this issue Mar 20, 2024 · 33 comments
Open
4 tasks done

"Linux Air Combat for Raspberry Pi-5", an Install based App #2565

rjbosen opened this issue Mar 20, 2024 · 33 comments

Comments

@rjbosen
Copy link

rjbosen commented Mar 20, 2024

What is the name of the app?

Linux Air Combat

Where is the app hosted?

https://sourceforge.net/projects/linuxaircombat/

About the app

Linux Air Combat ("LAC") is a free, open-source, online, multi-player combat flight simulator that strives for realism, with 54 of the most important aircraft of World War II. Control flight with joystick, console game controller, or mouse and keyboard.

Fighters can combat other fighters, escort friendly bombers, attack enemy bombers, or strafe enemy airfields, ships, and buildings.

Bombers can rain destruction upon enemy airfields or dive-bomb ships and facilities, but they must first survive the trip to and through enemy territory!

Bombers are automatically defended by their own gunners.

After installation, launch LAC from a bash shell by typing:

lac

followed by the ENTER key.

Upload file or Add PR Link

Linux Air Combat for Rpi5.zip

Confirmations

Copy link
Contributor

A zipfile was found in the body of your issue.
The sha1sum of the zip was: 9de272e1a9ea77703ef840afe6de449d48d11dd7

Click to show contents preview

Copy link
Contributor

Hello there 👋
Thanks for submitting your first issue to the Pi-Apps project! We'll try to get back to you as soon as possible.
In the meantime, we encourage you join our Discord server, where you can ask any questions you might have.

Please respond as soon as possible if a Pi-Apps maintainer requests more information from you. Stale issues will be closed after a lengthy period of time with no response.

@Botspot
Copy link
Owner

Botspot commented Mar 20, 2024

your zipfile is empty lol

@rjbosen
Copy link
Author

rjbosen commented Mar 20, 2024

Whoops! Let me look into that. On my end it says it's only 202 bytes. Is that what you got?

@Botspot
Copy link
Owner

Botspot commented Mar 20, 2024

yes

@rjbosen
Copy link
Author

rjbosen commented Mar 20, 2024

Sorry. This is the first time I have used the RPi5 archiver to create a zip file. Could I upload a tar instead?

@Botspot
Copy link
Owner

Botspot commented Mar 20, 2024

Sorry. This is the first time I have used the RPi5 archiver to create a zip file. Could I upload a tar instead?

sure

@rjbosen
Copy link
Author

rjbosen commented Mar 20, 2024

Thanks. Give me 5 mins or so....

@rjbosen
Copy link
Author

rjbosen commented Mar 20, 2024

Looks like it won't let me send a tar file.

I'll try again to figger out how to make a zipive....

@rjbosen
Copy link
Author

rjbosen commented Mar 20, 2024

Copy link
Contributor

A zipfile was found in the body of an issue comment.
The sha1sum of the zip was: 1c54788b449b67172fb83c566874a01c419e958c

Click to show contents preview

uninstall

#!/bin/bash

#Allow packages required by this app to be uninstalled
purge_packages || exit 1

if [ -f "/usr/bin/lac" ]; then
   sudo rm /usr/bin/lac || error "Could not delete /usr/bin/lac"
fi
if [ -d "/usr/share/lac" ]; then
   cd /usr/share/lac || error "Could not change current working directory to /usr/share/lac"
   sudo rm -R * || error "Could not delete all contents of /usr/share/lac filder"
   cd /usr/share || error "Could not change current working directory to /usr/share"
   sudo rmdir lac || error "Could not remove empty directory /usr/share/lac"
fi 

install-64

#!/bin/bash
#
# Install all of the prerequisite software libraries that may be necessary to run this app on Raspberry Pi5:
install_packages libglut3.12     || exit 1
# install_packages libsdl1.2Debian || exit 1
install_packages libsdl-mixer1.2 || exit 1
# Download the Install tar file
cd
cd Downloads || error "Failed to enter the Downloads directory."
wget https://sourceforge.net/projects/linuxaircombat/files/Choose%20Your%20Platform/BetaTestVersions/Lac09p61BetaTestPrecompiledForRaspberryPi5.tar || error "Failed to download Install tar file."
# De-archive the downloaded Install tar file
tar -xf Lac09p61BetaTestPrecompiledForRaspberryPi5.tar || error "Failed to de-archive install tar file."
# Enter the new directory where the downloaded executable can be found
cd Lac09p61ForRaspberryPi5/bin/Release || error "Failed to enter bin/Release subdirectory of de-archived install tar file."
# Copy the downloaded executable file to /usr/bin/lac
sudo cp Lac09p61 /usr/bin/lac || error "Failed to copy downloaded executable to /usr/bin/lac."
# Change to the de-archived new directory containing the sharable resources for LAC on Raspberry Pi5:
cd ../.. || error "Failed to change to the downloaded source code directory."
# Copy LAC run-time resource files to a new, globally accessible file structure commencing at /usr/share/lac:
sudo mkdir /usr/share/lac                         || error "Failed to create new global folder for shared resources at /usr/share/lac."
sudo cp lac.png /usr/share/lac                    || error "Failed to copy lac.png icon to /usr/share/lac."
sudo chmod +r /usr/share/lac/lac.png              || error "Failed to set read attribute for /usr/share/lac/lac.png"
sudo cp DefaultHeightMap.LAC /usr/share/lac       || error "Failed to copy DefaultHeightMap.LAC to /usr/share/lac/DefaultHeightMap.LAC"
sudo chmod +r /usr/share/lac/DefaultHeightMap.LAC || error "Failed to set read attribute for /usr/share/lac/DefaultHeightMap.LAC"
sudo mkdir /usr/share/lac/music                   || error "Failed to create new global subfolder for shared resources at /usr/share/lac/music"
sudo cp bin/music/* /usr/share/lac/music          || error "Failed to copy one or more music files into new shared subfolder at /usr/share/lac/music"
sudo chmod +r /usr/share/lac/music/*              || error "Failed to set read attribute for one or more shared music files in /usr/share/lac/music"
sudo mkdir /usr/share/lac/sounds                  || error "Failed to create new global subfolder for shared resources at /usr/share/lac/sounds"
sudo cp bin/sounds/* /usr/share/lac/sounds        || error "Failed to copy one or more sound files into new shared subfolder at /usr/share/lac/sounds"
sudo chmod +r /usr/share/lac/sounds/*             || error "Failed to set read attribute for one or more shared sound files in /usr/share/lac/sounds"
sudo mkdir /usr/share/lac/models                  || error "Failed to create new global subfolder for shared resources at /usr/share/lac/models"
sudo cp bin/models/* /usr/share/lac/models        || error "Failed to copy one or more 3d model files into new shared subfolder at /usr/share/lac/models"
sudo chmod +r /usr/share/lac/models/*             || error "Failed to set read attribute for one or more shared 3d model files in /usr/share/lac/models"
sudo mkdir /usr/share/lac/textures                || error "Failed to create new global subfolder for shared textures at /usr/share/lac/textures"
sudo cp bin/textures/* /usr/share/lac/textures    || error "Failed to copy one or more texture files into new shared subfolder at /usr/share/lac/textures"
sudo chmod +r /usr/share/lac/textures/*           || error "Failed to set read attribute for one or more shared texture files in /usr/share/lac/textures"
# DONE. Linux Air Combat has been installed. To execute it from a bash shell, type lac and hit the Enter key.
# Next we will clean up after ourselves. You don't need the downloaded source code or LAC's art, sound, and
# 3d object resource files any more. We will delete them all.
cd
cd Downloads || echo "Failed to change to user's Downloads directory."
if [ -f "Lac09p61BetaTestPrecompiledForRaspberryPi5.tar" ]; then
   rm Lac09p61BetaTestPrecompiledForRaspberryPi5.tar || error "Cleanup failed to delete the tar file we downloaded."
fi
if [ -d "Lac09p61ForRaspberryPi5" ]; then
   cd Lac09p61ForRaspberryPi5 || error "Cleanup failed to enter the de-archived folder we downloaded."
   rm -R * || error "Cleanup failed to delete all of the content of the de-archived tar file we downloaded."
   cd
   cd Downloads || error "Cleanup failed to change to the user's Downloads directory."
   rmdir Lac09p61ForRaspberryPi5 || error "Cleanup failed to delete the empty, de-archived folder at Downloads/Lac09p61ForRaspberryPi5."
fi
# Done. 

description

Linux Air Combat ("LAC")  is a free, open-source, online, multi-player combat flight simulator that strives for realism, with 54 of the most important aircraft of World War II. Control flight with joystick, console game controller, or mouse and keyboard.

Fighters can combat other fighters, escort friendly bombers, attack enemy bombers, or strafe enemy airfields, ships, and buildings.

Bombers can rain destruction upon enemy airfields or dive-bomb ships and facilities, but they must first survive the trip to and through enemy territory!

Bombers are automatically defended by their own gunners.



After installation, launch LAC from a bash shell by typing:

lac 

followed by the ENTER key.

credits

Derived from Tom Drexel's classic "gl-117" flight game by Robert Bosen, with support from several other developers and testers as listed in the "AUTHORS" button from the main menu.

website

https://askmisterwizard.com/2019/LinuxAirCombat/LacOnlineDocs.htm

@rjbosen
Copy link
Author

rjbosen commented Mar 20, 2024

I just uploaded "LinuxAirCombatForRpi5.zip". Did you get 5.9 KB?

@rjbosen
Copy link
Author

rjbosen commented Mar 20, 2024

Discord won't me sign up because I do not own a cell phone. I do not WANT a cell phone. Who wants to be tracked all the time and targeted for spam, ads, and monitored by the NSA? (I use VOIP from my desk.) VOIP and email.

@Botspot
Copy link
Owner

Botspot commented Mar 20, 2024

the zip works, you can see it if you click the "Click to show contents preview" button here.

@rjbosen
Copy link
Author

rjbosen commented Mar 20, 2024

Yes. I see that the content seems to be exactly what I intended. I have exercised the install and uninstall scripts from my end several times and I confirm they work for me on my Raspberry Pi 5 using 64-bit Raspberry Pi OS.

@Botspot
Copy link
Owner

Botspot commented Mar 20, 2024

OK, not sure how soon I can review it. Thanks for the work.

@rjbosen
Copy link
Author

rjbosen commented Mar 20, 2024

Thank you. I'm excited about the high-quality exposure my flight simulator will have through your efforts.

Regards....

@theofficialgman
Copy link
Collaborator

# Download the Install tar file
cd
cd Downloads || error "Failed to enter the Downloads directory."

use the /tmp folder for all temporary file storage and manipulation

if this flight sim is your project as you say it is you should really improve your makefile

OBJS=3ds.o aiobject.o audio.o cockpit.o common.o conf.o dirs.o effects.o fileloader.o FlightModel.o gl.o glland.o land.o loader_tga.o main.o mathtab.o menu.o mission.o model.o NetworkApi.o object.o objload.o pilots.o vertexarray.o

CXX=g++ -Ofast -g0 -fPIE

LIBS= -lglut -lGLU -lSDL -lSDL_mixer -L/lib64 -lGL

Lac09p55: $(OBJS)
	mkdir -p ~/.LAC
	cp DefaultHeightMap.LAC ~/.LAC/DefaultHeightMap.LAC 
	g++ -o Lac09p55 $(LIBS) $(OBJS)
	cp Lac09p55 bin/Release/Lac09p55
	chmod +x bin/Release/Lac09p55
clean:
	@rm -f *.o
	@rm -f Lac09p55

most makefile on other projects have separate rules for installing than building (eg: an install: target). all that copying into the /usr/ directory should be handled in the Makefile rather than having pi-apps carry that.
building also should not touch the users home directory which yours does

@theofficialgman
Copy link
Collaborator

makefile is incorrect. LIBS need to come after OBJS otherwise you get undefined references

@theofficialgman
Copy link
Collaborator

makefile produces a binary that cannot be run from the build folder. its common practice that installation is not required to run a binary and the build directory is setup such that it can be run

@theofficialgman
Copy link
Collaborator

Info: callbackSwitchMultimedia() is attempting to invoke firefox.
a function callbackSwitchMultimedia attempts to start firefox which is not guaranteed to be installed or the users default browser. using x-www-browser will open the users default browser

@rjbosen
Copy link
Author

rjbosen commented Mar 21, 2024

Thanks for helping me improve.

Perhaps the presence of source code and makefile in my download archive confused you?

Although my standard download includes source code and an associated makefile, there is no need for their use because the bin/Release subfolder includes a precompiled executable for the Raspberry Pi 5 on 64-bit Raspberry Pi OS. The installation script I sent you actually deletes the source code and makefile and uses only the precompiled binary executable. I don't want to change my standard download archive structure for Pi-Apps because it is widely used and comprehensively documented for so many platforms.

It's true that LAC demands installation at /usr/bin and will not run correctly from the build folder. This is indeed unusual, but it is important and very helpful in maintaining compatibility with AppImage distribution. I really don't want to reverse that decision for the Pi-Apps because it would demand treating Pi-Apps differently from everybody else.

It's true that the function callbackSwitchMultimedia() is attempting to invoke firefox. LAC has a run-time configuration mechanism through which LAC users designate their own default browser for use with LAC, which may be different from the default browser they use for other activities.

@theofficialgman
Copy link
Collaborator

theofficialgman commented Mar 21, 2024

Perhaps the presence of source code and makefile in my download archive confused you?
Although my standard download includes source code and an associated makefile, there is no need for their use because the bin/Release subfolder includes a precompiled executable

Nope. It was clear to me that the source code and binaries both exist in the download. I am giving you feedback on the compilation process because I would rather not use your binaries when compilation is "simple" and won't result in binaries that are incompatible with the various distros that we support. If you compile on bookworm, GLIBC requirements will be too high in the binary to run it on bullseye. For applications that can be compiled quickly and easily (like yours) it is always desirable to perform the compilation on the host.

there is no need for their use because the bin/Release subfolder includes a precompiled executable for the Raspberry Pi 5 on 64-bit Raspberry Pi OS. The installation script I sent you actually deletes the source code and makefile and uses only the precompiled binary executable.

See above

I don't want to change my standard download archive structure for Pi-Apps because it is widely used and comprehensively documented for so many platforms.

I have not asked you to change your download archive structure.

It's true that LAC demands installation at /usr/bin and will not run correctly from the build folder. This is indeed unusual, but it is important and very helpful in maintaining compatibility with AppImage distribution.

Appimages do not require your "lazy" build process.

I really don't want to reverse that decision for the Pi-Apps because it would demand treating Pi-Apps differently from everybody else.

I am not asking that you fix something for pi-apps. I am asking that you fix your terrible build and install system for everyone. Please follow the GNU compliant makefile standard already in place. Having users execute a series of janky install commands is not. We do not want to maintain your janky install commands in pi-apps.

I suggest you read some documentation https://access.redhat.com/documentation/fr-fr/red_hat_enterprise_linux/9/html/packaging_and_distributing_software/placing-arbitrary-artifacts-in-the-system-using-the-make-install-command_preparing-software-for-rpm-packaging https://www.gnu.org/software/make/manual/make.html and look at other FOSS projects and investigate using automake https://www.gnu.org/software/automake/ for creating your GNU standards compliant makefile.

It's true that the function callbackSwitchMultimedia() is attempting to invoke firefox. LAC has a run-time configuration mechanism through which LAC users designate their own default browser for use with LAC, which may be different from the default browser they use for other activities.

don't make firefox the default then. have it be x-www-browser or just use xdg-open if you are trying to open a webpage.

@theofficialgman
Copy link
Collaborator

Here is an example of a (potentially not fully standards compliant) professional makefile https://github.com/aristocratos/btop/blob/main/Makefile from btop

@rjbosen
Copy link
Author

rjbosen commented Mar 21, 2024

Is "x-www-browser" something that will work on different distros? Or is it specific to Raspberry Pi OS? I just tried it on PcLinuxOs and got "command not found". But on Raspberry Pi Os it does work.

@theofficialgman
Copy link
Collaborator

Is "x-www-browser" something that will work on different distros? Or is it specific to Raspberry Pi OS? I just tried it on PcLinuxOs and got "command not found". But on Raspberry Pi Os it does work.

its debian (and derivative) specific. hence why you should use xdg-open put_webpage_url_here which is universal. (I assume you are trying to open a URL, I have not read the source code for your application)

@rjbosen
Copy link
Author

rjbosen commented Mar 21, 2024

Yes. Thanks. That xdg-open open looks a lot better. I will make that change for the default in my next update.

@rjbosen
Copy link
Author

rjbosen commented Mar 21, 2024

I will update my install scripts to use /tmp instead of:

# Download the Install tar file
cd
cd Downloads || error "Failed to enter the Downloads directory."

I can see the wisdom of that. Thanks.

@rjbosen
Copy link
Author

rjbosen commented Mar 21, 2024

I think the only place where my Makefile touches the user/s home filesystem is this:

mkdir -p ~/.LAC
cp DefaultHeightMap.LAC ~/.LAC/DefaultHeightMap.LAC 

I remember that solved a thorny install problem for me YEARS ago. For the past 5 years or so those lines have just been leftovers. I can delete those lines right now because they haven't been needed for a long time. Thanks for helping me clean those out.

@Botspot
Copy link
Owner

Botspot commented Apr 1, 2024

Any updates on this?

@rjbosen
Copy link
Author

rjbosen commented Apr 2, 2024 via email

@Botspot
Copy link
Owner

Botspot commented Apr 26, 2024

I saw your new post on the Pi forums. Any updates for here, or have you lost interest in adding this to Pi-Apps?

@rjbosen
Copy link
Author

rjbosen commented Apr 26, 2024 via email

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

No branches or pull requests

3 participants