What is the "official" way of building in 2020?

Hi,

I plan to start jumping on code and start to see if I could solve some issues, as I’ve some years of Qt dev behind me.

So I cloned the repo, and followed README that pointed out to use Qt-designer. But in the SDK note page there’s a mention indicating The Linux SDK has been discontinued for now.

So I used the build script scripts/build-shotcut.sh but came across and errror.

If this way of building is the “good” way of building,

  • would you accept a PR to point out this way of building ? (instead of qmake, make)
  • where can I ask for help in build process ? Do you consider that build problems when using this script can lead to bug reports on Github ? Or do we use forum for this kind of problems ?

Thanks a lot !

ps: this is probably more oriented to devs @shotcut
pps: I’ve seen this promising work using cmake, I think I’ll try it

1 Like

scripts/build-shotcut.sh is what our nightly and release builds use. However, some developers do use it as part of their cycle. You can use it to install some dependencies and then do whatever you want for the Shotcut code.

pps: I’ve seen this promising work using cmake, I think I’ll try it

Neither main developers have used that. Only the guy who maintains the flatpak.

I strongly encourage to work through the error with the build script, and try to get it working without changing the script.

where can I ask for help in build process ?

You can ask in this thread, but keep in mind that I treat figuring out how to build mainly as an exercise and test for the would-be contributor.

Do you consider that build problems when using this script can lead to bug reports on Github ?

No, because the script is currently gospel as I explained. What are you doing wrong?

Thank you for your answer.

Thanks, that’s why I figured out. But as I didn’t got the script working, I wanted to give a try (didn’t succeeded, as I do not know the cmake process, and the guy hasn’t updated doc).

This is a good question :thinking:
Here are the steps I did:

  • git clone GitHub - mltframework/shotcut: cross-platform (Qt), open-source (GPLv3) video editor
  • cd shotcut
  • ./scripts/build-shotcut.sh
  • => configure failed due to missing yasm
  • I installed yasm and started script again
  • I got some errors because of non-clean git repos. For each one I deleted corresponding ~/shotcut/src/[repo_name] (is the script reentrant ?)
  • I finaly got to the point of something is starting to compile, but the compile fails for x264 because of the lack of nasm
  • I installed nasm and started script again
  • as before I got some dirty git repo errors that I fixed with
    rm -rf ~/shotcut/src/nv-codec-headers
    rm -rf ~/shotcut/src/bigsh0t
  • I launched the script again, waited for tar --exclude-vcs -cJf /home/bruno/shotcut/src.txz src (I don’t know exactly why there’s a tar creation during the compilation process)
  • => x264 compilation failed because of missing libeigen3-dev (in my Debian-derived system) package
  • I launched the script again, and after some tries I ended with:
LOG: About to run command: cd src/modules
LOG: MLTDISABLED <b>gdk</b> : this is an <b>optional</b> module that provides ... dunno ... . To enable it, try installing a package called something like ... dunno ....
LOG: MLTDISABLED <b>gtk2</b> : this is an <b>optional</b> module that provides some additional image loading support. To enable it, try installing a package called something like libgtk2-dev?.
LOG: MLTDISABLED <b>jackrack</b> : this is an <b>optional</b> module that provides sound effects/operations. To enable it, try installing a package called something like libjack-dev.
LOG: MLTDISABLED <b>lumas</b> : this is an <b>optional</b> module that provides ... dunno ... . To enable it, try installing a package called something like ... dunno ....
LOG: MLTDISABLED <b>ndi</b> : this is an <b>optional</b> module that provides ... dunno ... . To enable it, try installing a package called something like ... dunno ....
LOG: MLTDISABLED <b>opencv</b> : this is an <b>optional</b> module that provides ... dunno ... . To enable it, try installing a package called something like ... dunno ....
LOG: MLTDISABLED <b>sdl</b> : this is an <b>optional</b> module that provides ... dunno ... . To enable it, try installing a package called something like ... dunno ....
LOG: MLTDISABLED <b>sox</b> : this is an <b>optional</b> module that provides sound effects/operations. To enable it, try installing a package called something like sox-dev.
LOG: MLTDISABLED <b>swfdec</b> : this is an <b>optional</b> module that provides ... dunno ... . To enable it, try installing a package called something like ... dunno ....
ERROR: One or more required MLT modules could not be enabled
LOG: Process has finished. Reason: FAILURE Some kind of error occurred: One or more required MLT modules could not be enabled

