forked from NixOS/nixpkgs
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c4852c
commit 05742c1
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ lib, buildFHSUserEnv }: | ||
|
||
# Similar to runInLinuxVM, except we run under a FHS user env instead | ||
# of a VM. This allows you to use build systems that depend on the FHS | ||
# without any sort of patching. Resulting binaries may not work on | ||
# NixOS without wrapping them in FHS though. | ||
drv: envArgs: let | ||
fhsWrapper = buildFHSUserEnv ({ | ||
name = "${drv.name}-fhs-wrapper"; | ||
runScript = "$@"; | ||
} // envArgs); | ||
in lib.overrideDerivation drv (old: { | ||
builder = "${fhsWrapper}/bin/${fhsWrapper.name}"; | ||
args = [old.builder] ++ old.args; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters