Compiled my first game from source

If it doesn't relate to Debian, but you still want to share it, please do it here

Compiled my first game from source

Postby Wheelerof4te » 2018-01-24 18:03

I just compiled 0.a.d from source, and the feeling is...wonderful. Yes, it did take a while, yes there is a faster way. But damn, that was cool. There are some questions for those more experienced, so here I go:
1) Will my game compile itself all over when packagers release new version? Or will only changed code re-complile?
2) How to overwrite sources when new version comes? Should I just re-dowload and extract over the old directories before I re-compile it all over?
3) I understand that most newer software can be compiled from source and be run on an older system. For example, 0.a.d build manual mentions Debian Jessie. Are there specific build instructions for most popular software online? In other words, if build tools support it, I could run newer software even on old systems.

Compiling was done on fixed Ubuntu 17.10.1. Stretch is too buggy right now and I didn't have time for setting it up again.
*uck the PPAs, who needs them? :D
EDIT:
This is what I have in 0.a.d folder:
Code: Select all
~/0ad/0ad-0.0.22-alpha$ ls
binaries   license_dbghelp.txt   license_mit.txt  source
build      license_gpl-2.0.txt   LICENSE.txt
libraries  license_lgpl-2.1.txt  README.txt

What can I remove, since all this is taking up over 6.6 GB? Do I need only binaries for now?
Why Debian isn't user-friendly?
HOWTO: Install ES3 Morrowind on Debian Sid and Stable
"My computer is a few electrical transistors I flip manually with registers made out of salt water and lemon juice in some cups." - some guy on Reddit
User avatar
Wheelerof4te
 
Posts: 892
Joined: 2015-08-30 20:14

Re: Compiled my first game from source

Postby pylkko » 2018-01-24 21:02

The answers are "it depends".

How did you compile from what? Did you make a Debian package or did you just compile e.g C source code to a binary. There is a guide on this forum called "compiling for debian the smart way" or sometihng to that extent that tells how to make a .deb

1) Normally when you compile e.g. C source code, you input the source and the compiler prepares the binary/binaries. If you then need to change something, you need to recompile the entire binary from scratch. You can, of course, script a setup where you pull a source code and have it compiled in the case there is a diff. You could also use the Open build system.

2) There are many ways. One is to simply decompress files on top of older ones. Then there are version management systems like git, so that you can have many versions of the same code and automatically "sync" the code with another location and so on.

3) It depends on how the build is done. For example, if the build links in a lib that is not present in the ols system, then you will either need to also get that lib on the older system or recompile against what is present on the old system
User avatar
pylkko
 
Posts: 1294
Joined: 2014-11-06 19:02

Re: Compiled my first game from source

Postby Wheelerof4te » 2018-01-25 13:12

Thank you for the detailed answer. All I did is
Code: Select all
make -j3

as the last step to get the game and run binaries/system/pyrogenesis from the main directory. I didn't build the package, but from your answer I should have.
Nevermind that, it was a nice experience. I'm on Sid now.
Why Debian isn't user-friendly?
HOWTO: Install ES3 Morrowind on Debian Sid and Stable
"My computer is a few electrical transistors I flip manually with registers made out of salt water and lemon juice in some cups." - some guy on Reddit
User avatar
Wheelerof4te
 
Posts: 892
Joined: 2015-08-30 20:14

Re: Compiled my first game from source

Postby stevepusser » 2018-01-25 18:28

Yes, it's much better to build Debian packages from "debianized" source files: viewtopic.php?t=38976

You can also set up pbuilds for other releases or even Ubuntu on your Debian install...such as compile Stretch packages on Sid, or vice versa. Most packages build correctly in a pbuild for me, but some are...troublesome. You can even hook and unhook other derivative distro's repositories to a basic Debian one to convert them quickly back and forth, or use a folder on your machine as a local repository for the pbuilds: https://forum.mxlinux.org/viewtopic.php?f=86&t=42763

Another way is to use the free openSUSE Build Service to build packages from debianized sources for you in the "cloud" and host them for the world to use, like this repo I have for the Featherpad text editor: https://build.opensuse.org/package/show ... featherpad
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.102, Pale Moon 27.9.2, Enlightenment 0.22, Calligra 3.1, VLC 3.0.2, Firefox 60.0.1, Krita 4.0.3
User avatar
stevepusser
 
Posts: 9548
Joined: 2009-10-06 05:53

Re: Compiled my first game from source

Postby pylkko » 2018-01-25 19:22

OK, so you used a make file. If you look at the file, you will see that it is a script (kind of like a bash script) that performs all the commands needed to get the source compiled. https://en.m.wikipedia.org/wiki/Makefile

There is no reason that you should not search for / create code that can be made into debs other than it is really handy. When you start adding progrmas all over your system and recompiling newer and modified versions you might easily loose track of what you have ahead and even possibly loose some software for ever when you reinstall the OS and forget that something important is there or whatever
User avatar
pylkko
 
Posts: 1294
Joined: 2014-11-06 19:02

Re: Compiled my first game from source

Postby stevepusser » 2018-01-25 19:42

One of the best reasons to use debianized source is that it often includes patches or build tweaks that fix bugs or build problems that will have you tearing your hair out otherwise. Since you are on Sid and use the very latest gcc version, I think you'll eventually find a lot of programs that won't compile with that gcc without fixes.

