You are not logged in.

#1 2019-07-29 13:48:05

qubodup
Member
Registered: 2008-01-19
Posts: 66

[solved] mingw-w64-freealut: OpenAL not installed, cannot build alut

Hi, I'm trying to create a PKGBUILD for mingw-w64-freealut (the ultimate goal is to compile a linwarrior windows binary using linux) but it complains about not finding openal, even though mingw-w64-openal is installed.

PKGBUILD is based on MinGW_package_guidelines#CMake:

pkgname=mingw-w64-freealut
_realname=freealut
pkgver=1.1.0
pkgrel=1
pkgdesc="Cross-platform 3D audio library, software implementation (mingw-w64)"
arch=(any)
url="https://github.com/kcat/openal-soft"
license=('LGPL')
depends=('mingw-w64-crt')
makedepends=('mingw-w64-cmake' 'git')
options=(!strip !buildflags staticlibs)
_commit=6761218e51699f46bf25c377e65b3e9ea5e434b9  # tags/openal-soft-1.19.1
_md5sums=e089b28a0267faabdb6c079ee173664a
source=("http://pkgs.fedoraproject.org/repo/pkgs/freealut/${_realname}-${pkgver}.tar.gz/${_md5sums}/${_realname}-${pkgver}.tar.gz")
sha256sums=('60d1ea8779471bb851b89b49ce44eecb78e46265be1a6e9320a28b100c8df44f')

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

build() { 
  cd "$srcdir/${_realname}-$pkgver/"
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch} && pushd build-${_arch}
    ${_arch}-cmake ..
    make
    popd
  done
}

