You are not logged in.

#1 2020-07-03 05:57:48

MaxStirner
Member
Registered: 2018-10-24
Posts: 51

ecwolf-hg remake

The ecwolf-git package has been removed from the AUR, as it was not compiling correctly. I attempted to create a PKGBUILD myself, but couldn't get it to work. Could someone here help me with it?

# Maintainer: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG

pkgname=ecwolf-git
pkgver=.r0.
pkgrel=1
pkgdesc='Advanced source port of "Wolfenstein 3D" and "Spear of Destiny" based on Wolf4SDL (development version)'
arch=('i686' 'x86_64')
url="http://maniacsvault.net/ecwolf"
license=('GPL' 'custom: ID')
provides=('ecwolf')
conflicts=('ecwolf')
depends=('libvorbis' 'flac' 'opusfile' 'libmikmod' 'libjpeg')
makedepends=('git' 'cmake')
optdepends=('wolf3d-shareware: Demo version of Wolfenstein 3D')
install=ecwolf.install
source=("git+https://bitbucket.org/ecwolf/ecwolf"
        "git+https://bitbucket.org/ecwolf/sdl_mixer-for-ecwolf")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
  cd ecwolf
  local _tag=$(tags -q | sort -r | grep "^[0-9]\.[0-9]" | head -n1)
  local _commits=$(log --template "{node}\n" -r $_tag:tip | wc -l)
  local _hash=$(identify -i | sed "s/+//")
  printf "%s.r%s.%s" "$_tag" "$_commits" "$_hash"
}

prepare() {
  # reset build folders
  rm -rf build mixer-build
  mkdir build mixer-build
}

build() {
  msg2 "Building custom SDL_mixer..."
  cd mixer-build
  cmake ../sdl_mixer-for-ecwolf
  make

  msg2 "Building ecwolf..."
  cd ../build
  # build patch utility, enable gpl licensed opl emulator and force custom SDL2_mixer with dependency libraries
  cmake ../ecwolf -DBUILD_PATCHUTIL=ON -DGPL=ON \
    -DSDLMIXER_INCLUDE_DIR="$srcdir/sdl_mixer-for-ecwolf" \
    -DSDLMIXER_LIBRARY="$srcdir/mixer-build/libSDL_mixer.a;-lfluidsynth;-lvorbisfile;-lvorbis;-lopusfile;-lopus;-lFLAC;-lmikmod;-logg"
  make
}

package() {
  cd build

  # binaries
  install -Dm755 ecwolf "$pkgdir"/usr/bin/ecwolf
  install -m755 tools/patchutil/patchutil "$pkgdir"/usr/bin/ecwolf-patchutil
  # data
  install -Dm644 ecwolf.pk3 "$pkgdir"/usr/share/ecwolf/ecwolf.pk3
  cd ../ecwolf
  # doc
  install -d "$pkgdir"/usr/share/doc/ecwolf
  install -Dm644 README.* "$pkgdir"/usr/share/doc/ecwolf
  # license
  install -Dm644 docs/license-id.txt "$pkgdir"/usr/share/licenses/ecwolf/license-id.txt
}

Last edited by MaxStirner (2020-07-05 04:22:34)

Offline

#2 2020-07-04 21:29:29

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: ecwolf-hg remake

# Maintainer: carstene1ns <arch carsten-teibes de> - http://git.io/ctPKG

pkgname=ecwolf-git
_pkgname=ecwolf
pkgver=1.3.3.r359.gdee8991
pkgrel=1
pkgdesc='Advanced source port of "Wolfenstein 3D" and "Spear of Destiny" based on Wolf4SDL (development version)'
arch=('i686' 'x86_64')
url="http://maniacsvault.net/ecwolf"
license=('GPL' 'custom: ID')
provides=('ecwolf')
conflicts=('ecwolf')
depends=('libvorbis' 'flac' 'opusfile' 'libmodplug' 'fluidsynth' 'libjpeg' 'sdl2' 'sdl2_net')
makedepends=('git' 'cmake' 'sdl')
optdepends=('wolf3d-shareware: Demo version of Wolfenstein 3D')
#install=ecwolf.install
source=("git+https://bitbucket.org/ecwolf/ecwolf"
        "git+https://bitbucket.org/ecwolf/sdl_mixer-for-ecwolf")
sha256sums=('SKIP'
            'SKIP')

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

build() {
  echo "Building custom SDL_mixer..."
  cmake -B mixer-build sdl_mixer-for-ecwolf -DMAKE_SHARED=OFF -DDYN_FLUIDSYNTH=OFF
  make -C mixer-build SDL2_mixer

  echo "Building ecwolf..."
  # enable gpl licensed opl emulator and force custom SDL2_mixer with dependency libraries
  export LDFLAGS="-lvorbisfile -lopusfile -lFLAC  -lmodplug -lfluidsynth $LDFLAGS"
  cmake -B build ecwolf -DGPL=ON \
    -DSDL2_mixer_INCLUDE_DIRS="$srcdir/sdl_mixer-for-ecwolf" \
    -DSDL2_mixer_LIBRARIES="$srcdir/mixer-build/libSDL_mixer.a"
  make -C build
}

package() {
  cd build

  # binaries
  install -Dm755 ecwolf "$pkgdir"/usr/bin/ecwolf
  # data
  install -Dm644 ecwolf.pk3 "$pkgdir"/usr/share/ecwolf/ecwolf.pk3
  cd ../ecwolf
  # doc
  install -d "$pkgdir"/usr/share/doc/$pkgname
  install -Dm644 README.* "$pkgdir"/usr/share/doc/$pkgname
  # license
  install -Dm644 docs/license-id.txt "$pkgdir"/usr/share/licenses/$pkgname/license-id.txt
}

Overriding LDFLAGS to add in the libs is not ideal perhaps someone more famiar with cmake will have a better solution.
Build tested only.

Offline

#3 2020-07-04 22:18:02

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,845
Website

Re: ecwolf-hg remake

Please edit your topic title to actually describe the problem you are having: https://wiki.archlinux.org/index.php/Co … ow_to_post


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // 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.

Offline

#4 2020-07-05 04:54:39

MaxStirner
Member
Registered: 2018-10-24
Posts: 51

Re: ecwolf-hg remake

Looks good enough to me, thank you so much loqs. I know someone who can upload and maintain this.

Last edited by MaxStirner (2020-07-05 04:54:57)

Offline

#5 2020-07-05 15:58:20

loqs
Member
Registered: 2014-03-06
Posts: 17,321

Re: ecwolf-hg remake

Please check it works as expected.  If you or the future maintainer have any questions about the PKGBUILD please ask.

Offline

Board footer

Powered by FluxBB