Hello,
I want to create Flatpak for 3D Slicer.
Flatpak is a packaging and distributing desktop software on Linux.
https://www.flatpak.org/
I would like it to be submit to Flathub, an app store for Flatpak apps. Many Linux distros supported Flatpak. So I think it would be beneficial to package large software like 3D Slicer into Flatpak, it will make installing 3D Slicer quick and easy.
https://flathub.org/home
This is what I have been working on so far.
I build VTK 9.0.1 with the following flags,
> - -DVTK_BUILD_ALL_MODULES=OFF
> - -DBUILD_SHARED_LIBS=YES
> - -DOpenGL_GL_PREFERENCE=GLVND
> - -DVTK_WRAP_JAVA=OFF
> - -DVTK_WRAP_PYTHON=YES
> - -DCMAKE_BUILD_TYPE=Release
> - -DVTK_PYTHON_VERSION:STRING=3
> - -DVTK_GROUP_ENABLE_Qt=YES
> - -DVTK_GROUP_ENABLE_Views=YES
> - -DVTK_MODULE_ENABLE_VTK_GUISupportQt=YES
> - -DVTK_MODULE_ENABLE_VTK_RenderingContextOpenGL2=YES
> - -DVTK_MODULE_ENABLE_VTK_RenderingFreeTypeFontConfig=YES
> - -DVTK_MODULE_ENABLE_VTK_RenderingQt=YES
> - -DVTK_MODULE_ENABLE_VTK_GUISupportQtSQL=YES
> - -DVTK_MODULE_ENABLE_VTK_FiltersExtraction=YES
> - -DVTK_MODULE_ENABLE_VTK_FiltersFlowPaths=YES
> - -DVTK_MODULE_ENABLE_VTK_FiltersGeometry=YES
> - -DVTK_MODULE_ENABLE_VTK_FiltersParallel=YES
> - -DVTK_MODULE_ENABLE_VTK_IOExport=YES
> - -DVTK_MODULE_ENABLE_VTK_IOImage=YES
> - -DVTK_MODULE_ENABLE_VTK_IOLegacy=YES
> - -DVTK_MODULE_ENABLE_VTK_IOPLY=YES
> - -DVTK_MODULE_ENABLE_VTK_IOXML=YES
> - -DVTK_MODULE_ENABLE_VTK_ImagingMath=YES
> - -DVTK_MODULE_ENABLE_VTK_ImagingMorphological=YES
> - -DVTK_MODULE_ENABLE_VTK_ImagingStatistics=YES
> - -DVTK_MODULE_ENABLE_VTK_ImagingStencil=YES
> - -DVTK_MODULE_ENABLE_VTK_InteractionImage=YES
> - -DVTK_MODULE_ENABLE_VTK_RenderingVolumeOpenGL2=YES
> - -DVTK_MODULE_ENABLE_VTK_TestingRendering=YES
> - -DVTK_MODULE_ENABLE_VTK_ViewsQt=YES
> - -DVTK_MODULE_ENABLE_VTK_zlib=YES
And Slicer with this,
> - -DCMAKE_BUILD_TYPE:STRING=Release
> - -DSlicer_SUPERBUILD:BOOL=OFF
When building 3D Slicer, I got this error.
> -- Setting C++ standard
> -- Setting C++ standard - C++11
> -- The C compiler identification is GNU 10.2.0
> -- The CXX compiler identification is GNU 10.2.0
> -- Detecting C compiler ABI info
> -- Detecting C compiler ABI info - done
> -- Check for working C compiler: /usr/bin/cc - skipped
> -- Detecting C compile features
> -- Detecting C compile features - done
> -- Detecting CXX compiler ABI info
> -- Detecting CXX compiler ABI info - done
> -- Check for working CXX compiler: /usr/bin/c++ - skipped
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> -- Checking if --no-as-needed linker flag is required
> -- Checking if --no-as-needed linker flag is required - yes
> -- Check if the system is big endian
> -- Searching 16 bit integer
> -- Looking for sys/types.h
> -- Looking for sys/types.h - found
> -- Looking for stdint.h
> -- Looking for stdint.h - found
> -- Looking for stddef.h
> -- Looking for stddef.h - found
> -- Check size of unsigned short
> -- Check size of unsigned short - done
> -- Searching 16 bit integer - Using unsigned short
> -- Check if the system is big endian - little endian
> -- Could NOT find Subversion (missing: Subversion_SVN_EXECUTABLE)
> -- Found Git: /usr/bin/git
> -- Found Patch: /usr/bin/patch
> -- Configuring Slicer organization domain [www.na-mic.org]
> -- Configuring Slicer organization name [NA-MIC]
> -- Configuring Slicer default home module [Welcome]
> -- Configuring Slicer default favorite modules [Data, Volumes, Models, Transforms, Markups, SegmentEditor]
> -- Configuring Slicer text of disclaimer at startup [Thank you for using %1!<br><br>This software is not intended for clinical use.]
> -- Configuring Slicer release type [Experimental]
> CMake Warning (dev) at CMake/SlicerMacroExtractRepositoryInfo.cmake:94 (message):
> Skipping repository info extraction: directory [/run/build/Slicer] is not a
> GIT or SVN checkout
> Call Stack (most recent call first):
> CMake/SlicerVersion.cmake:55 (SlicerMacroExtractRepositoryInfo)
> CMakeLists.txt:183 (include)
> This warning is for project developers. Use -Wno-dev to suppress it.
>
> -- Configuring Slicer version [4.11.20210226-0000-00-00]
> -- Configuring Slicer revision [0]
> CMake Warning (dev) at CMake/SlicerMacroExtractRepositoryInfo.cmake:94 (message):
> Skipping repository info extraction: directory [/run/build/Slicer] is not a
> GIT or SVN checkout
> Call Stack (most recent call first):
> CMake/SlicerVersion.cmake:99 (SlicerMacroExtractRepositoryInfo)
> CMakeLists.txt:183 (include)
> This warning is for project developers. Use -Wno-dev to suppress it.
>
> -- Checking to see if CXX compiler accepts flag -fdiagnostics-show-option
> -- Checking to see if CXX compiler accepts flag -fdiagnostics-show-option - yes
> -- Checking to see if CXX compiler accepts flag -Wl,--no-undefined
> -- Checking to see if CXX compiler accepts flag -Wl,--no-undefined - yes
> -- Checking to see if CXX compiler accepts flag -fstack-protector-all
> -- Checking to see if CXX compiler accepts flag -fstack-protector-all - yes
> -- Configuring VTK
> -- Slicer_VTK_RENDERING_BACKEND is OpenGL2
> -- Slicer_VTK_SMP_IMPLEMENTATION_TYPE is Sequential
> -- Slicer_VTK_VERSION_MAJOR is 8
> -- Looking for pthread.h
> -- Looking for pthread.h - found
> -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
> -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
> -- Looking for pthread_create in pthreads
> -- Looking for pthread_create in pthreads - not found
> -- Looking for pthread_create in pthread
> -- Looking for pthread_create in pthread - found
> -- Found Threads: TRUE
> -- Configuring Slicer with Qt 5.15.2 (using modules: Core, Widgets, Multimedia, Network, OpenGL, PrintSupport, UiTools, Xml, XmlPatterns, Svg, Sql, WebEngine, WebEngineWidgets, WebChannel, Script, Test, )
> -- Setting QT_PLUGINS_DIR: /usr/lib/plugins
> -- Setting QT_BINARY_DIR: /usr/lib/bin
> --
> -- Forcing Slicer_USE_SYSTEM_QT to ON (Qt5_DIR [/usr/lib/x86_64-linux-gnu/cmake/Qt5] associated with a system location: /usr/lib/)
> --
> -- Setting ExternalData_OBJECT_STORES to '/run/build/Slicer/_flatpak_build/ExternalData/Objects'
> -- Configuring Slicer for [linux-amd64]
> -- Using system QT
> -- Found X11: /usr/include
> -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
> -- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
> -- Looking for gethostbyname
> -- Looking for gethostbyname - found
> -- Looking for connect
> -- Looking for connect - found
> -- Looking for remove
> -- Looking for remove - found
> -- Looking for shmat
> -- Looking for shmat - found
> -- Looking for IceConnectionNumber in ICE
> -- Looking for IceConnectionNumber in ICE - found
> -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so found components: OpenGL GLX
> -- Found Python3: /usr/bin/python3.8 (found suitable version "3.8.7", minimum required is "3.8") found components: Interpreter Development.Module Development.Embed
> -- Found FontConfig: /usr/lib/x86_64-linux-gnu/libfontconfig.so
> CMake Error at CMakeLists.txt:813 (find_package):
> Found package configuration file:
>
> /app/lib/cmake/vtk-9.0/vtk-config.cmake
>
> but it set VTK_FOUND to FALSE so package "VTK" is considered to be NOT
> FOUND. Reason given by package:
>
> Could not find the VTK package with the following required components:
> GUISupportQtOpenGL.
>
>
>
> -- Configuring incomplete, errors occurred!
It does not found GUISupportQtOpenGL. I assume that there are patch that were applied to when superbuild is enable to VTK that fix the issue?
For Flatpak, superbuild are difficult to package, since superbuild will try to download packages, it will fail because Flathub does not allow that.
Are there patch file (.patch) that I can use? I can manually patch it.
Relate? GUISupportQtOpenGL is deprecated in VTK9 · Issue #5339 · Slicer/Slicer · GitHub
Thanks
Andy