mirror of
https://github.com/clearlinux/autospec.git
synced 2026-08-26 18:35:57 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f398f5e7b | |||
| 8e89d0cb0e | |||
| 6fa3d52db4 | |||
| 5905be97e8 | |||
| 81e1eebe28 | |||
| 658bd0de10 | |||
| b628caf931 | |||
| 8142032e7c | |||
| 5a302d6c91 | |||
| f56f1fa18d | |||
| 0c408e7089 | |||
| 5471f10f61 |
@@ -751,6 +751,10 @@ class Requirements(object):
|
|||||||
configure_ac_files = []
|
configure_ac_files = []
|
||||||
qmake_profiles = []
|
qmake_profiles = []
|
||||||
cmake_files = []
|
cmake_files = []
|
||||||
|
|
||||||
|
if config.config_opts['use_ninja']:
|
||||||
|
self.add_buildreq('ninja')
|
||||||
|
|
||||||
for dirpath, _, files in os.walk(dirn):
|
for dirpath, _, files in os.walk(dirn):
|
||||||
default_score = 2 if dirpath == dirn else 1
|
default_score = 2 if dirpath == dirn else 1
|
||||||
|
|
||||||
|
|||||||
@@ -289,7 +289,6 @@ LibIcal, libical-dev
|
|||||||
LibKEduVocDocument, libkeduvocdocument-dev
|
LibKEduVocDocument, libkeduvocdocument-dev
|
||||||
LibKWorkspace, plasma-workspace-dev
|
LibKWorkspace, plasma-workspace-dev
|
||||||
LibKompareDiff2, libkomparediff2-dev
|
LibKompareDiff2, libkomparediff2-dev
|
||||||
LibLZMA, xz-dev
|
|
||||||
LibNotificationManager, plasma-workspace-dev
|
LibNotificationManager, plasma-workspace-dev
|
||||||
LibObs, obs-studio-dev
|
LibObs, obs-studio-dev
|
||||||
LibTaskManager, plasma-workspace-dev
|
LibTaskManager, plasma-workspace-dev
|
||||||
|
|||||||
@@ -115,12 +115,15 @@ class Config(object):
|
|||||||
self.old_keyid = None
|
self.old_keyid = None
|
||||||
self.profile_payload = None
|
self.profile_payload = None
|
||||||
self.signature = None
|
self.signature = None
|
||||||
|
self.signature_macro = None
|
||||||
|
self.pkey_macro = None
|
||||||
self.yum_conf = None
|
self.yum_conf = None
|
||||||
self.failed_pattern_dir = None
|
self.failed_pattern_dir = None
|
||||||
self.alias = None
|
self.alias = None
|
||||||
self.failed_commands = {}
|
self.failed_commands = {}
|
||||||
self.ignored_commands = {}
|
self.ignored_commands = {}
|
||||||
self.gems = {}
|
self.gems = {}
|
||||||
|
self.keyid_blocklist = {}
|
||||||
self.license_hashes = {}
|
self.license_hashes = {}
|
||||||
self.license_translations = {}
|
self.license_translations = {}
|
||||||
self.license_blacklist = {}
|
self.license_blacklist = {}
|
||||||
@@ -184,6 +187,7 @@ class Config(object):
|
|||||||
"server": "Package is only used by servers",
|
"server": "Package is only used by servers",
|
||||||
"no_glob": "Do not use the replacement pattern for file matching",
|
"no_glob": "Do not use the replacement pattern for file matching",
|
||||||
"allow_exe": "Allow Windows executables (*.exe, *.dll) to be packaged",
|
"allow_exe": "Allow Windows executables (*.exe, *.dll) to be packaged",
|
||||||
|
"use_ninja": "Use ninja build files",
|
||||||
}
|
}
|
||||||
# simple_pattern_pkgconfig patterns
|
# simple_pattern_pkgconfig patterns
|
||||||
# contains patterns for parsing build.log for missing dependencies
|
# contains patterns for parsing build.log for missing dependencies
|
||||||
@@ -603,6 +607,7 @@ class Config(object):
|
|||||||
read_pattern_conf("license_blacklist", self.license_blacklist, list_format=True, path=path)
|
read_pattern_conf("license_blacklist", self.license_blacklist, list_format=True, path=path)
|
||||||
read_pattern_conf("qt_modules", self.qt_modules, path=path)
|
read_pattern_conf("qt_modules", self.qt_modules, path=path)
|
||||||
read_pattern_conf("cmake_modules", self.cmake_modules, path=path)
|
read_pattern_conf("cmake_modules", self.cmake_modules, path=path)
|
||||||
|
read_pattern_conf("keyid_blocklist", self.keyid_blocklist, list_format=True, path=path)
|
||||||
|
|
||||||
def parse_existing_spec(self, name):
|
def parse_existing_spec(self, name):
|
||||||
"""Determine the old version, old patch list, old keyid, and cves from old spec file."""
|
"""Determine the old version, old patch list, old keyid, and cves from old spec file."""
|
||||||
|
|||||||
@@ -76,7 +76,6 @@
|
|||||||
-lkrb5, krb5-dev
|
-lkrb5, krb5-dev
|
||||||
-lldap, openldap-dev
|
-lldap, openldap-dev
|
||||||
-lldb, ldb-dev
|
-lldb, ldb-dev
|
||||||
-llzma, xz-dev
|
|
||||||
-llzo, lzo-dev
|
-llzo, lzo-dev
|
||||||
-lmagic, file-dev
|
-lmagic, file-dev
|
||||||
-lmenu, ncurses-dev
|
-lmenu, ncurses-dev
|
||||||
@@ -512,7 +511,6 @@ LIBGCRYPT - version >= 1.5.0, libgcrypt-dev
|
|||||||
LIBGD, libgd-dev
|
LIBGD, libgd-dev
|
||||||
LIBICAL, libical-dev
|
LIBICAL, libical-dev
|
||||||
LIBKONQ, kde-baseapps-dev
|
LIBKONQ, kde-baseapps-dev
|
||||||
LIBLZMA, xz-dev
|
|
||||||
LIBNOTIFY, libnotify-dev
|
LIBNOTIFY, libnotify-dev
|
||||||
LIBPCREVERSION, pcre-dev
|
LIBPCREVERSION, pcre-dev
|
||||||
LIBRSVG, librsvg-dev
|
LIBRSVG, librsvg-dev
|
||||||
@@ -534,7 +532,6 @@ LibExiv2, pkgconfig(exiv2)
|
|||||||
LibKEduVocDocument, libkeduvocdocument-dev
|
LibKEduVocDocument, libkeduvocdocument-dev
|
||||||
LibKWorkspace, plasma-workspace-dev
|
LibKWorkspace, plasma-workspace-dev
|
||||||
LibKrb5, krb5-dev
|
LibKrb5, krb5-dev
|
||||||
LibLZMA, xz-dev
|
|
||||||
LibR, R-dev
|
LibR, R-dev
|
||||||
LibSSH, libssh-dev
|
LibSSH, libssh-dev
|
||||||
LibXml2, libxml2-dev
|
LibXml2, libxml2-dev
|
||||||
@@ -1100,7 +1097,6 @@ libhandy-0.0, libhandy-dev
|
|||||||
libiberty.h, binutils-dev
|
libiberty.h, binutils-dev
|
||||||
libkmod.h, kmod-dev
|
libkmod.h, kmod-dev
|
||||||
libksba, libksba-dev
|
libksba, libksba-dev
|
||||||
liblzma, xz-dev
|
|
||||||
libmnl/libmnl.h, libmnl-dev
|
libmnl/libmnl.h, libmnl-dev
|
||||||
libmpfr, mpfr-dev
|
libmpfr, mpfr-dev
|
||||||
libmspack >= 0.0.20040308alpha (via pkg-config), libmspack-dev
|
libmspack >= 0.0.20040308alpha (via pkg-config), libmspack-dev
|
||||||
@@ -1161,8 +1157,6 @@ lxqt-build-tools, lxqt-build-tools
|
|||||||
lxqt-globalkeys, lxqt-globalkeys-dev
|
lxqt-globalkeys, lxqt-globalkeys-dev
|
||||||
lxqt-globalkeys-ui, lxqt-globalkeys-dev
|
lxqt-globalkeys-ui, lxqt-globalkeys-dev
|
||||||
lz4.h, lz4-dev
|
lz4.h, lz4-dev
|
||||||
lzma, xz-dev
|
|
||||||
lzma.h, xz-dev
|
|
||||||
lzo/lzoconf.h, lzo-dev
|
lzo/lzoconf.h, lzo-dev
|
||||||
magic, file-dev
|
magic, file-dev
|
||||||
magic.h, file-dev
|
magic.h, file-dev
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
59FCF207FEA7F445
|
||||||
@@ -483,6 +483,10 @@ class GPGVerifier(Verifier):
|
|||||||
return None
|
return None
|
||||||
# valid signature exists at package_sign_path, operate on it now
|
# valid signature exists at package_sign_path, operate on it now
|
||||||
keyid = get_keyid(self.package_sign_path)
|
keyid = get_keyid(self.package_sign_path)
|
||||||
|
if keyid in self.config.keyid_blocklist:
|
||||||
|
self.print_result(False, err_msg='KNOWNBADACTOR: {}'.format(keyid))
|
||||||
|
self.quit()
|
||||||
|
|
||||||
# default location first
|
# default location first
|
||||||
pubkey_loc = self.pubkey_path.format(keyid)
|
pubkey_loc = self.pubkey_path.format(keyid)
|
||||||
cache_key = os.path.join(KEY_CACHE_DIR, pubkey_loc)
|
cache_key = os.path.join(KEY_CACHE_DIR, pubkey_loc)
|
||||||
|
|||||||
+32
-18
@@ -159,8 +159,17 @@ class Specfile(object):
|
|||||||
|
|
||||||
# if package is verified, include the signature in the source tarball
|
# if package is verified, include the signature in the source tarball
|
||||||
if self.keyid and self.config.signature:
|
if self.keyid and self.config.signature:
|
||||||
|
# We'll need gnupg to verify the signature. Need to add it here so it's ready before write_buildreq
|
||||||
|
self.requirements.add_buildreq("gnupg")
|
||||||
|
|
||||||
count += 1
|
count += 1
|
||||||
self._write_strip(f"Source{count} : {self.config.signature}")
|
self._write_strip(f"Source{count} : {self.config.signature}")
|
||||||
|
self.config.signature_macro = f"%{{SOURCE{count}}}"
|
||||||
|
|
||||||
|
# Also include the public key in the source tarball.
|
||||||
|
count += 1
|
||||||
|
self._write_strip(f"Source{count} : {self.keyid}.pkey")
|
||||||
|
self.config.pkey_macro = f"%{{SOURCE{count}}}"
|
||||||
|
|
||||||
for source in self.config.extra_sources:
|
for source in self.config.extra_sources:
|
||||||
count += 1
|
count += 1
|
||||||
@@ -405,6 +414,8 @@ class Specfile(object):
|
|||||||
self._write_strip("## make_prepend end")
|
self._write_strip("## make_prepend end")
|
||||||
if self.config.make_command:
|
if self.config.make_command:
|
||||||
make = self.config.make_command
|
make = self.config.make_command
|
||||||
|
elif self.config.config_opts['use_ninja']:
|
||||||
|
make = "ninja"
|
||||||
else:
|
else:
|
||||||
make = "make"
|
make = "make"
|
||||||
if build32:
|
if build32:
|
||||||
@@ -421,7 +432,11 @@ class Specfile(object):
|
|||||||
|
|
||||||
def write_cmake_line_openmpi(self):
|
def write_cmake_line_openmpi(self):
|
||||||
"""Write cmake line (openmpi) to spec file."""
|
"""Write cmake line (openmpi) to spec file."""
|
||||||
cmake_string = 'cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=$MPI_ROOT -DCMAKE_INSTALL_SBINDIR=$MPI_BIN \\\n' \
|
if self.config.config_opts['use_ninja']:
|
||||||
|
cmake_type = "Ninja"
|
||||||
|
else:
|
||||||
|
cmake_type = "Unix Makefiles"
|
||||||
|
cmake_string = f"cmake -G {cmake_type} -DCMAKE_INSTALL_PREFIX=$MPI_ROOT -DCMAKE_INSTALL_SBINDIR=$MPI_BIN \\\n" \
|
||||||
'-DCMAKE_INSTALL_LIBDIR=$MPI_LIB -DCMAKE_INSTALL_INCLUDEDIR=$MPI_INCLUDE -DLIB_INSTALL_DIR=$MPI_LIB \\\n' \
|
'-DCMAKE_INSTALL_LIBDIR=$MPI_LIB -DCMAKE_INSTALL_INCLUDEDIR=$MPI_INCLUDE -DLIB_INSTALL_DIR=$MPI_LIB \\\n' \
|
||||||
'-DBUILD_SHARED_LIBS:BOOL=ON -DLIB_SUFFIX=64 \\\n' \
|
'-DBUILD_SHARED_LIBS:BOOL=ON -DLIB_SUFFIX=64 \\\n' \
|
||||||
'-DCMAKE_AR=/usr/bin/gcc-ar -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_RANLIB=/usr/bin/gcc-ranlib \\\n'
|
'-DCMAKE_AR=/usr/bin/gcc-ar -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_RANLIB=/usr/bin/gcc-ranlib \\\n'
|
||||||
@@ -430,6 +445,12 @@ class Specfile(object):
|
|||||||
def write_prep(self):
|
def write_prep(self):
|
||||||
"""Write prep section to spec file."""
|
"""Write prep section to spec file."""
|
||||||
self._write_strip("%prep")
|
self._write_strip("%prep")
|
||||||
|
if self.keyid and self.config.signature:
|
||||||
|
self._write_strip("mkdir .gnupg")
|
||||||
|
self._write_strip("chmod 700 .gnupg")
|
||||||
|
self._write_strip(f"gpg --homedir .gnupg --import {self.config.pkey_macro}")
|
||||||
|
self._write_strip(f"gpg --homedir .gnupg --status-fd 1 --verify {self.config.signature_macro} %{{SOURCE0}} > gpg.status")
|
||||||
|
self._write_strip(f"grep -E '^\\[GNUPG:\\] (GOODSIG|EXPKEYSIG) {self.keyid}' gpg.status")
|
||||||
self.write_prep_prepend()
|
self.write_prep_prepend()
|
||||||
prefix = self.content.prefixes[self.url]
|
prefix = self.content.prefixes[self.url]
|
||||||
if self.config.default_pattern == 'R':
|
if self.config.default_pattern == 'R':
|
||||||
@@ -576,7 +597,7 @@ class Specfile(object):
|
|||||||
if self.config.config_opts['use_clang']:
|
if self.config.config_opts['use_clang']:
|
||||||
flags.extend(["-O3"])
|
flags.extend(["-O3"])
|
||||||
else:
|
else:
|
||||||
flags.extend(["-Ofast", "-fno-semantic-interposition", "-falign-functions=32"])
|
flags.extend(["-fno-semantic-interposition", "-falign-functions=32"])
|
||||||
if not self.config.config_opts['full-debug-info'] and not self.config.config_opts['use_clang']:
|
if not self.config.config_opts['full-debug-info'] and not self.config.config_opts['use_clang']:
|
||||||
flags.extend(["-gno-variable-location-views", "-gno-column-info", "-femit-struct-debug-baseonly", "-fdebug-types-section", "-gz=zstd", "-g1"])
|
flags.extend(["-gno-variable-location-views", "-gno-column-info", "-femit-struct-debug-baseonly", "-fdebug-types-section", "-gz=zstd", "-g1"])
|
||||||
if self.config.default_pattern != 'qmake' or self.config.default_pattern != 'qmake6':
|
if self.config.default_pattern != 'qmake' or self.config.default_pattern != 'qmake6':
|
||||||
@@ -1082,7 +1103,6 @@ class Specfile(object):
|
|||||||
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
||||||
self.write_build_prepend()
|
self.write_build_prepend()
|
||||||
self._write_strip("GOAMD64=v3")
|
self._write_strip("GOAMD64=v3")
|
||||||
self._write_strip('CC="gcc-14"')
|
|
||||||
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
||||||
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
@@ -1188,7 +1208,6 @@ class Specfile(object):
|
|||||||
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
||||||
self.write_build_prepend()
|
self.write_build_prepend()
|
||||||
self._write_strip("GOAMD64=v3")
|
self._write_strip("GOAMD64=v3")
|
||||||
self._write_strip('CC="gcc-14"')
|
|
||||||
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
||||||
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
@@ -1249,7 +1268,6 @@ class Specfile(object):
|
|||||||
self._write_strip("pushd ../buildapx" + self.config.subdir)
|
self._write_strip("pushd ../buildapx" + self.config.subdir)
|
||||||
self.write_build_prepend()
|
self.write_build_prepend()
|
||||||
self._write_strip("GOAMD64=v3")
|
self._write_strip("GOAMD64=v3")
|
||||||
self._write_strip('CC=gcc-14')
|
|
||||||
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
||||||
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
@@ -1327,7 +1345,6 @@ class Specfile(object):
|
|||||||
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
||||||
self.write_build_prepend()
|
self.write_build_prepend()
|
||||||
self._write_strip("GOAMD64=v3")
|
self._write_strip("GOAMD64=v3")
|
||||||
self._write_strip('CC=gcc-14')
|
|
||||||
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
||||||
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
@@ -1372,7 +1389,6 @@ class Specfile(object):
|
|||||||
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
|
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
|
||||||
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
||||||
self.write_build_prepend()
|
self.write_build_prepend()
|
||||||
self._write_strip('CC=gcc-14')
|
|
||||||
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
||||||
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
@@ -1420,7 +1436,6 @@ class Specfile(object):
|
|||||||
|
|
||||||
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
|
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
|
||||||
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
||||||
self._write_strip('CC=gcc-14')
|
|
||||||
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
||||||
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
@@ -1463,7 +1478,6 @@ class Specfile(object):
|
|||||||
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
|
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
|
||||||
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
||||||
self.write_build_prepend()
|
self.write_build_prepend()
|
||||||
self._write_strip('CC=gcc-14')
|
|
||||||
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
||||||
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
@@ -1508,7 +1522,6 @@ class Specfile(object):
|
|||||||
|
|
||||||
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
|
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
|
||||||
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
self._write_strip("pushd ../buildapx/" + self.config.subdir)
|
||||||
self._write_strip('CC=gcc-14')
|
|
||||||
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
||||||
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
@@ -1624,7 +1637,11 @@ class Specfile(object):
|
|||||||
self._write_strip("pushd clr-build")
|
self._write_strip("pushd clr-build")
|
||||||
self.write_variables()
|
self.write_variables()
|
||||||
self._write_strip("export GOAMD64=v2")
|
self._write_strip("export GOAMD64=v2")
|
||||||
self._write_strip("%cmake {} {}".format(self.config.cmake_srcdir, self.extra_cmake))
|
if self.config.config_opts['use_ninja']:
|
||||||
|
cmake_type = "-G Ninja"
|
||||||
|
else:
|
||||||
|
cmake_type = "-G 'Unix Makefiles'"
|
||||||
|
self._write_strip(f"%cmake {self.config.cmake_srcdir} {self.extra_cmake} {cmake_type}")
|
||||||
|
|
||||||
self.write_profile_payload("cmake")
|
self.write_profile_payload("cmake")
|
||||||
|
|
||||||
@@ -1641,7 +1658,7 @@ class Specfile(object):
|
|||||||
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
||||||
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
||||||
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX2_CFLAGS} "')
|
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX2_CFLAGS} "')
|
||||||
self._write_strip("%cmake {} {}".format(self.config.cmake_srcdir, self.extra_cmake))
|
self._write_strip(f"%cmake {self.config.cmake_srcdir} {self.extra_cmake} {cmake_type}")
|
||||||
self.write_make_line()
|
self.write_make_line()
|
||||||
self._write_strip("popd")
|
self._write_strip("popd")
|
||||||
|
|
||||||
@@ -1655,7 +1672,7 @@ class Specfile(object):
|
|||||||
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
|
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
|
||||||
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
|
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {AVX512_CFLAGS} {AVX512_LFLAGS} "')
|
||||||
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX512_CFLAGS} "')
|
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {AVX512_CFLAGS} "')
|
||||||
self._write_strip("%cmake {} {}".format(self.config.cmake_srcdir, self.extra_cmake))
|
self._write_strip(f"%cmake {self.config.cmake_srcdir} {self.extra_cmake} {cmake_type}")
|
||||||
self.write_make_line()
|
self.write_make_line()
|
||||||
self._write_strip("popd")
|
self._write_strip("popd")
|
||||||
|
|
||||||
@@ -1665,12 +1682,11 @@ class Specfile(object):
|
|||||||
self.write_build_prepend()
|
self.write_build_prepend()
|
||||||
self.write_variables()
|
self.write_variables()
|
||||||
self._write_strip("GOAMD64=v3")
|
self._write_strip("GOAMD64=v3")
|
||||||
self._write_strip('CC=gcc-14')
|
|
||||||
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'CFLAGS="$CLEAR_INTERMEDIATE_CFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
self._write_strip(f'CXXFLAGS="$CLEAR_INTERMEDIATE_CXXFLAGS {AVX2_CFLAGS} {AVX2_LFLAGS} "')
|
||||||
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
self._write_strip(f'FFLAGS="$CLEAR_INTERMEDIATE_FFLAGS {APX_CFLAGS} {APX_LFLAGS} "')
|
||||||
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {APX_CFLAGS} "')
|
self._write_strip(f'FCFLAGS="$CLEAR_INTERMEDIATE_FCFLAGS {APX_CFLAGS} "')
|
||||||
self._write_strip("%cmake {} {}".format(self.config.cmake_srcdir, self.extra_cmake))
|
self._write_strip(f"%cmake {self.config.cmake_srcdir} {self.extra_cmake} {cmake_type}")
|
||||||
self.write_make_line()
|
self.write_make_line()
|
||||||
self._write_strip("popd")
|
self._write_strip("popd")
|
||||||
|
|
||||||
@@ -1683,7 +1699,7 @@ class Specfile(object):
|
|||||||
self._write_strip("%cmake -DLIB_INSTALL_DIR:PATH=/usr/lib32 "
|
self._write_strip("%cmake -DLIB_INSTALL_DIR:PATH=/usr/lib32 "
|
||||||
"-DCMAKE_INSTALL_LIBDIR=/usr/lib32 "
|
"-DCMAKE_INSTALL_LIBDIR=/usr/lib32 "
|
||||||
"-DLIB_SUFFIX=32 "
|
"-DLIB_SUFFIX=32 "
|
||||||
"{} {} ".format(self.config.cmake_srcdir, self.extra_cmake))
|
f"{self.config.cmake_srcdir} {self.extra_cmake} {cmake_type}")
|
||||||
self.write_make_line()
|
self.write_make_line()
|
||||||
self._write_strip("unset PKG_CONFIG_PATH")
|
self._write_strip("unset PKG_CONFIG_PATH")
|
||||||
self._write_strip("popd")
|
self._write_strip("popd")
|
||||||
@@ -1871,7 +1887,6 @@ class Specfile(object):
|
|||||||
self._write_strip('ninja -v -C builddiravx512')
|
self._write_strip('ninja -v -C builddiravx512')
|
||||||
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
|
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
|
||||||
self._write_strip("GOAMD64=v3")
|
self._write_strip("GOAMD64=v3")
|
||||||
self._write_strip('CC=gcc-14')
|
|
||||||
if self.config.config_opts['pgo'] and self.config.profile_payload != "":
|
if self.config.config_opts['pgo'] and self.config.profile_payload != "":
|
||||||
self._write_strip(f'CFLAGS="$CFLAGS_GENERATE {APX_CFLAGS} {APX_LFLAGS} "'
|
self._write_strip(f'CFLAGS="$CFLAGS_GENERATE {APX_CFLAGS} {APX_LFLAGS} "'
|
||||||
f' CXXFLAGS="$CXXFLAGS_GENERATE {AVX2_CFLAGS} {AVX2_LFLAGS} "'
|
f' CXXFLAGS="$CXXFLAGS_GENERATE {AVX2_CFLAGS} {AVX2_LFLAGS} "'
|
||||||
@@ -1942,7 +1957,6 @@ class Specfile(object):
|
|||||||
self._write_strip('DESTDIR=%{buildroot}-v4 ninja -C builddiravx512 install')
|
self._write_strip('DESTDIR=%{buildroot}-v4 ninja -C builddiravx512 install')
|
||||||
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
|
if self.config.config_opts['use_apx'] and not self.config.config_opts['use_clang']:
|
||||||
self._write_strip("GOAMD64=v3")
|
self._write_strip("GOAMD64=v3")
|
||||||
self._write_strip('CC=gcc-14')
|
|
||||||
self._write_strip('DESTDIR=%{buildroot}-va ninja -C builddirapx install')
|
self._write_strip('DESTDIR=%{buildroot}-va ninja -C builddirapx install')
|
||||||
|
|
||||||
self._write_strip("GOAMD64=v2")
|
self._write_strip("GOAMD64=v2")
|
||||||
|
|||||||
+1
-1
@@ -135,7 +135,7 @@ def convert_version(ver_str, name):
|
|||||||
# them out with expensive regular expressions
|
# them out with expensive regular expressions
|
||||||
banned_subs = ["x86.64", "source", "src", "all", "bin", "release", "rh",
|
banned_subs = ["x86.64", "source", "src", "all", "bin", "release", "rh",
|
||||||
"ga", ".ce", "lcms", "onig", "linux", "gc", "sdk", "orig",
|
"ga", ".ce", "lcms", "onig", "linux", "gc", "sdk", "orig",
|
||||||
"jurko", "%2f", "%2F", "%20"]
|
"jurko", "%2f", "%2F", "%20", "x265"]
|
||||||
|
|
||||||
# package names may be modified in the version string by adding "lib" for
|
# package names may be modified in the version string by adding "lib" for
|
||||||
# example. Remove these from the name before trying to remove the name from
|
# example. Remove these from the name before trying to remove the name from
|
||||||
|
|||||||
@@ -402,6 +402,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
should be sufficient.
|
should be sufficient.
|
||||||
"""
|
"""
|
||||||
conf = config.Config("")
|
conf = config.Config("")
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'setup.py'), 'w').close()
|
open(os.path.join(tmpd, 'setup.py'), 'w').close()
|
||||||
@@ -418,6 +419,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
should be sufficient.
|
should be sufficient.
|
||||||
"""
|
"""
|
||||||
conf = config.Config("")
|
conf = config.Config("")
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'CMakeLists.txt'), 'w').close()
|
open(os.path.join(tmpd, 'CMakeLists.txt'), 'w').close()
|
||||||
@@ -434,6 +436,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
should be sufficient.
|
should be sufficient.
|
||||||
"""
|
"""
|
||||||
conf = config.Config("")
|
conf = config.Config("")
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'SConstruct'), 'w').close()
|
open(os.path.join(tmpd, 'SConstruct'), 'w').close()
|
||||||
@@ -450,6 +453,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
should be sufficient.
|
should be sufficient.
|
||||||
"""
|
"""
|
||||||
conf = config.Config("")
|
conf = config.Config("")
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'meson.build'), 'w').close()
|
open(os.path.join(tmpd, 'meson.build'), 'w').close()
|
||||||
@@ -480,6 +484,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
buildreq.pypidata.get_pypi_metadata = MagicMock(return_value=content)
|
buildreq.pypidata.get_pypi_metadata = MagicMock(return_value=content)
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
conf = config.Config(tmpd)
|
conf = config.Config(tmpd)
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'subdir', 'pyproject.toml'), 'w').close()
|
open(os.path.join(tmpd, 'subdir', 'pyproject.toml'), 'w').close()
|
||||||
self.reqs.scan_for_configure(os.path.join(tmpd, 'subdir'), "", conf)
|
self.reqs.scan_for_configure(os.path.join(tmpd, 'subdir'), "", conf)
|
||||||
@@ -512,6 +517,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
m_open = mock_open(read_data=content)
|
m_open = mock_open(read_data=content)
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
conf = config.Config(tmpd)
|
conf = config.Config(tmpd)
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'subdir', 'pyproject.toml'), 'w').close()
|
open(os.path.join(tmpd, 'subdir', 'pyproject.toml'), 'w').close()
|
||||||
open(os.path.join(tmpd, 'pypi.json'), 'w').close()
|
open(os.path.join(tmpd, 'pypi.json'), 'w').close()
|
||||||
@@ -537,6 +543,7 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
|
|
||||||
with tempfile.TemporaryDirectory() as tmpd:
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
conf = config.Config(tmpd)
|
conf = config.Config(tmpd)
|
||||||
|
conf.config_opts['use_ninja'] = False
|
||||||
os.mkdir(os.path.join(tmpd, 'subdir'))
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
open(os.path.join(tmpd, 'subdir', 'setup.py'), 'w').close()
|
open(os.path.join(tmpd, 'subdir', 'setup.py'), 'w').close()
|
||||||
open(os.path.join(tmpd, 'subdir', 'requires.txt'), 'w').close()
|
open(os.path.join(tmpd, 'subdir', 'requires.txt'), 'w').close()
|
||||||
@@ -546,6 +553,21 @@ class TestBuildreq(unittest.TestCase):
|
|||||||
self.reqs.add_setup_py_requires.assert_called_once()
|
self.reqs.add_setup_py_requires.assert_called_once()
|
||||||
self.reqs.grab_python_requirements.assert_called_once()
|
self.reqs.grab_python_requirements.assert_called_once()
|
||||||
|
|
||||||
|
def test_scan_for_configure_ninja(self):
|
||||||
|
"""
|
||||||
|
Test scan_for_configure when ninja is enabled.
|
||||||
|
"""
|
||||||
|
conf = config.Config("")
|
||||||
|
conf.config_opts['use_ninja'] = True
|
||||||
|
with tempfile.TemporaryDirectory() as tmpd:
|
||||||
|
os.mkdir(os.path.join(tmpd, 'subdir'))
|
||||||
|
open(os.path.join(tmpd, 'setup.py'), 'w').close()
|
||||||
|
|
||||||
|
self.reqs.scan_for_configure(tmpd, "", conf)
|
||||||
|
|
||||||
|
self.assertEqual(self.reqs.buildreqs,
|
||||||
|
set(['buildreq-distutils3', 'ninja']))
|
||||||
|
|
||||||
def test_parse_cmake_pkg_check_modules(self):
|
def test_parse_cmake_pkg_check_modules(self):
|
||||||
"""
|
"""
|
||||||
Test parse_cmake to ensure accurate detection of versioned and
|
Test parse_cmake to ensure accurate detection of versioned and
|
||||||
|
|||||||
Reference in New Issue
Block a user