# Maintainer: Alexei Colin # NOTE: GUI is needed to run this, because top-level installer does not forward # '--unattended" to the nested installers it invokes, hence those installers # generate a GUI box. Parent installer fails if run headless. pkgname=ti-ble-sdk pkgver=2.02.07.06 pkgrel=1 pkgdesc="Texas Instruments BLE Stack for CC2640/CC2650/CC1350" arch=('x86_64') url="http://www.ti.com/tool/ble-stack" license=('custom:LPRF') makedepends=('wine') depends=('python-lxml' 'ti-rtos-cc13xx-cc26xx') optdepends=('ccstudio' 'ti-cgt-arm') install=$pkgname.install _bundle=ble_sdk_${pkgver//./_} _installer=${_bundle}_setup.exe # Alternatively, to download from TI, you need a download key, which # you can get by following the $url link above and clicking through # _key= source=(# Requires you to open "$url" in browser to get download link with key #"https://downloads.ti.com/downloads/simplelink/esd/ble_sdk/${_installer}?__gda__=${_key}" local://${_installer} ltoa.patch) # TI website provides MD5 specifically md5sums=('f681835d5795944959b085c377262edc' '3e6e7a357007813934822a31eaed51c9') options=(!strip libtool staticlibs emptydirs !purge !zipman) _winedir=wine # install into CCS parent directory for CCS to find it automatically _ccsdir=ccstudio _destdir=opt _installdir=installdir _installpath=$_installdir/$_destdir/$_ccsdir build() { cd $srcdir echo ">>> Running Windows installer via wine. When prompted:" echo ">>> * CANCEL installation of Mono for .NET Framework (not needed)" echo ">>> * CANCEL installation of Gecko (not needed)" echo ">>> * CANCEL the install of TI RTOS (it was installed automatically as a package dependency)" echo ">>> * IGNORE error about dotNetFx" WINEPREFIX=$srcdir/$_winedir wine $srcdir/${_installer} \ --mode unattended --prefix $srcdir/${_installpath} 1> wine.log 2>&1 } _run() { echo "$@" "$@" } # Credit: https://github.com/jcormier/TI_BLE_CC2650_Linux_Convert function _replace_text_in_ble_sdk { _from="$1" _to="$2" shift shift echo -e "Changing $_from to $_to in all ble_sdk source files" echo grep --exclude-dir=".git" --exclude=*.a "$@" -rl "$_from" "${_installpath}" \| xargs sed -i "s#$_from#$_to#g" grep --exclude-dir=".git" --exclude=*.a "$@" -rl "$_from" "${_installpath}" | xargs sed -i "s#$_from#$_to#g" } package() { cd $srcdir # Fix paths (case, etc). Credit: https://github.com/jcormier/TI_BLE_CC2650_Linux_Convert # There's an invalid linked location in ${_installpath}/examples/cc2650stk/sensortag_lcd/ccs/app/.project # This is a best guess at what's intended. #_replace_text_in_ble_sdk "SRC_COMMON/hal/src/target/_common/board.h" "SRC_EX/target/Board.h" # Use Board.h consistently in the ble stack instead of a mixture of board.h and Board.h. # The tirtos uses Board.h consistently so we'll assume that's correct. _replace_text_in_ble_sdk "\\\"board\\.h" "\\\"Board.h" _replace_text_in_ble_sdk "\\/board\\.h" "\\/Board.h" #_replace_text_in_ble_sdk "