aboutsummaryrefslogtreecommitdiffstats
path: root/community/stlink
diff options
context:
space:
mode:
Diffstat (limited to 'community/stlink')
-rw-r--r--community/stlink/APKBUILD29
1 files changed, 14 insertions, 15 deletions
diff --git a/community/stlink/APKBUILD b/community/stlink/APKBUILD
index 83b0adf544..b4bae7cbdd 100644
--- a/community/stlink/APKBUILD
+++ b/community/stlink/APKBUILD
@@ -2,39 +2,38 @@
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=stlink
pkgver=1.6.0
-pkgrel=1
+pkgrel=2
pkgdesc="STM32 discovery line linux programmer"
url="https://github.com/texane/stlink"
arch="all"
license="MIT"
-depends=""
-depends_dev=""
makedepends="cmake libusb-dev"
-install=""
options="!check" # upstream doesn't have automated tests
subpackages="$pkgname-doc $pkgname-dev"
-source="$pkgname-$pkgver.tar.gz::https://github.com/texane/$pkgname/archive/v$pkgver.tar.gz"
+source="$pkgname-$pkgver.tar.gz::https://github.com/texane/stlink/archive/v$pkgver.tar.gz"
-builddir="$srcdir"/$pkgname-$pkgver
build() {
- cd "$builddir"
- cmake \
+ if [ "$CBUILD" != "$CHOST" ]; then
+ CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
+ fi
+ cmake -B build \
+ -DCMAKE_BUILD_TYPE=None \
-DCMAKE_INSTALL_PREFIX=/usr \
- -DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=True \
- -DCMAKE_BUILD_TYPE=None \
- -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
- -DCMAKE_C_FLAGS="$CFLAGS -Wno-error=cpp"
- make
+ -DCMAKE_C_FLAGS="$CFLAGS -Wno-error=cpp" \
+ $CMAKE_CROSSOPTS .
+ make -C build
}
package() {
- cd "$builddir"
- make DESTDIR="$pkgdir" install
+ make -C build DESTDIR="$pkgdir" install
mkdir -p "$pkgdir"/usr/share/doc/$pkgname
install -m644 README.md CHANGELOG.md doc/tutorial.md \
"$pkgdir"/usr/share/doc/$pkgname/
+
+ mkdir -p "$pkgdir"/usr/lib/udev
+ mv "$pkgdir"/etc/udev/rules.d "$pkgdir"/usr/lib/udev
}
sha512sums="0bf2416dac69e490560063714d630c4f549568bd9047113fb334f0841f5db23b97876307be8f0b1731863a2438c9502b9916d0d652c516d50969cb8b2cfa1a15 stlink-1.6.0.tar.gz"