diff options
author | Daniel Bermond | 2021-08-03 18:05:01 +0000 |
---|---|---|
committer | Daniel Bermond | 2021-08-03 18:05:01 +0000 |
commit | cb38b485b3373063821efbff7ef9ce6d27954724 (patch) | |
tree | 191747af800ad75d26b145311004fe895de95f03 | |
download | aur-cb38b485b3373063821efbff7ef9ce6d27954724.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 23 | ||||
-rw-r--r-- | 010-qt-jpegxl-image-plugin-add-qt6-support.patch | 42 | ||||
-rw-r--r-- | PKGBUILD | 43 |
3 files changed, 108 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..f71709c21606 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,23 @@ +pkgbase = qt6-jpegxl-image-plugin-git + pkgdesc = Qt6 plug-in to allow Qt6 and KDE based applications to read/write JXL images (git version) + pkgver = 0.2.0.r0.geb424dd + pkgrel = 1 + url = https://github.com/novomesk/qt-jpegxl-image-plugin/ + arch = x86_64 + license = GPL3 + checkdepends = appstream + makedepends = git + makedepends = cmake + makedepends = extra-cmake-modules + makedepends = highway + makedepends = vulkan-headers + depends = libjxl + depends = qt6-base + provides = qt6-jpegxl-image-plugin + conflicts = qt6-jpegxl-image-plugin + source = git+https://github.com/novomesk/qt-jpegxl-image-plugin.git + source = 010-qt-jpegxl-image-plugin-add-qt6-support.patch + sha256sums = SKIP + sha256sums = 2058af22093781d6d675372fc177090416f667235d49342657c14b403f66271d + +pkgname = qt6-jpegxl-image-plugin-git diff --git a/010-qt-jpegxl-image-plugin-add-qt6-support.patch b/010-qt-jpegxl-image-plugin-add-qt6-support.patch new file mode 100644 index 000000000000..335e3fa9c63d --- /dev/null +++ b/010-qt-jpegxl-image-plugin-add-qt6-support.patch @@ -0,0 +1,42 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,7 +20,15 @@ include(KDECMakeSettings) + include(CheckIncludeFiles) + + set(REQUIRED_QT_VERSION 5.14.0) +-find_package(Qt5Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) ++string(REGEX MATCH "^[0-9]" REQUIRED_QT_MAJOR "${REQUIRED_QT_VERSION}") ++set(QT_MAJOR ${REQUIRED_QT_MAJOR} CACHE STRING "Qt major version to use") ++ ++if(QT_MAJOR GREATER_EQUAL ${REQUIRED_QT_MAJOR}) ++ message(STATUS "Info: building with Qt${QT_MAJOR}") ++ find_package(Qt${QT_MAJOR}Gui ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE) ++else() ++ message(FATAL_ERROR "Qt major version must be at least ${REQUIRED_QT_MAJOR}") ++endif() + + include(FindPkgConfig) + pkg_check_modules(LibJXL REQUIRED IMPORTED_TARGET libjxl>=0.5.0) +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -18,16 +18,16 @@ function(kimageformats_add_plugin plugin) + add_library(${plugin} MODULE ${KIF_ADD_PLUGIN_SOURCES}) + set_property(TARGET ${plugin} APPEND PROPERTY AUTOGEN_TARGET_DEPENDS ${json}) + set_target_properties(${plugin} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/imageformats") +- target_link_libraries(${plugin} Qt5::Gui) ++ target_link_libraries(${plugin} Qt${QT_MAJOR}::Gui) + install(TARGETS ${plugin} DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/imageformats) + endfunction() + + ################################## + + if (LibJXL_FOUND) +- kimageformats_add_plugin(libqjpegxl JSON "jpegxl.json" SOURCES "main.cpp" "qjpegxlhandler.cpp") +- target_link_libraries(libqjpegxl PkgConfig::LibJXL PkgConfig::LibJXLThreads) +- install(FILES jxl.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/) ++ kimageformats_add_plugin(libqjpegxl-qt${QT_MAJOR} JSON "jpegxl.json" SOURCES "main.cpp" "qjpegxlhandler.cpp") ++ target_link_libraries(libqjpegxl-qt${QT_MAJOR} PkgConfig::LibJXL PkgConfig::LibJXLThreads) ++ install(FILES jxl.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR}/qimageioplugins/ RENAME jxl-qt${QT_MAJOR}.desktop) + endif() + + ################################## diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..aaec674c7bdb --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,43 @@ +# Maintainer: Daniel Bermond <dbermond@archlinux.org> + +pkgname=qt6-jpegxl-image-plugin-git +pkgver=0.2.0.r0.geb424dd +pkgrel=1 +pkgdesc='Qt6 plug-in to allow Qt6 and KDE based applications to read/write JXL images (git version)' +arch=('x86_64') +url='https://github.com/novomesk/qt-jpegxl-image-plugin/' +license=('GPL3') +depends=('libjxl' 'qt6-base') +makedepends=('git' 'cmake' 'extra-cmake-modules' 'highway' 'vulkan-headers') +checkdepends=('appstream') +provides=('qt6-jpegxl-image-plugin') +conflicts=('qt6-jpegxl-image-plugin') +source=('git+https://github.com/novomesk/qt-jpegxl-image-plugin.git' + '010-qt-jpegxl-image-plugin-add-qt6-support.patch') +sha256sums=('SKIP' + '2058af22093781d6d675372fc177090416f667235d49342657c14b403f66271d') + +prepare() { + patch -d qt-jpegxl-image-plugin -Np1 -i "${srcdir}/010-qt-jpegxl-image-plugin-add-qt6-support.patch" +} + +pkgver() { + git -C qt-jpegxl-image-plugin describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//' +} + +build() { + cmake -B build -S qt-jpegxl-image-plugin \ + -DCMAKE_BUILD_TYPE:STRING='None' \ + -DCMAKE_INSTALL_PREFIX:PATH='/usr' \ + -DQT_MAJOR:STRING='6' \ + -Wno-dev + make -C build +} + +check() { + make -C build test +} + +package() { + make -C build DESTDIR="$pkgdir" install +} |