package() {
  for _arch in ${_architectures}; do
    cd "${srcdir}/foo-$pkgver/build-${_arch}"
    make DESTDIR="${pkgdir}" install
    ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll
    ${_arch}-strip -g "$pkgdir"/usr/${_arch}/lib/*.a
  done
}

Does anybody know why this is failing?

Last edited by qubodup (2019-07-30 10:20:54)

Offline

#2 2019-07-29 13:52:04

2ManyDogs
Forum Moderator
Registered: 2012-01-15
Posts: 2,668

Re: [solved] mingw-w64-freealut: OpenAL not installed, cannot build alut

Please use a pastebin client that does not require us to download your PKGBUILD (or simply post it here using [ code ] tags).

Offline

#3 2019-07-29 14:10:33

qubodup
Member
Registered: 2008-01-19
Posts: 66

Re: [solved] mingw-w64-freealut: OpenAL not installed, cannot build alut

The issue might have been to use CMake.

I found https://github.com/Adsun701/aur-package … t/PKGBUILD which uses configure. However it unfortunately fails:

libtool: link: i686-w64-mingw32-gcc -shared  .libs/libalut_la-alutBufferData.o .libs/libalut_la-alutCodec.o .libs/libalut_la-alutError.o .libs/libalut_la-alutInit.o .libs/libalut_la-alutInputStream.o .libs/libalut_la-alutLoader.o .libs/libalut_la-alutOutputStream.o .libs/libalut_la-alutUtil.o .libs/libalut_la-alutVersion.o .libs/libalut_la-alutWaveform.o    -O2 -Wl,-O1 -Wl,--sort-common -Wl,--as-needed   -o .libs/libalut-0.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libalut.dll.a
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutBufferData.o:alutBufferData.c:(.text+0x11c): undefined reference to `_imp__alGenBuffers'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutBufferData.o:alutBufferData.c:(.text+0x122): undefined reference to `_imp__alGetError'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutBufferData.o:alutBufferData.c:(.text+0x18b): undefined reference to `_imp__alBufferData'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0xf): undefined reference to `_imp__alcGetCurrentContext'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0x1b): undefined reference to `_imp__alGetError'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0x28): undefined reference to `_imp__alcGetContextsDevice'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0x31): undefined reference to `_imp__alcGetError'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0xc3): undefined reference to `_imp__alcOpenDevice'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0xda): undefined reference to `_imp__alcCreateContext'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0xe9): undefined reference to `_imp__alcMakeContextCurrent'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0x156): undefined reference to `_imp__alcCloseDevice'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0x16d): undefined reference to `_imp__alcDestroyContext'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0x176): undefined reference to `_imp__alcCloseDevice'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0x219): undefined reference to `_imp__alcMakeContextCurrent'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0x22b): undefined reference to `_imp__alcGetContextsDevice'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0x23b): undefined reference to `_imp__alcDestroyContext'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0x244): undefined reference to `_imp__alcGetError'
/usr/lib/gcc/i686-w64-mingw32/9.1.0/../../../../i686-w64-mingw32/bin/ld: .libs/libalut_la-alutInit.o:alutInit.c:(.text+0x251): undefined reference to `_imp__alcCloseDevice'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:453: libalut.la] Error 1
make[2]: Leaving directory '/home/user/Downloads/try2/src/freealut-1.1.0/build-i686-w64-mingw32/src'
make[1]: *** [Makefile:446: all-recursive] Error 1
make[1]: Leaving directory '/home/user/Downloads/try2/src/freealut-1.1.0/build-i686-w64-mingw32'
make: *** [Makefile:376: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

Full output: http://ix.io/1PWN

Offline

#4 2019-07-29 20:19:01

loqs
Member
Registered: 2014-03-06
Posts: 8,452

Re: [solved] mingw-w64-freealut: OpenAL not installed, cannot build alut

Does this work for you?

pkgname=mingw-w64-freealut
_realname=freealut
pkgver=1.1.0
pkgrel=1
pkgdesc="Cross-platform 3D audio library, software implementation (mingw-w64)"
arch=(any)
url="https://github.com/kcat/openal-soft"
license=('LGPL')
depends=('mingw-w64-crt' 'mingw-w64-openal')
makedepends=('mingw-w64-cmake' 'git')
options=(!strip !buildflags staticlibs)
_commit=6761218e51699f46bf25c377e65b3e9ea5e434b9  # tags/openal-soft-1.19.1
_md5sums=e089b28a0267faabdb6c079ee173664a
source=("http://pkgs.fedoraproject.org/repo/pkgs/freealut/${_realname}-${pkgver}.tar.gz/${_md5sums}/${_realname}-${pkgver}.tar.gz")
sha256sums=('60d1ea8779471bb851b89b49ce44eecb78e46265be1a6e9320a28b100c8df44f')

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

build() { 
  cd "$srcdir/${_realname}-$pkgver/"
  sed -i 's/openal openal32/openal openal32 OpenAL32/' CMakeLists.txt
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch} && pushd build-${_arch}
    ${_arch}-cmake ..
    make
    popd
  done
}

package() {
  for _arch in ${_architectures}; do
    cd "${srcdir}/${_realname}-$pkgver/build-${_arch}"
    make DESTDIR="${pkgdir}" install
  done
}

Offline

#5 2019-07-30 10:20:36

qubodup
Member
Registered: 2008-01-19
Posts: 66

Re: [solved] mingw-w64-freealut: OpenAL not installed, cannot build alut

loqs wrote:

Does this work for you?

pkgname=mingw-w64-freealut
_realname=freealut
pkgver=1.1.0
pkgrel=1
pkgdesc="Cross-platform 3D audio library, software implementation (mingw-w64)"
arch=(any)
url="https://github.com/kcat/openal-soft"
license=('LGPL')
depends=('mingw-w64-crt' 'mingw-w64-openal')
makedepends=('mingw-w64-cmake' 'git')
options=(!strip !buildflags staticlibs)
_commit=6761218e51699f46bf25c377e65b3e9ea5e434b9  # tags/openal-soft-1.19.1
_md5sums=e089b28a0267faabdb6c079ee173664a
source=("http://pkgs.fedoraproject.org/repo/pkgs/freealut/${_realname}-${pkgver}.tar.gz/${_md5sums}/${_realname}-${pkgver}.tar.gz")
sha256sums=('60d1ea8779471bb851b89b49ce44eecb78e46265be1a6e9320a28b100c8df44f')

_architectures="i686-w64-mingw32 x86_64-w64-mingw32"

build() { 
  cd "$srcdir/${_realname}-$pkgver/"
  sed -i 's/openal openal32/openal openal32 OpenAL32/' CMakeLists.txt
  for _arch in ${_architectures}; do
    mkdir -p build-${_arch} && pushd build-${_arch}
    ${_arch}-cmake ..
    make
    popd
  done
}

package() {
  for _arch in ${_architectures}; do
    cd "${srcdir}/${_realname}-$pkgver/build-${_arch}"
    make DESTDIR="${pkgdir}" install
  done
}

Yes! Thank you!

For others: in the end cmake was the right way to go after all. DIFF of the two cmake PKGBUILDs: https://www.diffchecker.com/GID3R0eT

Last edited by qubodup (2019-07-30 15:43:20)

Offline

Board footer

Powered by FluxBB