logo

overlay

My (experimental) gentoo overlay

stepmania-select-audio-backends.patch (2451B)


      1 diff -ru stepmania-5.0.12_orig/CMake/DefineOptions.cmake stepmania-5.0.12/CMake/DefineOptions.cmake
      2 --- stepmania-5.0.12_orig/CMake/DefineOptions.cmake	2016-09-22 15:30:46.585653678 +0200
      3 +++ stepmania-5.0.12/CMake/DefineOptions.cmake	2016-09-22 15:32:15.409856429 +0200
      4 @@ -41,6 +41,11 @@
      5  # Turn this option on to log every segment added or removed.
      6  option(WITH_LOGGING_TIMING_DATA "Build with logging all Add and Erase Segment calls." OFF)
      7  
      8 +option(WITH_ALSA "Enable ALSA sound" OFF)
      9 +option(WITH_PULSEAUDIO "Enable PulseAudio sound" OFF)
     10 +option(WITH_OSS "Enable OSS sound" OFF)
     11 +option(WITH_JACK "Enable JACK sound" OFF)
     12 +
     13  if(NOT MSVC)
     14    # Turn this option off to disable using FFMEPG.
     15    option(WITH_FFMPEG "Build with FFMPEG." ON)
     16 diff -ru stepmania-5.0.12_orig/StepmaniaCore.cmake stepmania-5.0.12/StepmaniaCore.cmake
     17 --- stepmania-5.0.12_orig/StepmaniaCore.cmake	2016-09-22 15:30:46.939646512 +0200
     18 +++ stepmania-5.0.12/StepmaniaCore.cmake	2016-09-22 15:35:03.872452142 +0200
     19 @@ -353,35 +353,51 @@
     20      set(HAX_XRANDR FALSE)
     21    endif()
     22  
     23 -  find_package(PulseAudio)
     24 -  if (PULSEAUDIO_FOUND)
     25 -    set(HAS_PULSE TRUE)
     26 +  if (WITH_PULSEAUDIO)
     27 +    find_package(PulseAudio)
     28 +    if (PULSEAUDIO_FOUND)
     29 +      set(HAS_PULSE TRUE)
     30 +    else()
     31 +      set(HAS_PULSE FALSE)
     32 +    endif()
     33    else()
     34      set(HAS_PULSE FALSE)
     35    endif()
     36  
     37 -  find_package(ALSA)
     38 -  if (ALSA_FOUND)
     39 -    set(HAS_ALSA TRUE)
     40 +  if (WITH_ALSA)
     41 +    find_package(ALSA)
     42 +    if (ALSA_FOUND)
     43 +      set(HAS_ALSA TRUE)
     44 +    else()
     45 +      set(HAS_ALSA FALSE)
     46 +    endif()
     47    else()
     48      set(HAS_ALSA FALSE)
     49    endif()
     50  
     51 -  find_package(JACK)
     52 -  if (JACK_FOUND)
     53 -    set(HAS_JACK TRUE)
     54 +  if (WITH_JACK)
     55 +    find_package(JACK)
     56 +    if (JACK_FOUND)
     57 +      set(HAS_JACK TRUE)
     58 +    else()
     59 +      set(HAS_JACK FALSE)
     60 +    endif()
     61    else()
     62      set(HAS_JACK FALSE)
     63    endif()
     64  
     65 -  find_package(OSS)
     66 -  if (OSS_FOUND)
     67 -    set(HAS_OSS TRUE)
     68 +  if (WITH_OSS)
     69 +    find_package(OSS)
     70 +    if (OSS_FOUND)
     71 +      set(HAS_OSS TRUE)
     72 +    else()
     73 +      set(HAS_OSS FALSE)
     74 +    endif()
     75    else()
     76      set(HAS_OSS FALSE)
     77    endif()
     78  
     79 -  if(NOT OSS_FOUND AND NOT JACK_FOUND AND NOT ALSA_FOUND AND NOT PULSE_FOUND)
     80 +  if(NOT HAS_OSS AND NOT HAS_JACK AND NOT HAS_ALSA AND NOT HAS_PULSE)
     81      message(FATAL_ERROR "No sound libraries found. You will require at least one.")
     82    else()
     83      message(STATUS "-- At least one sound library was found. Do not worry if any were not found at this stage.")