Stepping through ebuilds

From Gentoo Wiki
Jump to:navigation Jump to:search

This article discusses how to step through an E-Build within their Local Overlay. When one emerges a package Portage executes ebuild which steps through a series of build phases that retrieve the the source code, configure and compile it into an installable package which it can then be merged into ones system.

Phases

clean

Cleans up partially built packages

manifest

Rebuilds the package manifest (See repoman manifest)

Prepare

Collects and unpacks the source code into the work folder, /var/tmp/portage/CATEGORY/PACKAGE/work.

Build

Compiles the source code into a binary.

Install

Generates a package from the build artifacts.

Merge

Merges the package into ones system.

(See the ebuild man page, man ebuild, for a "complete" listing of these commands)

Debugging

To resolve an issue with an E-Build.one may step into the source before building it as follows :

cd /var/db/repos/local/CATEGORY/PACKAGE
ebuild /CATEGORY/PACKAGE clean prepare
pushd /var/tmp/portage//CATEGORY/PACKAGE/work/
# Resolve the issue
popd
# Attempt the build issue
ebuild /CATEGORY/PACKAGE build
# Package the build
ebuild /CATEGORY/PACKAGE install
# Merge the build into ones system
ebuild /CATEGORY/PACKAGE merge