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

moc-ng wants to ovewrite Qt's moc under /usr/bin/ #13

Open
Petross404 opened this issue Feb 13, 2019 · 3 comments
Open

moc-ng wants to ovewrite Qt's moc under /usr/bin/ #13

Petross404 opened this issue Feb 13, 2019 · 3 comments

Comments

@Petross404
Copy link

Trying to install moc-ng with Portage gives me this :

>> Installing (1 of 1) dev-util/moc-ng-9999::testing
 * checking 4 files for package collisions
 * This package will overwrite one or more files that may belong to other
 * packages (see list below). You can use a command such as `portageq
 * owners / <filename>` to identify the installed package that owns a
 * file. If portageq reports that only one package owns a file then do
 * NOT file a bug report. A bug report is only useful if it identifies at
 * least two or more packages that are known to install the same file(s).
 * If a collision occurs and you can not explain where the file came from
 * then you should simply ignore the collision since there is not enough
 * information to determine if a real problem exists. Please do NOT file
 * a bug report at https://bugs.gentoo.org/ unless you report exactly
 * which two packages install the same file(s). See
 * https://wiki.gentoo.org/wiki/Knowledge_Base:Blockers for tips on how
 * to solve the problem. And once again, please do NOT file a bug report
 * unless you have completely understood the above message.
 * 
 * Detected file collision(s):
 * 
 *      /usr/bin/moc
 * 
 * Searching all installed packages for file collisions...
 * 
 * Press Ctrl-C to Stop
 * 
 * dev-qt/qtchooser-66:0::gentoo
 *      /usr/bin/moc
 * 
 * Package 'dev-util/moc-ng-9999' NOT merged due to file collisions. If
 * necessary, refer to your elog messages for the whole content of the
 * above message.
@Petross404
Copy link
Author

This patch helped but still, is there a better way?

From 62b06474c31f9d0674f5139e584711e21f4fb702 Mon Sep 17 00:00:00 2001
From: Petros Siligkounas <[email protected]>
Date: Wed, 13 Feb 2019 20:48:13 +0200
Subject: [PATCH] Rename moc target as moc-ng, so it doesn't overwrite Qt's moc

---
 src/CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e38fbd1..bcf57ea 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -98,6 +98,10 @@ configure_file(embedded_includes.h.in embedded_includes.h)
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
 include("GNUInstallDirs")
+#Installing moc under /usr/bin will erase Qt's moc
+if(${CMAKE_BUILD_TYPE} MATCHES "Gentoo")
+    set_target_properties(moc PROPERTIES OUTPUT_NAME "moc-ng")
+endif()
 install(TARGETS moc mocng_plugin
     RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
     LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

@ogoffart
Copy link
Member

The idea is to overwrite Qt's moc so it is used instead, as it is supposed to be a drop-in replacement.

I admit not everybody wants that, but if we give it another name, it makes it harder to use.

@Petross404
Copy link
Author

Petross404 commented Feb 16, 2019

I am thinking about another idea. Maybe moc-ng could be installed in some other directory like /usr/lib/moc-ng/moc and a symlink as /usr/bin/moc could point either to moc-ng or /usr/lib64/qt5/.../moc.

This has to be supported from the distribution and Qt's packaging so I don't hold my breath. Thank you anyway. Feel free to close this issue is there is nothing to be done (at least now).

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

2 participants