And now it’s almost 2am and I really have to sleep :slight_smile: So I’ll continue this adventure tomorrow.
Thanks again for your time !

I also recommend that you push forward with build-shotcut.sh. That will give you a good environment with all the dependencies.

Here are some suggestions:

Create a file called build-shotcut.conf in the same directory as the script.

For the first build, set:

  • INSTALL_DIR=$PWD
  • AUTO_APPEND_DATE=0
  • SOURCE_DIR="$INSTALL_DIR/src"
  • ACTION_GET_COMPILE_INSTALL=1
  • ACTION_GET_ONLY=0
  • ACTION_COMPILE_INSTALL=0
  • CLEANUP=0
  • ARCHIVE=0
  • SOURCES_CLEAN=0
  • SOURCES_CONFIGURE=1
  • INSTALL_AS_ROOT=0
  • ASAN_BUILD=0
  • CREATE_STARTUP_SCRIPT=1
  • DEBUG_BUILD=1

After everything has built, if you want just a compile/run workflow for shotcut, change the following:

  • ACTION_GET_COMPILE_INSTALL=0
  • ACTION_COMPILE_INSTALL=1
  • SOURCES_CONFIGURE=0
  • CREATE_STARTUP_SCRIPT=0
  • SUBDIRS=“shotcut”

If you get stuck on an error, feel free to ask here for help. As I recall, I had to hand-jam an old deb file on Ubuntu to resolve a link error.

Thanks a lot @brian. I’ve indeed seen in the script that there was a mention to an external config file but I didn’t go further.

I’ve created this config file in the same folder as the script one and started the script with those params but this didn’t changed the error that blocked me:

LOG: About to run command: cd src/modules
LOG: MLTDISABLED <b>gdk</b> : this is an <b>optional</b> module that provides ... dunno ... . To enable it, try installing a package called something like ... dunno ....
LOG: MLTDISABLED <b>gtk2</b> : this is an <b>optional</b> module that provides some additional image loading support. To enable it, try installing a package called something like libgtk2-dev?.
LOG: MLTDISABLED <b>jackrack</b> : this is an <b>optional</b> module that provides sound effects/operations. To enable it, try installing a package called something like libjack-dev.
LOG: MLTDISABLED <b>lumas</b> : this is an <b>optional</b> module that provides ... dunno ... . To enable it, try installing a package called something like ... dunno ....
LOG: MLTDISABLED <b>ndi</b> : this is an <b>optional</b> module that provides ... dunno ... . To enable it, try installing a package called something like ... dunno ....
LOG: MLTDISABLED <b>opencv</b> : this is an <b>optional</b> module that provides ... dunno ... . To enable it, try installing a package called something like ... dunno ....
LOG: MLTDISABLED <b>sdl</b> : this is an <b>optional</b> module that provides ... dunno ... . To enable it, try installing a package called something like ... dunno ....
LOG: MLTDISABLED <b>sox</b> : this is an <b>optional</b> module that provides sound effects/operations. To enable it, try installing a package called something like sox-dev.
LOG: MLTDISABLED <b>swfdec</b> : this is an <b>optional</b> module that provides ... dunno ... . To enable it, try installing a package called something like ... dunno ....
ERROR: One or more required MLT modules could not be enabled
LOG: Process has finished. Reason: FAILURE Some kind of error occurred: One or more required MLT modules could not be enabled

Any clue on this ? As far as I understand this error message, I understand it as:

  • here is a list of optional modules (gdk, jacktrack, lumas, etc) that are not found (but I don’t really care as they are optional, isn’t it ?)
  • there are “One or more required MLT modules” could not be enabled, I suppose this is because there’re not found

