avrdude: Update to 7.3

This commit is contained in:
Yang Kun
2024-04-16 23:52:34 +08:00
committed by Biswapriyo Nath
parent e88d8349b4
commit d1530bc6f1
5 changed files with 53 additions and 91 deletions

View File

@@ -0,0 +1,15 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index bdad325..da877bf 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -321,10 +321,6 @@ add_executable(avrdude
target_link_libraries(avrdude PUBLIC libavrdude)
-if(MINGW)
- target_link_options(avrdude PRIVATE -static)
-endif()
-
# =====================================
# Install
# =====================================

View File

@@ -1,22 +0,0 @@
--- a/configure.ac
+++ b/configure.ac
@@ -34,7 +34,7 @@
AC_CONFIG_HEADERS(ac_cfg.h)
AC_CONFIG_MACRO_DIR([m4])
-LT_INIT()
+LT_INIT([win32-dll])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
--- a/Makefile.am
+++ b/Makefile.am
@@ -190,7 +190,7 @@
xbee.h \
xbee.c
libavrdude_la_SOURCES = $(libavrdude_a_SOURCES)
-libavrdude_la_LDFLAGS = -version-info 1:0
+libavrdude_la_LDFLAGS = -no-undefined -version-info 1:0
include_HEADERS = libavrdude.h

View File

@@ -1,11 +0,0 @@
--- a/configure.ac
+++ b/configure.ac
@@ -220,6 +218,8 @@
AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/time.h termios.h unistd.h])
AC_CHECK_HEADERS([ddk/hidsdi.h],,,[#include <windows.h>
#include <setupapi.h>])
+AC_CHECK_HEADERS([hidsdi.h],,,[#include <windows.h>
+#include <setupapi.h>])
# Checks for typedefs, structures, and compiler characteristics.

View File

@@ -1,12 +0,0 @@
--- a/configure.ac
+++ b/configure.ac
@@ -230,6 +230,9 @@
AC_CHECK_HEADERS([netinet/in.h])
+# WinSock2
+AC_CHECK_LIB([ws2_32], [puts])
+
# Checks for library functions.
AC_CHECK_FUNCS([memset select strcasecmp strdup strerror strncasecmp strtol strtoul gettimeofday usleep getaddrinfo])

View File

@@ -3,76 +3,68 @@
_realname=avrdude
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=7.0
pkgver=7.3
pkgrel=1
pkgdesc='Software for programming Atmel AVR Microcontrollers (mingw-w64)'
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://www.nongnu.org/avrdude/"
license=('GPL')
makedepends=("${MINGW_PACKAGE_PREFIX}-autotools"
"${MINGW_PACKAGE_PREFIX}-cc")
license=('spdx:GPL-2.0-or-later')
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake")
depends=("${MINGW_PACKAGE_PREFIX}-hidapi"
"${MINGW_PACKAGE_PREFIX}-libelf"
"${MINGW_PACKAGE_PREFIX}-libftdi"
"${MINGW_PACKAGE_PREFIX}-libserialport"
"${MINGW_PACKAGE_PREFIX}-libusb"
"${MINGW_PACKAGE_PREFIX}-libusb-compat"
"${MINGW_PACKAGE_PREFIX}-libusb-win32"
"${MINGW_PACKAGE_PREFIX}-libwinpthread-git")
"${MINGW_PACKAGE_PREFIX}-libusb-compat-git"
"${MINGW_PACKAGE_PREFIX}-ncurses"
"${MINGW_PACKAGE_PREFIX}-readline")
options=('staticlibs' 'strip')
source=("https://download.savannah.gnu.org/releases/avrdude/avrdude-${pkgver}.tar.gz"{,.sig}
'01-libtool.patch'
'02-ddk-headers.patch'
'03-winsock.patch')
sha256sums=('c0ef65d98d6040ca0b4f2b700d51463c2a1f94665441f39d15d97442dbb79b54'
'SKIP'
'446739442932386b4d7dd076599c81188e78332fe7e2b8d0d0459b767ec5e1aa'
'4ea0bbff0c0f101dd560d183fd7792ddbef0e9cd71c7c455adcb8af577e954de'
'7246ac25f5c72e14379747a4efb3a1d4f9b8b10419537c08c5bbf686ddf1a61c')
source=("https://github.com/avrdudes/avrdude/archive/refs/tags/v${pkgver}.zip"
'0001-Remove-static-flag.patch')
sha256sums=('1a0ad78f3aa0935cf411952d92357fc67a43a780c07a6a2d22b620ca0f60e7ab'
'917dd4e89863b3db42a00b1ebbbe14527a80eba7712baf9eb7cae230bea8a74a')
validpgpkeys=('EF497ABE47ED91B3FC3D7EA54D902FF7723BDEE9'
'5E84F980C3CAFD4BB5841070F48CA81B69A85873'
'56628323218C669FF578705C7E9EADC3030D34EB')
prepare()
{
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying ${_patch}"
patch -Nbp1 -i "${srcdir}/${_patch}"
done
}
prepare() {
cd "${srcdir}/${_realname}-${pkgver}"
# Fixes a warning from libtool. However, a DLL still does not generated.
patch -p1 -i ../01-libtool.patch
# Look for headers like hidsdi.h and hidpi.h at the top level,
# (do not assume they are inside the "ddk" directory).
patch -p1 -i ../02-ddk-headers.patch
# Removal of this AC_CHECK_LIB causes linker errors
patch -p1 -i ../03-winsock.patch
./bootstrap
apply_patch_with_msg 0001-Remove-static-flag.patch
}
build() {
[[ -d "${srcdir}"/build-${MSYSTEM} ]] && rm -rf "${srcdir}"/build-${MSYSTEM}
declare -a _extra_config
if check_option "debug" "n"; then
_extra_config+=("-DCMAKE_BUILD_TYPE=Release")
else
_extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi
mkdir -p "${srcdir}"/build-${MSYSTEM} && cd "${srcdir}"/build-${MSYSTEM}
CFLAGS+=" -I${MINGW_PREFIX}/include/libusb-compat"
"../${_realname}-${pkgver}/configure" \
--prefix="${MINGW_PREFIX}" \
--build="${MINGW_CHOST}" \
--host="${MINGW_CHOST}"
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
-DCMAKE_C_FLAGS_INIT="-I${MINGW_PREFIX}/include/libusb-compat" \
-DUSE_STATIC_LIBS=OFF \
"${_extra_config[@]}" \
../${_realname}-${pkgver}
make
}
check() {
cd "${srcdir}/build-${MSYSTEM}"
make check
${MINGW_PREFIX}/bin/cmake --build .
}
package() {
cd "${srcdir}/build-${MSYSTEM}"
make DESTDIR="${pkgdir}" install
# As we can see from confwin.c, AVRDUDE searches for avrdude.conf
# using the PATH; it does not find it in /etc.
mv "${pkgdir}"${MINGW_PREFIX}/etc/avrdude.conf "${pkgdir}"${MINGW_PREFIX}/bin
DESTDIR=${pkgdir} ${MINGW_PREFIX}/bin/cmake --install .
}