summaryrefslogtreecommitdiffstats
path: root/bare/config/devel/texane-stlink-1.cfg
blob: 9d6a157e7e4d3600323a9fcf80ccecb563217e2b (plain) (blame)
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
#
# ST-Link Version 1.
#
# This configuration file configure's, make's and install's SL-Link.
#

%if %{release} == %{nil}
%define release 1
%endif

%include %{_configdir}/base.cfg

%define stlink_version 3494c11

Name:      texane-stlink-%{stlink_version}-%{release}
Summary:   ST-Link v%{stlink_version} for host %{_host}
Version:   %{stlink_version}
Release:   %{release}
URL: 	   https://github.com/texane/stlink/

#
# Source
#
%source set stlink https://api.github.com/repos/texane/stlink/texane-stlink-%{stlink_version}.tar.gz
%patch add stlink texane-stlink-3494c11-2.diff

#
# Prepare the source code.
#
%prep
  %source setup stlink -q -c -n %{name}-%{version}
  cd texane-stlink-%{stlink_version}
  %patch setup stlink -p1
  cd ..

%build
  export PATH="%{_bindir}:${PATH}"

  cd texane-stlink-%{stlink_version}

  ./autogen.sh

%if "%{_build}" != "%{_host}"
  CFLAGS_FOR_BUILD="-g -O2 -Wall" \
%endif
  CPPFLAGS="-I $SB_TMPPREFIX/include/libusb-1.0" \
  CFLAGS="$SB_CFLAGS" \
  LDFLAGS="-L $SB_TMPPREFIX/lib" \
  ./configure \
    --build=%{_build} --host=%{_host} \
    --verbose \
    --prefix=%{_prefix} --bindir=%{_bindir} \
    --exec-prefix=%{_exec_prefix} \
    --includedir=%{_includedir} --libdir=%{_libdir} \
    --mandir=%{_mandir} --infodir=%{_infodir}

  %{__make} %{?_smp_mflags} all

  cd ..

%install
  export PATH="%{_bindir}:${PATH}"
  rm -rf $SB_BUILD_ROOT

  cd texane-stlink-%{stlink_version}
  %{__make} DESTDIR=$SB_BUILD_ROOT install

  cd ..