Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Help compiling BZFlag with SDL2

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
Guid Head
Posts: 6
Joined: 2020-01-05 12:21

Help compiling BZFlag with SDL2

#1 Post by Guid Head »

I've been having issues with a game called BZFlag where the tank intermittently stops moving. I've posted this issue on the BZFlag forum https://forums.bzflag.org/viewtopic.php?f=2&t=20017 and I'm having the same issue with my new install of Debian Buster. If you scroll down towards the bottom, someone found the solution, but I have no idea where to start about recompiling BZFlag with SDL2.
Can someone give me step-by-step instruction on how to approach this as I have no experience with this?

Thanks

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Help compiling BZFlag with SDL2

#2 Post by Head_on_a_Stick »

Try the flatpak instead, it might be fixed for that.
deadbang

Guid Head
Posts: 6
Joined: 2020-01-05 12:21

Re: Help compiling BZFlag with SDL2

#3 Post by Guid Head »

Head_on_a_Stick wrote:Try the flatpak instead, it might be fixed for that.

So I have good news and bad news. The Flatpak version works but 1) It's very sluggish for some reason. 2) I'm really not a fan of Flatpaks.

I'd rather have a compiled version with SDL2 and would be nice to understand/learn how to compile..

Thanks for the help though.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Help compiling BZFlag with SDL2

#4 Post by stevepusser »

You could try rebuilding the package from the Debian sources, except use the SDL 2 -dev packages instead of the SDL 1.2 ones in debian/control--replace "libsdl1.2-dev" with "libsdl2-dev".
MX Linux packager and developer

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Help compiling BZFlag with SDL2

#5 Post by stevepusser »

It also turns out that you need to force the use of SDL in the debian/rules file by editing line 14 to read:

Code: Select all

CONFIGURE_OPTS := --prefix=/usr --datarootdir=/usr/share/games --with-SDL2
Since it only takes a couple minutes if you know what you're doing, I've also set up an OBS repo with SDL 2 builds for various Debian and Ubuntu releases. https://build.opensuse.org/package/show ... DL2/bzflag
MX Linux packager and developer

Guid Head
Posts: 6
Joined: 2020-01-05 12:21

Re: Help compiling BZFlag with SDL2

#6 Post by Guid Head »

stevepusser wrote:You could try rebuilding the package from the Debian sources, except use the SDL 2 -dev packages instead of the SDL 1.2 ones in debian/control--replace "libsdl1.2-dev" with "libsdl2-dev".
Where do I find this debian/control file? I've downloaded the source from here https://packages.debian.org/buster/bzflag. The file I downloaded is bzflag_2.4.18.orig.tar.gz from the right side column.
I've then extracted the files but don't see debian/control.

Guid Head
Posts: 6
Joined: 2020-01-05 12:21

Re: Help compiling BZFlag with SDL2

#7 Post by Guid Head »

So I think I got the files I need now. I've made the mod's you've mention in the /debain/control and debian/rules files.
But I get an error when trying to build. I know I'm missing something or using the wrong command.

Code: Select all

guido@debian:~/Downloads/bzflag-master$ dpkg-buildpackage -us -uc
dpkg-buildpackage: info: source package bzflag
dpkg-buildpackage: info: source version 2.4.18-1
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by Markus Koschany <apo@debian.org>
dpkg-buildpackage: info: host architecture amd64
 dpkg-source --before-build .
dpkg-checkbuilddeps: error: Unmet build dependencies: groff libc-ares-dev libcpputest-dev libcurl4-gnutls-dev | libcurl4-dev | libcurl-dev libglew-dev libncurses5-dev | libncurses-dev
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
I issued this command

Code: Select all

dpkg-buildpackage -us -uc
What folder do I run the build command from and if I don't have the right command, what do I use?

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Help compiling BZFlag with SDL2

#8 Post by stevepusser »

This is the immediate cause of your build failure:

Code: Select all

dpkg-checkbuilddeps: error: Unmet build dependencies: groff libc-ares-dev libcpputest-dev libcurl4-gnutls-dev | libcurl4-dev | libcurl-dev libglew-dev libncurses5-dev | libncurses-dev
Let me organize that a bit better:

Code: Select all

dpkg-checkbuilddeps: error: Unmet build dependencies: groff libc-ares-dev libcpputest-dev 
libcurl4-gnutls-dev | libcurl4-dev | libcurl-dev libglew-dev 
libncurses5-dev | libncurses-dev
The build-deps separated by the "|" are alternatives, so install the first in each of those alternatives:

Code: Select all

apt-get install groff libc-ares-dev libcpputest-dev libcurl4-gnutls-dev libncurses5-dev
You need to add an epoch to the beginning of the version in the first stanza of debian/changelog; otherwise the Debian version will always be trying to upgrade over your custom version. Add a "1:" to the start of the version to make it look like:

bzflag (1:2.4.18-1........stuff)
MX Linux packager and developer

Guid Head
Posts: 6
Joined: 2020-01-05 12:21

Re: Help compiling BZFlag with SDL2

#9 Post by Guid Head »

Yay!! It compiled.
Thanks Steve!!

So, now I see it created all kinds of files.

Code: Select all

guido@debian:~/Downloads$ ls
bzflag_2.4.18-1_all.deb          bzflag_2.4.18-1.dsc                      bzflag-data_2.4.18-1_all.deb      bzflag-server-dbgsym_2.4.18-1_amd64.deb
bzflag_2.4.18-1_amd64.buildinfo  bzflag_2.4.18.orig.tar.gz                bzflag-master
bzflag_2.4.18-1_amd64.changes    bzflag-client_2.4.18-1_amd64.deb         bzflag-master.tar.gz
bzflag_2.4.18-1.debian.tar.xz    bzflag-client-dbgsym_2.4.18-1_amd64.deb  bzflag-server_2.4.18-1_amd64.deb
Do I just install bzflag-data_2.4.18-1_all.deb file?

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 72 times

Re: Help compiling BZFlag with SDL2

#10 Post by stevepusser »

You need to install bzflag-data, bzflag-client, and bzflag deb packages. All at once if using apt on the command line to do so, or in that order if one at a time with gdebi or deepin-package-installer.

But the coolest way is to install local-apt-repository and put the deb files into /srv/local-apt-repository (create the folder). That way they will just appear as updates over the stock Debian packages you have installed after you update apt.

As root or with sudo in the folder with the debs that you build:

Code: Select all

apt-get install local-apt-repository
mkdir -p /srv/local-apt-repository
cp *.deb /srv/local-apt-repository
apt-get update
apt-get upgrade
Last edited by stevepusser on 2020-01-08 01:46, edited 1 time in total.
MX Linux packager and developer

Guid Head
Posts: 6
Joined: 2020-01-05 12:21

Re: Help compiling BZFlag with SDL2

#11 Post by Guid Head »

stevepusser wrote:You need to install bzflag-data, bzflag-client, and bzflag deb packages. All at once if using apt on the command line to do so, or in that order if one at a time with gdebi or deepin-package-installer.

But the coolest way is to install local-apt-repository and put the deb files into /srv/local-apt-repository (create the folder). That way they will just appear as updates over the stock Debian packages you have installed after you update apt.

Cool! Will give this a try when I get home from work today.
Thanks again!

Post Reply