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

Support for RPM package #7

Open
toxinu opened this issue Jul 24, 2014 · 23 comments
Open

Support for RPM package #7

toxinu opened this issue Jul 24, 2014 · 23 comments

Comments

@toxinu
Copy link

toxinu commented Jul 24, 2014

Hi there,

It could be nice to support rpm packaging like deb!

Thank you.

@josefnpat
Copy link

+1, but keep in mind 0.9.x isn't very prevalent on rpm based machines. This would be nice, but should probably be a lower priority.

Unless of course one would be willing to make an SRPM (for greater compatibility) that includes love and the game itself, but it would probably less along the *nix philosophy of each package has it's own purpose.

I base my lower priorities on the fact of the available versions in famous RPM based distros:

While Mageia is great to keep up to date, and also very high on distrowatch (number 4 atm), the RHEL and RepoForge mostly indicates that many folks have to compile love from source. I know that @bartbes maintains the _.debs (debian) and the PPA (_buntu) for love, so it's very easy to get the latest version for debian based systems. Unless we get a maintainer for SPRM's (which would make generating RPM's per OS easy), I would highly suggest making this a lower priority.

@toxinu
Copy link
Author

toxinu commented Jul 24, 2014

@josefnpat Thank you for your anwser.
My issue was mainly about probing rpm need.
I'm totally not able to build rpm and I agree that it's a lower priority.

But I found it's very sad to not be able to build self contained game with love2d binary.
In order to isolate love2d version just for your game. Cause if I want to install two love2d games on my computer but one is 0.8 and other is 0.9.1, there will be potentially some problems.

@josefnpat
Copy link

That's a good point, and honestly an issue across all linux distros. All the binaries by default on debian systems share the binary name love as opposed to love091 (like lua5.1 does)

@toxinu
Copy link
Author

toxinu commented Jul 24, 2014

I do some tests about love2d embedding.

I just package a little game I do for linux64, download here.
It has been packaged on Ubuntu 14.04 64bit.

You can review Python script that I create for this occasion (here). I can't confirm you that it will work on every Linux 64bit.

If some folks use Fedora or something other than Ubuntu 14.04 64 bit, can you give me some feedback about the game I package just above (here)?

@josefnpat
Copy link

may I ask how you went about packaging the binary? Usually when you build love (esp when you aren't using an older version) there are a ton of static binary issues.

@toxinu
Copy link
Author

toxinu commented Jul 25, 2014

Python script is easy but I can explain it quickly too.

Requirements
For now this script assume that you already have love installed and in your PATH.
For this example, I don't compile Love2D, I use a fresh Ubuntu install via ppa.

How it work
I just run ldd love to get list of lib used by love2d, copy them in a lib directory, copy love binary, create a bash wrapper script that modify LD_LIBRARY_PATH on the fly.

Idea
I could try to enhance this script in order to manage love compilation instead of simply use love binary. Why not ?

@josefnpat
Copy link

So long as you are only distributing to ubuntu 14.04, (and perhaps a few releases behind) this should work fine. Other OS's (esp the fedora strain) will give you tons of segfaults. Do not depend on it as a "catch all" for linux deployment.

@toxinu
Copy link
Author

toxinu commented Jul 25, 2014

Okay thank your for your advice @josefnpat . Is it something you already experiment ?
Cause for me, today linux distribution is nearly broken for love.

Distribution packaging like deb don't allow to have multiple love version on a system and it's a very big issue. And status for rpm-like distros are worse...

@josefnpat
Copy link

Yeah, I've been trying for a long time to create a "catch all" for linux binary distribution. It's really ... annoying.

As for installing multiple versions of love, I follow the building instructions for love, and build each require version, then softlink the binary to /usr/bin/love072, /usr/bin/love080, /usr/bin/love091 etc.

@toxinu
Copy link
Author

toxinu commented Jul 25, 2014

I just give a try to my work just above and it's run on Fedora 👍

Edit: I can't surrender easily! I'll try it tomorrow on Archlinux, Mageia, Debian and Linux Mint.

@josefnpat
Copy link

👍 worked for me on arch, but still an exception 😄

@toxinu
Copy link
Author

toxinu commented Jul 25, 2014

I just test on, Mageia, Debian and Linux Mint.

Linux 64bit build on Ubuntu 14.04.1 LTS:

  • Ubuntu 14.04.1 LTS: Ok
  • Ubuntu 13.10: Not Ok
  • Linux Mint 17: Ok
  • Mageia 4.1: Ok
  • Archlinux: Ok
  • Debian 7.6.0: Not Ok (cause debian just have EGLIBC 2.13)

Sorry for testing while you say to me to stop 😭

@MisterDA
Copy link
Owner

Soo... RPM or not RPM ? That is the question. At least a PKGBUILD ?

@pablomayobre
Copy link
Contributor

+1 for the PKGBUILD. RPM is not a priority but would be nice too

@pablomayobre
Copy link
Contributor

I found FPM today... It seems like a good way to make RPMs althought I dont know how it does it, it may be possible

@josefnpat
Copy link

I can give you a sample PKGBUILD for arch! One second!

@josefnpat
Copy link

PKGBUILD

# Maintainer: Josef Patoprsty <[email protected]>

pkgname=slg09x
pkgver=308
pkgrel=1
pkgdesc="Starfire Lords: Genesis"
arch=('any')
url="http://starfirelordsgenesis.com"
license=('custom')
depends=('love')
_gamepkg="${pkgname}-linux.zip"
source=(${pkgname}.sh
        ${pkgname}.desktop
        ${pkgname}_${pkgver}.love.zip)

sha1sums=('20abd6f0c739f6963ee1bc1212ca80aa84218fc7'
          '3bfd3068b02579c3345bb13761c0948f444b6586'
          '%%ZIP_SHA%%')

package() {
    # Install Data
    install -D -m755 "${srcdir}/${pkgname}_${pkgver}.love" "${pkgdir}/usr/share/${pkgname}/${pkgname}.love"
    install -D -m644 "${srcdir}/README" "$pkgdir/usr/share/${pkgname}/README"

    # Install Launcher
    install -D -m755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}"

    # Install Desktop
    install -D -m644 "${srcdir}/${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
}

slg09x.sh

#!/bin/bash
exec love --fused /usr/share/slg09x/slg09x.love "$@"

slg09x.desktop

[Desktop Entry]
Version=1.0
Type=Application
Icon=gnome-mime-application-x-love-game
Exec=slg09x
Terminal=false
StartupNotify=false
Name=Starfire Lords: Genesis
GenericName=Arcade Game
Comment=Top down shooter with co-op gameplay.
Categories=Game;ArcadeGame;

@josefnpat
Copy link

@pablomayobre
Copy link
Contributor

Question: Is Arch needed to make a PKGBUILD? Can I do this in, say, Debian?

@MisterDA
Copy link
Owner

A PKGBUILD is an Arch Linux package build description file (actually, it is a shell script) used when creating packages.

It's just a simple text file. Then makepkg reads it and compiles/downloads the package. I hope you can write a text file with Debian.
This is easy, not much different from what has been done on deb pkg.

FPM seems 🆒 ! Could be a solution to a lot of problems. If I was to use it in love-release, I would probably drop the Debian script. Also love-release just gives you a .app for OS X, and FPM gives an installer. I could take advantage of both, like with Windows. I will probably rename love-release's options to match FPM options, too.

@pablomayobre
Copy link
Contributor

And then you distribute that file? That is easy! So where does this script look for the .love file?

Glad you liked FPM!

@MisterDA
Copy link
Owner

Normally, it downloads it.

@pablomayobre
Copy link
Contributor

What I meant is: ${srcdir} is replaced by the directory that contained the PKGBUILD file?

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

No branches or pull requests

4 participants