2018-09-12 00:17:20 +02:00
|
|
|
{ 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 {
|
2018-11-05 00:32:52 +01:00
|
|
|
pname = "elf-header";
|
2018-09-12 00:17:20 +02:00
|
|
|
inherit (libc) version;
|
|
|
|
|
|
|
|
src = null;
|
|
|
|
|
2019-06-19 17:45:34 +02:00
|
|
|
dontUnpack = true;
|
2018-09-12 00:17:20 +02:00
|
|
|
|
|
|
|
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 // {
|
2018-09-18 15:47:54 +02:00
|
|
|
outputsToInstall = [ "out" ];
|
2018-09-12 00:17:20 +02:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|