Opened 10 months ago

Last modified 9 months ago

#67850 assigned defect

lmms: updating and fixing: some help with bundling and clang testing wanted

Reported by: barracuda156 Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: luzpaz
Port: lmms

Description (last modified by barracuda156)

Ryan, would you help a bit with lmms? I have updated it to 1.2.2 (the last version to support Qt4, and pretty recent anyway) and fixed PowerPC build. I may need help to sort out making an app bundle. And test Clang build, if possible.

There is one caveat for PPC (or GCC in general, no one ever tested it in upstream), Apple Midi does not build: https://github.com/LMMS/lmms/issues/6785

:info:build [ 56%] Building CXX object src/CMakeFiles/lmmsobjs.dir/core/midi/MidiPort.cpp.o
:info:build cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src && /opt/local/bin/g++-mp-12 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_XML_LIB -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/lmmsobjs_autogen/include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2 -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/include -I/opt/local/include/opus -I/opt/local/include/SDL -I/opt/local/include -I/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/3rdparty/rpmalloc/rpmalloc/rpmalloc -isystem /opt/local/libexec/qt4/include -isystem /opt/local/libexec/qt4/include/QtGui -isystem /opt/local/libexec/qt4/include/QtXml -isystem /opt/local/libexec/qt4/include/QtCore -fno-exceptions -Wall -Werror=unused-function -Wno-sign-compare -Wno-strict-overflow -Wno-array-bounds -Wno-attributes -pipe -Os -fPIC -DPIC -std=c++0x -DNDEBUG -arch ppc -mmacosx-version-min=10.6   -D'QT_TRANSLATIONS_DIR="/opt/local/libexec/qt4/share/translations"' -D'LIB_DIR="../lib/"' -D'PLUGIN_DIR="../lib/lmms/"' -MD -MT src/CMakeFiles/lmmsobjs.dir/core/midi/MidiPort.cpp.o -MF CMakeFiles/lmmsobjs.dir/core/midi/MidiPort.cpp.o.d -o CMakeFiles/lmmsobjs.dir/core/midi/MidiPort.cpp.o -c /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiPort.cpp
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp: In member function 'virtual QString MidiApple::sourcePortName(const MidiEvent&) const':
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:157:41: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'const void*' [-Wformat=]
:info:build   157 |         qDebug("sourcePortName return '%s'?\n", event.sourcePort());
:info:build       |                                        ~^       ~~~~~~~~~~~~~~~~~~
:info:build       |                                         |                       |
:info:build       |                                         char*                   const void*
:info:build       |                                        %p
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp: In member function 'void MidiApple::openDevices()':
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:442:45: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
:info:build   442 |                 char * deviceName = getName(device);
:info:build       |                                             ^~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:401:31: note:   initializing argument 1 of 'char* getName(void*&)'
:info:build   401 | char *getName( MIDIObjectRef &object )
:info:build       |                ~~~~~~~~~~~~~~~^~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:458:56: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
:info:build   458 |                         qDebug("  Entity: %s", getName(entity));
:info:build       |                                                        ^~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:401:31: note:   initializing argument 1 of 'char* getName(void*&)'
:info:build   401 | char *getName( MIDIObjectRef &object )
:info:build       |                ~~~~~~~~~~~~~~~^~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:466:55: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
:info:build   466 |                                 char * name = getName(source);
:info:build       |                                                       ^~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:401:31: note:   initializing argument 1 of 'char* getName(void*&)'
:info:build   401 | char *getName( MIDIObjectRef &object )
:info:build       |                ~~~~~~~~~~~~~~~^~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:480:55: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
:info:build   480 |                                 char * name = getName(dest);
:info:build       |                                                       ^~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:401:31: note:   initializing argument 1 of 'char* getName(void*&)'
:info:build   401 | char *getName( MIDIObjectRef &object )
:info:build       |                ~~~~~~~~~~~~~~~^~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp: In static member function 'static void MidiApple::NotifyCallback(const MIDINotification*, void*)':
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:549:45: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long int' [-Wformat=]
:info:build   549 |         qDebug("MidiApple::NotifyCallback '%d'",message->messageID);
:info:build       |                                            ~^   ~~~~~~~~~~~~~~~~~~
:info:build       |                                             |            |
:info:build       |                                             int          long int
:info:build       |                                            %ld
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp: In member function 'char* MidiApple::getFullName(OpaqueMIDIEndpoint*&)':
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:615:37: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
:info:build   615 |         char * deviceName = getName(device);
:info:build       |                                     ^~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:401:31: note:   initializing argument 1 of 'char* getName(void*&)'
:info:build   401 | char *getName( MIDIObjectRef &object )
:info:build       |                ~~~~~~~~~~~~~~~^~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:616:39: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*'
:info:build   616 |         char * endPointName = getName(endpoint_ref);
:info:build       |                                       ^~~~~~~~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_multimedia_lmms/lmms/work/lmms-1.2.2/src/core/midi/MidiApple.cpp:401:31: note:   initializing argument 1 of 'char* getName(void*&)'
:info:build   401 | char *getName( MIDIObjectRef &object )
:info:build       |                ~~~~~~~~~~~~~~~^~~~~~
:info:build make[2]: *** [src/CMakeFiles/lmmsobjs.dir/core/midi/MidiApple.cpp.o] Error 1
:info:build make[2]: *** Waiting for unfinished jobs....

