gphoto2: update to 2.5.32 (#25186)

* gphoto2: update patch for 2.5.32

* gphoto2: update to 2.5.32

* fixes

* fnmatch fixes: while ignoring the encoding to keep it simple

* build out-of-tree

---------

Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
This commit is contained in:
Miloš Komarčević 2025-08-17 16:54:17 +02:00 committed by GitHub
parent 0c1699b349
commit b41ccbf926
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 62 additions and 20 deletions

View File

@ -18,15 +18,6 @@ index f34088e..8c8b51f 100644
/* name it file_%filename if --filename is set, otherwise capture_preview */
r = save_camera_file_to_file (NULL, "capture_preview", p->filename?GP_FILE_TYPE_PREVIEW:GP_FILE_TYPE_NORMAL, file, tmpfilename);
gp_file_unref (file);
@@ -1016,7 +1019,7 @@ action_camera_capture_movie (GPParams *p, const char *arg)
fd = dup(fileno(stdout));
xname = "stdout";
} else {
- fd = open("movie.mjpg",O_WRONLY|O_CREAT,0660);
+ fd = open("movie.mjpg",O_WRONLY | O_CREAT | O_BINARY,0660);
if (fd == -1) {
cli_error_print(_("Could not open 'movie.mjpg'."));
return GP_ERROR;
@@ -1070,6 +1073,9 @@ action_camera_capture_movie (GPParams *p, const char *arg)
}
gp_file_unref (file);

View File

@ -0,0 +1,14 @@
--- gphoto2-2.5.28/gphoto2/gp-params.c.orig 2025-08-17 11:37:20.980244500 +0200
+++ gphoto2-2.5.28/gphoto2/gp-params.c 2025-08-17 11:38:05.444623100 +0200
@@ -518,7 +518,11 @@
}
/* Actually run the hook script */
+#ifdef _WIN32
+ retcode = spawnve(_P_WAIT, hook_script, child_argv, child_envp);
+#else
retcode = spawnve(hook_script, child_argv, child_envp);
+#endif
/* Free all memory */
for (i=0; child_envp[i] != NULL; i++) {

View File

@ -0,0 +1,28 @@
--- gphoto2-2.5.32/gphoto2/shell.c.orig 2023-06-13 13:09:15.000000000 +0200
+++ gphoto2-2.5.32/gphoto2/shell.c 2025-08-17 12:32:30.399955300 +0200
@@ -31,7 +31,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <fnmatch.h>
+#ifndef _WIN32
+# include <fnmatch.h>
+#else
+# include <shlwapi.h>
+#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
@@ -769,7 +773,11 @@
/* Get all matching files */
for (x = 1; x <= gp_list_count (list); x++) {
gp_list_get_name (list, x - 1, &name);
- if (fnmatch (arg, name, (1 << 4)) == 0) {
+#ifdef _WIN32
+ if (PathMatchSpecA(name, arg)) {
+#else
+ if (fnmatch(arg, name, (1 << 4)) == 0) {
+#endif
printf ("Getting file %s ... ", name);
fflush(stdout);
// get file

View File

@ -3,13 +3,16 @@
_realname=gphoto2
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=2.5.28
pkgver=2.5.32
pkgrel=1
pkgdesc="The gphoto2 commandline tool for accessing and controlling digital cameras (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='http://www.gphoto.org/'
msys2_repository_url="https://github.com/gphoto/gphoto2"
msys2_references=(
'anitya: 10207'
)
license=('spdx:GPL-2.0-or-later')
depends=("${MINGW_PACKAGE_PREFIX}-libgphoto2"
"${MINGW_PACKAGE_PREFIX}-libiconv"
@ -20,24 +23,30 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-autotools"
"${MINGW_PACKAGE_PREFIX}-cc")
validpgpkeys=('7C4AFD61D8AAE7570796A5172209D6902F969C95') # Marcus Meissner
source=("https://github.com/gphoto/gphoto2/releases/download/v${pkgver}/${_realname}-${pkgver}.tar.xz"{,.asc}
"01_gphoto_close_before_rename.patch")
sha256sums=('ff3e32c7bd2a129d817dcd9e75ce51834409b1966e1f20e74c427c32ae732afa'
"01_gphoto_close_before_rename.patch"
"02_fix-spawnve-usage.patch"
"03-no-fnmatch.patch")
sha256sums=('be08a449bbed9613bc9db105997c4ba71410d41870496420359a99b37502c406'
'SKIP'
'ca4e431c4f2bca1272a6580ebab7d81a82fa38fad07624cc8c6328b458293b19')
'5722c6971d0795b6678972695b26eafcddd20a2a7c5e78aecaa4d0ec1ae26a7b'
'70079291e40b2877cb9c31fdb3c6c45eac19ce7dff566b2811f55eb15bf937c0'
'f0443a928c8faafdc06eb1636cd8bb84ac2c5d96500c9aba328075908082af98')
prepare() {
cd $srcdir/${_realname}-${pkgver}
cd "${_realname}-${pkgver}"
patch -p1 -i "${srcdir}"/01_gphoto_close_before_rename.patch
patch -p1 -i "${srcdir}"/02_fix-spawnve-usage.patch
patch -p1 -i "${srcdir}"/03-no-fnmatch.patch
autoreconf -fiv
}
build() {
[[ -d build-${MSYSTEM} ]] && rm -rf build-${MSYSTEM}
cp -r ${_realname}-${pkgver} build-${MSYSTEM}
mkdir -p "build-${MSYSTEM}" && cd "build-${MSYSTEM}"
cd "${srcdir}/build-${MSYSTEM}"
./configure \
export LDFLAGS="$LDFLAGS -lshlwapi"
../"${_realname}-${pkgver}"/configure \
--prefix=${MINGW_PREFIX} \
--build=${MINGW_CHOST} \
--host=${MINGW_CHOST} \
@ -48,8 +57,8 @@ build() {
package() {
cd "${srcdir}/build-${MSYSTEM}"
cd "build-${MSYSTEM}"
make install DESTDIR="${pkgdir}"
install -Dm644 COPYING "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE
install -Dm644 "${srcdir}/${_realname}-${pkgver}/COPYING" "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE
}