Skip to content
This repository was archived by the owner on Aug 7, 2025. It is now read-only.

Commit ced5bef

Browse files
author
William Douglas
committed
Add qmake5 build pattern
Add support for qmake5 build pattern that uses the qmake binary in /usr/lib64/qt5. Signed-off-by: William Douglas <william.douglas@intel.com>
1 parent 65cf152 commit ced5bef

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

autospec/specfiles.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1806,6 +1806,59 @@ def write_cmake_pattern(self):
18061806

18071807
self.write_cmake_install()
18081808

1809+
def write_qmake5_pattern(self):
1810+
"""Write qmake5 build pattern to spec file."""
1811+
extra_qmake_args = ""
1812+
if self.config.config_opts['use_clang']:
1813+
extra_qmake_args = "-spec linux-clang "
1814+
if self.config.config_opts['use_lto']:
1815+
extra_qmake_args += "-config ltcg -config fat-static-lto "
1816+
else:
1817+
extra_qmake_args += "QMAKE_CFLAGS+=-fno-lto QMAKE_CXXFLAGS+=-fno-lto "
1818+
1819+
self.write_prep()
1820+
self._write_strip("%build")
1821+
self.write_build_prepend()
1822+
self.write_proxy_exports()
1823+
self._write_strip("export LANG=C.UTF-8")
1824+
self.write_variables()
1825+
1826+
if self.config.subdir:
1827+
self._write_strip("pushd " + self.config.subdir)
1828+
1829+
self._write_strip('export QMAKE_CFLAGS="$CFLAGS"')
1830+
self._write_strip('export QMAKE_CXXFLAGS="$CXXFLAGS"')
1831+
self._write_strip('export QMAKE_LFLAGS="$LDFLAGS"')
1832+
self._write_strip('export QMAKE_LIBDIR=/usr/lib64')
1833+
self._write_strip('export QMAKE_CFLAGS_RELEASE=')
1834+
self._write_strip('export QMAKE_CXXFLAGS_RELEASE=')
1835+
1836+
# Add the qtbase tools to the path
1837+
self._write_strip('export PATH=/usr/lib64/qt5/bin:$PATH')
1838+
1839+
if self.config.make_command:
1840+
qmake = self.config.make_command
1841+
else:
1842+
qmake = "qmake"
1843+
self._write_strip(f"{qmake} {extra_qmake_args} {self.config.extra_configure}")
1844+
self._write_strip("test -r config.log && cat config.log")
1845+
self.write_make_line()
1846+
1847+
if self.config.subdir:
1848+
self._write_strip("popd")
1849+
1850+
if self.config.config_opts['use_avx2']:
1851+
self._write_strip("pushd ../buildavx2/" + self.config.subdir)
1852+
self._write(f"{qmake} 'QT_CPU_FEATURES.x86_64 += avx avx2 bmi bmi2 f16c fma lzcnt popcnt'\\\n")
1853+
self._write(f' QMAKE_CFLAGS+="{AVX2_CFLAGS} {AVX2_LFLAGS}" QMAKE_CXXFLAGS+="{AVX2_CFLAGS} {AVX2_LFLAGS}" \\\n')
1854+
self._write(f' QMAKE_LFLAGS+="{AVX2_LCFLAGS}" {extra_qmake_args} {self.config.extra_configure}\n')
1855+
self.write_make_line()
1856+
self._write_strip("popd")
1857+
1858+
self.write_build_append()
1859+
self._write_strip("\n")
1860+
self.write_make_install()
1861+
18091862
def write_qmake_pattern(self):
18101863
"""Write qmake build pattern to spec file."""
18111864
extra_qmake_args = ""

0 commit comments

Comments
 (0)