Page 1 of 1
Strange question about cat
Posted: Sat Jul 23, 2011 1:36 pm
by T-Bone
On
http://love2d.org/wiki/Game_Distribution, it is written that on Linux, you can create an excecutable from a .love file by writing "cat love game.love > game" (of course changing "game" to the name of your game). This simply does not work (it can't find "love" even if it's installed). I think I understand what it tries to do (create a text file called "game" containing the text "love game.love"), and this can be done graphically with gedit very easily, but if cat can really create text files (never used it that way) then the code on the wiki should be corrected.
Or maybe I have misunderstood something? Perhaps it's referring to some binary version of LÖVE for Linux, which cat merges with your .love file?
Re: Strange question about cat
Posted: Sat Jul 23, 2011 1:39 pm
by Robin
You are very wrong indeed.
cat concatenates files. It needs a copy of LÖVE in the same directory, otherwise it will not work. (You can of course do something like "cat /usr/bin/love ...", though.)
What that particular line is, it copies the executable from love and pastes a .love at the end of it, where "game" is the name of the new executable, which runs the provided game.
It is pretty much exactly the same as the Windows version of that action.
EDIT: example:
Code: Select all
$ cat a
first file
$ cat b
second file
$ cat a b
first file
second file
$ cat a b > c
$ cat c
first file
second file
Re: Strange question about cat
Posted: Sat Jul 23, 2011 2:36 pm
by T-Bone
I see. That makes a lot of sense. Perhaps the wiki should be clarified, or am I just stupid?
But since this seems to copy LÖVE in binary format, will it work on another computer? I'm guessing you would have to, at the very least, make sure to have the 32-bit version of LÖVE installed.
Re: Strange question about cat
Posted: Sat Jul 23, 2011 2:48 pm
by bartbes
It is, indeed, of limited use, because you need not just compatible architectures, but also libraries etc, that's why it is common to distribute the .love for linux users. Something you can do with most package management systems is the creation of a launcher that runs your .love with love, then add love as a dependency for the package.
Re: Strange question about cat
Posted: Sat Jul 23, 2011 2:50 pm
by Robin
In practice it might work better to make a package (.deb or .rpm) from of the .love and add the right version of LÖVE as a dependency.
Re: Strange question about cat
Posted: Sat Jul 23, 2011 3:19 pm
by T-Bone
A simple install script will probably be sufficient for Ubuntu users (first run sudo apt-get install love, then make a launcher and put it in /usr/share/applications)
Re: Strange question about cat
Posted: Sat Jul 23, 2011 3:35 pm
by TechnoCat
Robin wrote:(You can of course do something like "cat /usr/bin/love ...", though.)
Code: Select all
$ cat `which love` game.love > game.bin
That should do it. And those are graves, not apostrophes.
Re: Strange question about cat
Posted: Sun Jul 24, 2011 6:15 am
by Robin
Even better.