Out-of-tree build: Difference between revisions
Appearance
imported>Milahu create page: Out-of-tree build |
(No difference)
|
Latest revision as of 15:29, 23 May 2022
By default, stdenv.mkDerivation
will run configure
and make
in the source root,
but some projects require an out-of-tree build
Example: the build script
./autogen.sh
# out-of-tree build
mkdir build
cd build
../configure --enable-feature-a
make
make install
can be translated to the Nix expression
stdenv.mkDerivation {
preConfigure = ''
patchShebangs .
./autogen.sh
mkdir build
cd build
'';
configureScript = "../configure";
configureFlags = [
"--enable-feature-a"
];
}