You are not logged in.

#1 2014-01-02 01:42:33

rectec
Member
From: Oregon, USA
Registered: 2013-07-05
Posts: 21
Website

Help needed with making a PKGBUILD for Gaming Anywhere

Hello, community. Gaming Anywhere is a cloud gaming server and client. There is no entry for it in the AUR so I've decided to submit it myself. However I'm a bit confused on how to create a PKGBUILD for it. I've had a fair amount of experience modifying PKGBUILDs but this is the first one I've created from scratch. I'd like your advice.

Gaming Anywhere (referred to as GA from here on out) is a bit peculiar when it comes to compilation and installation. It's not your standard "./configure, make, make install" process. For some reason it likes to add some files into a directory called "myprog" in the user's home folder during compilation. To be honest I'm at a bit of a loss as to what to do anywhere after the initial make. Anyway, here's where I am on the PKGBUILD so far:

# Maintainer: Robert Charlton <rectec [at] mail [dot] com>

pkgname=gaminganywhere
pkgver=0.7.4
pkgrel=1
pkgdesc="Open-source cloud gaming platform"
arch=('any')
url="http://gaminganywhere.org"
license=('custom')
depends=(
	'libx11'
	'libxext'
	'libxtst'
	'freetype2'
	'glu'
	'libgl'
	'libpulse'
	'alsa-lib'
)
makedepends=('gcc' 'pkg-config')
optdepends=()
provides=(gaminganywhere)
conflicts=()
replaces=()
backup=()
options=()
install=
source=(http://gaminganywhere.org/dl/gaminganywhere-${pkgver}-all-in-one.tar.bz2)
md5sums=('c177bc5ed04f111c38c5bea031da0401')

build() {
	cd "$srcdir/$pkgname-$pkgver/deps.src"
	make
}

package() {
	cd "$srcdir/$pkgname-$pkgver"
	make DESTDIR="$pkgdir/" install
}

NB: I have not yet checked the quality of the PKGBUILD code yet. Just trying to get it to actually work beforehand.

It's far from perfect, but it's a start. The two main things I'm confused about are 1) Dependencies and 2) What to do with the resulting files after building. Running makepkg, I believe this gets as far as the build() function and fails near the end. This is the part I'm stuck on. Also, what in the world to I do with all these files scattered everywhere? It looks like it comes with its own libraries, also. Not sure what to do about them.

Hopefully you guys can make sense of it. I would prefer (and I'm sure you would, too) to install the binaries to /usr/bin and the libraries to /usr/lib, as usual, but it looks like GA wants to have everything packed into a single folder. So maybe put it all in /opt/gaminganywhere or something along those lines?

Like I said, I'm at a loss about a lot of this. I definitely haven't gone over everything so I'll be happy to clarify and answer your questions. There is still a lot left to do before this is complete - namely filling out more variables and creating a .service file or two. I'd just like to get past this hurdle first. Thanks. :)

Offline

#2 2014-01-02 04:35:48

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 17,922

Re: Help needed with making a PKGBUILD for Gaming Anywhere

Moving to AUR Issues, Discussion and PKGBUILD requests.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2014-01-02 06:58:49

Scimmia
Fellow
Registered: 2012-09-01
Posts: 8,637

Re: Help needed with making a PKGBUILD for Gaming Anywhere

Looks like it comes pre-built, but it's always better to build from source, especially if we can ditch the included libs and use system shared libs.

The myprog folder is because of the env-setup file and if you don't edit and source that file, it's hardcoded to that path in the makefiles. I'm thinking we can just remove this if we can use system libs.

I'm working on getting it to build, right now I'm running into a problem inside live media, but this is how far I've gotten. It builds everything but rtpsclient. I'll look into that more tomorrow.

Edit: Got it. Try this PKGBUILD, it builds fine using shared system libs. I'm not sure if the symlink will work or not, we may have to change that to a small script, so let me know. I still dumped everything in /opt, but we *may* be able to put the mod dir in /usr/bin along with the executables, but I have no idea how the config files work. The .so file would need to go into /usr/lib if we do that, of course. It includes a font, too, which may be required to be in the same dir as the executable. If so, /usr/bin really isn't an option.

# Maintainer: Robert Charlton <rectec [at] mail [dot] com>
# Contributor: Doug Newgard <scimmia22 at outlook dot com>

pkgname=gaminganywhere
pkgver=0.7.4
pkgrel=1
pkgdesc="Open-source cloud gaming platform"
arch=('i686' 'x86_64')
url="http://gaminganywhere.org"
license=('BSD')
depends=('ffmpeg' 'sdl2_ttf')
makedepends=('live-media')
source=("http://gaminganywhere.org/dl/gaminganywhere-$pkgver-all-in-one.tar.bz2")
md5sums=('c177bc5ed04f111c38c5bea031da0401')

prepare() {
  cd "$srcdir/$pkgname-$pkgver"

  rm -rf bin deps.* env-setup

# include header for sleep function
  sed -i '/#include <stdarg.h>/a #include <unistd.h>' ga/client/ga-client.cpp

# Set right include dirs for live-media
  sed -i '/^L5CF/ s|=.*|= -I/usr/include/liveMedia -I/usr/include/BasicUsageEnvironment -I/usr/include/UsageEnvironment -I/usr/include/groupsock|' ga/Makefile.def

# Get rid of all of the GADEPS junk from the makefiles. Not stricly required, but cleans things up
  sed -i '/^GADEPS/d;s/\S*GADEPS\S*//g' ga/Makefile.def ga/module/Makefile.common ga/{client,core,server/event-posix,server/periodic}/Makefile

# Fix for build with live-media >= 2013.06.14
  sed -i '1210 s/)/, -1)/' ga/client/rtspclient.cpp
}

build() {
  cd "$srcdir/$pkgname-$pkgver/ga"

  make all
  make install
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  install -dm755 "$pkgdir/"{opt,usr/bin}
  cp -a bin "$pkgdir/opt/gaminganywhere"

  ln -s "/opt/gaminganywhere/ga-client" "$pkgdir/usr/bin/ga-client"

  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

Things to note:
arch array is not 'any', that's for things like data files and scripts. Anything with built binaries needs to list the specific architectures.
License is BSD, which isn't exactly custom. Needs installed as well.
gcc and pkg-config are in the base-devel group and should be assumed, not included in the makedepends array.
Will already "provide" itself, you don't need it in the provides array.

Last edited by Scimmia (2014-01-02 20:40:28)

Offline

#4 2014-01-04 10:59:48

rectec
Member
From: Oregon, USA
Registered: 2013-07-05
Posts: 21
Website

Re: Help needed with making a PKGBUILD for Gaming Anywhere

Wow, thank you very much! That was more help than I expected. :) And sorry for the slight delay. I wasn't notified. Anyway, let me get to your notes.

Scimmia wrote:

arch array is not 'any', that's for things like data files and scripts. Anything with built binaries needs to list the specific architectures.

My bad. I just haven't had any issues with putting 'any'. It always seems to build properly regardless of the architecture. We'll start out with i686 and x86_64, and add more as requests come in to do so.

Scimmia wrote:

License is BSD, which isn't exactly custom. Needs installed as well.

Where did you get that info? I looked all over the site for license details, but all it would tell me is that it's 'open-source'. Finally, I just went to the license page on its Github. I don't know if that is indeed the BSD license, but it doesn't state as such, so I just put 'custom'.

Scimmia wrote:

gcc and pkg-config are in the base-devel group and should be assumed, not included in the makedepends array.
Will already "provide" itself, you don't need it in the provides array.

No objection ;)

Much appreciated. I'll test this out on my end and let you know if I need anything else. Thanks.

Offline

#5 2014-01-04 11:13:37

rectec
Member
From: Oregon, USA
Registered: 2013-07-05
Posts: 21
Website

Re: Help needed with making a PKGBUILD for Gaming Anywhere

Ok. One problem. You've set a package called 'sld2_ttf' as a dependency, but there is no such package. Googling it yields no results. Also, I believe it should be in makedepends, as it fails to build without it:

Package sdl2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `sdl2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sdl2' found
Package SDL2_ttf was not found in the pkg-config search path.
Perhaps you should add the directory containing `SDL2_ttf.pc'
to the PKG_CONFIG_PATH environment variable
No package 'SDL2_ttf' found

Not sure what this is. Help would be appreciated.

Offline

#6 2014-01-04 12:42:31

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 9,452

Re: Help needed with making a PKGBUILD for Gaming Anywhere

sdl2_ttf  is in extra repo, if pacman -Si sdl2_ttf doesn't find it on your system you need to check your pacman.conf


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
Did you use the guided installer ? If yes, I can't help you.

(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2014-01-04 17:19:18

Scimmia
Fellow
Registered: 2012-09-01
Posts: 8,637

Re: Help needed with making a PKGBUILD for Gaming Anywhere

rectec wrote:
Scimmia wrote:

License is BSD, which isn't exactly custom. Needs installed as well.

Where did you get that info? I looked all over the site for license details, but all it would tell me is that it's 'open-source'. Finally, I just went to the license page on its Github. I don't know if that is indeed the BSD license, but it doesn't state as such, so I just put 'custom'.

The license file is right in the tarball in a file named LICENSE. I just recognized it as 3 clause BSD, but if you google the opening lines, you can ID it pretty readily.

Indeed sdl2_ttf is in [extra], and will pull in the sdl2 package with it. It's needed not only at built time but also at run time, so depends is the correct place.

Offline

#8 2014-01-04 22:50:04

rectec
Member
From: Oregon, USA
Registered: 2013-07-05
Posts: 21
Website

Re: Help needed with making a PKGBUILD for Gaming Anywhere

Oh, my mistake. I was entering 'sld2_ttf' when it should've been 'sdl2_ttf'. That's what I get for staying up too late. Sorry for the confusion. :)

Scimmia wrote:

