Qt package guidelines
QT Applications have build steps nativly like this:
$ qmake $ make $ make install
On the other hand, PantherX has some Build Systems for C/C++ packages:
configure & make & make install.
cmake & make & make install.
qmake & make & make install.
trivial-build-system: Every thing should be defined in the package definition.
With above descriptions, for packaging a Qt Application For PantherX we should select 1., 2. or 3. and customize/replace some steps in guix build system.
We can replace some steps in package building/installation. Here is a piece of package definition. In this sample the
gnu-build-system used. And generally two things added to the package definition:
At this step we should run
qmake - with needed parameters.
Adding some instruction for correcting the installation path, before starting the
At this step we should modify the installation path in Makefile(s). In this example the
(substitute* ....) method used for replacing the
(build-system gnu-build-system) (arguments `(#:phases (modify-phases %standard-phases (replace 'configure (lambda _ (invoke "qmake" "CONFIG+=without_djvu without_cups" "qpdfview.pro"))) ;; Installation process hard-codes "/usr/bin", possibly ;; prefixed. (add-before 'install 'fix-install-directory (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) (substitute* "Makefile.pdf-plugin" (("\\$\\(INSTALL_ROOT\\)/usr") out)) (substitute* "Makefile.ps-plugin" (("\\$\\(INSTALL_ROOT\\)/usr") out)) (substitute* "Makefile.image-plugin" (("\\$\\(INSTALL_ROOT\\)/usr") out)) (substitute* "Makefile.application" (("\\$\\(INSTALL_ROOT\\)/usr") out)) #t))) )))
If you developed one application which is using the
QtWebEngine library, you should update the path of
QtWebEngineProcess in the package definition, like the example:
... (arguments `(#:phases (modify-phases %standard-phases (add-after 'install 'wrap ;; The program fails to find the QtWebEngineProcess program, ;; so we set QTWEBENGINEPROCESS_PATH to help it. (lambda* (#:key inputs outputs #:allow-other-keys) (let ((bin (string-append (assoc-ref outputs "out") "/bin")) (qtwebengineprocess (string-append (assoc-ref inputs "qtwebengine") "/lib/qt5/libexec/QtWebEngineProcess"))) (for-each (lambda (program) (wrap-program program `("QTWEBENGINEPROCESS_PATH" = (,qtwebengineprocess)))) (find-files bin ".*"))) #t))))) ...
You can find many examples in upstream. It’s enough to search
qtwebengine in upstream guix package repository.