View | Details | Raw Unified | Return to bug 257708 | Differences between
and this patch

Collapse All | Expand All

(-)b/devel/stlink/Makefile (-12 / +9 lines)
Lines 1-7 Link Here
1
PORTNAME=	stlink
1
PORTNAME=	stlink
2
PORTVERSION=	1.7.0
2
PORTVERSION=	1.7.0
3
DISTVERSIONPREFIX=	v
3
DISTVERSIONPREFIX=	v
4
PORTREVISION=	0
5
CATEGORIES=	devel
4
CATEGORIES=	devel
6
5
7
MAINTAINER=	lev@FreeBSD.org
6
MAINTAINER=	lev@FreeBSD.org
Lines 9-25 COMMENT= STM32 ST-Link JTAG variant tools Link Here
9
8
10
LICENSE=	BSD3CLAUSE
9
LICENSE=	BSD3CLAUSE
11
10
12
OPTIONS_DEFINE=		GTK3 DOCS
13
OPTIONS_SUB=		yes
14
GTK3_EXTRA_PATCHES_OFF=	${FILESDIR}/extra-pacth-turn-off-gtk
15
GTK3_USES=		gnome
16
GTK3_USE=		GNOME=gtk30
17
18
USE_GITHUB=	yes
19
GH_ACCOUNT=	stlink-org
20
21
USES=		cmake pkgconfig
11
USES=		cmake pkgconfig
22
USE_CSTD=	c99
12
USE_CSTD=	c99
13
USE_GITHUB=	yes
14
GH_ACCOUNT=	stlink-org
23
USE_LDCONFIG=	yes
15
USE_LDCONFIG=	yes
24
16
25
PORTDOCS=	README.md ${ALLDOCS}
17
PORTDOCS=	README.md ${ALLDOCS}
Lines 27-36 PORTDOCS= README.md ${ALLDOCS} Link Here
27
ALLDOCS=	compiling.md dev/developer.txt devices_boards.md \
19
ALLDOCS=	compiling.md dev/developer.txt devices_boards.md \
28
		flashloaders.md release.md tutorial.md \
20
		flashloaders.md release.md tutorial.md \
29
		version_support.md
21
		version_support.md
30
		
22
31
FLASHLOADERS=	cleanroom.md linker.ld Makefile stm32f0.s stm32f4.s \
23
FLASHLOADERS=	cleanroom.md linker.ld Makefile stm32f0.s stm32f4.s \
32
		stm32f4lv.s stm32f7.s stm32f7lv.s stm32l4.s stm32lx.s \
24
		stm32f4lv.s stm32f7.s stm32f7lv.s stm32l4.s stm32lx.s \
33
25
26
OPTIONS_DEFINE=		GTK3 DOCS
27
OPTIONS_SUB=		yes
28
GTK3_USES=		gnome
29
GTK3_USE=		GNOME=gtk30
30
GTK3_EXTRA_PATCHES_OFF=	${FILESDIR}/extra-pacth-turn-off-gtk
31
34
.include <bsd.port.pre.mk>
32
.include <bsd.port.pre.mk>
35
33
36
post-install:
34
post-install:
Lines 44-49 post-install: Link Here
44
.for F in ${FLASHLOADERS}
42
.for F in ${FLASHLOADERS}
45
	${INSTALL_DATA} ${WRKSRC}/flashloaders/${F} ${STAGEDIR}${DATADIR}/${F}
43
	${INSTALL_DATA} ${WRKSRC}/flashloaders/${F} ${STAGEDIR}${DATADIR}/${F}
46
.endfor
44
.endfor
47
	
48
45
49
.include <bsd.port.post.mk>
46
.include <bsd.port.post.mk>
(-)b/devel/stlink/files/patch-CMakeLists.txt (-3 / +5 lines)
Lines 1-8 Link Here
1
--- CMakeLists.txt.orig	2021-07-13 15:04:41.612208000 +0300
1
--- CMakeLists.txt.orig	2021-09-15 09:54:35 UTC
2
+++ CMakeLists.txt	2021-07-13 15:06:16.763751332 +0300
2
+++ CMakeLists.txt
3
@@ -299,4 +299,5 @@
3
@@ -298,6 +298,7 @@ endif ()
4
 # add_subdirectory(src/stlink-gui)  # contains subordinate CMakeLists to build GUI
4
 add_subdirectory(tests)           # contains subordinate CMakeLists to build test executables
5
 add_subdirectory(tests)           # contains subordinate CMakeLists to build test executables
