Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging nightmare #20

Closed
dvzrv opened this issue Mar 19, 2018 · 4 comments
Closed

Packaging nightmare #20

dvzrv opened this issue Mar 19, 2018 · 4 comments

Comments

@dvzrv
Copy link

dvzrv commented Mar 19, 2018

I'd like to package libqpsd for Arch Linux (needed for nomacs - at least most likely in the future).
Sadly, using qmake is a nightmare...

Currently, I'm trying something in the vein of:

mkdir build
cd build  
qmake "QT_INSTALL_PLUGINS=/usr/lib/qt/plugins" ..
make
make DESTDIR="${pkgdir}" install

However, the install target just deletes the .so file and then all fails.
In the end I end up manually placing the .so file into the package file system...
It seems, the .pro file is actually pretty unusable on Linux.
There's no documentation on how to use it, what the variables actually do and what the estimated outcome would be.
Any help on how to procede would be very much appreciated!

@eli-schwartz
Copy link
Contributor

eli-schwartz commented Mar 19, 2018

The .pro file uses DESTDIR to immediately put the plugin in /usr rather than waiting until make install to place it in INSTALL_ROOT.

Instead, target.path = $$[QT_INSTALL_PLUGINS]/imageformats should be used. qmake is supposed to handle this automatically in a cross-platform manner, so I'm confused as to why this sprinkles conditionals everywhere... am I missing something?

@roniemartinez
Copy link
Owner

Thanks @eli-schwartz

@dvzrv , you can also try to use the CMake build system. I don't have it here in my repo but nomacs implemented it.

@eli-schwartz
Copy link
Contributor

That would be sort of missing the point, as the CMake version does not actually implement installation and would also involve downloading arbitrary thirdparty forks just to obtain a build system...

We know exactly why it doesn't work. It's a pretty easy fix:

From 23f44c1b1b7862d510e0b59534b36b90a1890175 Mon Sep 17 00:00:00 2001
From: Eli Schwartz <[email protected]>
Date: Mon, 19 Mar 2018 21:11:32 -0400
Subject: [PATCH] Fix `make install`

Currently this instead tries to install directly to /usr during `make`
---
 QPsdPlugin.pro | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/QPsdPlugin.pro b/QPsdPlugin.pro
index 8c63256..0d6f12d 100644
--- a/QPsdPlugin.pro
+++ b/QPsdPlugin.pro
@@ -18,8 +18,6 @@ CONFIG(release, debug|release) {
 
 TEMPLATE = lib
 
-DESTDIR = $$[QT_INSTALL_PLUGINS]/imageformats
-
 SOURCES += qpsdplugin.cpp \
     qpsdhandler.cpp \
     qpsdhandler_p.cpp
@@ -32,11 +30,5 @@ OTHER_FILES += \
     README.md \
     CHANGELOG.md
 
-unix:!symbian {
-    maemo5 {
-        target.path = /opt/usr/lib
-    } else {
-        target.path = /usr/lib
-    }
-    INSTALLS += target
-}
+target.path = $$[QT_INSTALL_PLUGINS]/imageformats
+INSTALLS += target
-- 
2.16.2

@roniemartinez
Copy link
Owner

Thank you @eli-schwartz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants