You are not logged in.

#1 2022-01-09 13:32:07

Chryseus8
Member
Registered: 2019-05-27
Posts: 5

[SOLVED] Cortex Command Community Project

Cortex Command Community Project is a AGPL3 game based on the commercial game Cortex Command.
I've already made a working pkgbuild but I don't really have the time to maintain it myself and it could probably do with cleaning up anyways, since I had some significant problems getting it to work.

PKGBUILD

pkgname=cortex-command-community-git
pkgver=v0.1.0.pre2.r2371.g0298cb78
_gitname=Cortex-Command-Community-Project-Source
_data=Cortex-Command-Community-Project-Data
pkgrel=1
pkgdesc="Action 2D side-scrolling game with advanced physics"
arch=('x86_64')
url="https://cortex-command-community.github.io/"
license=('AGPL3')
depends=('allegro4' 'libpng' 'boost' 'flac' 'luajit' 'minizip' 'lz4' 'libx11')
makedepends=('meson')
source=('git+https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source.git'
    'git+https://github.com/cortex-command-community/Cortex-Command-Community-Project-Data.git')
md5sums=(SKIP SKIP)

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

build() {
	cd "$_gitname"
	meson build
	ninja -C build
}

package() {
    cd "$_gitname"
    mkdir -p "$pkgdir/opt/CortexCommand"
    mkdir -p "$pkgdir/usr/bin"
    cp build/CortexCommand "$pkgdir/opt/CortexCommand/"
    cp external/lib/linux/x86_64/*.so* "$pkgdir/opt/CortexCommand"
    cd "../$_data"
    cp -r * "$pkgdir/opt/CortexCommand/"
    mkdir "$pkgdir/opt/CortexCommand/_ScreenShots"
    find "$pkgdir/opt/CortexCommand" -type d -exec chmod 777 {} +
    chmod 777 "$pkgdir/opt/CortexCommand/CortexCommand"
    cp "$pkgdir/../../Cortex.sh" "$pkgdir/opt/CortexCommand/"
    ln -s "/opt/CortexCommand/Cortex.sh" "$pkgdir/usr/bin/CortexCommand"
}

Cortex.sh

#!/bin/sh
cd /opt/CortexCommand
exec ./CortexCommand "$@"

Last edited by Chryseus8 (2022-01-10 17:05:12)

Offline

#2 2022-01-10 11:48:18

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

Re: [SOLVED] Cortex Command Community Project

Please remove all empty files (like backup=() ) to improve readability.

You can probably make the package() function a bit simpler, see https://wiki.archlinux.org/title/Meson_ … guidelines .

mkdir -p "$pkgdir/usr/local/bin"

ln -s "/opt/CortexCommand/Cortex.sh" "$pkgdir/usr/local/bin/CortexCommand"

/usr/local is intended for (local) system administrators and should never be touched by packages.
just create the link in /usr/bin .

Last edited by Lone_Wolf (2022-01-10 12:59:19)


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

#3 2022-01-10 12:37:55

Slithery
Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,257

Re: [SOLVED] Cortex Command Community Project

The pkgdesc variable shouldn't contain the name of the software.
https://wiki.archlinux.org/title/PKGBUILD#pkgdesc


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2022-01-10 13:12:39

Chryseus8
Member
Registered: 2019-05-27
Posts: 5

Re: [SOLVED] Cortex Command Community Project

Thanks for the suggestions, I cleaned up the PKGBUILD, this appears to all work correctly however I suspect there may be a bug in the game which prevents it from running unless all the files are in one place.
It constantly spawns a new process and fails to start, I've reported this so unless it's my own fault it should be fixed soon, in the meantime my previous mess will get it running at least.

pkgname=cortex-command-community-git
pkgver=v0.1.0.pre2.r2371.g0298cb78
_gitname=Cortex-Command-Community-Project-Source
pkgrel=1
pkgdesc="Action 2D side-scrolling game with advanced physics"
arch=('x86_64')
url="https://cortex-command-community.github.io/"
license=('AGPL3')
depends=('allegro4' 'libpng' 'boost' 'flac' 'luajit' 'minizip' 'lz4' 'libx11')
makedepends=('meson')
source=('git+https://github.com/cortex-command-community/Cortex-Command-Community-Project-Source.git'
    'git+https://github.com/cortex-command-community/Cortex-Command-Community-Project-Data.git')
md5sums=(SKIP SKIP)

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

build() {
	cd "$_gitname"
	arch-meson build
	ninja -C build
}

package() {
    cd "$_gitname"
    meson install -C build --destdir "$pkgdir"
}

Offline

#5 2022-01-10 17:32:04

Chryseus8
Member
Registered: 2019-05-27
Posts: 5

Re: [SOLVED] Cortex Command Community Project

It looks like it will be very difficult to include in the AUR so I'm marking this as solved.
While the source was released under the AGPL3, the data is very much non-free, there is also the added complication of it bundling fmod.

Offline

Board footer

Powered by FluxBB