The license file is right in the tarball in a file named LICENSE. I just recognized it as 3 clause BSD, but if you google the opening lines, you can ID it pretty readily.

I thought that was the case. I'll make sure to Google the opening lines of the licenses in the future. Thanks.

Offline

#9 2014-01-04 23:06:54

rectec
Member
From: Oregon, USA
Registered: 2013-07-05
Posts: 21
Website

Re: Help needed with making a PKGBUILD for Gaming Anywhere

Alright. It builds fine and ga-client seems to run fine. But running ga-server-periodic yields a command not found error. I noticed ga-client gets linked to /usr/bin in the PKGBUILD:

ln -s "/opt/gaminganywhere/ga-client" "$pkgdir/usr/bin/ga-client"

So I've linked ga-server-periodic to /usr/bin and now it works. However I can't find any binaries named 'ga-server-event-driven' or 'ga-server'. Maybe they have been deprecated.

I'll see if I can actually get GA to work now.

EDIT: I've attempted to run ga-server-periodic. It needs to read a config file from /opt/gaminganywhere/config and get a library from /opt/gaminganywhere/mod. I can specify which config file to use (e.g. /opt/gaminganywhere/config/server.desktop.conf) but I can't tell it where to find the libraries. Any suggestions?

Last edited by rectec (2014-01-04 23:21:29)

Offline

#10 2014-01-05 04:26:36

Scimmia
Fellow
Registered: 2012-09-01
Posts: 8,637

Re: Help needed with making a PKGBUILD for Gaming Anywhere

Try just going to /opt/gaminganywhere and running ./ga-server-periodic <whatever options>. If that works, we may have to replace the symlinks with script that just cd to the correct dir and run the program from there.

Edit: just took a look at the code, it's hardcoded to look in a dir called "mod" in the same dir as the executable, so a wrapper script will be needed. It also means that if we wanted to move things to /usr, the mod dir would need to be in /usr/bin, which isn't good, so that's probably not an option without some patching.

Anyway, remove the symlinks in the package function of the PKGBUILD and add this instead:

  printf "#!/bin/bash\ncd /opt/gaminganywhere\n./ga-client \$@\n" > "$pkgdir/usr/bin/ga-client"
  printf "#!/bin/bash\ncd /opt/gaminganywhere\n./ga-server-periodic \$@\n" > "$pkgdir/usr/bin/ga-server-periodic"
  chmod 755 "$pkgdir/usr/bin/"{ga-client,ga-server-periodic}

Last edited by Scimmia (2014-01-05 05:06:56)

Offline

#11 2014-01-05 05:12:01

rectec
Member
From: Oregon, USA
Registered: 2013-07-05
Posts: 21
Website

Re: Help needed with making a PKGBUILD for Gaming Anywhere

You're a wizard, Scimmia. I've never seen something so overly-complicated to set up. Anyway, it doesn't complain about missing modules, now. But now it's having a problem with my audio:

ALSA lib pcm_dmix.c:961:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
# [1554] 1388898298.264209 open failed: Invalid argument
# [1554] 1388898298.264216 ALSA: initialization failed.
# [1554] 1388898298.264222 audio source init failed.

Probably an issue with my .asoundrc. I'm running pure ALSA, by the way. I'll rename the .asoundrc. If it still doesn't work, I don't know. I'll need some more help.

EDIT: Yes, it was. Server and client worked successfully at first glance. NOTE: Do not point the client at a server on the same machine!
I need to get my laptop up and running. Once I do, I'll test out the client on there. Thanks.

Last edited by rectec (2014-01-05 05:17:54)

Offline

#12 2014-01-05 08:36:13

rectec
Member
From: Oregon, USA
Registered: 2013-07-05
Posts: 21
Website

Re: Help needed with making a PKGBUILD for Gaming Anywhere

Alright. I set the server up to stream the desktop. I've submitted gaminganywhere to the AUR and installed it onto my laptop. It's basically just a remote desktop tool. It runs fine, but it's incredibly slow. I'm assuming that's just an issue with the program itself. Oh well. It's in its early stages of development with a pretty small team behind it, so I wouldn't expect it to be perfect.

Tomorrow I'm going to write a .service file for this. Remember, it's in the AUR now. Feel free to leave feedback :)

Thanks a lot for the help.

Last edited by rectec (2014-01-05 23:27:46)

Offline

#13 2021-09-07 02:22:32

kode54
Member
Registered: 2013-10-21
Posts: 10

Re: Help needed with making a PKGBUILD for Gaming Anywhere

Has this since been deleted from the AUR for being a badly behaved package?

Offline

#14 2021-09-07 07:15:17

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 10,455
Website

Re: Help needed with making a PKGBUILD for Gaming Anywhere

Looks like it was never migrated to the git-based AUR. Feel free to fix up any issues with the PKGBUILD and maintain it on the AUR yourself: https://github.com/aur-archive/gaminganywhere


Sakura:-
Mobo: MSI MEG B550 UNIFY // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

Board footer

Powered by FluxBB