aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-01-16merge-srpm: updated documentationpohlyPatrick Ohly
Include x11/wayland under ivi, use i686 as alternative, enable optimization of common code by listing all profiles/archs and the wayland/ivi feature check.
2015-01-16merge-srpm: optimize if checksPatrick Ohly
Implements enough rewrite rules to give the desired result for the cairo recipe in the recommented setup for Tizen. Specifically, it: - merges nested checks where one is more restrictive than the other - removes if checks that are true for all known build configs - merges two adjacent checks with the same content into one with a combined check. The current approach uses brute force to apply all possible combination of rewrite rules. It is possible that the result space can be pruned already while generating combinations; this may be worth investigating if runtime performance becomes an issue. Run with debug logging to see what rewriting rules are tried.
2015-01-16merge-srpm: parse and re-generate conditional sectionsPatrick Ohly
This is the first step towards optimizing conditional sections. At the moment, no transformations are done and the output is exactly the same as before.
2015-01-16merge-srpm: initial functional versionPatrick Ohly
merge-srpm.py compares the output of meta-translator in different build configurations and produces one combined spec file and set of source and patch files, using configurable if checks to mark regions that are not common to all configs. Different content of files with the same name is detected and causes the files to be renamed. Relies on spec files which do not care about the exact name in Source and Patch properties. The conditional sections are created by diffing files, so the result is nicer when changes affect entire lines instead of just some words in a long, otherwise unmodified line. In other words, reformatting long configure invocations is useful.
2015-01-16package_srpm: be explicit about target file name during copyPatrick Ohly
When merging multiple .spec files, we may end up having to rename source files when they have conflicting content. "cp %{source}" must re-recreate the original file name. It also makes it easier to review what the cp operations do.
2015-01-16package_srpm: reformat command invocationsPatrick Ohly
In particular configure invocations can become very long. Adding or removing individual arguments leads to poor diffs because the entire line is changed. It also is not very readable. The new srpm_reflow_cmds() can be used in SRPM_EXTRA_HOOKS to reformat some common command invocations (currently hard-coded to configure and python calls, in particular "%{__python} $RPM_SOURCE_DIR/file-list-generator.py") such that each parameter is on its own line. All of them, even the last one, have a \ at the end of the line, to avoid extra diff noise when the last parameter changes. Unfortunately parsing with shlex.split() and re-encoding with pipes.quote() does not preserve the original semantic: parameters where shell expansion are allowed will get surrounded by single quotes by pipes.quote(), preventing expansion. A hack is used to detect that and enable expansion again.
2015-01-05path variables: avoid ExpansionErrorPatrick Ohly
After replacing ${systemd_unitdir} with %{_unitdir}, some recipes (for example, avahi) failed to convert properly because %{_unitdir} appeared inside a ${@...} block where closing curly brackets are not allowed. To avoid the issue, use XXX and YYY as start/end markers around rpm macros and only replace with %{...} as the final step right before writing the .spec file. This is also done for the other path variables as a precaution because it was a simple, local change. Other replacements may have similar issues in recipes that have not been tested yet.
2015-01-05package_srpm: PACKAGECONFIG support optionalPatrick Ohly
For testing the migration to the revised code it was useful to disable the new PACKAGECONFIG support temporarily. It might also be useful in other cases, so make this configurable via SRPM_IGNORE_PACKAGECONFIG with "not ignored" as default.
2015-01-05package_srpm: workaround for adding autotools files (bzip2)Patrick Ohly
In addition to copying into %{_builddir}, also copy Makefile.am, configure.ac and configure.in into the unpacked source directory. Necessary for versions of the bzip2 recipe where the do_extraunpack does not get converted (as in Poky 1.7). A better solution would be to also consider the "subdir" SRC_URI parameter, but that does not help yet for bzip2 in Poky 1.7 because the bzip2 recipe was only changed to use "subdir" later.
2015-01-05package_srpm: comment about copying filesPatrick Ohly
Explain that the code was added for recipes like acpid.
2015-01-05package_srpm: return to build dirPatrick Ohly
After each code block inserted into a .spec file operation, return to the build dir because the code block may have changed the current directory and the next block might expect to be in the build directory again (because that is how BitBake runs each task). The extra "cd" invocations in the .spec file are often redundant, but determining reliably whether they are needed would be more work for little gain (nicer .spec files).
2015-01-05package_srpm: improve build_dir calculationPatrick Ohly
Replacing PN and PV before explanding S failed for sqlite3, which runs Python code to determine S. Instead do string replacements in the final string to get the same effect (nicer .spec file). Avoid basename(), because that logic fails for recipes which build deeper inside the source tree (tcl) or recipes with trailing slashes (pkgconfig). Instead strip the well-known %{_builddir} path prefix to get the remaining path components. Finally, do all of that once outside of the code which generates the "setup -n", because other code will also need to know the build dir.
2015-01-05package_srpm: copy additional source files into build dirPatrick Ohly
In some cases (bzip2) these are configure.ac and Makefile.am that are later used during do_configure, in other cases (acpid) these are files that recipes expect to find in WORKDIR (aka %{_builddir} in the .spec). Some of the extra files are handled by the package_srpm_extra_pkginfo() hook. It now can return a list of source numbers which don't need to be copied.
2015-01-05package_srpm: fix intra-recipe dependency checkPatrick Ohly
As the comment correctly pointed out, the "= %{version}%{release}" dependency must be applied to all packages built from the same recipe, but then the code only compared against the main package. Better generate the list of packages getting built once, and check against that. Also let's drop the 'PKG_' check, because it is uncertain whether that has any effect.
2015-01-05package_srpm: fix inter-recipe dependency printingPatrick Ohly
In the code path for dependencies to other other recipes with version specification, the package name was not renamed.
2015-01-05srpm_utils: fix infodir typoPatrick Ohly
The "infodir" has been misspelled as "infordir" for a while...
2015-01-05package_srpm: run empty populate_packagesPatrick Ohly
Several classes append or prepend to populate_packages to modify the resulting packages. We are not interested in populate_packages itself (does thing related to binary packages, which we don't have here), but we do want this extra code, for example from useradd.bbclass or Tizen's libpkg.bbclass. So replace populate_packages with an empty stub and then execute the combined function. It would be nice to do that such that populate_packages only gets replaced during translation, but that is hard to achieve due to the way how variables are expanded.
2015-01-05package_srpm: handle % in regex replacePatrick Ohly
"connmann" and "which" recipes use % as separator in a sed replace operation. This is a special character in .spec files, leading to rpmbuild mangling and breaking the shell command. Fix this with regular expressions for all recipes.
2014-12-19package_srpm: fix incorrect return values from parse_packageconfigHEADmasterRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-19package_srpm: replace base_do_configure with a stubRoss Burton
base_do_configure() simply does a clean of an existing build tree, so doesn't serve any purpose in spec files. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-19package_srpm: use translator-specific data when fetchingRoss Burton
Don't use the original data when fetching as there may be translator-specific overrides in effect on SRC_URI. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-19package_srpm: handle PACKAGECONFIG parse failures more gracefullyRoss Burton
Instead of emitting an error log and later hitting unbound variables, emit a warning log and set the expected values to empty strings. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-19package_srpm: Add srpm OVERRIDE when translatingRoss Burton
Add "srpm" to OVERRIDES when archiving and translating so that translation-specific modifications can be made to recipes. Based on a series of patches by Patrick Ohly. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-17package_srpm: rename functions to _srcrpmPatrick Ohly
Use _srcrpm in task and function names so that _srpm is free to be used as an override. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-17Rename "translator" task into "srpms"Patrick Ohly
This has two advantages: - it better describes what the task does ("translator - translate into what?!") - it allows using "translator" as override [ Rename changed from srpm to srpms - RB ] Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-16srpm_utils: replace systemd_unitdirRoss Burton
The Tizen RPM macro %{_unitdir} is the *system* unit directory, so this has to be expanded to the parent of that directory. Ugly, but it works. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-16gitignore: addRoss Burton
2014-12-16package_srpm: handle exceptions from parse_packageconfigRoss Burton
parse_packageconfig() causes lots of expansions which are prone to break due to Bitbake's poor handling of Python fragments. For example this string value when expanded causes a parse failure due to the embedded }: ${@some_python("%{foo}")} Instead of producing useless errors (which is due to bb.data.exec_func() silently failing), catch the exception and log it for clarity. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-15file-list-generator.py: additional debug output for matchingPatrick Ohly
Print full path of each file and what it gets added to. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-15file-list-generator.py: also include symlink info for filesPatrick Ohly
For consistency with dir symlinks, also add -> <target> for file symlinks. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-15file-list-generator.py: handle symlinks to dirsPatrick Ohly
os.walk() unexpectedly reports symlinks to directories as directories. We need to treat them like directory content, ie. like regular files. When listing the content of the install directory, show what the directory symlink points to. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-15fix multilib suppressionPatrick Ohly
Replacing oe_multilib_header with an empty function leads to a shell syntax error. A function must have at least one command, so replace with : instead. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-13package_srpm: move clean_data() to a Python moduleRoss Burton
The reference to ${EXTRA_OECONF} in the replacement autotools_do_configure can't be expanded until we want it to, but that's tricky/ugly if it is in the bbclass. Solve this by starting to move code to a new Python helper module. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-13handle PACKAGECONFIGRoss Burton
Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-12package_srpm: refactor print_deps()Ross Burton
Refactor print_deps() so that its just a wrapper around prepare_deps(). Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05autoconf: check for files before autoreconf and configurePatrick Ohly
The autotools_do_configure also checks and thus works for recipes which do not have all the files that autoreconf and/or configure expect. Do likewise in .spec files. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05do not remove dependencies too aggressivelyPatrick Ohly
The assumption that certain tools are always installed is not true for Tizen. If it is true for other distros, then those distros can remove undesired dependencies by appending to SRPM_REWRITE_DEPENDS. Instead, properly map these tools to the package providing them. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05hook for per-package source and informationPatrick Ohly
One usage of the the hook is injecting a %manifest line into the %package sections of each (sub-)package and the necessary Source entry. Doing this via the general-purpose post-processing hook would have been more work and led to code-duplication, because the code adding the extra information would have had to parse the .spec file again and re-do the package renaming. The approach for the hook is the same as for a similar hook in package_rpm.bbclass: setting SRPM_EXTRA_PKGDATA to 1 enables a call to package_srpm_extra_pkgdata(), which must be a Python method provided by the user of the hook. This is simpler than looking up many different hook methods by name. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05handle epoch in intra-package dependencyPatrick Ohly
When making a sub-package depend on some other package from the same recipe, we need to take the epoch into account. Relevant for recipes like libnl and glib-2.0. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05autotools_do_configure: need to determine ac pathsPatrick Ohly
In some recipes (for example, expat), the -I parameters for aclocal is important. We need to use the same logic as in autotools_do_configure to determine them. In fact, if autotools.bbclass was refactored slightly we could call that code snippet directly. Creating a separate srpm_autotools_do_configure shell function also makes the code a bit easier. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05SRPM_REWRITE_RUNTIME_DEPS: rewrite RDEPENDS, RPROVIDES, etc.Patrick Ohly
Uses regular expressions as in SRPM_RENAME instead of string mapping as in SRPM_REWRITE_DEPENDS. Useful for replacing perl-module and python-module runtime dependencies in Tizen: SRPM_REWRITE_RUNTIME_DEPS_append = " \ perl-module-.*=perl \ python-core=python \ python-textutils=python \ " Uses the same code as SRPM_RENAME, thus the refactoring. The actual replacement happens after turning one versioned dependency into a single string and before concatenating all of them; bb.utils.join_deps() had to be copied to inject the regex replacement. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05fix freetype replacementPatrick Ohly
freetype is actually version 2.x and provides freetype2.pc. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05avoid arch dependenciesPatrick Ohly
Several arch-specific variables get inserted into generated .spec files, for example in boost. We need to use the corresponding spec macros to avoid arch dependencies in the .spec file. Also makes the toolchain replacement simpler, because we don't need to list all the possible compilerlibs and gcc variants. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05gtk-doc-stub-native: also provides introspection.m4Patrick Ohly
For some reason gtk-doc-stub-native also contains introspection.m4, so the replacement must also contain gobject-introspection, because that is the package that normally has that file. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05SRPM_REWRITE_DEPENDS: support replacement with multiple packagesPatrick Ohly
This makes the right hand side a comma-separated list that gets expanded into one dependency per entry. Needed for gtk-doc-stub-native=gtk-doc,gobject-introspection. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05enable autoreconfPatrick Ohly
Some recipes patch autotools input files, in which case we get autotools version mismatches during "make" when it tries to rebuild the output files. We must recreate all files using the current set of autotools. Even if this is not necessary for some recipe, doing it always ensures that it'll work once it becomes necessary for some reason. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05file-list-generator.py: fix packaging of entire directoriesPatrick Ohly
The "is directory" check only worked for directories also present on the build file system because the install directory path was dropped by os.path.join(). Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05file-list-generator.py: INFO listing of installed filesPatrick Ohly
It is useful to know the output of the install phase. Print an indented listing of files and directories at INFO level. Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-05file-list-generator.py: --keep unmatched filesPatrick Ohly
It may be useful to not delete files that are not in any package. Not used at the moment, though. The original use case was bundling of locale files with Tizen's %find_lang macro. It turned out that not removing the -locale packages from PACKAGES is easier. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2014-12-01package_srpm: hack away oe_multilib_headerRoss Burton
Stub away this function for now, until we need to support multilib translations. RPM-land does ML differently anyway. Signed-off-by: Ross Burton <ross.burton@intel.com>