summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO33
-rw-r--r--.gitignore5
-rw-r--r--CMakeDesktopNoDep.patch24
-rw-r--r--CMakePatch.patch43
-rw-r--r--FindLCMS2.cmake105
-rw-r--r--LICENSE.txt165
-rw-r--r--PKGBUILD62
7 files changed, 437 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..c9afd0caf655
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,33 @@
+pkgbase = pdf4qt-git
+ pkgdesc = Open source PDF editor
+ pkgver = r849.198b8a5
+ pkgrel = 1
+ url = https://jakubmelka.github.io/
+ arch = x86_64
+ license = LGPL3
+ makedepends = git
+ makedepends = cmake
+ depends = openssl
+ depends = libjpeg-turbo
+ depends = qt6-speech
+ depends = qt6-svg
+ depends = qt6-base
+ depends = openjpeg2
+ depends = onetbb
+ depends = lcms2
+ depends = freetype2
+ depends = zlib
+ depends = glibc
+ depends = gcc-libs
+ provides = pdf4qt-git
+ conflicts = pdf4qt-git
+ source = pdf4qt-git::git+https://github.com/JakubMelka/PDF4QT
+ source = CMakePatch.patch
+ source = CMakeDesktopNoDep.patch
+ source = FindLCMS2.cmake
+ b2sums = SKIP
+ b2sums = be47f2902d2639170b6fc10742b118cd14b263f30d2225aa601820cb33f946d1d9b5f032fd9c0671e1ac4936c072ff4c6dc7f57c7a53f95f1ad59ba5c2b3ff1c
+ b2sums = c413589e2ae48dbf137e7156b5378093fe88d0eac7aa935e1390be03dbfbe9f94e0c3bada3d1c76e4300be929274cff47f9866dfb7387629b7f9d15f1f9d3169
+ b2sums = d26119741d02bddc6e18234aeb9d437ed866676f126e073f87efa8f19e3eedfbb77d2f571ff0e1c3963fabc86e1db83b7a1864edfdc1ba8f63cdd1e36da1e382
+
+pkgname = pdf4qt-git
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..31f7037602c0
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/src
+/pkg
+/pdf4qt-git
+/*.pkg.tar.zst
+/clear.sh
diff --git a/CMakeDesktopNoDep.patch b/CMakeDesktopNoDep.patch
new file mode 100644
index 000000000000..ce6aed964786
--- /dev/null
+++ b/CMakeDesktopNoDep.patch
@@ -0,0 +1,24 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d656713..4877af8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -89,6 +89,9 @@ add_subdirectory(WixInstaller)
+ message("CMAKE_PREFIX_PATH = " ${CMAKE_PREFIX_PATH})
+ message("CMAKE_TOOLCHAIN_FILE = " ${CMAKE_TOOLCHAIN_FILE})
+
++install(FILES Desktop/Pdf4QtDocDiff.desktop Desktop/Pdf4QtDocPageOrganizer.desktop Desktop/Pdf4QtViewerLite.desktop Desktop/Pdf4QtViewerProfi.desktop DESTINATION usr/share/applications)
++install(FILES Desktop/Pdf4QtDocDiff.svg Desktop/Pdf4QtDocPageOrganizer.svg Desktop/Pdf4QtViewerLite.svg Desktop/Pdf4QtViewerProfi.svg DESTINATION usr/share/icons)
++
+ if(PDF4QT_INSTALL_DEPENDENCIES)
+ install(DIRECTORY ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin/
+ TYPE BIN
+@@ -98,9 +101,6 @@ if(PDF4QT_INSTALL_DEPENDENCIES)
+ PATTERN "*.dylib"
+ )
+
+- install(FILES Desktop/Pdf4QtDocDiff.desktop Desktop/Pdf4QtDocPageOrganizer.desktop Desktop/Pdf4QtViewerLite.desktop Desktop/Pdf4QtViewerProfi.desktop DESTINATION usr/share/applications)
+- install(FILES Desktop/Pdf4QtDocDiff.svg Desktop/Pdf4QtDocPageOrganizer.svg Desktop/Pdf4QtViewerLite.svg Desktop/Pdf4QtViewerProfi.svg DESTINATION usr/share/icons)
+-
+ if("${PDF4QT_QT_ROOT}" STREQUAL "")
+ message(WARNING "Set variable PDF4QT_QT_ROOT to Qt6 root directory")
+ endif()
diff --git a/CMakePatch.patch b/CMakePatch.patch
new file mode 100644
index 000000000000..d9a759a00451
--- /dev/null
+++ b/CMakePatch.patch
@@ -0,0 +1,43 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index d656713..b6a1ee3 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -47,10 +47,10 @@ find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Svg Xml PrintSupport TextT
+ qt_standard_project_setup()
+
+ find_package(OpenSSL REQUIRED)
+-find_package(lcms REQUIRED)
++find_package(LCMS2 REQUIRED)
+ find_package(ZLIB REQUIRED)
+-find_package(freetype CONFIG REQUIRED)
+-find_package(OpenJPEG CONFIG REQUIRED)
++find_package(Freetype REQUIRED)
++find_package(OpenJPEG REQUIRED)
+ find_package(JPEG REQUIRED)
+ find_package(PNG REQUIRED)
+
+diff --git a/Pdf4QtLib/CMakeLists.txt b/Pdf4QtLib/CMakeLists.txt
+index 399deb8..dc49b0d 100644
+--- a/Pdf4QtLib/CMakeLists.txt
++++ b/Pdf4QtLib/CMakeLists.txt
+@@ -111,10 +111,10 @@ GENERATE_EXPORT_HEADER(Pdf4QtLib
+ EXPORT_FILE_NAME "${CMAKE_BINARY_DIR}/${INSTALL_INCLUDEDIR}/pdf4qtlib_export.h")
+
+ target_link_libraries(Pdf4QtLib PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Xml Qt6::Svg Qt6::OpenGLWidgets)
+-target_link_libraries(Pdf4QtLib PRIVATE lcms2::lcms2)
++target_link_libraries(Pdf4QtLib PRIVATE LCMS2::LCMS2)
+ target_link_libraries(Pdf4QtLib PRIVATE OpenSSL::SSL OpenSSL::Crypto)
+ target_link_libraries(Pdf4QtLib PRIVATE ZLIB::ZLIB)
+-target_link_libraries(Pdf4QtLib PRIVATE freetype)
++target_link_libraries(Pdf4QtLib PRIVATE ${FREETYPE_LIBRARIES})
+ target_link_libraries(Pdf4QtLib PRIVATE openjp2)
+ target_link_libraries(Pdf4QtLib PRIVATE JPEG::JPEG)
+
+@@ -128,6 +128,7 @@ endif()
+
+ target_include_directories(Pdf4QtLib INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/sources)
+ target_include_directories(Pdf4QtLib PUBLIC ${CMAKE_BINARY_DIR}/${INSTALL_INCLUDEDIR})
++target_include_directories(Pdf4QtLib PRIVATE ${FREETYPE_INCLUDE_DIRS})
+
+ set_target_properties(Pdf4QtLib PROPERTIES
+ VERSION ${PDF4QT_VERSION}
diff --git a/FindLCMS2.cmake b/FindLCMS2.cmake
new file mode 100644
index 000000000000..10db14511cc3
--- /dev/null
+++ b/FindLCMS2.cmake
@@ -0,0 +1,105 @@
+# Copyright (C) 2021 Igalia S.L.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+#[=======================================================================[.rst:
+FindLCMS2
+---------
+
+Find LCMS2 headers and libraries.
+
+Imported Targets
+^^^^^^^^^^^^^^^^
+
+``LCMS2::LCMS2``
+ The LCMS2 library, if found.
+
+Result Variables
+^^^^^^^^^^^^^^^^
+
+This will define the following variables in your project:
+
+``LCMS2_FOUND``
+ true if (the requested version of) LCMS2 is available.
+``LCMS2_VERSION``
+ the version of LCMS2.
+``LCMS2_LIBRARIES``
+ the libraries to link against to use LCMS2.
+``LCMS2_INCLUDE_DIRS``
+ where to find the LCMS2 headers.
+``LCMS2_COMPILE_OPTIONS``
+ this should be passed to target_compile_options(), if the
+ target is not used for linking
+
+#]=======================================================================]
+
+find_package(PkgConfig QUIET)
+if (PkgConfig_FOUND)
+ pkg_check_modules(PC_LCMS2 QUIET lcms2)
+ set(LCMS2_COMPILE_OPTIONS ${PC_LCMS2_CFLAGS_OTHER})
+ set(LCMS2_VERSION ${PC_LCMS2_VERSION})
+endif ()
+
+find_path(LCMS2_INCLUDE_DIR
+ NAMES lcms2.h
+ HINTS ${PC_LCMS2_INCLUDEDIR} ${PC_LCMS2_INCLUDE_DIRS} ${LCMS2_INCLUDE_DIR}
+ PATH_SUFFIXES lcms2 liblcms2
+)
+
+find_library(LCMS2_LIBRARY
+ NAMES ${LCMS2_NAMES} lcms2 liblcms2 lcms-2 liblcms-2
+ HINTS ${PC_LCMS2_LIBDIR} ${PC_LCMS2_LIBRARY_DIRS}
+ PATH_SUFFIXES lcms2
+)
+
+if (LCMS2_INCLUDE_DIR AND NOT LCMS_VERSION)
+ file(READ ${LCMS2_INCLUDE_DIR}/lcms2.h LCMS2_VERSION_CONTENT)
+ string(REGEX MATCH "#define[ \t]+LCMS_VERSION[ \t]+([0-9]+)[ \t]*\n" LCMS2_VERSION_MATCH ${LCMS2_VERSION_CONTENT})
+ if (LCMS2_VERSION_MATCH)
+ string(SUBSTRING ${CMAKE_MATCH_1} 0 1 LCMS2_VERSION_MAJOR)
+ string(SUBSTRING ${CMAKE_MATCH_1} 1 2 LCMS2_VERSION_MINOR)
+ set(LCMS2_VERSION "${LCMS2_VERSION_MAJOR}.${LCMS2_VERSION_MINOR}")
+ endif ()
+endif ()
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LCMS2
+ FOUND_VAR LCMS2_FOUND
+ REQUIRED_VARS LCMS2_LIBRARY LCMS2_INCLUDE_DIR
+ VERSION_VAR LCMS2_VERSION
+)
+
+if (LCMS2_LIBRARY AND NOT TARGET LCMS2::LCMS2)
+ add_library(LCMS2::LCMS2 UNKNOWN IMPORTED GLOBAL)
+ set_target_properties(LCMS2::LCMS2 PROPERTIES
+ IMPORTED_LOCATION "${LCMS2_LIBRARY}"
+ INTERFACE_COMPILE_OPTIONS "${LCMS2_COMPILE_OPTIONS}"
+ INTERFACE_INCLUDE_DIRECTORIES "${LCMS2_INCLUDE_DIR}"
+ )
+endif ()
+
+mark_as_advanced(LCMS2_INCLUDE_DIR LCMS2_LIBRARY)
+
+if (LCMS2_FOUND)
+ set(LCMS2_LIBRARIES ${LCMS2_LIBRARY})
+ set(LCMS2_INCLUDE_DIRS ${LCMS2_INCLUDE_DIR})
+endif ()
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 000000000000..0a041280bd00
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..d26de47861a5
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,62 @@
+# Maintainer: Raffaele Mancuso <raffaelemancuso532 at gmail dot com>
+pkgname=pdf4qt-git
+pkgver=r849.198b8a5
+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')
+provides=("${pkgname%-VCS}")
+conflicts=("${pkgname%-VCS}")
+source=("$pkgname"::'git+https://github.com/JakubMelka/PDF4QT'
+ 'CMakePatch.patch'
+ 'CMakeDesktopNoDep.patch'
+ 'FindLCMS2.cmake')
+b2sums=('SKIP'
+ 'be47f2902d2639170b6fc10742b118cd14b263f30d2225aa601820cb33f946d1d9b5f032fd9c0671e1ac4936c072ff4c6dc7f57c7a53f95f1ad59ba5c2b3ff1c'
+ 'c413589e2ae48dbf137e7156b5378093fe88d0eac7aa935e1390be03dbfbe9f94e0c3bada3d1c76e4300be929274cff47f9866dfb7387629b7f9d15f1f9d3169'
+ 'd26119741d02bddc6e18234aeb9d437ed866676f126e073f87efa8f19e3eedfbb77d2f571ff0e1c3963fabc86e1db83b7a1864edfdc1ba8f63cdd1e36da1e382')
+
+pkgver() {
+ cd "$srcdir/${pkgname%-VCS}"
+ # Git, no tags available
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+}
+
+prepare() {
+ cd "$srcdir/${pkgname%-VCS}"
+ patch -p1 -i "$srcdir/CMakePatch.patch"
+ patch -p1 -i "$srcdir/CMakeDesktopNoDep.patch"
+}
+
+build() {
+ cmake -B build -S "${pkgname%-VCS}" \
+ -DCMAKE_BUILD_TYPE='None' \
+ -DCMAKE_INSTALL_PREFIX='/' \
+ -Wno-dev \
+ -DCMAKE_MODULE_PATH="$srcdir" \
+ -DPDF4QT_INSTALL_DEPENDENCIES=0
+ cmake --build build
+}
+
+check() {
+ ctest --test-dir build --output-on-failure
+}
+
+package() {
+ DESTDIR="$pkgdir" cmake --install build
+}
+