Changeset View
Changeset View
Standalone View
Standalone View
bin/BuildSystem/BuildSystemBase.py
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Line(s) | 154 | for fileName in files: | |||
---|---|---|---|---|---|
165 | with open(fileName, "wb") as f: | 165 | with open(fileName, "wb") as f: | ||
166 | f.write(content) | 166 | f.write(content) | ||
167 | return True | 167 | return True | ||
168 | 168 | | |||
169 | def internalPostInstall(self): | 169 | def internalPostInstall(self): | ||
170 | if not super().internalPostInstall(): | 170 | if not super().internalPostInstall(): | ||
171 | return False | 171 | return False | ||
172 | # a post install routine to fix the prefix (make things relocatable) | 172 | # a post install routine to fix the prefix (make things relocatable) | ||
173 | pkgconfigPath = os.path.join(self.imageDir(), "lib", "pkgconfig") | | |||
174 | newPrefix = OsUtils.toUnixPath(CraftCore.standardDirs.craftRoot()) | 173 | newPrefix = OsUtils.toUnixPath(CraftCore.standardDirs.craftRoot()) | ||
175 | oldPrefixes = [self.subinfo.buildPrefix] | 174 | oldPrefixes = [self.subinfo.buildPrefix] | ||
176 | if CraftCore.compiler.isWindows: | 175 | if CraftCore.compiler.isWindows: | ||
177 | oldPrefixes += [OsUtils.toUnixPath(self.subinfo.buildPrefix), OsUtils.toMSysPath(self.subinfo.buildPrefix)] | 176 | oldPrefixes += [OsUtils.toUnixPath(self.subinfo.buildPrefix), OsUtils.toMSysPath(self.subinfo.buildPrefix)] | ||
178 | 177 | | |||
179 | if os.path.exists(pkgconfigPath): | 178 | pattern = [re.compile("^.*(pc|pri|cmake)$")] | ||
180 | for pcFile in os.listdir(pkgconfigPath): | 179 | files = utils.filterDirectoryContent(self.installDir(), whitelist=lambda x, root: utils.regexFileFilter(x, root, pattern), | ||
181 | if pcFile.endswith(".pc"): | 180 | blacklist=lambda x, root: True) | ||
182 | path = os.path.join(pkgconfigPath, pcFile) | 181 | | ||
183 | if not self.patchInstallPrefix([path], oldPrefixes, newPrefix): | 182 | if not self.patchInstallPrefix(files, oldPrefixes, newPrefix): | ||
184 | return False | 183 | return False | ||
vonreth: Any other file type we need to check? | |||||
Shouldn't be no, that covers everything I can immediately think of - pkgconfig, QMake and CMake. bcooksley: Shouldn't be no, that covers everything I can immediately think of - pkgconfig, QMake and CMake. | |||||
185 | 184 | | |||
186 | if (CraftCore.compiler.isMacOS | 185 | if (CraftCore.compiler.isMacOS | ||
187 | and os.path.isdir(self.installDir())): | 186 | and os.path.isdir(self.installDir())): | ||
188 | files = utils.filterDirectoryContent(self.installDir(), lambda x, root: utils.isBinary(x.path), lambda x, root: True) | 187 | files = utils.filterDirectoryContent(self.installDir(), lambda x, root: utils.isBinary(x.path), lambda x, root: True) | ||
189 | for f in files: | 188 | for f in files: | ||
190 | if os.path.islink(f): | 189 | if os.path.islink(f): | ||
191 | continue | 190 | continue | ||
192 | _, ext = os.path.splitext(f) | 191 | _, ext = os.path.splitext(f) | ||
Show All 27 Lines |
Any other file type we need to check?