Skip to content

Instantly share code, notes, and snippets.

@adlerweb
Last active August 28, 2023 23:53
Show Gist options
  • Select an option

  • Save adlerweb/5a94803f2b4f6b4bb16f332cee766e56 to your computer and use it in GitHub Desktop.

Select an option

Save adlerweb/5a94803f2b4f6b4bb16f332cee766e56 to your computer and use it in GitHub Desktop.

Revisions

  1. adlerweb renamed this gist Aug 28, 2023. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. adlerweb created this gist Aug 28, 2023.
    48 changes: 48 additions & 0 deletions PKGBUILD
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,48 @@
    #Maintainer: Matthias Mailänder <matthias at mailaender dot name>
    #Contributor NiNjA <heinep at gmail dot com>
    #Contributor float <flo.at at gmx dot de>
    #Contributor adlerweb <aur at adlerweb dot info>

    pkgname=s25rttr
    pkgver=0.9.5
    pkgrel=3
    pkgdesc="Return to the Roots is a reimplementation of Settlers II (Die Siedler II) by BlueByte Software GmbH. Put the files from the original game in the folder (/usr/share/s25rttr/S2/)"
    arch=('i686' 'x86_64')
    url="https://www.siedler25.org/"
    license=('GPL3')
    depends=('sdl2' 'sdl2_mixer' 'libcurl-gnutls' 'bzip2' 'glfw' 'libsamplerate' 'boost-libs' 'miniupnpc' 'lua51')
    makedepends=('cmake' 'boost')
    install="s25rttr.install"
    source=("$pkgname-$pkgver.tar.gz::https://github.com/Return-To-The-Roots/s25client/releases/download/v$pkgver/s25client_src_v$pkgver.tar.gz")
    sha256sums=('c6a9ef5b90943b5f2e81543f1e3290ff773663a45ebbbcc5a786bb5f5495fbec')
    provides=("return-to-the-roots=${pkgver}")
    conflicts=("return-to-the-roots")

    prepare() {
    patch --forward --strip=1 --input="${srcdir}/s25rttr-gcc13.patch"
    }

    build() {
    CFLAGS="${CFLAGS} -Wno-error=deprecated-declarations -Wno-dangling-reference"
    CXXFLAGS="${CXXFLAGS} -Wno-error=deprecated-declarations -Wno-dangling-reference"

    cmake -B build -S "s25client_v$pkgver" \
    -D CMAKE_INSTALL_PREFIX=/usr \
    -D RTTR_BUILD_UPDATER=OFF \
    -D RTTR_USE_SYSTEM_LIBS=ON \
    -D BUILD_TESTING=OFF \
    -D LUA_INCLUDE_DIR=/usr/include/lua5.1/

    cmake --build build
    }

    package() {
    pushd build
    make DESTDIR="$pkgdir" install
    popd

    pushd "s25client_v$pkgver"
    install -D -m 0644 tools/release/debian/s25rttr.desktop "${pkgdir}/usr/share/applications/s25rttr.desktop"
    install -D -m 0644 tools/release/debian/s25rttr.png "${pkgdir}/usr/share/icons/hicolor/64x64/apps/s25rttr.png"
    popd
    }
    12 changes: 12 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    tldr:

    * copy patch to src
    * add as new section to PKGBUILD
    ```
    prepare() {
    patch --forward --strip=1 --input="${srcdir}/s25rttr-gcc13.patch"
    }
    * add before ```cmake -B``` in ```build()```
    ```
    CFLAGS="${CFLAGS} -Wno-error=deprecated-declarations -Wno-dangling-reference"
    CXXFLAGS="${CXXFLAGS} -Wno-error=deprecated-declarations -Wno-dangling-reference"```
    22 changes: 22 additions & 0 deletions s25rttr-gcc13.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    diff -Naur src.org/s25client_v0.9.5/external/libsiedler2/src/oem.cpp src/s25client_v0.9.5/external/libsiedler2/src/oem.cpp
    --- src.org/s25client_v0.9.5/external/libsiedler2/src/oem.cpp 2023-08-28 03:58:21.933231358 +0200
    +++ src/s25client_v0.9.5/external/libsiedler2/src/oem.cpp 2023-08-28 04:00:13.180588074 +0200
    @@ -4,6 +4,7 @@

    #include "oem.h"
    #include <array>
    +#include <cstdint>

    namespace libsiedler2 {

    diff -Naur src.org/s25client_v0.9.5/libs/s25main/gameTypes/LanGameInfo.h src/s25client_v0.9.5/libs/s25main/gameTypes/LanGameInfo.h
    --- src.org/s25client_v0.9.5/libs/s25main/gameTypes/LanGameInfo.h 2023-08-28 03:58:21.889897756 +0200
    +++ src/s25client_v0.9.5/libs/s25main/gameTypes/LanGameInfo.h 2023-08-28 03:59:23.610280483 +0200
    @@ -4,6 +4,7 @@

    #pragma once

    +#include <cstdint>
    #include <string>

    class Serializer;