So there are missing modules. But where is the list of those missing required modules ?

@shotcut ? Do you have any clues ?

Thanks a lot

Some self-discovery might be required in this case. I would recommend to install:

  • libjack-dev
  • sox-dev

The sox module says it is optional, but it is an incorrect message

Thank you. I suspected something like that, but (if I understood correctly) as I’m a kind of beta-tester external newcomer I thought you would be interested to know where I’ve been stucked.

Next episode coming soon … :slight_smile:

If you don’t mind me asking, what do you plan on tackling? :slightly_smiling_face:

I planned to try to propose to the team an implementation of markers (because this is on the readmap, but it’s a priority for me, and it looks like a “quite simlpe” one).

Note that I’m totally aware that I’m probably totally wrong by thinking that this is a more or less “easy pieck” :wink:

Actually, looking into this more, sox should be optional as Shotcut is not using anything from it. However, our builds include it for sake of a more comprehensive build of MLT (some people use things from MLT from Shotcut builds outside of Shotcut). I will change the script to make this dependency truly optional.

I planned to try to propose to the team an implementation of markers

That is not easy for someone new to Shotcut code. You are better off trying to fix some bugs first to learn. I found that is one of the easiest way to learn.
If you want markers now, add a video track, make it not visible, and add a color clip to it. Then, you can copy and paste this color clip as-needed. You can change independently the color, duration, and name of these color clips as well. There are some finer points of that you might want to look into. For example, today if you double-click a clip it selects and seeks to its start (good). However, that does not work when you double-click the clip’s trim handle on the left or right edge of the clip. That makes using a short color clip as a marker less usable.

Thanks @shotcut. Indeed, I’ve seen this technique explained somewhere on the forum. I started to try using it, but it’s really not easy to use

Thanks. I installed libsox-dev and I can now progress one step ahead on MLT compilation and the next error is:

make[1]: Entering directory '/home/bruno/shotcut/src/mlt/src/melt'
cc -I/home/bruno/shotcut/Shotcut/Shotcut.app/include -DNDEBUG -DARCH_X86_64 -Wall -DPIC   -O2 -pipe -fno-tree-dominator-opts -fno-tree-pre -ffast-math -DUSE_MMX -mmmx -DUSE_SSE -msse -DUSE_SSE2 -msse2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -DARCH_X86_64 -Wall -DPIC   -O2 -pipe -fno-tree-dominator-opts -fno-tree-pre -ffast-math -DUSE_MMX -mmmx -DUSE_SSE -msse -DUSE_SSE2 -msse2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -I.. -rdynamic -DVERSION=\"6.25.0\" -DHAVE_SDL2 -D_REENTRANT -I/usr/include/SDL2   -c -o melt.o melt.c
cc -I/home/bruno/shotcut/Shotcut/Shotcut.app/include -DNDEBUG -DARCH_X86_64 -Wall -DPIC   -O2 -pipe -fno-tree-dominator-opts -fno-tree-pre -ffast-math -DUSE_MMX -mmmx -DUSE_SSE -msse -DUSE_SSE2 -msse2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -DARCH_X86_64 -Wall -DPIC   -O2 -pipe -fno-tree-dominator-opts -fno-tree-pre -ffast-math -DUSE_MMX -mmmx -DUSE_SSE -msse -DUSE_SSE2 -msse2 -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fPIC -pthread -I.. -rdynamic -DVERSION=\"6.25.0\" -DHAVE_SDL2 -D_REENTRANT -I/usr/include/SDL2   -c -o io.o io.c
cc -o melt melt.o io.o -L/home/bruno/shotcut/Shotcut/Shotcut.app/lib -Wl,--no-undefined -Wl,--as-needed -Wl,--no-undefined -Wl,--as-needed -L../framework -lmlt -lpthread -lSDL2
make[1]: Leaving directory '/home/bruno/shotcut/src/mlt/src/melt'
qimage_wrapper.cpp:177:35: error: missing binary operator before token "("
  177 | #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
      |                                   ^