5
 add_subdirectory(cmake/packaging) # contains subordinate CMakeLists to build packages
6
 add_subdirectory(cmake/packaging) # contains subordinate CMakeLists to build packages
6
+add_subdirectory(doc/dev/pkg-config) # contains subordinate CMakeLists to build pkg-config descriptor
7
+add_subdirectory(doc/dev/pkg-config) # contains subordinate CMakeLists to build pkg-config descriptor
7
 
8
 
8
 option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF)
9
 option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF)
10
 add_subdirectory(doc/man)         # contains subordinate CMakeLists to generate manpages
(-)b/devel/stlink/files/patch-cmake_modules_c__flags.cmake (+12 lines)
Added Link Here
1
Work around upstream bug #1175 and make the build more robust
2
against minor platform differences.  -Werror should not be
3
provided in release builds.
4
5
--- cmake/modules/c_flags.cmake.orig	2021-09-15 09:45:53 UTC
6
+++ cmake/modules/c_flags.cmake
7
@@ -50,5 +50,4 @@ if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
8
     add_cflag_if_supported("-O0")
9
 else ()
10
     add_cflag_if_supported("-O2")
11
-    add_cflag_if_supported("-Werror")
12
 endif ()
(-)b/devel/stlink/files/patch-doc_dev_pkg-config_CMakeLists.txt (-3 / +3 lines)
Lines 1-6 Link Here
1
--- doc/dev/pkg-config/CMakeLists.txt.orig	2021-04-25 01:24:02.000000000 +0300
1
--- doc/dev/pkg-config/CMakeLists.txt.orig	2021-04-24 22:24:02 UTC
2
+++ doc/dev/pkg-config/CMakeLists.txt	2021-07-13 15:09:25.486974252 +0300
2
+++ doc/dev/pkg-config/CMakeLists.txt
3
@@ -11,5 +11,5 @@
3
@@ -11,5 +11,5 @@ configure_file(
4
 
4
 
5
 install(
5
 install(
6
     FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
6
     FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc"
(-)b/devel/stlink/files/patch-doc_man_CMakeLists.txt (-3 / +3 lines)
Lines 1-6 Link Here
1
--- doc/man/CMakeLists.txt.orig	2021-07-13 15:08:26.986789558 +0300
1
--- doc/man/CMakeLists.txt.orig	2021-04-24 22:24:02 UTC
2
+++ doc/man/CMakeLists.txt	2021-04-25 01:24:02.000000000 +0300
2
+++ doc/man/CMakeLists.txt
3
@@ -30,7 +30,7 @@
3
@@ -30,7 +30,7 @@ foreach (manpage ${MANPAGES})
4
     endif ()
4
     endif ()
5
 
5
 
6
     if (f AND NOT WIN32)
6
     if (f AND NOT WIN32)
(-)b/devel/stlink/files/patch-src_common.c (-1 / +34 lines)
Added Link Here
0
- 
1
Partial application of upstream commit c8fc656, closing
2
upstream bug #985 and #1175 and fixing the build on 32
3
bit platforms.
4
5
https://github.com/stlink-org/stlink/commit/c8fc6561fead79ad49c09d82bab864745086792c
6
https://github.com/stlink-org/stlink/issues/985
7
https://github.com/stlink-org/stlink/issues/1175
8
9
--- src/common.c.orig	2021-04-24 22:24:02 UTC
10
+++ src/common.c
11
@@ -1,4 +1,5 @@
12
 #define DEBUG_FLASH 0
13
+#include <limits.h>
14
 #include <stdarg.h>
15
 #include <stdint.h>
16
 #include <stdio.h>
17
@@ -2205,7 +2206,7 @@ static int map_file(mapped_file_t *mf, const char *pat
18
 
19
   if (sizeof(st.st_size) != sizeof(size_t)) {
20
     // on 32 bit systems, check if there is an overflow
21
-    if (st.st_size > (off_t)INT32_MAX) {
22
+    if (st.st_size > (off_t)SSIZE_MAX) {
23
       fprintf(stderr, "mmap() size_t overflow for file %s\n", path);
24
       goto on_error;
25
     }
26
@@ -2219,7 +2220,7 @@ static int map_file(mapped_file_t *mf, const char *pat
27
     goto on_error;
28
   }
29
 
30
-  mf->len = st.st_size;
31
+  mf->len = (size_t)st.st_size;
32
   error = 0; // success
33
 
34
 on_error:

Return to bug 257708