Help compiling BZFlag with SDL2

If none of the more specific forums is the right place to ask

Help compiling BZFlag with SDL2

Postby Guid Head » 2020-01-05 13:30

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
Guid Head
 
Posts: 6
Joined: 2020-01-05 12:21

Re: Help compiling BZFlag with SDL2

Postby Head_on_a_Stick » 2020-01-05 15:44

Try the flatpak instead, it might be fixed for that.
Black Lives Matter

Debian buster-backports ISO image: for new hardware support
User avatar
Head_on_a_Stick
 
Posts: 12511
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Help compiling BZFlag with SDL2

Postby Guid Head » 2020-01-05 17:14

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.
Guid Head
 
Posts: 6
Joined: 2020-01-05 12:21

Re: Help compiling BZFlag with SDL2

Postby stevepusser » 2020-01-06 01:19

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: 12000
Joined: 2009-10-06 05:53

Re: Help compiling BZFlag with SDL2

Postby stevepusser » 2020-01-06 22:04

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
User avatar
stevepusser
 
Posts: 12000
Joined: 2009-10-06 05:53

Re: Help compiling BZFlag with SDL2

Postby Guid Head » 2020-01-06 22:08

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

Postby Guid Head » 2020-01-06 22:43

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?
Guid Head
 
Posts: 6
Joined: 2020-01-05 12:21

Re: Help compiling BZFlag with SDL2

Postby stevepusser » 2020-01-06 23:45

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
User avatar
stevepusser
 
Posts: 12000
Joined: 2009-10-06 05:53

Re: Help compiling BZFlag with SDL2

Postby Guid Head » 2020-01-07 00:28

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?
Guid Head
 
Posts: 6
Joined: 2020-01-05 12:21

Re: Help compiling BZFlag with SDL2

Postby stevepusser » 2020-01-07 01:58

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
User avatar
stevepusser
 
Posts: 12000
Joined: 2009-10-06 05:53

Re: Help compiling BZFlag with SDL2

Postby Guid Head » 2020-01-07 12:08

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!
Guid Head
 
Posts: 6
Joined: 2020-01-05 12:21


Return to General Questions

Who is online

Users browsing this forum: No registered users and 17 guests

fashionable