This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
lsts_glued/rules/libftdi1/default.bash

67 lines
1.6 KiB
Bash
Raw Normal View History

2016-01-22 11:02:04 +00:00
version=\
(
'1.2'
)
url=\
(
"http://www.intra2net.com/en/developer/libftdi/download/libftdi1-$version.tar.bz2"
)
md5=\
(
'89dff802d89c4c0d55d8b4665fd52d0b'
)
maintainer=\
(
'Ricardo Martins <rasm@oceanscan-mst.com>'
)
requires=\
(
'cmake/host'
'libusb/default'
'confuse/default'
)
configure()
{
export PKG_CONFIG="${cfg_dir_toolchain}/bin/pkg-config"
export PKG_CONFIG_PATH="$cfg_dir_toolchain_sysroot/usr/lib/pkgconfig"
rm -rf build && mkdir build && cd build
echo "set(CMAKE_SYSTEM_NAME Linux)" > Toolchain.cmake
echo "set(CMAKE_C_COMPILER $cmd_target_cc)" >> Toolchain.cmake
echo "set(CMAKE_CXX_COMPILER $cmd_target_cxx)" >> Toolchain.cmake
echo "set(CMAKE_FIND_ROOT_PATH \"$cfg_dir_toolchain_sysroot/usr\")" >> Toolchain.cmake
echo "set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)" >> Toolchain.cmake
echo "set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)" >> Toolchain.cmake
echo "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)" >> Toolchain.cmake
cmake \
-DCMAKE_TOOLCHAIN_FILE=./Toolchain.cmake \
-DCMAKE_INSTALL_PREFIX="$cfg_dir_toolchain_sysroot/usr" \
-DPKG_CONFIG_EXECUTABLE="$PKG_CONFIG" \
..
}
build()
{
cmake --build build
}
host_install()
{
export PKG_CONFIG="${cfg_dir_toolchain}/bin/pkg-config"
export PKG_CONFIG_PATH="$cfg_dir_toolchain_sysroot/usr/lib/pkgconfig"
cmake --build build --target install
}
target_install()
{
cp -a "$cfg_dir_toolchain_sysroot/usr/lib/libftdi"*.so* "$cfg_dir_rootfs/lib" &&
$cmd_target_strip "$cfg_dir_rootfs/lib/libftdi"*.so*
}