You are not logged in.

#1 2024-10-08 13:57:28

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,926

Packaging software without prefix / install support

While searching for a party-based RPG I found the Exile series .

It's proprietary soiftware, but one part of it, Blades of Exile was opensourced under the GPL v2 in 2007 by the author.
The openboe project has lots of info and the sourcecode is available at https://github.com/calref/cboe/


I got interested and looked into creating a PKGBUILD. It does appear no one ever tried to package this for any linux distro.

openboe has a hard dependency on a specific version of tgui that is needed at build AND runtime.
(PKGBUILD at the bottom of this post)

I have managed to get openboe-git to build , but the scons / SConstruct method used has no support for prefixes or install targets .

# Maintainer: Lone_Wolf <lone_wolf@klaas-de-kat.nl>

pkgname=openboe-git
_gitname=cboe
pkgver=r2460.f19bc3c
pkgrel=1
pkgdesc="Classic Blades of Exile"
url="https://openboe.com/"
license=('GPL-2.0')
arch=('x86_64')
makedepends=(boost scons git catch2 cppcodec)
depends=(sfml boost-libs zlib zenity tgui9)
source=(git+https://github.com/calref/cboe.git
              git+https://github.com/catchorg/Catch2.git
              git+https://github.com/texus/TGUI.git
              git+https://github.com/tplgy/cppcodec
              fix-rpaths::git+https://gist.github.com/NQNStudios/7145bcf6621891f5176c8caa165d6b93
)
              
sha512sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP')
options=(!debug !lto)

prepare() {
  cd $_gitname
  git submodule init
  git config submodule.deps/Catch2.url "$srcdir"/Catch2
  git config submodule.deps/TGUI.url "$srcdir"/TGUI
  git config submodule.deps/cppcodec.url "$srcdir"/cppcodec
  git config submodule.deps/fix-rpath.url "$srcdir"/fix-rpath
  git -c protocol.file.allow=always submodule update
}

pkgver() {
  cd $_gitname
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}



build() {
  cd $_gitname
  scons
}

package () {
  cd $_gitname
  # copy stuff to pkgdir and create symlinks from usr/bin to ease starting ?
}

At the end of build () executables & data files are present in src/cboe/build/Blades of Exile

$ ls -l src/cboe/build/Blades\ of\ Exile/
total 24876
-rwxr-xr-x 1 panoramix panoramix 9358128  8 okt 14:40 'Blades of Exile'
drwxr-xr-x 2 panoramix panoramix    4096  8 okt 14:40 'Blades of Exile Base'
drwxr-xr-x 2 panoramix panoramix    4096  8 okt 14:40 'Blades of Exile Scenarios'
-rwxr-xr-x 1 panoramix panoramix 7191120  8 okt 14:40 'BoE Character Editor'
-rwxr-xr-x 1 panoramix panoramix 8897088  8 okt 14:40 'BoE Scenario Editor'
drwxr-xr-x 9 panoramix panoramix    4096  8 okt 14:40  data
drwxr-xr-x 5 panoramix panoramix    4096  8 okt 14:40  docs
$ 

I copied those files to a temp location and the program does run .

Should I put this under /usr/share/$pkgname or would /opt be a better choice ?
What command would be best to move the files AND which permissions should I set ?



# Maintainer: Lone_Wolf <Lone_Wolf@klaas-de-kat.nl>
# Contributor: Bruno Van de Velde <bruno@texus.me>

pkgname=tgui9
pkgver=v0.9.5.r5.gc638b49f1
pkgrel=2
pkgdesc="Cross-platform C++ GUI library for SFML"
arch=('x86_64')
url="https://tgui.eu/"
license=('Zlib')
makedepends=(cmake doxygen git)
depends=(sfml gcc-libs glibc)
provides=('tgui')
conflicts=('tgui')
source=(git+https://github.com/texus/TGUI.git#branch=0.9
)
sha512sums=('SKIP')
options=(!debug !lto)

pkgver() {
  cd TGUI
  git describe --long --tags | sed -r 's/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  cmake \
    -B _build -S "$srcdir"/TGUI \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -D CMAKE_BUILD_TYPE=RelWithDebugInfo \
    -D CMAKE_BUILD_WITH_INSTALL_RPATH=TRUE \
    -D TGUI_BUILD_DOC=true \
    -D TGUI_CXX_STANDARD=14
  make -C _build
}

package() {
  make -C _build DESTDIR="$pkgdir/" install
  install -Dm644 TGUI/license.txt ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#2 2024-10-08 14:50:43

seth
Member
Registered: 2012-09-03
Posts: 58,659

Re: Packaging software without prefix / install support

https://github.com/SCons/scons/wiki/FAQ … -directory
But you'd probably have to rewrite the build instruction…


Assuming you've to shove everything into one location (because the game binary looks for it in $PWD) I'd go w/ installing to /opt and a shell script in /usr/bin that cd's into the /opt dir in case that's necessary.
Also it's not nice to have executable with blanks in the filename wink

https://man.archlinux.org/man/core/core … stall.1.en allows you to relocate files and change ownership/permissions in one call.
I'd keep the permissions and transfer ownershit to root:users (assuming there're no executable text files in the data  dir etc)

The game seems to depend on zenity as well?

Offline

#3 2024-10-08 15:39:02

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,926

Re: Packaging software without prefix / install support

Yes, it needs zenity but works fine with the zenity version from extra repo.

I knew install can change permissions, but didn't realise it can change owner/group in the same command.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#4 2024-10-08 15:47:03

seth
Member
Registered: 2012-09-03
Posts: 58,659

Re: Packaging software without prefix / install support

Ah, sorry - I accidentally checked the depends list of the tgui9 PKGBUILD after finding the bug.

Offline

Board footer

Powered by FluxBB