From e36c2cd3e576f7ebe396829f103cd6510738bcfc Mon Sep 17 00:00:00 2001 From: bra1nwave Date: Fri, 5 Jun 2020 22:17:41 +0200 Subject: [PATCH] stlink: update to 1.6.1. --- .../01-install-pkgconfig-files-again.patch | 22 +++++++ .../stlink/patches/02-enable-cross-gtk.patch | 11 ++++ .../patches/03-dont-link-ssp-as-static.patch | 11 ++++ srcpkgs/stlink/patches/04-fix-paths.patch | 58 +++++++++++++++++++ srcpkgs/stlink/patches/05-musl.patch | 11 ++++ srcpkgs/stlink/patches/enable-cross-gtk.patch | 21 ------- srcpkgs/stlink/patches/musl.patch | 11 ---- srcpkgs/stlink/template | 9 +-- 8 files changed, 118 insertions(+), 36 deletions(-) create mode 100644 srcpkgs/stlink/patches/01-install-pkgconfig-files-again.patch create mode 100644 srcpkgs/stlink/patches/02-enable-cross-gtk.patch create mode 100644 srcpkgs/stlink/patches/03-dont-link-ssp-as-static.patch create mode 100644 srcpkgs/stlink/patches/04-fix-paths.patch create mode 100644 srcpkgs/stlink/patches/05-musl.patch delete mode 100644 srcpkgs/stlink/patches/enable-cross-gtk.patch delete mode 100644 srcpkgs/stlink/patches/musl.patch diff --git a/srcpkgs/stlink/patches/01-install-pkgconfig-files-again.patch b/srcpkgs/stlink/patches/01-install-pkgconfig-files-again.patch new file mode 100644 index 00000000000..08ff4a1ad12 --- /dev/null +++ b/srcpkgs/stlink/patches/01-install-pkgconfig-files-again.patch @@ -0,0 +1,22 @@ +From e0a029f305f199ad46f35d001931e9b531e1abcd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Mon, 1 Jun 2020 00:27:18 +0200 +Subject: [PATCH] CMakeLists.txt: Install pkgconfig files again + +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 86282775..60f9087d 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -49,7 +49,7 @@ find_package(libusb REQUIRED) + + ## Package configuration (pkg-config) on unix-based systems + if (NOT WIN32 AND NOT CMAKE_CROSSCOMPILING) +- #add_subdirectory(cmake/pkgconfig) ++ add_subdirectory(cmake/pkgconfig) + find_package(PkgConfig) + pkg_check_modules(GTK3 gtk+-3.0) + endif () diff --git a/srcpkgs/stlink/patches/02-enable-cross-gtk.patch b/srcpkgs/stlink/patches/02-enable-cross-gtk.patch new file mode 100644 index 00000000000..c31ab28ad6a --- /dev/null +++ b/srcpkgs/stlink/patches/02-enable-cross-gtk.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt.orig ++++ CMakeLists.txt +@@ -48,7 +48,7 @@ + find_package(libusb REQUIRED) + + ## Package configuration (pkg-config) on unix-based systems +-if (NOT WIN32 AND NOT CMAKE_CROSSCOMPILING) ++if (NOT WIN32) + add_subdirectory(cmake/pkgconfig) + find_package(PkgConfig) + pkg_check_modules(GTK3 gtk+-3.0) diff --git a/srcpkgs/stlink/patches/03-dont-link-ssp-as-static.patch b/srcpkgs/stlink/patches/03-dont-link-ssp-as-static.patch new file mode 100644 index 00000000000..fb9dd61deac --- /dev/null +++ b/srcpkgs/stlink/patches/03-dont-link-ssp-as-static.patch @@ -0,0 +1,11 @@ +--- CMakeLists.txt.orig ++++ CMakeLists.txt +@@ -71,7 +71,7 @@ + + CHECK_LIBRARY_EXISTS(ssp __stack_chk_fail "" _stack_chk_fail_exists) + if (_stack_chk_fail_exists) +- set(SSP_LIB -static ssp) ++ set(SSP_LIB ssp) + else () + set(SSP_LIB "") + endif () diff --git a/srcpkgs/stlink/patches/04-fix-paths.patch b/srcpkgs/stlink/patches/04-fix-paths.patch new file mode 100644 index 00000000000..18aeca2fabc --- /dev/null +++ b/srcpkgs/stlink/patches/04-fix-paths.patch @@ -0,0 +1,58 @@ +From 2016590502558caa98c21abad2ce83c5f4804a98 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Mon, 1 Jun 2020 00:20:26 +0200 +Subject: [PATCH] doc/man: Fix installation directory + +On Unix-like operating systems man pages are commonly installed to +`/usr/share/man` not `/usr/share/stlink/man`. +--- + doc/man/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/doc/man/CMakeLists.txt b/doc/man/CMakeLists.txt +index 23da9e15..9b3c5076 100644 +--- doc/man/CMakeLists.txt ++++ doc/man/CMakeLists.txt +@@ -30,7 +30,7 @@ foreach (manpage ${MANPAGES}) + endif () + + if (f AND NOT WIN32) +- install(FILES ${f} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/man/man1) ++ install(FILES ${f} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/man/man1) + unset(f) + endif () + endforeach () + +From e95b5ffcfe38c917a1f421c2257e58a3d9b2e8cc Mon Sep 17 00:00:00 2001 +From: Vasiliy Glazov +Date: Mon, 1 Jun 2020 08:44:11 +0300 +Subject: [PATCH] Fix installation path for desktop-file and icons. + +This change fixes installation path for desktop-file and icons. +They should be installed directly to +``` +/usr/share/applications/ +/usr/share/icons/hicolor/scalable/apps/ +``` +--- + src/stlink-gui/CMakeLists.txt | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/stlink-gui/CMakeLists.txt b/src/stlink-gui/CMakeLists.txt +index 8c36e5a1..cc68509f 100644 +--- src/stlink-gui/CMakeLists.txt ++++ src/stlink-gui/CMakeLists.txt +@@ -13,11 +13,11 @@ if (NOT WIN32) + + # Install desktop application entry + install(FILES stlink-gui.desktop +- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/applications) ++ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) + + # Install icons + install(FILES icons/stlink-gui.svg +- DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}/icons/hicolor/scalable/apps) ++ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps) + + set(GUI_SOURCES gui.c gui.h) + diff --git a/srcpkgs/stlink/patches/05-musl.patch b/srcpkgs/stlink/patches/05-musl.patch new file mode 100644 index 00000000000..2f13cc42d73 --- /dev/null +++ b/srcpkgs/stlink/patches/05-musl.patch @@ -0,0 +1,11 @@ +--- src/st-util/gdb-remote.c.orig ++++ src/st-util/gdb-remote.c +@@ -13,7 +13,7 @@ + #include + #else + #include +-#include ++#include + #endif + + #include "gdb-remote.h" diff --git a/srcpkgs/stlink/patches/enable-cross-gtk.patch b/srcpkgs/stlink/patches/enable-cross-gtk.patch deleted file mode 100644 index 156a2bb4b6c..00000000000 --- a/srcpkgs/stlink/patches/enable-cross-gtk.patch +++ /dev/null @@ -1,21 +0,0 @@ -commit 850c646b0b150f9e2efc0f8d2ee93241fd19db79 -Author: Enno Boland -Date: Thu Oct 18 19:14:08 2018 +0200 - - Revert "skip GTK detection if we're cross-compiling (#588)" - - This reverts commit cc3a5705099019e01dc59f7907d0c5b1b85878d8. - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 395848b..39c23b0 100644 ---- ./CMakeLists.txt -+++ ./CMakeLists.txt -@@ -39,7 +39,7 @@ endif() - # Dependencies - ### - find_package(LibUSB REQUIRED) --if (NOT APPLE AND NOT WIN32 AND NOT CMAKE_CROSSCOMPILING) -+if (NOT APPLE AND NOT WIN32) - find_package(PkgConfig) - pkg_check_modules(gtk gtk+-3.0) - endif () diff --git a/srcpkgs/stlink/patches/musl.patch b/srcpkgs/stlink/patches/musl.patch deleted file mode 100644 index 913c2500620..00000000000 --- a/srcpkgs/stlink/patches/musl.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- src/gdbserver/gdb-remote.c.orig -+++ src/gdbserver/gdb-remote.c -@@ -12,7 +12,7 @@ - #include - #else - #include --#include -+#include - #endif - - static const char hex[] = "0123456789abcdef"; diff --git a/srcpkgs/stlink/template b/srcpkgs/stlink/template index 56bed9ad5f7..06f39a7cf25 100644 --- a/srcpkgs/stlink/template +++ b/srcpkgs/stlink/template @@ -1,9 +1,10 @@ # Template file for 'stlink' pkgname=stlink -version=1.6.0 +version=1.6.1 revision=1 build_style=cmake -configure_args="-DSTLINK_UDEV_RULES_DIR=/usr/lib/udev/rules.d -DSTLINK_MODPROBED_DIR=/usr/lib/modprobe.d" +configure_args="-DSTLINK_UDEV_RULES_DIR=/usr/lib/udev/rules.d -DSTLINK_MODPROBED_DIR=/usr/lib/modprobe.d + -DSTLINK_LIBRARY_PATH=/usr/lib" hostmakedepends="pkg-config" makedepends="libusb-devel gtk+3-devel" short_desc="STM32 discovery line Linux programmer" @@ -12,7 +13,7 @@ license="BSD-3-Clause" homepage="https://github.com/texane/stlink" changelog="https://raw.githubusercontent.com/texane/stlink/master/CHANGELOG.md" distfiles="${homepage}/archive/v${version}.tar.gz" -checksum=5575e9322e6914fad3bcbcad77fa2669e4b1853cd49bed44bfac1c68992f538a +checksum=ca9a640f84c3e2c9873bd51759594bc05c00cdf6e1f21b434ae2c0e7985433d8 post_install() { vlicense LICENSE.md LICENSE @@ -36,6 +37,6 @@ stlink-gtk_package() { pkg_install() { vmove usr/share/applications/stlink-gui.desktop vmove usr/share/icons/hicolor/scalable/apps/stlink-gui.svg - vmove usr/bin/stlink-gui + vmove "usr/bin/stlink-gui*" } }