Unverified Commit 9bb9d548 authored by Faye Chun's avatar Faye Chun
Browse files

stepmania: fix aarch64-linux build by using libpng from nixpkgs

Currently, the aarch64-linux build of Stepmania fails with libpng linkage errors:

> ld: ../extern/libpng.a(pngrtran.c.o): in function `png_do_read_transformations':
> pngrtran.c:(.text+0x4118): undefined reference to `png_riffle_palette_neon'
> ld: pngrtran.c:(.text+0x5188): undefined reference to `png_do_expand_palette_rgba8_neon'
> ld: pngrtran.c:(.text+0x6268): undefined reference to `png_do_expand_palette_rgb8_neon'
> ld: ../extern/libpng.a(pngrutil.c.o): in function `png_read_filter_row':
> pngrutil.c:(.text+0x6734): undefined reference to `png_init_filter_functions_neon'
> collect2: error: ld returned 1 exit status

Stepmania vendors many dependencies in source form in their code repository; it appears that the libpng
build configured there seems to be either misconfigured or isn't building correctly under NixOS. I played
around with a couple of NEON-related compile flags but couldn't get anything to stick.

A workaround that works seems to be building against the Nixpkgs libpng instead. It builds, launch, and (so far)
plays correctly on my NixOS-based M1 Air and my PC.
parent 4ff6cdec
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
, gtk2
, libmad
, libogg
, libpng
, libpulseaudio
, libvorbis
, udev
@@ -51,6 +52,7 @@ stdenv.mkDerivation {
    gtk2
    libmad
    libogg
    libpng
    libpulseaudio
    libvorbis
    udev
@@ -59,6 +61,7 @@ stdenv.mkDerivation {

  cmakeFlags = [
    "-DWITH_SYSTEM_FFMPEG=1"
    "-DWITH_SYSTEM_PNG=on"
    "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
    "-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include"
  ];
@@ -79,8 +82,6 @@ stdenv.mkDerivation {
    platforms = platforms.linux;
    license = licenses.mit; # expat version
    maintainers = with maintainers; [ h7x4 ];
    # never built on aarch64-linux since first introduction in nixpkgs
    broken = stdenv.isLinux && stdenv.isAarch64;
    mainProgram = "stepmania";
  };
}