qimage_wrapper.cpp:188:34: error: missing binary operator before token "("
  188 | #if QT_VERSION < QT_VERSION_CHECK(5, 5, 0)
      |                                  ^
qimage_wrapper.cpp:428:35: error: missing binary operator before token "("
  428 | #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0)
      |                                   ^
consumer_qglsl.cpp:25:34: error: missing binary operator before token "("
   25 | #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
      |                                  ^
consumer_qglsl.cpp:157:34: error: missing binary operator before token "("
  157 | #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
      |                                  ^
consumer_qglsl.cpp:181:34: error: missing binary operator before token "("
  181 | #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
      |                                  ^
consumer_qglsl.cpp:208:34: error: missing binary operator before token "("
  208 | #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
      |                                  ^
make[2]: *** [Makefile:60: depend] Error 1
make[1]: *** [Makefile:5: depend] Error 1
make: *** [Makefile:9: all] Error 1
ERROR: Unable to build mlt
LOG: Process has finished. Reason: FAILURE Some kind of error occurred: Unable to build mlt

This is strange, I understand it as a syntax error in precompiler directives :thinking:
Anyone had this issue before ?

I tried to fix it by adding #include <QtGlobal> in qimage_wrapper.cpp but the script complains about local changes.
Is there a way to disable local changes check ? (in the meanwhile I’ve added a commit but this is not really clean)

My first guess would be that it is not finding the QtGlobal header file it needs.

Do you have this file in exactly this location?
/home/bruno/Qt/5.15.1/gcc_64/include/QtCore/QtGlobal

If not, you should download and install Qt from the Qt website and install in your home directory.

If you have gotten this far in the process, you can flop these around so that it quits trying to download the code every time:
ACTION_GET_COMPILE_INSTALL=0
ACTION_COMPILE_INSTALL=1

Thank you for your answer

No ! But I have ~/Qt/5.9.7/gcc_64/include/QtCore/QtGlobal. So I suppose I shouldn’t have followed Shotcut - How To Use the Linux SDK to downloaded “Our special build of the Qt 5.9.7 SDK that includes QtWebKit” ?

I’ll try with Qt v5.15.1

Thanks, I’ll give it a try.
It would be awesome to have some comments after each script config constant to understand how to combine then by the way.

I’ll try this and let you informed.

Thanks again

Unfortunately, that instruction is outdated. No special build required. Just install the Qt build into the location.

Feel free to add some breadcrumbs as you go so that someone in the future can follow them.

Thanks for your patience. It is worth it in the end!

I tried this but I didn’t noticed any difference: I still have to rm -rf ~/shotcut/src/bigsh0t; rm -rf ~/shotcut/src/nv-codec-headers before launching the script to workaround the git changes error, and I’m still waiting for a time (that appears to be infinite :s) for tar --exclude-vcs -cJf /home/bruno/shotcut/src.txz src command to achieve (why a tar is made before compilation ?), then still waiting for h264, libavfilter and so to compile.

The fact that you use a custom script instead of standard tools make the compilation really complex, and the comprehension of the script is really not easy (I hope the main Shotcut code is more documented :wink: ).

Yes I took notes of all that I’ve done to make some notes somewhere. But I’d absolutely not be able to write anything about those script’s globals as it’s really obscure to me.

This makes me think that your configuration file is not working. Please recheck the instructions here:

Setting ACTION_GET_COMPILE_INSTALL=0 will cause it to not download (clone) sources
Setting ARCHIVE=0 will cause it to skip the tar step.

You should have two files in a directory:

  • build-shotcut.sh
  • build-shotcut.conf

Within that directory, run ./build-shotcut.sh
build-shotcut.sh will load the parameters from build-shotcut.conf
Some inspection may be required to determine why that is not working for you.

You should set your expectations now so you are no disappointed later. Shotcut does not have an army of contributors. So there is not a lot of convenience available in scripting and documentation. But Dan and I are happy to help people who put in a reasonable effort themselves (as you are now). We genuinely welcome help in this area.