You are not logged in.
I'm trying to package pdf4qt.
I cam up with the following PKGBUILD
# Maintainer: XXX <YYY>
pkgname=pdf4qt-git
pkgver=1.3.6.r58.gb358056
pkgrel=1
pkgdesc="Open source PDF editor"
arch=('x86_64')
url="https://jakubmelka.github.io/"
license=('LGPL3')
depends=('openssl'
'libjpeg-turbo'
'qt6-speech'
'qt6-svg'
'qt6-base'
'openjpeg2'
'onetbb'
'lcms2'
'freetype2'
'zlib'
'glibc'
'gcc-libs'
)
makedepends=('git'
'cmake'
'qt6-declarative'
'qt6-multimedia'
)
optdepends=(
'flite: Text-To-Speech using flite synthesizer',
'libspeechd: Text-To-Speech using speechd synthesizer'
)
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=(
"$pkgname"::'git+https://github.com/JakubMelka/PDF4QT'
'CMakeListsMain.patch'
'CMakeListsLib.patch'
'FindLCMS2.cmake'
)
sha256sums=('SKIP'
'75d2807ac8dbc3a0c77eff47de2f71df775ddf47eeaf87e155a5b34b528ad30c'
'd53ecb1906965453b38e7b0e75495f60ee9da141162f39b02ba18ae6885ab31d'
'fb438faf87211cf3c21c6fa624cedd2ec6af49b03827e1ad230e0202e939a8ec')
pkgver() {
cd "$srcdir/$pkgname"
git describe --tags --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd "$srcdir/$pkgname"
patch -p1 -i "$srcdir/CMakeListsMain.patch"
patch -p1 -i "$srcdir/CMakeListsLib.patch"
}
build() {
cmake -B build -S "$pkgname" \
-DCMAKE_BUILD_TYPE='None' \
-DCMAKE_INSTALL_PREFIX='/' \
-Wno-dev \
-DCMAKE_MODULE_PATH="$srcdir" \
-DPDF4QT_INSTALL_DEPENDENCIES=0 \
-DCMAKE_PREFIX_PATH=/usr/lib
cmake --build build
}
package() {
DESTDIR="$pkgdir" cmake --install build
}
But when I makepkg, I obtain the following error:
==> Starting build()...
-- Build type - CMAKE_BUILD_TYPE: None
CMake Error at CMakeLists.txt:69 (find_package):
By not providing "Findlcms.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "lcms", but
CMake did not find one.
Could not find a package configuration file provided by "lcms" with any of
the following names:
lcmsConfig.cmake
lcms-config.cmake
Add the installation prefix of "lcms" to CMAKE_PREFIX_PATH or set
"lcms_DIR" to a directory containing one of the above files. If "lcms"
provides a separate development package or SDK, be sure it has been
installed.
-- Configuring incomplete, errors occurred!
==> ERROR: A failure occurred in build().
Aborting...
It looks like the extra-cmake-modules package miss a module for lcms2.
What is the suggested way to solve this?
Last edited by raffaem (2023-12-23 20:00:09)
Offline
For whatever reason, you have chosen to ignore installing vcpkg...
Offline
vcpkg will compile all the dependencies from source files. This will lead to a compilation time of approximately 1 hour on my machine, approximately 40 GB between sources and binaries, and will not share the libraries with the system installed ones.
Since all the dependencies are already provided by the distribution, I find no reason to download them via vcpkg.
The only "problematic" dependency is lcms2, which I temporarily fixed by providing my own FindLCMS2.cmake (https://aur.archlinux.org/cgit/aur.git/ … pdf4qt-git).
I'm wondering whether I should open a ticket in extra-cmake-modules to provide this missing CMake module.
Last edited by raffaem (2023-12-30 05:46:05)
Offline
Also, notice that "all dependencies" include the Qt libraries, whose compilation require a really long time.
Offline
The dependency seems rather https://aur.archlinux.org/packages/lcms ?
Online
It is, but my understanding is that the related CMake modules are provided by extra-cmake-modules?
It isn't. It's this one: https://archlinux.org/packages/extra/x86_64/lcms2/
Last edited by raffaem (2023-12-30 05:46:24)
Offline
Then why is it trying to find lcms and not lcms2?
And how does that relate to the FindLCMS2.cmake you provide - doesn't the error go away with that?
Online
And how does that relate to the FindLCMS2.cmake you provide - doesn't the error go away with that?
https://aur.archlinux.org/packages/pdf4qt-git needed the following change to build locally in a clean chroot:
diff --git a/PKGBUILD b/PKGBUILD
index 264a62d..82df1f5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
# Maintainer: Raffaele Mancuso <raffaelemancuso532 at gmail dot com>
pkgname=pdf4qt-git
-pkgver=1.3.6.r65.g53849f5
+pkgver=1.3.6.r75.gd6e5dd2
pkgrel=1
pkgdesc="Open source PDF editor"
arch=('x86_64')
@@ -48,6 +48,7 @@ pkgver() {
prepare() {
cd "$srcdir/$pkgname"
+ sed -i 's/LICENSE.txt/LICENSE.md/' Pdf4QtViewer/pdf4qtviewer.qrc
patch -p1 -i "$srcdir/CMakeListsMain.patch"
patch -p1 -i "$srcdir/CMakeListsLib.patch"
}
Offline
LCMS2 seems to use meson and eg. gwenview and openjpeg ship their own cmake modules for it:
https://github.com/KDE/gwenview/blob/ma … CMS2.cmake
https://github.com/uclouvain/openjpeg/b … CMS2.cmake
So your approach is normal, but you can oc. file an upstream bug to include a variant of that (likely the gwenview one) into extra-cmake-modules:
https://bugs.kde.org/buglist.cgi?compon … esolution=---
Online
Then why is it trying to find lcms and not lcms2?
I guess the distribution of the author call "lcms" the last version of lcms.
And how does that relate to the FindLCMS2.cmake you provide - doesn't the error go away with that?
Yes it does go away with that
Last edited by raffaem (2023-12-30 16:23:51)
Offline