From nobody Wed Oct 27 15:56:27 2021 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 21FFF1823518; Wed, 27 Oct 2021 15:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HfYG40WH8z3Qp0; Wed, 27 Oct 2021 15:56:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5E021305B; Wed, 27 Oct 2021 15:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19RFuRLj024597; Wed, 27 Oct 2021 15:56:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19RFuRAn024596; Wed, 27 Oct 2021 15:56:27 GMT (envelope-from git) Date: Wed, 27 Oct 2021 15:56:27 GMT Message-Id: <202110271556.19RFuRAn024596@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yasuhiro Kimura Subject: git: b6534ecd950c - main - devel/stlink: Fix build on 32 bit platforms List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yasu X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b6534ecd950cf32e1b76733d34a2ec929b690704 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yasu: URL: https://cgit.FreeBSD.org/ports/commit/?id=b6534ecd950cf32e1b76733d34a2ec929b690704 commit b6534ecd950cf32e1b76733d34a2ec929b690704 Author: Robert Clausecker AuthorDate: 2021-08-22 16:54:30 +0000 Commit: Yasuhiro Kimura CommitDate: 2021-10-27 15:53:07 +0000 devel/stlink: Fix build on 32 bit platforms * Remove settings of optimization from cmake/modules/c_flags.cmake as per section 13.9 of Porter's Handbook * Switch to DISTVERSION * Pet portclippy * Reformat Makefile with portfmt PR: 257708 Approved by: maitainer timeout (> 1 month) Differential Revision: https://reviews.freebsd.org/D32545 --- devel/stlink/Makefile | 31 +++++++++----------- devel/stlink/files/patch-CMakeLists.txt | 8 +++-- .../files/patch-cmake_modules_c__flags.cmake | 18 ++++++++++++ .../files/patch-doc_dev_pkg-config_CMakeLists.txt | 6 ++-- devel/stlink/files/patch-doc_man_CMakeLists.txt | 6 ++-- devel/stlink/files/patch-src_common.c | 34 ++++++++++++++++++++++ 6 files changed, 77 insertions(+), 26 deletions(-) diff --git a/devel/stlink/Makefile b/devel/stlink/Makefile index f8023a00ecfd..2b3de850f815 100644 --- a/devel/stlink/Makefile +++ b/devel/stlink/Makefile @@ -1,7 +1,6 @@ PORTNAME= stlink -PORTVERSION= 1.7.0 +DISTVERSION= 1.7.0 DISTVERSIONPREFIX= v -PORTREVISION= 0 CATEGORIES= devel MAINTAINER= lev@FreeBSD.org @@ -9,27 +8,25 @@ COMMENT= STM32 ST-Link JTAG variant tools LICENSE= BSD3CLAUSE -OPTIONS_DEFINE= GTK3 DOCS -OPTIONS_SUB= yes -GTK3_EXTRA_PATCHES_OFF= ${FILESDIR}/extra-pacth-turn-off-gtk -GTK3_USES= gnome -GTK3_USE= GNOME=gtk30 - -USE_GITHUB= yes -GH_ACCOUNT= stlink-org - USES= cmake pkgconfig USE_CSTD= c99 +USE_GITHUB= yes +GH_ACCOUNT= stlink-org USE_LDCONFIG= yes -PORTDOCS= README.md ${ALLDOCS} +PORTDOCS= ${ALLDOCS} README.md ALLDOCS= compiling.md dev/developer.txt devices_boards.md \ - flashloaders.md release.md tutorial.md \ - version_support.md - -FLASHLOADERS= cleanroom.md linker.ld Makefile stm32f0.s stm32f4.s \ - stm32f4lv.s stm32f7.s stm32f7lv.s stm32l4.s stm32lx.s \ + flashloaders.md release.md tutorial.md version_support.md + +FLASHLOADERS= cleanroom.md linker.ld Makefile stm32f0.s stm32f4.s stm32f4lv.s \ + stm32f7.s stm32f7lv.s stm32l4.s stm32lx.s + +OPTIONS_DEFINE= DOCS GTK3 +OPTIONS_SUB= yes +GTK3_USES= gnome +GTK3_USE= GNOME=gtk30 +GTK3_EXTRA_PATCHES_OFF= ${FILESDIR}/extra-pacth-turn-off-gtk .include diff --git a/devel/stlink/files/patch-CMakeLists.txt b/devel/stlink/files/patch-CMakeLists.txt index c17726682dc9..c8461f37f41b 100644 --- a/devel/stlink/files/patch-CMakeLists.txt +++ b/devel/stlink/files/patch-CMakeLists.txt @@ -1,8 +1,10 @@ ---- CMakeLists.txt.orig 2021-07-13 15:04:41.612208000 +0300 -+++ CMakeLists.txt 2021-07-13 15:06:16.763751332 +0300 -@@ -299,4 +299,5 @@ +--- CMakeLists.txt.orig 2021-09-15 09:54:35 UTC ++++ CMakeLists.txt +@@ -298,6 +298,7 @@ endif () + # add_subdirectory(src/stlink-gui) # contains subordinate CMakeLists to build GUI add_subdirectory(tests) # contains subordinate CMakeLists to build test executables add_subdirectory(cmake/packaging) # contains subordinate CMakeLists to build packages +add_subdirectory(doc/dev/pkg-config) # contains subordinate CMakeLists to build pkg-config descriptor option(STLINK_GENERATE_MANPAGES "Generate manpages with pandoc" OFF) + add_subdirectory(doc/man) # contains subordinate CMakeLists to generate manpages diff --git a/devel/stlink/files/patch-cmake_modules_c__flags.cmake b/devel/stlink/files/patch-cmake_modules_c__flags.cmake new file mode 100644 index 000000000000..064de12f7844 --- /dev/null +++ b/devel/stlink/files/patch-cmake_modules_c__flags.cmake @@ -0,0 +1,18 @@ +Work around upstream bug #1175 and make the build more robust +against minor platform differences. -Werror should not be +provided in release builds. + +--- cmake/modules/c_flags.cmake.orig 2021-04-24 22:24:02 UTC ++++ cmake/modules/c_flags.cmake +@@ -44,11 +44,3 @@ endif () + if (NOT (WIN32 OR (EXISTS "/etc/debian_version" AND MINGW))) + add_cflag_if_supported("-fPIC") + endif () +- +-if (${CMAKE_BUILD_TYPE} MATCHES "Debug") +- add_cflag_if_supported("-ggdb") +- add_cflag_if_supported("-O0") +-else () +- add_cflag_if_supported("-O2") +- add_cflag_if_supported("-Werror") +-endif () diff --git a/devel/stlink/files/patch-doc_dev_pkg-config_CMakeLists.txt b/devel/stlink/files/patch-doc_dev_pkg-config_CMakeLists.txt index 42e007c084e4..1bb3871c36ef 100644 --- a/devel/stlink/files/patch-doc_dev_pkg-config_CMakeLists.txt +++ b/devel/stlink/files/patch-doc_dev_pkg-config_CMakeLists.txt @@ -1,6 +1,6 @@ ---- doc/dev/pkg-config/CMakeLists.txt.orig 2021-04-25 01:24:02.000000000 +0300 -+++ doc/dev/pkg-config/CMakeLists.txt 2021-07-13 15:09:25.486974252 +0300 -@@ -11,5 +11,5 @@ +--- doc/dev/pkg-config/CMakeLists.txt.orig 2021-04-24 22:24:02 UTC ++++ doc/dev/pkg-config/CMakeLists.txt +@@ -11,5 +11,5 @@ configure_file( install( FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" diff --git a/devel/stlink/files/patch-doc_man_CMakeLists.txt b/devel/stlink/files/patch-doc_man_CMakeLists.txt index fe262daea6fd..5d758bec75dd 100644 --- a/devel/stlink/files/patch-doc_man_CMakeLists.txt +++ b/devel/stlink/files/patch-doc_man_CMakeLists.txt @@ -1,6 +1,6 @@ ---- doc/man/CMakeLists.txt.orig 2021-07-13 15:08:26.986789558 +0300 -+++ doc/man/CMakeLists.txt 2021-04-25 01:24:02.000000000 +0300 -@@ -30,7 +30,7 @@ +--- doc/man/CMakeLists.txt.orig 2021-04-24 22:24:02 UTC ++++ doc/man/CMakeLists.txt +@@ -30,7 +30,7 @@ foreach (manpage ${MANPAGES}) endif () if (f AND NOT WIN32) diff --git a/devel/stlink/files/patch-src_common.c b/devel/stlink/files/patch-src_common.c new file mode 100644 index 000000000000..28597bb71049 --- /dev/null +++ b/devel/stlink/files/patch-src_common.c @@ -0,0 +1,34 @@ +Partial application of upstream commit c8fc656, closing +upstream bug #985 and #1175 and fixing the build on 32 +bit platforms. + +https://github.com/stlink-org/stlink/commit/c8fc6561fead79ad49c09d82bab864745086792c +https://github.com/stlink-org/stlink/issues/985 +https://github.com/stlink-org/stlink/issues/1175 + +--- src/common.c.orig 2021-04-24 22:24:02 UTC ++++ src/common.c +@@ -1,4 +1,5 @@ + #define DEBUG_FLASH 0 ++#include + #include + #include + #include +@@ -2205,7 +2206,7 @@ static int map_file(mapped_file_t *mf, const char *pat + + if (sizeof(st.st_size) != sizeof(size_t)) { + // on 32 bit systems, check if there is an overflow +- if (st.st_size > (off_t)INT32_MAX) { ++ if (st.st_size > (off_t)SSIZE_MAX) { + fprintf(stderr, "mmap() size_t overflow for file %s\n", path); + goto on_error; + } +@@ -2219,7 +2220,7 @@ static int map_file(mapped_file_t *mf, const char *pat + goto on_error; + } + +- mf->len = st.st_size; ++ mf->len = (size_t)st.st_size; + error = 0; // success + + on_error: