1 From 03a5a7eab673d18d00c9b5eb8c7d5b790079e8ff Mon Sep 17 00:00:00 2001
2 From: OPNA2608 <christoph.neidahl@gmail.com>
3 Date: Mon, 12 Apr 2021 20:20:46 +0200
4 Subject: [PATCH 03/11] qtbase-mkspecs
7 mkspecs/features/create_cmake.prf | 51 +++---------
8 .../data/cmake/Qt5BasicConfig.cmake.in | 80 +------------------
9 mkspecs/features/qml_module.prf | 2 +-
10 mkspecs/features/qml_plugin.prf | 2 +-
11 mkspecs/features/qt_app.prf | 2 +-
12 mkspecs/features/qt_build_paths.prf | 4 +-
13 mkspecs/features/qt_docs.prf | 10 +--
14 mkspecs/features/qt_example_installs.prf | 2 +-
15 mkspecs/features/qt_functions.prf | 27 ++++---
16 mkspecs/features/qt_installs.prf | 22 ++---
17 mkspecs/features/qt_plugin.prf | 2 +-
18 11 files changed, 52 insertions(+), 152 deletions(-)
20 diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
21 index 24ed125f12..f0666a1986 100644
22 --- a/mkspecs/features/create_cmake.prf
23 +++ b/mkspecs/features/create_cmake.prf
24 @@ -21,7 +21,7 @@ load(cmake_functions)
25 # at cmake time whether package has been found via a symlink, and correct
26 # that to an absolute path. This is only done for installations to
27 # the /usr or / prefix.
28 -CMAKE_INSTALL_LIBS_DIR = $$cmakeTargetPath($$[QT_INSTALL_LIBS])
29 +CMAKE_INSTALL_LIBS_DIR = $$cmakeTargetPath($$NIX_OUTPUT_OUT/lib/)
30 contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_USR_MOVE_WORKAROUND = $$CMAKE_INSTALL_LIBS_DIR
32 CMAKE_OUT_DIR = $$MODULE_BASE_OUTDIR/lib/cmake
33 @@ -77,45 +77,20 @@ split_incpath {
34 $$cmake_extra_source_includes.output
37 -CMAKE_INCLUDE_DIR = $$cmakeRelativePath($$[QT_INSTALL_HEADERS], $$[QT_INSTALL_PREFIX])
38 -contains(CMAKE_INCLUDE_DIR, "^\\.\\./.*") {
39 - CMAKE_INCLUDE_DIR = $$[QT_INSTALL_HEADERS]/
40 - CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
42 +CMAKE_INCLUDE_DIR = $$NIX_OUTPUT_DEV/include/
43 +CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
45 -CMAKE_LIB_DIR = $$cmakeRelativePath($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX])
46 -contains(CMAKE_LIB_DIR,"^\\.\\./.*") {
47 - CMAKE_LIB_DIR = $$[QT_INSTALL_LIBS]/
48 - CMAKE_LIB_DIR_IS_ABSOLUTE = True
50 - CMAKE_RELATIVE_INSTALL_LIBS_DIR = $$cmakeRelativePath($$[QT_INSTALL_PREFIX], $$[QT_INSTALL_LIBS])
51 - # We need to go up another two levels because the CMake files are
52 - # installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME}
53 - CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}../../"
55 +CMAKE_BIN_DIR = $$NIX_OUTPUT_BIN/bin/
56 +CMAKE_BIN_DIR_IS_ABSOLUTE = True
58 -CMAKE_BIN_DIR = $$cmakeRelativePath($$[QT_HOST_BINS], $$[QT_INSTALL_PREFIX])
59 -contains(CMAKE_BIN_DIR, "^\\.\\./.*") {
60 - CMAKE_BIN_DIR = $$[QT_HOST_BINS]/
61 - CMAKE_BIN_DIR_IS_ABSOLUTE = True
63 +CMAKE_LIB_DIR = $$NIX_OUTPUT_OUT/lib/
64 +CMAKE_LIB_DIR_IS_ABSOLUTE = True
66 -CMAKE_PLUGIN_DIR = $$cmakeRelativePath($$[QT_INSTALL_PLUGINS], $$[QT_INSTALL_PREFIX])
67 -contains(CMAKE_PLUGIN_DIR, "^\\.\\./.*") {
68 - CMAKE_PLUGIN_DIR = $$[QT_INSTALL_PLUGINS]/
69 - CMAKE_PLUGIN_DIR_IS_ABSOLUTE = True
71 +CMAKE_PLUGIN_DIR = $$NIX_OUTPUT_PLUGIN/
72 +CMAKE_PLUGIN_DIR_IS_ABSOLUTE = True
74 -win32:!static:!staticlib {
75 - CMAKE_DLL_DIR = $$cmakeRelativePath($$[QT_INSTALL_BINS], $$[QT_INSTALL_PREFIX])
76 - contains(CMAKE_DLL_DIR, "^\\.\\./.*") {
77 - CMAKE_DLL_DIR = $$[QT_INSTALL_BINS]/
78 - CMAKE_DLL_DIR_IS_ABSOLUTE = True
81 - CMAKE_DLL_DIR = $$CMAKE_LIB_DIR
82 - CMAKE_DLL_DIR_IS_ABSOLUTE = $$CMAKE_LIB_DIR_IS_ABSOLUTE
84 +CMAKE_DLL_DIR = $$NIX_OUTPUT_OUT/lib/
85 +CMAKE_DLL_DIR_IS_ABSOLUTE = True
87 static|staticlib:CMAKE_STATIC_TYPE = true
89 @@ -258,7 +233,7 @@ contains(CONFIG, plugin) {
91 cmake_qt5_plugin_file.files = $$cmake_target_file.output
92 static|staticlib: cmake_qt5_plugin_file.files += $$cmake_qt5_plugin_import_file.output
93 - cmake_qt5_plugin_file.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
94 + cmake_qt5_plugin_file.path = $$NIX_OUTPUT_OUT/lib/cmake/Qt5$${CMAKE_MODULE_NAME}
95 INSTALLS += cmake_qt5_plugin_file
98 @@ -400,7 +375,7 @@ exists($$cmake_macros_file.input) {
99 cmake_qt5_module_files.files += $$cmake_macros_file.output
102 -cmake_qt5_module_files.path = $$[QT_INSTALL_LIBS]/cmake/Qt5$${CMAKE_MODULE_NAME}
103 +cmake_qt5_module_files.path = $$NIX_OUTPUT_OUT/lib/cmake/Qt5$${CMAKE_MODULE_NAME}
105 # We are generating cmake files. Most developers of Qt are not aware of cmake,
106 # so we require automatic tests to be available. The only module which should
107 diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
108 index db18dbece6..8246f37931 100644
109 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
110 +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
111 @@ -2,30 +2,6 @@ if (CMAKE_VERSION VERSION_LESS 3.1.0)
112 message(FATAL_ERROR \"Qt 5 $${CMAKE_MODULE_NAME} module requires at least CMake version 3.1.0\")
115 -!!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND)
116 -!!IF !isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
117 -set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
119 -get_filename_component(_IMPORT_PREFIX \"${CMAKE_CURRENT_LIST_FILE}\" PATH)
120 -# Use original install prefix when loaded through a
121 -# cross-prefix symbolic link such as /lib -> /usr/lib.
122 -get_filename_component(_realCurr \"${_IMPORT_PREFIX}\" REALPATH)
123 -get_filename_component(_realOrig \"$$CMAKE_INSTALL_LIBS_DIR/cmake/Qt5$${CMAKE_MODULE_NAME}\" REALPATH)
124 -if(_realCurr STREQUAL _realOrig)
125 - get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$CMAKE_INSTALL_LIBS_DIR/$${CMAKE_RELATIVE_INSTALL_LIBS_DIR}\" ABSOLUTE)
127 - get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
131 -unset(_IMPORT_PREFIX)
133 -!!ELIF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
134 -get_filename_component(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
136 -set(_qt5$${CMAKE_MODULE_NAME}_install_prefix \"$$[QT_INSTALL_PREFIX]\")
139 !!IF !equals(TEMPLATE, aux)
140 # For backwards compatibility only. Use Qt5$${CMAKE_MODULE_NAME}_VERSION instead.
141 set(Qt5$${CMAKE_MODULE_NAME}_VERSION_STRING "$$eval(QT.$${MODULE}.VERSION)")
142 @@ -145,11 +121,7 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
144 set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
146 -!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
147 - set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
149 set(imported_location \"$${CMAKE_DLL_DIR}${LIB_LOCATION}\")
151 _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
153 ${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}
154 @@ -209,11 +181,7 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
157 !!IF !isEmpty(CMAKE_WINDOWS_BUILD)
158 -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
159 - set(imported_implib \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
161 set(imported_implib \"IMPORTED_IMPLIB_${Configuration}\" \"$${CMAKE_LIB_DIR}${IMPLIB_LOCATION}\")
163 _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_implib})
164 if(NOT \"${IMPLIB_LOCATION}\" STREQUAL \"\")
165 set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
166 @@ -229,24 +197,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
167 !!IF !no_module_headers
168 !!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
169 set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
170 - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework\"
171 - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Headers\"
172 + \"$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework\"
173 + \"$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Headers\"
175 !!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
176 set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
177 - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
178 - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
181 - set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
184 -!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
185 - set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}\")
186 -!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
187 - set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
188 - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
189 - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION/$${MODULE_INCNAME}\"
190 + \"$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, .,0, 0)/Headers/$$VERSION/\"
191 + \"$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, .,0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
194 set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
195 @@ -262,7 +219,6 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
196 set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
200 !!IF !isEmpty(CMAKE_ADD_SOURCE_INCLUDE_DIRS)
201 include(\"${CMAKE_CURRENT_LIST_DIR}/ExtraSourceIncludes.cmake\" OPTIONAL)
203 @@ -491,25 +447,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
204 !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
205 !!IF isEmpty(CMAKE_DEBUG_TYPE)
206 !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
207 -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
208 - if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
209 -!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
210 if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
211 -!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
212 _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" \"\" $${CMAKE_DEBUG_AND_RELEASE})
213 !!ELSE // CMAKE_STATIC_WINDOWS_BUILD
215 -!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
216 - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
218 \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
221 -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
222 - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
224 \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" )
226 _populate_$${CMAKE_MODULE_NAME}_target_properties(DEBUG \"$${CMAKE_LIB_FILE_LOCATION_DEBUG}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
227 !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
229 @@ -528,25 +472,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
230 !!IF !isEmpty(CMAKE_FIND_OTHER_LIBRARY_BUILD)
231 !!IF isEmpty(CMAKE_RELEASE_TYPE)
232 !!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
233 -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
234 - if (EXISTS \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
235 -!!ELSE // CMAKE_LIB_DIR_IS_ABSOLUTE
236 if (EXISTS \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
237 -!!ENDIF // CMAKE_LIB_DIR_IS_ABSOLUTE
238 _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" $${CMAKE_DEBUG_AND_RELEASE})
239 !!ELSE // CMAKE_STATIC_WINDOWS_BUILD
241 -!!IF isEmpty(CMAKE_DLL_DIR_IS_ABSOLUTE)
242 - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_DLL_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
244 \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
247 -!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
248 - \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
250 \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" )
252 _populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_LIB_FILE_LOCATION_RELEASE}\" \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
253 !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
255 @@ -573,11 +505,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
257 set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
259 -!!IF isEmpty(CMAKE_PLUGIN_DIR_IS_ABSOLUTE)
260 - set(imported_location \"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
262 set(imported_location \"$${CMAKE_PLUGIN_DIR}${PLUGIN_LOCATION}\")
264 _qt5_$${CMAKE_MODULE_NAME}_check_file_exists(${imported_location})
265 set_target_properties(Qt5::${Plugin} PROPERTIES
266 \"IMPORTED_LOCATION_${Configuration}\" ${imported_location}
267 diff --git a/mkspecs/features/qml_module.prf b/mkspecs/features/qml_module.prf
268 index 3d6cd9b3db..ca8b0b2701 100644
269 --- a/mkspecs/features/qml_module.prf
270 +++ b/mkspecs/features/qml_module.prf
271 @@ -51,7 +51,7 @@ builtin_resources {
273 qmldir.base = $$qmldir_path
274 qmldir.files = $$qmldir_file
275 -qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH
276 +qmldir.path = $$NIX_OUTPUT_QML/$$TARGETPATH
278 qmlfiles.base = $$_PRO_FILE_PWD_
279 qmlfiles.files = $$fq_aux_qml_files
280 diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
281 index 1b67435787..24a1f78c17 100644
282 --- a/mkspecs/features/qml_plugin.prf
283 +++ b/mkspecs/features/qml_plugin.prf
284 @@ -50,7 +50,7 @@ load(qt_build_paths)
286 DESTDIR = $$MODULE_BASE_OUTDIR/qml/$$TARGETPATH
288 -target.path = $$[QT_INSTALL_QML]/$$TARGETPATH
289 +target.path = $$NIX_OUTPUT_QML/$$TARGETPATH
293 diff --git a/mkspecs/features/qt_app.prf b/mkspecs/features/qt_app.prf
294 index 8354f30eea..62028fef8e 100644
295 --- a/mkspecs/features/qt_app.prf
296 +++ b/mkspecs/features/qt_app.prf
297 @@ -30,7 +30,7 @@ host_build:force_bootstrap {
298 target.path = $$[QT_HOST_BINS]
300 !build_pass:qtConfig(debug_and_release): CONFIG += release
301 - target.path = $$[QT_INSTALL_BINS]
302 + target.path = $$NIX_OUTPUT_BIN/bin
303 CONFIG += relative_qt_rpath # Qt's tools and apps should be relocatable
306 diff --git a/mkspecs/features/qt_build_paths.prf b/mkspecs/features/qt_build_paths.prf
307 index 3bb3823a8e..655b7b7db8 100644
308 --- a/mkspecs/features/qt_build_paths.prf
309 +++ b/mkspecs/features/qt_build_paths.prf
310 @@ -24,6 +24,6 @@ exists($$MODULE_BASE_INDIR/.git): \
312 # If the module is not built independently, everything ends up in qtbase.
313 # This is the case in non-prefix builds, except for selected modules.
314 - MODULE_BASE_OUTDIR = $$[QT_HOST_PREFIX]
315 - MODULE_QMAKE_OUTDIR = $$[QT_HOST_PREFIX]
316 + MODULE_BASE_OUTDIR = $$NIX_OUTPUT_OUT
317 + MODULE_QMAKE_OUTDIR = $$NIX_OUTPUT_OUT
319 diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf
320 index 095bf15dac..4cc977bea5 100644
321 --- a/mkspecs/features/qt_docs.prf
322 +++ b/mkspecs/features/qt_docs.prf
323 @@ -65,7 +65,7 @@ QMAKE_DOCS_OUTPUTDIR = $$QMAKE_DOCS_BASE_OUTDIR/$$QMAKE_DOCS_TARGETDIR
325 QDOC += -outputdir $$shell_quote($$QMAKE_DOCS_OUTPUTDIR)
326 !build_online_docs: \
327 - QDOC += -installdir $$shell_quote($$[QT_INSTALL_DOCS])
328 + QDOC += -installdir $$shell_quote($$NIX_OUTPUT_DOC)
332 @@ -84,8 +84,8 @@ DOC_INDEXES =
333 DOC_INDEXES += -indexdir $$shell_quote($$qrep/doc)
336 - PREP_DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
337 - DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
338 + PREP_DOC_INDEXES += -indexdir $$shell_quote($$NIX_OUTPUT_DOC)
339 + DOC_INDEXES += -indexdir $$shell_quote($$NIX_OUTPUT_DOC)
342 qtattributionsscanner.target = qtattributionsscanner
343 @@ -108,12 +108,12 @@ prepare_docs {
344 qch_docs.commands = $$QHELPGENERATOR $$shell_quote($$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp) -o $$shell_quote($$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch)
346 inst_html_docs.files = $$QMAKE_DOCS_OUTPUTDIR
347 - inst_html_docs.path = $$[QT_INSTALL_DOCS]
348 + inst_html_docs.path = $$NIX_OUTPUT_DOC
349 inst_html_docs.CONFIG += no_check_exist directory no_default_install no_build
350 INSTALLS += inst_html_docs
352 inst_qch_docs.files = $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch
353 - inst_qch_docs.path = $$[QT_INSTALL_DOCS]
354 + inst_qch_docs.path = $$NIX_OUTPUT_DOC
355 inst_qch_docs.CONFIG += no_check_exist no_default_install no_build
356 INSTALLS += inst_qch_docs
358 diff --git a/mkspecs/features/qt_example_installs.prf b/mkspecs/features/qt_example_installs.prf
359 index 15b373ba40..5c373fe1d5 100644
360 --- a/mkspecs/features/qt_example_installs.prf
361 +++ b/mkspecs/features/qt_example_installs.prf
362 @@ -91,7 +91,7 @@ sourcefiles += \
363 $$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
364 $$DBUS_ADAPTORS $$DBUS_INTERFACES
365 addInstallFiles(sources.files, $$sourcefiles)
366 -sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase
367 +sources.path = $$NIX_OUTPUT_DEV/share/examples/$$probase
371 diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf
372 index 7777e615bd..b0c6880a74 100644
373 --- a/mkspecs/features/qt_functions.prf
374 +++ b/mkspecs/features/qt_functions.prf
375 @@ -87,19 +87,22 @@ defineTest(qtHaveModule) {
376 defineTest(qtPrepareTool) {
377 cmd = $$eval(QT_TOOL.$${2}.binary)
379 - cmd = $$[QT_HOST_BINS]/$$2
380 - exists($${cmd}.pl) {
381 - $${1}_EXE = $${cmd}.pl
382 - cmd = perl -w $$system_path($${cmd}.pl)
383 - } else: contains(QMAKE_HOST.os, Windows) {
384 - $${1}_EXE = $${cmd}.exe
385 - cmd = $$system_path($${cmd}.exe)
386 - } else:contains(QMAKE_HOST.os, Darwin) {
387 - BUNDLENAME = $${cmd}.app/Contents/MacOS/$$2
388 - exists($$BUNDLENAME) {
390 + cmd = $$system("command -v $${2}")
392 + cmd = $$system("command -v $${2}.pl")
395 + cmd = perl -w $$system_path($${cmd})
396 + } else: contains(QMAKE_HOST.os, Windows) {
397 + cmd = $$system("command -v $${2}.exe")
399 + } else: contains(QMAKE_HOST.os, Darwin) {
400 + cmd = $$system("command -v $${2}.app")
402 + cmd = $${cmd}/Contents/MacOS/$${2}
410 diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf
411 index 1ebca17366..a8f958eae8 100644
412 --- a/mkspecs/features/qt_installs.prf
413 +++ b/mkspecs/features/qt_installs.prf
416 !qt_no_install_library {
419 - dlltarget.path = $$[QT_HOST_BINS]
421 - dlltarget.path = $$[QT_INSTALL_BINS]
422 + dlltarget.path = $$NIX_OUTPUT_BIN/bin
423 INSTALLS += dlltarget
426 - target.path = $$[QT_HOST_LIBS]
428 - target.path = $$[QT_INSTALL_LIBS]
429 + target.path = $$NIX_OUTPUT_OUT/lib
430 !static: target.CONFIG = no_dll
436 gen_headers.files = $$SYNCQT.GENERATED_HEADER_FILES
437 - gen_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME
438 + gen_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME
439 INSTALLS += gen_headers
441 targ_headers.files = $$SYNCQT.HEADER_FILES $$SYNCQT.INJECTED_HEADER_FILES
442 - targ_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME
443 + targ_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME
444 INSTALLS += targ_headers
446 private_headers.files = $$SYNCQT.PRIVATE_HEADER_FILES $$SYNCQT.INJECTED_PRIVATE_HEADER_FILES
447 - private_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/private
448 + private_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/private
449 generated_privates: \
450 private_headers.CONFIG += no_check_exist
451 INSTALLS += private_headers
453 qpa_headers.files = $$SYNCQT.QPA_HEADER_FILES
454 - qpa_headers.path = $$[QT_INSTALL_HEADERS]/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/qpa
455 + qpa_headers.path = $$NIX_OUTPUT_DEV/include/$$MODULE_INCNAME/$$VERSION/$$MODULE_INCNAME/qpa
456 INSTALLS += qpa_headers
461 !isEmpty(MODULE_PRI) {
462 - pritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
463 + pritarget.path = $$NIX_OUTPUT_DEV/mkspecs/modules
464 pritarget.files = $$MODULE_PRI
465 INSTALLS += pritarget
466 } else: isEmpty(MODULE_PRIVATE_PRI) {
467 warning("Project $$basename(_PRO_FILE_) is a module, but has not defined MODULE_PRI, which is required for Qt to expose the module to other projects.")
469 !isEmpty(MODULE_PRIVATE_PRI) {
470 - privpritarget.path = $$[QT_HOST_DATA]/mkspecs/modules
471 + privpritarget.path = $$NIX_OUTPUT_DEV/mkspecs/modules
472 privpritarget.files = $$MODULE_PRIVATE_PRI
473 INSTALLS += privpritarget
475 diff --git a/mkspecs/features/qt_plugin.prf b/mkspecs/features/qt_plugin.prf
476 index 573d717eea..024c624cb6 100644
477 --- a/mkspecs/features/qt_plugin.prf
478 +++ b/mkspecs/features/qt_plugin.prf
479 @@ -88,7 +88,7 @@ CONFIG(static, static|shared)|prefix_build {
483 -target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE
484 +target.path = $$NIX_OUTPUT_PLUGIN/$$PLUGIN_TYPE
487 qt_libinfix_plugins: TARGET = $$TARGET$$QT_LIBINFIX