-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyocto.nix
67 lines (60 loc) · 1.89 KB
/
yocto.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{ pkgs ? import <nixpkgs> {} }:
(pkgs.buildFHSUserEnv {
name = "yocto-env";
# Packages Yocto is expecting on the host system by default
targetPkgs = pkgs: (with pkgs; let
sh = (pkgs.runCommand "sh" {} ''
mkdir -p $out/bin
cat > $out/bin/bash <<'EOF'
#!${bashInteractive}/bin/bash
export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive
export LOCALEARCHIVE=/usr/lib/locale/locale-archive
exec -a /bin/bash ${bashInteractive}/bin/bash "$@"
EOF
chmod +x $out/bin/bash
ln -s $out/bin/bash $out/bin/sh
'');
in [
which gcc glibc glibcLocales shadow gnumake python27 gawk wget
gitFull diffstat diffutils unzip texinfo bzip2 gzip perl patch chrpath file
cpio utillinux nettools iproute procps openssh xterm SDL findutils
socat gnutar ccache cmake vim binutils gitRepo
(pkgs.runCommand "python3" {} ''
mkdir -p $out/bin
cat > $out/bin/python3 <<'EOF'
#!${runtimeShell}
export LOCALE_ARCHIVE=/usr/lib/locale/locale-archive
export LOCALEARCHIVE=/usr/lib/locale/locale-archive
exec -a /usr/bin/python3 ${python3}/bin/python "$@"
EOF
chmod +x $out/bin/python3
'')
(hiPrio sh)
]);
# Headers are required to build
extraOutputsToInstall = [ "dev" ];
# Force install locale from "glibcLocales" since there are collisions
extraBuildCommands = ''
ln -sf ${pkgs.glibcLocales}/lib/locale/locale-archive $out/usr/lib/locale
'';
profile = ''
export hardeningDisable=all
export CC=gcc
export LD=ld
export EDITOR=vim
export STRIP=strip
export OBJCOPY=objcopy
export RANLIB=ranlib
export OBJDUMP=objdump
export AS=as
export AR=ar
export NM=nm
export CXX=g++
export SIZE=size
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export SHELL=/bin/bash
'';
multiPkgs = pkgs: (with pkgs; []);
runScript = "bash";
}).env