summaryrefslogtreecommitdiff
path: root/packaging/heaptrack.spec
blob: a34c3e334d72333ad9a7eaa13fcd8b9abcef1a71 (plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
Name:       heaptrack
Summary:    heaptrack for dotnet apps
# Version corresponds to CMake @HEAPTRACK_VERSION_MAJOR@.@HEAPTRACK_VERSION_MINOR@.@HEAPTRACK_VERSION_PATCH@-@HEAPTRACK_VERSION_SUFFIX@
Version:    1.1.0
Release:    0.1
Group:      Application Framework/Application State Management
License:    GPL
Source0:    %{name}-%{version}.tar.gz
Source1001: heaptrack.manifest
%define	heaptrack_src heaptrack-%{version}
%define	heaptrack_build build-%{_target_platform}
AutoReqProv: no

ExcludeArch: aarch64 x86_64

BuildRequires: cmake
BuildRequires: gcc
BuildRequires: clang
BuildRequires: glibc-devel
BuildRequires: libdw-devel
BuildRequires: libunwind-devel
BuildRequires: boost-devel
BuildRequires: boost-iostreams
BuildRequires: boost-program-options
BuildRequires: pkgconfig(zlib)
BuildRequires: coreclr-devel

# .NET Core Runtime
%define dotnettizendir  dotnet.tizen
%define netcoreappdir   %{dotnettizendir}/netcoreapp

%define sdk_install_prefix /home/owner/share/tmp/sdk_tools/%{name}

%description
Heaptrack for Tizen applications

%prep
%setup -q
cp %{SOURCE1001} .

%build

echo _target _target_cpu _target_arch _target_os _target_platform
echo %{_target}
echo %{_target_cpu}
echo %{_target_arch}
echo %{_target_os}
echo %{_target_platform}

export CFLAGS="--target=%{_host}"
export CXXFLAGS="--target=%{_host}"

%define _heaptrack_build_conf RelWithDebInfo
%define _coreclr_devel_directory %{_datarootdir}/%{netcoreappdir}

mkdir build
cd build
cmake \
  -DCMAKE_INSTALL_PREFIX=install \
  -DCMAKE_BUILD_TYPE=%{_heaptrack_build_conf} \
  -DHEAPTRACK_BUILD_GUI=OFF \
  -DTIZEN=ON \
  ..

make %{?jobs:-j%jobs} VERBOSE=1

%ifarch %{arm}
%define arch_dir armel
%else
%define arch_dir x86
%endif

cd ../profiler
ROOTFS_DIR=/ \
CC=clang CXX=clang++ \
cmake \
  -DCMAKE_INSTALL_PREFIX=../build/install \
  -DCMAKE_TOOLCHAIN_FILE=profiler/cross/%{arch_dir}/toolchain.cmake \
  -DCLR_BIN_DIR=%{_coreclr_devel_directory} \
  -DCLR_SRC_DIR=%{_coreclr_devel_directory} \
  -DCLR_ARCH=%{_target_cpu} \
  profiler
make
cd -

%install
cd build
make install
make -C ../profiler install
mkdir -p %{buildroot}%{sdk_install_prefix}
cp install/lib/heaptrack/*.so %{buildroot}%{sdk_install_prefix}
cp install/lib/heaptrack/libexec/* %{buildroot}%{sdk_install_prefix}

%files
%manifest heaptrack.manifest
%{sdk_install_prefix}/*