Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46684 from obsidiansystems/elf-header
elf-header: Init at <libc version> for 18.09
- Loading branch information
Showing
5 changed files
with
56 additions
and
6 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,43 @@ | ||
{ stdenvNoCC, lib, glibc, musl }: | ||
|
||
let | ||
libc = | ||
if stdenvNoCC.targetPlatform.isMusl | ||
then musl | ||
else glibc; | ||
headerPath = | ||
if stdenvNoCC.targetPlatform.isMusl | ||
then "musl-${libc.version}/include/elf.h" | ||
else "glibc-${libc.version}/elf/elf.h"; | ||
in | ||
|
||
stdenvNoCC.mkDerivation { | ||
name = "elf-header"; | ||
inherit (libc) version; | ||
|
||
src = null; | ||
|
||
unpackPhase = "true"; | ||
|
||
dontBuild = true; | ||
|
||
installPhase = '' | ||
mkdir -p "$out/include"; | ||
tar -xf \ | ||
${lib.escapeShellArg libc.src} \ | ||
${lib.escapeShellArg headerPath} \ | ||
--to-stdout \ | ||
| sed -e '/features\.h/d' \ | ||
> "$out/include/elf.h" | ||
''; | ||
|
||
meta = libc.meta // { | ||
description = "The datastructures of ELF according to the target platform's libc"; | ||
longDescription = '' | ||
The Executable and Linkable Format (ELF, formerly named Extensible Linking | ||
Format), is usually defined in a header like this. | ||
''; | ||
platforms = lib.platforms.all; | ||
maintainers = [ lib.maintainers.ericson2314 ]; | ||
}; | ||
} |
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
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
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
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