Commit 7ee11c38 authored by A. Wilcox's avatar A. Wilcox 🦊
Browse files

Portage integration: Handle PROVIDES and give it to apk

parent 2a693a78
......@@ -183,6 +183,26 @@ def _translate_dep(dep):
return '{name}{op}{ver}'.format(name=package, op=dep_op, ver=ver)
def _maybe_package_provides(settings):
"""Determine if this package provides SONAMEs."""
build_info = os.path.join(settings['PORTAGE_BUILDDIR'], 'build-info')
provides = os.path.join(build_info, 'PROVIDES')
if os.path.exists(provides):
with open(provides, 'r') as provide_file:
provide_lines = provide_file.readlines()
else:
provide_lines = []
for line in provide_lines:
if line.startswith(settings['ARCH'] + ': '):
# We have some SONAMEs! Chop the arch name off.
sonames = line.split()[1:]
return ['so:' + soname for soname in sonames]
return []
def native(settings, mydbapi=None):
"""Take a Portage settings object and turn it into an APK.
......@@ -221,6 +241,8 @@ def native(settings, mydbapi=None):
params['depends'] = map(_translate_dep, run_deps)
params['provides'] = _maybe_package_provides(settings)
package = Package(**params)
apk = APKFile.create(package, settings['D'])
filename = "{name}-{ver}.apk".format(name=package.name, ver=package.version)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment