forked from alisw/alidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
debuggui.sh
71 lines (65 loc) · 2.83 KB
/
debuggui.sh
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
67
68
69
70
71
package: DebugGUI
version: "v0.2.0"
tag: f3d259727ffbe7426031dd99fd4742003eb3e6b5
requires:
- "GCC-Toolchain:(?!osx)"
- GLFW
- FreeType
- libuv
build_requires:
- capstone
- CMake
- alibuild-recipe-tools
source: https://github.com/AliceO2Group/DebugGUI
---
case $ARCHITECTURE in
osx*)
[[ ! $GLFW_ROOT ]] && GLFW_ROOT=`brew --prefix glfw`
[[ ! $LIBUV_ROOT ]] && LIBUV_ROOT=`brew --prefix libuv`
[[ ! $FREETYPE_ROOT ]] && FREETYPE_ROOT=`brew --prefix freetype`
EXTRA_LIBS="-framework CoreFoundation -framework AppKit"
DEFINES="-DNO_PARALLEL_SORT"
;;
*)
DEFINES="-DIMGUI_IMPL_OPENGL_LOADER_GL3W -DTRACY_NO_FILESELECTOR"
EXTRA_LIBS="-lGL"
! ld -ltbb -o /dev/null 2>/dev/null || EXTRA_LIBS="${EXTRA_LIBS} -ltbb"
[[ ! $FREETYPE_ROOT ]] && FREETYPE_ROOT="/usr"
;;
esac
# Use ninja if in devel mode, ninja is found and DISABLE_NINJA is not 1
if [[ ! $CMAKE_GENERATOR && $DISABLE_NINJA != 1 && $DEVEL_SOURCES != $SOURCEDIR ]]; then
NINJA_BIN=ninja-build
type "$NINJA_BIN" &> /dev/null || NINJA_BIN=ninja
type "$NINJA_BIN" &> /dev/null || NINJA_BIN=
[[ $NINJA_BIN ]] && CMAKE_GENERATOR=Ninja || true
unset NINJA_BIN
fi
# build the tracy profiler
rsync -av $SOURCEDIR/tracy/ tracy/
pushd tracy/profiler/build/unix
make \
LIBS="-L$CAPSTONE_ROOT/lib -L$GLFW_ROOT/lib -L$FREETYPE_ROOT/lib -lglfw -lfreetype -lcapstone -lpthread -ldl $EXTRA_LIBS" \
DEFINES="$DEFINES" \
TBB=off \
INCLUDES="-I$CAPSTONE_ROOT/include -I$SOURCEDIR/tracy/imgui -I$SOURCEDIR/tracy -I$SOURCEDIR/tracy/profiler/libs/gl3w ${FREETYPE_ROOT:+-I$FREETYPE_ROOT/include/freetype2} -I${GLFW_ROOT:+$GLFW_ROOT/include}"
popd
mkdir -p $INSTALLROOT/{include/tracy,bin}
cp tracy/profiler/build/unix/Tracy-debug $INSTALLROOT/bin/tracy-profiler
cp tracy/*.{h,hpp,cpp} $INSTALLROOT/include/tracy
cp -r tracy/{common,client,libbacktrace} $INSTALLROOT/include/tracy/
cmake $SOURCEDIR \
-DCMAKE_INSTALL_PREFIX=$INSTALLROOT \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
cp ${BUILDDIR}/compile_commands.json ${INSTALLROOT}
cmake --build . -- ${JOBS+-j $JOBS} install
#ModuleFile
mkdir -p etc/modulefiles
alibuild-generate-module > etc/modulefiles/$PKGNAME
cat >> etc/modulefiles/$PKGNAME <<EoF
# Our environment
set DEBUGGUI_ROOT \$::env(BASEDIR)/$PKGNAME/\$version
prepend-path PATH \$DEBUGGUI_ROOT/bin
prepend-path LD_LIBRARY_PATH \$DEBUGGUI_ROOT/lib
EoF
mkdir -p $INSTALLROOT/etc/modulefiles && rsync -a --delete etc/modulefiles/ $INSTALLROOT/etc/modulefiles