stlink: bump version, enable for x86_64 arch

This commit is contained in:
Gerasim Troeglazov
2020-10-01 21:47:30 +10:00
parent 5cb2c022b7
commit b88f45eae6
3 changed files with 105 additions and 49 deletions

View File

@@ -0,0 +1,44 @@
From 096a8cdae1859505980e303d8ce38fc9867e2058 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Thu, 1 Oct 2020 21:37:16 +1000
Subject: Fix for Haiku
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8628277..dec48d4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -178,6 +178,8 @@ if (APPLE) # ... with Apple macOS libraries
target_link_libraries(${STLINK_LIB_SHARED} ${LIBUSB_LIBRARY} ${SSP_LIB} ${ObjC} ${CoreFoundation} ${IOKit})
elseif (WIN32) # ... with Windows libraries
target_link_libraries(${STLINK_LIB_SHARED} ${LIBUSB_LIBRARY} ${SSP_LIB} wsock32 ws2_32)
+elseif (HAIKU)
+ target_link_libraries(${STLINK_LIB_SHARED} ${LIBUSB_LIBRARY} ${SSP_LIB} network bsd)
else ()
target_link_libraries(${STLINK_LIB_SHARED} ${LIBUSB_LIBRARY} ${SSP_LIB})
endif ()
@@ -213,6 +215,8 @@ if (APPLE) # ... with Apple macOS libraries
target_link_libraries(${STLINK_LIB_STATIC} ${LIBUSB_LIBRARY} ${SSP_LIB} ${ObjC} ${CoreFoundation} ${IOKit})
elseif (WIN32) # ... with Windows libraries
target_link_libraries(${STLINK_LIB_STATIC} ${LIBUSB_LIBRARY} ${SSP_LIB} wsock32 ws2_32)
+elseif (HAIKU)
+ target_link_libraries(${STLINK_LIB_STATIC} ${LIBUSB_LIBRARY} ${SSP_LIB} network bsd)
else ()
target_link_libraries(${STLINK_LIB_STATIC} ${LIBUSB_LIBRARY} ${SSP_LIB})
endif ()
diff --git a/src/libusb_settings.h b/src/libusb_settings.h
index c2e2df9..65d8982 100644
--- a/src/libusb_settings.h
+++ b/src/libusb_settings.h
@@ -33,6 +33,8 @@
#define MINIMAL_API_VERSION 0x01000102 // v1.0.16
#elif defined (__linux__)
#define MINIMAL_API_VERSION 0x01000104 // v1.0.20
+#elif defined (__HAIKU__)
+ #define MINIMAL_API_VERSION 0x01000107 // v1.0.23
#elif defined (__APPLE__)
#define MINIMAL_API_VERSION 0x01000104 // v1.0.20
#elif defined (_WIN32)
--
2.28.0

View File

@@ -1,49 +0,0 @@
SUMMARY="STM32 discovery line programmer"
DESCRIPTION="stlink is a cheap adapter used to program and debug STM32 \
microcontrollers. This tool allows interfacing the stlink with GDB for easy \
programming and debugging of these chips."
HOMEPAGE="https://github.com/texane/stlink"
COPYRIGHT="2011 The Capt'ns Missing Link Authors"
LICENSE="BSD (3-clause)"
REVISION="2"
SOURCE_URI="https://github.com/texane/stlink/archive/1.0.0.tar.gz"
CHECKSUM_SHA256="d80af441be2c2be8a8e431e4ff6608f7c5ae52017c590d1c04b28bf0af0a3ddb"
ARCHITECTURES="!x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
stlink$secondaryArchSuffix = $portVersion
cmd:st_flash$secondaryArchSuffix
cmd:st_info$secondaryArchSuffix
cmd:st_term$secondaryArchSuffix
cmd:st_util$secondaryArchSuffix
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libusb_1.0$secondaryArchSuffix
"
BUILD_REQUIRES="
devel:libusb_1.0$secondaryArchSuffix
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel
cmd:aclocal
cmd:autoreconf
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
./autogen.sh
runConfigure ./configure
make $jobArgs LDFLAGS="-lnetwork -lbsd"
}
INSTALL()
{
make install
}

View File

@@ -0,0 +1,61 @@
SUMMARY="STM32 discovery line programmer"
DESCRIPTION="stlink is a cheap adapter used to program and debug STM32 \
microcontrollers. This tool allows interfacing the stlink with GDB for easy \
programming and debugging of these chips."
HOMEPAGE="https://github.com/texane/stlink"
COPYRIGHT="2011-2020 The Capt'ns Missing Link Authors"
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="https://github.com/texane/stlink/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="ca9a640f84c3e2c9873bd51759594bc05c00cdf6e1f21b434ae2c0e7985433d8"
PATCHES="stlink-$portVersion.patchset"
ARCHITECTURES="!x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
stlink$secondaryArchSuffix = $portVersion
cmd:st_flash$commandSuffix = $portVersion
cmd:st_info$commandSuffix = $portVersion
cmd:st_util$commandSuffix = $portVersion
lib:libstlink$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libssp$secondaryArchSuffix
lib:libusb_1.0$secondaryArchSuffix
"
BUILD_REQUIRES="
devel:libusb_1.0$secondaryArchSuffix
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make $jobArgs
}
INSTALL()
{
mkdir -p $commandBinDir $libDir
cp build/bin/{st-flash,st-info,st-util} $commandBinDir
cp build/lib/*.so* $libDir
}