Bug 249348

Summary: audio/mixxx: Update to 2.3 (change build system to CMake)
Product: Ports & Packages Reporter: David Schlachter <fbsd-bugzilla>
Component: Individual Port(s)Assignee: Jose Alonso Cardenas Marquez <acm>
Status: New ---    
Severity: Affects Some People CC: fbsd-bugzilla
Priority: --- Keywords: needs-patch
Version: LatestFlags: bugzilla: maintainer-feedback? (acm)
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 247189    

Description David Schlachter 2020-09-15 18:57:12 UTC
The Mixxx 2.3 beta was released in June, though I haven't been able to find an estimated release date for the final version. For porting, the major change is a transition to CMake for the build instead of SCons (see bug 247189).

I've opened this bug to document changes for building Mixxx 2.3 with CMake, currently with the latest git snapshot of the 2.3 branch. I think most changes for porting the (upcoming) new version will just be adaptations of the existing patches for the new build system.

Here's what I've done so far to try to make it build:

- add security/qtkeychain, sysutils/upower, comms/hidapi as dependencies. (Some of these are patched out in the current port.)

- portmidi: rather than patching this out, I think the best solution would be to add a new portmidi port. After downloading the sources, I tried the following changes to build:

   - configure script using ccmake is interactive. I had to manually specify the JAVA_INCLUDE_PATH and JAVA_JVM_LIBRARY paths as described in `portmidi/trunk/pm_linux/README_LINUX.txt`. The paths depend on the installed JDK version. There must be a good way to do this automatically. In my case, these paths are: JAVA_INCLUDE_PATH=/usr/local/openjdk8/include and JAVA_JVM_LIBRARY=/usr/local/openjdk8/jre/lib/amd64/server/libjvm.so
   - add `/usr/local/include` to `include_directories` on line 68 of portmidi/trunk/CMakeLists.txt
   - set the env variable LIBRARY_PATH=/usr/local/lib in order to find asound library from alsa, may be better to instead patch in the `-L/usr/local/lib` flag throughout the source files
   - patch two functions using deprecated `ftime` to use `gettimeofday` in `porttime/ptlinux.c` (c.f. https://forum.freecadweb.org/viewtopic.php?t=15724).

  For the default make target, I get this error around 93%:
    make[2]: don't know how to make pm_java/jportmidi/JPortMidi.class. Stop

  It is possible to patch out portmidi: keep existing patch to controllers/controllermanager.cpp, remove REQUIRED keyword in CMakeLists.txt for PortMidi, comment out `portmidicontroller.cpp` and `portmidienumerator.cpp` around line 2365 of CMakeLists.txt. However, this causes build failures later on that I haven't yet figured out.

- use system libusb. I'm not sure how to make this happen in CMakeLists.txt (see lines around 2260). I don't use a USB controller, and configure succeeds if the feature is disabled (cmake -DHID=off ...). It should be possible to pass the flags '-DLIBUSB_INCLUDE_DIR=/usr/include -DLIBUSB_LIBRARIES=/usr/lib/libusb.so' to the configure command, but this fails in logic around lib-hdiapi.

- add include directory for ogg.h in libshout. There may be a better way to do this, but I just added `/usr/local/include` to `include_directories` in `lib/libshout/CMakeLists.txt`.

- change `endian.h` to `sys/endian.h`, and `byteswap.h` to `infiniband/byteswap.h` in lib/kaitai/kaitaistream.cpp

With these changes (patching out portmidi since I haven't succeded in building it yet), mixxx 2.3 configures successfully and builds partially (12%), failing eventually with:

  In file included from /home/david/Downloads/mixxx/cmake_build/mixxx-lib_autogen/T7JLZL2D4I/moc_portmidicontroller.cpp:10:
/home/david/Downloads/mixxx/cmake_build/mixxx-lib_autogen/T7JLZL2D4I/../../../src/controllers/midi/portmidicontroller.h:20:10: fatal error: 
      'portmidi.h' file not found
#include <portmidi.h>
         ^~~~~~~~~~~~
Comment 1 David Schlachter 2020-09-16 19:43:14 UTC
portmidi builds successfully with the above procedure if *gmake* is used instead of BSD make. I'll open a separate issue for a new portmidi port separately when I have a ports Makefile working.