Linux installation scripts, some adjustments

This commit is contained in:
Jakub Melka 2023-07-30 16:44:40 +02:00
parent 91c9315900
commit df7454580e
5 changed files with 54 additions and 2 deletions

View File

@ -92,6 +92,8 @@ 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.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) install(FILES Desktop/Pdf4QtDocDiff.svg Desktop/Pdf4QtDocPageOrganizer.svg Desktop/Pdf4QtViewerLite.svg Desktop/Pdf4QtViewerProfi.svg DESTINATION usr/share/icons)
configure_file(make-package.sh.in make-package.sh)
if(PDF4QT_INSTALL_DEPENDENCIES) if(PDF4QT_INSTALL_DEPENDENCIES)
install(DIRECTORY ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin/ install(DIRECTORY ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin/
TYPE BIN TYPE BIN

View File

@ -32,7 +32,9 @@
#pragma warning(push) #pragma warning(push)
#pragma warning(disable:5033) #pragma warning(disable:5033)
#endif #endif
#ifndef CMS_NO_REGISTER_KEYWORD
#define CMS_NO_REGISTER_KEYWORD #define CMS_NO_REGISTER_KEYWORD
#endif
#include <lcms2.h> #include <lcms2.h>
#include <lcms2_plugin.h> #include <lcms2_plugin.h>
#ifdef PDF4QT_COMPILER_MSVC #ifdef PDF4QT_COMPILER_MSVC

View File

@ -45,7 +45,9 @@
#pragma warning(push) #pragma warning(push)
#pragma warning(disable:5033) #pragma warning(disable:5033)
#ifndef CMS_NO_REGISTER_KEYWORD
#define CMS_NO_REGISTER_KEYWORD #define CMS_NO_REGISTER_KEYWORD
#endif
#include <lcms2.h> #include <lcms2.h>
#pragma warning(pop) #pragma warning(pop)

View File

@ -1904,15 +1904,28 @@ void PDFProgramController::updatePageLayoutActions()
void PDFProgramController::loadPlugins() void PDFProgramController::loadPlugins()
{ {
QStringList availablePlugins;
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
QDir directory(QApplication::applicationDirPath() + "/pdfplugins"); QDir directory(QApplication::applicationDirPath() + "/pdfplugins");
QStringList availablePlugins = directory.entryList(QStringList("*.dll")); availablePlugins = directory.entryList(QStringList("*.dll"));
#elif defined(Q_OS_UNIX) #elif defined(Q_OS_UNIX)
#ifndef NDEBUG
QDir directory(QApplication::applicationDirPath() + "/../pdfplugins"); QDir directory(QApplication::applicationDirPath() + "/../pdfplugins");
QStringList availablePlugins = directory.entryList(QStringList("*.so")); availablePlugins = directory.entryList(QStringList("*.so"));
#else
QDir directory(QApplication::applicationDirPath());
if (directory.cdUp() &&
directory.cd("lib") &&
directory.cd("pdf4qt"))
{
availablePlugins = directory.entryList(QStringList("*.so"));
}
#endif
#else #else
static_assert(false, "Implement this for another OS!"); static_assert(false, "Implement this for another OS!");
#endif #endif
for (const QString& availablePlugin : availablePlugins) for (const QString& availablePlugin : availablePlugins)
{ {
QString pluginFileName = directory.absoluteFilePath(availablePlugin); QString pluginFileName = directory.absoluteFilePath(availablePlugin);

33
make-package.sh.in Normal file
View File

@ -0,0 +1,33 @@
#!/bin/bash
mkdir -p install/lib/pdf4qt
mv -f install/lib/*Plugin.so* install/lib/pdf4qt/
#mkdir -p install/usr/bin/
#mv -f install/bin/* install/usr/bin/
mkdir -p install/DEBIAN/
file="install/DEBIAN/control"
>$file
echo "Package: PDF4QT" >>$file
echo "Version: ${PDF4QT_VERSION}" >>$file
echo "Section: base" >>$file
echo "Priority: optional" >>$file
echo "Architecture: amd64" >>$file
echo "Depends: libqt6gui6, libqt6xml6, libqt6svg6, libqt6openglwidgets6, libtbb12, libqt6printsupport6, libqt6texttospeech6, qt6-speech-speechd-plugin, qt6-speech-flite-plugin">>$file
echo "Maintainer: Jakub Melka" >>$file
echo "Description: This software is consisting of PDF rendering library, and several applications, such as advanced document viewer, command line tool, and document page manipulator application. Software is implementing PDF functionality based on PDF Reference 2.0. It is written and maintained by Jakub Melka." >>$file
echo "Homepage: https://jakubmelka.github.io/" >>$file
echo "Vcs-Browser: https://github.com/JakubMelka/PDF4QT" >>$file
dpkg-deb --build install
mv install.deb PDF4QT-${PDF4QT_VERSION}.deb