Created
December 15, 2016 20:07
-
-
Save cleverca22/333cc892ee345c8ccd3b98ff73abfa52 to your computer and use it in GitHub Desktop.
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
{ stdenv, makeSetupHook }: | |
let | |
target = if builtins.trace "system is ${stdenv.system}" stdenv.system == "armv6l-linux" then "Tag_CPU_arch: v6" else | |
(if stdenv.system == "armv7l-linux" then "Tag_CPU_arch: v7" else "NOP"); | |
in | |
if target == "NOP" then | |
makeSetupHook {} ./nop.sh | |
else | |
makeSetupHook { substitutions = { inherit target; NIX_DEBUG="1"; }; } ./enforce-arch.sh |
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
function enforceArch() { | |
echo checking target arches | |
for x in $out/lib/*.so; do | |
echo checking $x | |
readelf -A $x | grep "@target@" | |
done | |
} | |
postInstallHooks+=(enforceArch) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment