[vlc-commits] contrib: update mpg123 to 1.26.0

Steve Lhomme git at videolan.org
Tue May 26 09:50:20 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon May 25 14:52:30 2020 +0200| [38ed27f02fa01ec83f6229340b40523e7591102f] | committer: Steve Lhomme

contrib: update mpg123 to 1.26.0

Simplify the patches (that have been sent upstream and pass CI)

Set _FILE_OFFSET_BITS as it is set in VLC as the mpg123 change ABI if it's
defined or not...

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=38ed27f02fa01ec83f6229340b40523e7591102f
---

 ...gure-detect-WINDOWS_UWP-for-mingw-as-well.patch | 64 ++++++++++++++
 ...on-t-error-on-GetThreadErrorMode-if-we-re.patch | 35 ++++++++
 .../0003-fix-lfs_alias_t-type-for-Android.patch    | 51 ++++++++++++
 contrib/src/mpg123/SHA512SUMS                      |  2 +-
 contrib/src/mpg123/mpg123-libm.patch               |  9 --
 contrib/src/mpg123/mpg123-win32.patch              |  9 --
 contrib/src/mpg123/mpg123_android_off_t.patch      | 21 -----
 contrib/src/mpg123/rules.mak                       | 24 +++---
 contrib/src/mpg123/winstore.patch                  | 97 ----------------------
 9 files changed, 164 insertions(+), 148 deletions(-)

diff --git a/contrib/src/mpg123/0001-configure-detect-WINDOWS_UWP-for-mingw-as-well.patch b/contrib/src/mpg123/0001-configure-detect-WINDOWS_UWP-for-mingw-as-well.patch
new file mode 100644
index 0000000000..82512918fc
--- /dev/null
+++ b/contrib/src/mpg123/0001-configure-detect-WINDOWS_UWP-for-mingw-as-well.patch
@@ -0,0 +1,64 @@
+From 099787a99e7214f068aa61d63befaced516ce254 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Mon, 25 May 2020 10:43:34 +0200
+Subject: [PATCH 1/3] configure: detect WINDOWS_UWP for mingw as well
+
+It is supported as well as with MSVC.
+
+We need to include winapifamily.h to detect UWP builds.
+The official way is to use the WINAPI_FAMILY_PARTITION macro which is compatible between MSVC and mingw.
+
+In UWP build we should use UNICODE API.
+---
+ configure.ac | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 4dfe617..917d251 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -162,6 +162,23 @@ AC_CHECK_HEADERS([windows.h])
+ case "$host" in
+ 	*-*-mingw*)
+ 		win32=yes
++		AC_MSG_CHECKING([if this is a UWP build])
++			AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
++			  [[#include <winapifamily.h>
++			   #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
++			   # error Win32 Desktop build
++			   #endif
++			  ]],[[;]])
++			],[
++				uwp_build=yes
++				AC_MSG_RESULT([yes])
++			],[
++				uwp_build=no
++				AC_MSG_RESULT([no])
++			])
++		if test x"$uwp_build" = xyes; then
++		  AC_DEFINE( [WINDOWS_UWP], 1, [Windows UWP build] )
++		fi
+ 	;;
+ 	*)
+ 		win32=no
+@@ -2284,6 +2301,9 @@ dnl We do not support non-unicode Windows.
+ if test "x$win32_specific_codes" = xenabled; then
+ #### Check for Wide functions
+   AC_CHECK_FUNC([_wopen], [win32_unicode=enabled],[win32_unicode=disabled])
++  if test "x$uwp_build" = xyes; then
++    AC_DEFINE([WANT_WIN32_UNICODE], [1], [ Define to use Unicode for Windows ])
++  else
+   AC_MSG_CHECKING([if we want Unicode File Open for Win32])
+   if test "x$win32_unicode" = xenabled; then
+     dnl We need to include the header for PathCombineW checking as
+@@ -2331,6 +2351,7 @@ if test "x$win32_specific_codes" = xenabled; then
+   else
+     AC_MSG_ERROR([Unicode File Open for Win32 not available])
+   fi
++  fi
+ 
+ #### Check for Network functions
+   AC_CHECK_HEADERS([ws2tcpip.h], [win32_sockets=enabled], [AC_MSG_WARN([Please update your headers to support winsock 2.2.])])
+-- 
+2.26.0.windows.1
+
diff --git a/contrib/src/mpg123/0002-configure-don-t-error-on-GetThreadErrorMode-if-we-re.patch b/contrib/src/mpg123/0002-configure-don-t-error-on-GetThreadErrorMode-if-we-re.patch
new file mode 100644
index 0000000000..a05369f5eb
--- /dev/null
+++ b/contrib/src/mpg123/0002-configure-don-t-error-on-GetThreadErrorMode-if-we-re.patch
@@ -0,0 +1,35 @@
+From 8084885e55bdc7e9f05bc25b76b8776a0205193d Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Mon, 25 May 2020 16:27:51 +0200
+Subject: [PATCH 2/3] configure: don't error on GetThreadErrorMode if we're not
+ going to use it
+
+In UWP builds GetThreadErrorMode is not supported (at least not on all Win8/Win10).
+But it's still possible to build mpg123 without module handling.
+---
+ configure.ac | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index 917d251..c494221 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2435,6 +2435,7 @@ if test x$win32_specific_codes = xenabled; then
+     AC_MSG_RESULT([no])
+   fi
+ # Check GetThreadErrorMode
++  if test x"$modules" != xdisabled; then
+   AC_MSG_CHECKING([if we have GetThreadErrorMode])
+     AC_LINK_IFELSE([AC_LANG_SOURCE([
+     #include <windows.h>
+@@ -2457,6 +2458,7 @@ if test x$win32_specific_codes = xenabled; then
+     AC_MSG_RESULT([no])
+     AC_ERROR([GetThreadErrorMode is required but not found])
+   fi
++  fi
+ fi
+ 
+ #### WINVER Bump
+-- 
+2.26.0.windows.1
+
diff --git a/contrib/src/mpg123/0003-fix-lfs_alias_t-type-for-Android.patch b/contrib/src/mpg123/0003-fix-lfs_alias_t-type-for-Android.patch
new file mode 100644
index 0000000000..7bfc9ce3c3
--- /dev/null
+++ b/contrib/src/mpg123/0003-fix-lfs_alias_t-type-for-Android.patch
@@ -0,0 +1,51 @@
+From 29604faf999056eb1c5e8e934ef9ceee472c78de Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Mon, 25 May 2020 12:46:56 +0200
+Subject: [PATCH 3/3] fix lfs_alias_t type for Android
+
+---
+ configure.ac                   | 5 +++--
+ ports/cmake/src/CMakeLists.txt | 4 ++++
+ 2 files changed, 7 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c494221..f22047e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1158,6 +1158,7 @@ AC_CHECK_TYPE(uint16_t, unsigned short)
+ AC_CHECK_SIZEOF(size_t,4)
+ AC_CHECK_SIZEOF(ssize_t,4)
+ AC_CHECK_SIZEOF(off_t,4)
++AC_CHECK_SIZEOF(off64_t,8)
+ AC_CHECK_SIZEOF(int32_t)
+ AC_CHECK_SIZEOF(long,4)
+ 
+@@ -1168,8 +1169,8 @@ if test "x$largefile_sensitive" = xyes; then
+   lfs_alias_type=long
+   lfs_alias_size=$ac_cv_sizeof_long
+ else
+-  lfs_alias_type=off_t
+-  lfs_alias_size=$ac_cv_sizeof_off_t
++  lfs_alias_type=off64_t
++  lfs_alias_size=$ac_cv_sizeof_off64_t
+ fi
+ 
+ if test "x$lfs_alias_size" = "x"; then 
+diff --git a/ports/cmake/src/CMakeLists.txt b/ports/cmake/src/CMakeLists.txt
+index 7ea2282..4b7b931 100644
+--- a/ports/cmake/src/CMakeLists.txt
++++ b/ports/cmake/src/CMakeLists.txt
+@@ -109,6 +109,10 @@ check_type_size(off_t SIZEOF_OFF_T)
+ if(LFS_SENSITIVE)
+     set(LFS_ALIAS_TYPE long)
+     math(EXPR LFS_ALIAS_BITS "${SIZEOF_LONG} * 8")
++elseif(CMAKE_ANDROID_ARCH_ABI)
++    check_type_size(off64_t SIZEOF_OFF64_T)
++    set(LFS_ALIAS_TYPE off64_t)
++    math(EXPR LFS_ALIAS_BITS "${SIZEOF_OFF64_T} * 8")
+ else()
+     set(LFS_ALIAS_TYPE off_t)
+     math(EXPR LFS_ALIAS_BITS "${SIZEOF_OFF_T} * 8")
+-- 
+2.26.0.windows.1
+
diff --git a/contrib/src/mpg123/SHA512SUMS b/contrib/src/mpg123/SHA512SUMS
index 2715bb93e1..0cb7ae2616 100644
--- a/contrib/src/mpg123/SHA512SUMS
+++ b/contrib/src/mpg123/SHA512SUMS
@@ -1 +1 @@
-a33666ae4aca7e7c1a93a6414d8c525ec19044c54f712d578180147d88e63033f7af2370b9ad22960cc3a0b454f15967b7a831cccc97e034c8855f70cdf1ab09  mpg123-1.25.10.tar.bz2
+0b58b02228f950320fa948fde17730f22a27e7bf6185fe678632281ca230fa5b84358382acb0f1f438631fcdfb93d1dce252d4fbfe616711144f181deb9f2a3e  mpg123-1.26.0.tar.bz2
diff --git a/contrib/src/mpg123/mpg123-libm.patch b/contrib/src/mpg123/mpg123-libm.patch
deleted file mode 100644
index b11671d4dc..0000000000
--- a/contrib/src/mpg123/mpg123-libm.patch
+++ /dev/null
@@ -1,9 +0,0 @@
---- mpg123/libmpg123.pc.in.orig	2015-08-12 01:33:47.000000000 -0400
-+++ mpg123/libmpg123.pc.in	2016-02-03 20:40:25.335615001 -0500
-@@ -7,5 +7,5 @@
- Description: An optimised MPEG Audio decoder
- Requires: 
- Version: @PACKAGE_VERSION@
--Libs: -L${libdir} -lmpg123 
-+Libs: -L${libdir} -lmpg123 @LIBM@
- Cflags: -I${includedir} 
diff --git a/contrib/src/mpg123/mpg123-win32.patch b/contrib/src/mpg123/mpg123-win32.patch
deleted file mode 100644
index dd39b3e0a0..0000000000
--- a/contrib/src/mpg123/mpg123-win32.patch
+++ /dev/null
@@ -1,9 +0,0 @@
---- mpg123/libmpg123.pc.in	2017-09-27 09:52:17.532298223 +0200
-+++ mpg123/libmpg123.pc.in.new	2017-09-27 09:53:18.236300149 +0200
-@@ -7,5 +7,5 @@
- Description: An optimised MPEG Audio decoder
- Requires: 
- Version: @PACKAGE_VERSION@
--Libs: -L${libdir} -lmpg123 @LIBM@
-+Libs: -L${libdir} -lmpg123 @LIBM@ -lshlwapi
- Cflags: -I${includedir} 
diff --git a/contrib/src/mpg123/mpg123_android_off_t.patch b/contrib/src/mpg123/mpg123_android_off_t.patch
deleted file mode 100644
index ce022bb748..0000000000
--- a/contrib/src/mpg123/mpg123_android_off_t.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- mpg123/configure.ac	2015-08-12 07:38:31.000000000 +0200
-+++ mpg123.old/configure.ac	2015-12-02 14:26:55.303304758 +0100
-@@ -1007,6 +1007,7 @@
- AC_CHECK_SIZEOF(size_t,4)
- AC_CHECK_SIZEOF(ssize_t,4)
- AC_CHECK_SIZEOF(off_t,4)
-+AC_CHECK_SIZEOF(off64_t,8)
- AC_CHECK_SIZEOF(int32_t)
- AC_CHECK_SIZEOF(long,4)
- 
-@@ -1017,8 +1018,8 @@
-   lfs_alias_type=long
-   lfs_alias_size=$ac_cv_sizeof_long
- else
--  lfs_alias_type=off_t
--  lfs_alias_size=$ac_cv_sizeof_off_t
-+  lfs_alias_type=off64_t
-+  lfs_alias_size=$ac_cv_sizeof_off64_t
- fi
- 
- if test "x$lfs_alias_size" = "x"; then 
diff --git a/contrib/src/mpg123/rules.mak b/contrib/src/mpg123/rules.mak
index c4ebea7eab..85864a4d94 100644
--- a/contrib/src/mpg123/rules.mak
+++ b/contrib/src/mpg123/rules.mak
@@ -1,5 +1,5 @@
 # mpg123
-MPG123_VERSION := 1.25.10
+MPG123_VERSION := 1.26.0
 MPG123_URL := $(SF)/mpg123/mpg123/$(MPG123_VERSION)/mpg123-$(MPG123_VERSION).tar.bz2
 
 PKGS += mpg123
@@ -7,6 +7,10 @@ ifeq ($(call need_pkg,"libmpg123"),)
 PKGS_FOUND += mpg123
 endif
 
+MPG123_CFLAGS := $(CFLAGS)
+# Same forced value as in VLC
+MPG123_CFLAGS += -D_FILE_OFFSET_BITS=64
+
 MPG123CONF = $(HOSTCONF)
 MPG123CONF += --with-default-audio=dummy --enable-buffer=no --enable-modules=no --disable-network
 
@@ -37,21 +41,19 @@ $(TARBALLS)/mpg123-$(MPG123_VERSION).tar.bz2:
 
 mpg123: mpg123-$(MPG123_VERSION).tar.bz2 .sum-mpg123
 	$(UNPACK)
-	$(APPLY) $(SRC)/mpg123/no-programs.patch
-	$(APPLY) $(SRC)/mpg123/mpg123-libm.patch
+	$(APPLY) $(SRC)/mpg123/0001-configure-detect-WINDOWS_UWP-for-mingw-as-well.patch
+	$(APPLY) $(SRC)/mpg123/0002-configure-don-t-error-on-GetThreadErrorMode-if-we-re.patch
 ifdef HAVE_ANDROID
-	$(APPLY) $(SRC)/mpg123/mpg123_android_off_t.patch
-endif
-ifdef HAVE_WIN32
-	$(APPLY) $(SRC)/mpg123/mpg123-win32.patch
-endif
-ifdef HAVE_WINSTORE
-	$(APPLY) $(SRC)/mpg123/winstore.patch
+	$(APPLY) $(SRC)/mpg123/0003-fix-lfs_alias_t-type-for-Android.patch
 endif
+	# remove generated file from the source package
+	cd $(UNPACK_DIR) && rm -rf src/libsyn123/syn123.h
+	$(APPLY) $(SRC)/mpg123/no-programs.patch
+	$(call pkg_static,"libmpg123.pc.in")
 	$(MOVE)
 
 .mpg123: mpg123
 	$(RECONF)
-	cd $< && $(HOSTVARS) ./configure $(MPG123CONF)
+	cd $< && $(HOSTVARS) CFLAGS="$(MPG123_CFLAGS)" ./configure $(MPG123CONF)
 	cd $< && $(MAKE) install
 	touch $@
diff --git a/contrib/src/mpg123/winstore.patch b/contrib/src/mpg123/winstore.patch
deleted file mode 100644
index d325156329..0000000000
--- a/contrib/src/mpg123/winstore.patch
+++ /dev/null
@@ -1,97 +0,0 @@
---- mpg123/configure.ac	2015-08-12 07:38:31.000000000 +0200
-+++ mpg123/configure.ac.winstore	2016-05-16 16:23:05.234325900 +0200
-@@ -2294,23 +2294,41 @@ win32_fifo_working=no
- if test x$win32_specific_codes = xenabled; then
-   AC_MSG_CHECKING([if we have Named Pipes])
-   if test "x$fifo" != "xdisabled"; then
-+    if test "x$win32_wide_working" = xyes; then
-     AC_LINK_IFELSE([AC_LANG_SOURCE([
-     #include <windows.h>
-       int main(){
--        CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
-         CreateNamedPipeW(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
-         return 0;
-       }])],[win32_fifo_working=yes],[win32_winver_bump=yes])
-+    else
-+    AC_LINK_IFELSE([AC_LANG_SOURCE([
-+    #include <windows.h>
-+      int main(){
-+        CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
-+        return 0;
-+      }])],[win32_fifo_working=yes],[win32_winver_bump=yes])
-+    fi
-     if test "x$win32_fifo_working" != "xyes"; then
-+      if test "x$win32_wide_working" = xyes; then
-     AC_LINK_IFELSE([AC_LANG_SOURCE([
-     #define WINVER 0x501
-     #define _WIN32_WINNT 0x501
-     #include <windows.h>
-       int main(){
--        CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
-         CreateNamedPipeW(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
-         return 0;
-       }])],[win32_fifo_working=yes],[win32_fifo_working=no])
-+      else
-+    AC_LINK_IFELSE([AC_LANG_SOURCE([
-+    #define WINVER 0x501
-+    #define _WIN32_WINNT 0x501
-+    #include <windows.h>
-+      int main(){
-+        CreateNamedPipeA(NULL,PIPE_ACCESS_DUPLEX|FILE_FLAG_OVERLAPPED,PIPE_TYPE_BYTE,1,255,255,0,NULL);
-+        return 0;
-+      }])],[win32_fifo_working=yes],[win32_fifo_working=no])
-+      fi
-     fi
-   fi
-   have_mkfifo=$win32_fifo_working
-@@ -2324,6 +2342,10 @@ fi
- 
- #### WINVER Bump
- if test x$win32_specific_codes = xenabled; then
-+  AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
-+  #if defined(WINVER) && WINVER > 0x0501
-+  #error don't bump
-+  #endif]])],[],[win32_winver_bump=no])
-   AC_MSG_CHECKING([if WINVER and _WIN32_WINNT needs version bumps])
-   if test "x$win32_winver_bump" = "xyes"; then
-     AC_MSG_RESULT([yes])
---- mpg123/src/compat/compat.c	2017-11-17 11:22:26.575986065 +0100
-+++ mpg123/src/compat/compat.c.new	2017-11-17 11:22:22.671985997 +0100
-@@ -14,13 +14,14 @@
- #define _POSIX_SOURCE
- #include "compat.h"
- 
--#ifdef _MSC_VER
--#include <io.h>
--
-+#include <winapifamily.h>
- #if(defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_APP))
- #define WINDOWS_UWP
- #endif
- 
-+#ifdef _MSC_VER
-+#include <io.h>
-+
- #endif
- #ifdef HAVE_SYS_STAT_H
- #  include <sys/stat.h>
---- mpg123/configure.ac.winstore	2019-03-12 14:32:33.852490800 +0100
-+++ mpg123/configure.ac	2019-03-12 14:44:17.475401200 +0100
-@@ -2202,7 +2202,7 @@ if test "x$win32_specific_codes" = xenab
-       {
-         MultiByteToWideChar (0, 0, NULL, 0, NULL, 0);
-         WideCharToMultiByte (0, 0, NULL, 0, NULL, 0, NULL, NULL);
--        PathCombineW(0,0,0);
-+        //PathCombineW(0,0,0);
-         return 0;
-       }
-     ])], [win32_wide_working=yes], [win32_winver_bump=yes])
-@@ -2217,7 +2217,7 @@ if test "x$win32_specific_codes" = xenab
-         {
-           MultiByteToWideChar (0, 0, NULL, 0, NULL, 0);
-           WideCharToMultiByte (0, 0, NULL, 0, NULL, 0, NULL, NULL);
--          PathCombineW(0,0,0);
-+          //PathCombineW(0,0,0);
-           return 0;
-         }
-       ])], [win32_wide_working=yes], [AC_MSG_RESULT([no])])



More information about the vlc-commits mailing list