For now, I just disabled it. There is no explicit option for that, but I simply replaced a few defines (only specific to Apple Midi), adding && defined(__clang__).

We need to pick two commits also:

  1. My fix for GCC: https://github.com/LMMS/lmms/commit/a9d49d4ff70642c958380a0b2e4fc6180c1a1877
  2. Upstream fix for PPC detection: https://github.com/LMMS/lmms/commit/ae4d1b52e2b4f871a006a777d8dc4a2bae688329

And it works! (I run the binary from destroot here, since bundling script is broken.) https://user-images.githubusercontent.com/92015510/256976807-002be92f-333b-45fa-9c97-79ce1bcf242e.png

Change History (7)

comment:1 Changed 10 months ago by barracuda156

  1. S. Specifically, where Apple Midi is used and has to be disabled with GCC, unless fixed:

include/MidiApple.h

#ifndef MIDI_APPLE_H
#define MIDI_APPLE_H

#include "lmmsconfig.h"

#if defined(LMMS_BUILD_APPLE) && defined(__clang__)

src/core/midi/MidiApple.cpp

#include "MidiApple.h"

#if defined(LMMS_BUILD_APPLE) && defined(__clang__)

src/core/Mixer.cpp

#if defined(LMMS_BUILD_APPLE) && defined(__clang__)
    if (name == MidiApple::name())
    {
		return true;
    }
#endif
. . .
#if defined(LMMS_BUILD_APPLE) && defined(__clang__)
    printf( "trying midi apple...\n" );
    if( client_name == MidiApple::name() || client_name == "" )
    {
        MidiApple * mapple = new MidiApple;
        m_midiClientName = MidiApple::name();
        printf( "Returning midi apple\n" );
        return mapple;
    }
    printf( "midi apple didn't work: client_name=%s\n", client_name.toUtf8().constData());
#endif

src/gui/SetupDialog.cpp

#if defined(LMMS_BUILD_APPLE) && defined(__clang__)
    m_midiIfaceSetupWidgets[MidiApple::name()] =
                    MidiSetupWidget::create<MidiApple>( msw );
#endif

(Only the defined is modified in all these.)

comment:2 Changed 10 months ago by barracuda156

Description: modified (diff)

comment:3 Changed 10 months ago by barracuda156

Description: modified (diff)

comment:4 Changed 10 months ago by barracuda156

I reviewed my portfile, I had to disable jack for PPC, because it fails with ICE, and apparently that is broken for ages: #60420 #67794

So I have this:

if {${os.platform} eq "darwin" && ${configure.build_arch} in [list ppc ppc64]} {
    # See: https://github.com/jackaudio/jack2/issues/950
    configure.args-replace \
                        -DWANT_JACK=ON -DWANT_JACK=OFF
} else {
    depends_lib-append  port:jack
}

And C11/C++11 needed:

compiler.c_standard     2011
compiler.cxx_standard   2011

if {${os.platform} eq "darwin" && ${os.major} < 16} {
    configure.cxxflags-append \
                        -D_GLIBCXX_USE_CXX11_ABI=0
}

-D_GLIBCXX_USE_CXX11_ABI=0 is likely needed, but has to be verified. I also do not really know the OS version threshold – this is what was used earlier in folly port.

comment:5 Changed 10 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: luzpaz added

Has duplicate #67868.

Sergey, I realize I'm long overdue in updating this port, but I haven't looked into it at all yet and am not planning on looking into it right now. Looks like I haven't touched the port since 2015 so there's really no particular reason I should be the maintainer anymore. If you have a working update, please submit a PR and feel free to take over maintenance of the port if you like.

Last edited 10 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:6 in reply to:  5 Changed 10 months ago by barracuda156

Replying to ryandesign:

Has duplicate #67868.

Sergey, I realize I'm long overdue in updating this port, but I haven't looked into it at all yet and am not planning on looking into it right now. Looks like I haven't touched the port since 2015 so there's really no particular reason I should be the maintainer anymore. If you have a working update, please submit a PR and feel free to take over maintenance of the port if you like.

Got it, thank you. I will try. Upstream is actually very willing to help, so I think we could sort things out.

comment:7 Changed 10 months ago by barracuda156

Provisionally Midi is fixed, and we do not need to disable it. Building in the process.

UPD. Looks like everything fixed now.

Last edited 9 months ago by barracuda156 (previous) (diff)
Note: See TracTickets for help on using tickets.