Right now I'm really having trouble building Pale Moon packages on Debian testing and Ubuntu 17.10 with gcc-4.9 (the recommended way), since their libc6 2.26 causes a build failure with an "isinfinite" function. I can build PM with gcc-6 on those platforms, but then testers report that the browser crashes a lot. But if I ever do figure it out, then anyone that uses my debianized source automatically gets the fix.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.102, Pale Moon 27.9.2, Enlightenment 0.22, Calligra 3.1, VLC 3.0.2, Firefox 60.0.1, Krita 4.0.3
User avatar
stevepusser
 
Posts: 9548
Joined: 2009-10-06 05:53

Re: Compiled my first game from source

Postby Wheelerof4te » 2018-01-25 20:32

Thanks steve for the link to building the .debs from source. I'm amazed the procedure has remained almost the same for so long. So, source has to be pulled from Sid or Testing via
Code: Select all
apt-get source <packagename>
in order to build a backported version? Then why would one want to pull source from Stable? I guess for patching leftover bugs...
Why Debian isn't user-friendly?
HOWTO: Install ES3 Morrowind on Debian Sid and Stable
"My computer is a few electrical transistors I flip manually with registers made out of salt water and lemon juice in some cups." - some guy on Reddit
User avatar
Wheelerof4te
 
Posts: 892
Joined: 2015-08-30 20:14

Re: Compiled my first game from source

Postby Head_on_a_Stick » 2018-01-25 20:38

Wheelerof4te wrote:why would one want to pull source from Stable?

In case you wanted to apply different compile-time options (or add patches, as you note) — for example, I like a very specific set of ./configure options for urxvt and I can build a custom package by editing debian/rules and changing the flags.

Have you tried apt-build(1) yet?
apt-build - Fetch sources and build packages optimized for your architecture.

This command will rebuild your entire system from source with architecture-optimised compilation flags (just like Gentoo):
Code: Select all
# apt-build world

How cool is that?

EDIT: dammit there goes the palindrome :cry:
"An you're a prick. Prick on a stick." — acewiza
User avatar
Head_on_a_Stick
 
Posts: 7463
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Compiled my first game from source

Postby Wheelerof4te » 2018-01-25 20:51

Head_on_a_Stick wrote:This command will rebuild your entire system from source with architecture-optimised compilation flags:
Code: Select all
apt-build world

Head_on_a_Stick wrote:How cool is that?

Really cool :D How long would it take, though? Days?

Now I understand much better why FF57+ can't be built for Stable, because there is no required dependency rust. Can rust itself be built and then backported via point release to, say, Debian 9.5? That would make sense to me now, unless rust could break some things in Stable.
Why Debian isn't user-friendly?
HOWTO: Install ES3 Morrowind on Debian Sid and Stable
"My computer is a few electrical transistors I flip manually with registers made out of salt water and lemon juice in some cups." - some guy on Reddit
User avatar
Wheelerof4te
 
Posts: 892
Joined: 2015-08-30 20:14

Re: Compiled my first game from source

Postby Head_on_a_Stick » 2018-01-25 21:26

Wheelerof4te wrote:How long would it take, though?

Please post the output of
Code: Select all
# time apt-build world

:mrgreen:
"An you're a prick. Prick on a stick." — acewiza
User avatar
Head_on_a_Stick
 
Posts: 7463
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Compiled my first game from source

Postby Wheelerof4te » 2018-01-25 21:48

Installing apt-build pulls in a bunch of libs. Won't risk it right now on Sid:
Code: Select all
The following NEW packages will be installed:
  apt-build at autoconf automake autopoint autotools-dev build-essential
  dctrl-tools debhelper debian-keyring devscripts dh-autoreconf
  dh-strip-nondeterminism diffstat dpkg-dev dput equivs exim4-base
  exim4-config exim4-daemon-light g++ g++-7 gettext git git-man guile-2.0-libs
..cue a bunch more lib packages

But it's nice to have an easier option.
Why Debian isn't user-friendly?
HOWTO: Install ES3 Morrowind on Debian Sid and Stable
"My computer is a few electrical transistors I flip manually with registers made out of salt water and lemon juice in some cups." - some guy on Reddit
User avatar
Wheelerof4te
 
Posts: 892
Joined: 2015-08-30 20:14

Re: Compiled my first game from source

Postby stevepusser » 2018-01-25 23:36

You can automate getting the sources with the commands in that guide, but I don't like adding and removing repos to my sources, so just I download the sources directly from packages.debian.org and extract them with

Code: Select all
dpkg-source -x <name-of-.dsc-file>


Tab-complete will save you typing in the name of the .dsc file.

The same procedure works with Ubuntu repos, or others such as PPAs. You can download the source files directly from the repository for PPAs, such as the 0ad PPA: http://ppa.launchpad.net/wfg/0ad/ubuntu/pool/main/0/
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.102, Pale Moon 27.9.2, Enlightenment 0.22, Calligra 3.1, VLC 3.0.2, Firefox 60.0.1, Krita 4.0.3
User avatar
stevepusser
 
Posts: 9548
Joined: 2009-10-06 05:53


Return to Offtopic

Who is online

Users browsing this forum: None1975 and 5 guests

fashionable