Gfx Stack Update
[nyanlinux.git] / builders / drm / builder.sh
blob458b0cb1e00495dadbc54493521184103ca50487
1 src_name=drm
2 git_url0=git://anongit.freedesktop.org/mesa/$src_name
4 src_dir=$src_dir_root/$src_name
5 pkg_dir=/run/pkgs/$src_name
6 rm -Rf $pkg_dir
7 mkdir -p /run/pkgs
8 cp -Hr $src_dir $pkg_dir
10 cd $pkg_dir
12 PATH_SAVED=$PATH
13 export PATH="\
14 /opt/toolchains/x64/elf/binutils-gcc/current/bin:\
15 /nyan/git/current/bin:\
16 /nyan/python/current/bin:\
17 $PATH\
19 if test x$git_commit != x; then
20 git checkout --force $git_commit
21 git reset --hard
23 #-------------------------------------------------------------------------------
24 # install our canonical build system from the contrib dir
25 cp -rf $nyan_root/builders/drm-$slot/contrib $pkg_dir
27 build_dir=/run/builds/$pkg_name
28 rm -Rf $build_dir
29 mkdir -p $build_dir
30 cd $build_dir
32 # generate our local configuration file
33 cat >$build_dir/local_conf.sh <<EOF
34 runtime_data_dir="/usr/share"
35 runtime_data_store_dir="/nyan/drm/$slot/share"
36 runtime_data_store_virtual_dir="/nyan/drm/current/share"
38 lib_store_dir="/nyan/drm/$slot/lib"
39 lib_store_virtual_dir="/nyan/drm/current/lib"
41 runtime_lib_dir="/usr/lib"
43 inc_store_dir="/nyan/drm/$slot/include"
44 inc_store_virtual_dir="/nyan/drm/current/include"
46 slib_gcc="gcc \
47 -std=gnu99 -pipe -fPIC -O2 -c -static-libgcc -fvisibility=hidden \
48 -ftls-model=global-dynamic -fpic \
49 -isystem /nyan/glibc/current/include \
50 -isystem /nyan/linux-headers/current/include"
52 libdrm_slib_gccld="gcc \
53 -o \\\$build_dir/install_root\\\$lib_store_dir/libdrm.so.\\\$libdrm_so_major.\\\$libdrm_so_minor.\\\$libdrm_so_patch \
54 -Wl,-soname=libdrm.so.\\\$libdrm_so_major \
55 -pipe -shared -static-libgcc \
56 -B/nyan/glibc/current/lib -L/nyan/glibc/current/lib \
57 -Wl,-rpath-link,/nyan/glibc/current/lib \
58 -Wl,--no-undefined,--gc-sections \
59 -Wl,-s \
60 \\\$libdrm_so \
61 -lm"
63 libdrm_amdgpu_slib_gccld="gcc \
64 -o \\\$build_dir/install_root\\\$lib_store_dir/libdrm_amdgpu.so.\\\$libdrm_amdgpu_so_major.\\\$libdrm_amdgpu_so_minor.\\\$libdrm_amdgpu_so_patch \
65 -Wl,-soname=libdrm_amdgpu.so.\\\$libdrm_amdgpu_so_major \
66 -pipe -shared -static-libgcc \
67 -B/nyan/glibc/current/lib -L/nyan/glibc/current/lib \
68 -Wl,-rpath-link,/nyan/glibc/current/lib \
69 -Wl,--no-undefined,--gc-sections \
70 -Wl,-s \
71 \\\$libdrm_amdgpu_so \
72 \\\$build_dir/install_root\\\$lib_store_dir/libdrm.so.\\\$libdrm_so_major.\\\$libdrm_so_minor.\\\$libdrm_so_patch"
74 libdrm_radeon_slib_gccld="gcc \
75 -o \\\$build_dir/install_root\\\$lib_store_dir/libdrm_radeon.so.\\\$libdrm_radeon_so_major.\\\$libdrm_radeon_so_minor.\\\$libdrm_radeon_so_patch \
76 -Wl,-soname=libdrm_radeon.so.\\\$libdrm_radeon_so_major \
77 -pipe -shared -static-libgcc \
78 -B/nyan/glibc/current/lib -L/nyan/glibc/current/lib \
79 -Wl,-rpath-link,/nyan/glibc/current/lib \
80 -Wl,--no-undefined,--gc-sections \
81 -Wl,-s \
82 \\\$libdrm_radeon_so \
83 \\\$build_dir/install_root\\\$lib_store_dir/libdrm.so.\\\$libdrm_so_major.\\\$libdrm_so_minor.\\\$libdrm_so_patch"
84 EOF
86 $pkg_dir/contrib/x86_64_amdgpu_linux_gnu_drm_gcc.sh
88 rm -Rf /nyan/drm/$slot/*
89 cp -Rf $build_dir/install_root/nyan/drm/$slot/* /nyan/drm/$slot
91 # we don't use the symbolic link oriented runtime, but we keep it.
93 export PATH=$PATH_SAVED
94 unset PATH_SAVED
95 rm -Rf $build_dir $pkg_dir