haskell-game/sdl2-mixer

SDL2_mixer 2.0.2 breaks the build

peti opened this issue · 6 comments

peti commented

openSUSE has recently updated its SDL2_mixer system library to version 2.0.2 and that change has broken the build of this Haskell package:

[   88s] In file included from dist/build/SDL/Raw/Mixer_hsc_make.c:1:0:
[   88s] Mixer.hsc: In function ‘main’:
[   88s] Mixer.hsc:196:16: error: ‘MIX_INIT_MODPLUG’ undeclared (first use in this function); did you mean ‘MIX_INIT_MOD’?
[   88s] /usr/lib64/ghc-8.2.2/template-hsc.h:38:10: note: in definition of macro ‘hsc_const’
[   88s]      if ((x) < 0)                                      \
[   88s]           ^
[   88s] Mixer.hsc:196:16: note: each undeclared identifier is reported only once for each function it appears in
[   88s] /usr/lib64/ghc-8.2.2/template-hsc.h:38:10: note: in definition of macro ‘hsc_const’
[   88s]      if ((x) < 0)                                      \
[   88s]           ^
[   88s] Mixer.hsc:199:16: error: ‘MIX_INIT_FLUIDSYNTH’ undeclared (first use in this function); did you mean ‘MIX_INIT_MID’?
[   88s] /usr/lib64/ghc-8.2.2/template-hsc.h:38:10: note: in definition of macro ‘hsc_const’
[   88s]      if ((x) < 0)                                      \
[   88s]           ^
[   88s] Mixer.hsc:404:16: error: ‘MUS_MP3_MAD’ undeclared (first use in this function); did you mean ‘MUS_MP3’?
[   88s] /usr/lib64/ghc-8.2.2/template-hsc.h:38:10: note: in definition of macro ‘hsc_const’
[   88s]      if ((x) < 0)                                      \
[   88s]           ^
[   88s] Mixer.hsc:406:16: error: ‘MUS_MODPLUG’ undeclared (first use in this function); did you mean ‘MUS_MOD’?
[   88s] /usr/lib64/ghc-8.2.2/template-hsc.h:38:10: note: in definition of macro ‘hsc_const’
[   88s]      if ((x) < 0)                                      \
[   88s]           ^
[   88s] compiling dist/build/SDL/Raw/Mixer_hsc_make.c failed (exit code 1)
[   88s] command was: /usr/bin/gcc -c dist/build/SDL/Raw/Mixer_hsc_make.c -o dist/build/SDL/Raw/Mixer_hsc_make.o -fno-stack-protector -fno-stack-protector -fuse-ld=bfd -D__GLASGOW_HASKELL__=802 -Dlinux_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dlinux_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -I/usr/include/SDL2 -D_REENTRANT -Idist/build/autogen -Idist/build/global-autogen -include dist/build/autogen/cabal_macros.h -I/usr/include/SDL2 -I/usr/lib64/ghc-8.2.2/vector-0.12.0.1-IUGn3M9mkBh8CyXcBnfTR4/include -I/usr/lib64/ghc-8.2.2/primitive-0.6.2.0-EI3NK1Xfv9zEcRtyXK2EwZ/include -I/usr/lib64/ghc-8.2.2/time-1.8.0.2/include -I/usr/lib64/ghc-8.2.2/bytestring-0.10.8.2/include -I/usr/lib64/ghc-8.2.2/base-4.10.1.0/include -I/usr/lib64/ghc-8.2.2/integer-gmp-1.0.1.0/include -I/usr/lib64/ghc-8.2.2/include -I/usr/lib64/ghc-8.2.2/include/

Is this a known issue?

peti commented

I found this patch in another project which suggests what kind of changes might be necessary to fix this problem: https://github.com/kivy/kivy/commit/3b85f3e1c292b3f6c3f226490f52a2ab78251730.patch

Same problem on OS X.

works for me, I'm on OS X.

.cabal:

  build-depends:
      base >=4.7 && <5
    , sdl2
    , sdl2-mixer >=1.1.0

stack.yaml:

extra-deps:
  - sdl2-mixer-1.1.0

@vyorkin you probably don't have SDL2_mixer 2.0.2 but a previous one.

@Rydgel here is the my brew info output:

❯ brew info sdl2_mixer
sdl2_mixer: stable 2.0.2 (bottled), HEAD
Sample multi-channel audio mixer library
https://www.libsdl.org/projects/SDL_mixer/
/usr/local/Cellar/sdl2_mixer/2.0.2_3 (10 files, 338.6KB) *
  Built from source on 2018-02-14 at 09:36:28 with: --with-flac --with-fluid-synth --with-libmikmod
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/sdl2_mixer.rb
==> Dependencies
Build: pkg-config ✔
Required: libmodplug ✔, libvorbis ✔, sdl2 ✔
Optional: flac ✔, fluid-synth ✔, libmikmod ✔, mpg123 ✘
==> Options
--with-flac
	Build with flac support
--with-fluid-synth
	Build with fluid-synth support
--with-libmikmod
	Build with libmikmod support
--with-mpg123
	Build with mpg123 support
--HEAD
	Install HEAD version

Ok I understand what's wrong. Seems like the LTS package is the old 0.1 version.

capture d ecran 2018-02-14 a 15 33 40

I made it work by forcing the sdl2-mixer-1.1.0 package in the stack.yml file.
Thanks!