[vlc-commits] [Git][videolan/vlc][master] 5 commits: contrib: libxml2: build with CMake

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Oct 4 12:15:28 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
5356a445 by Steve Lhomme at 2022-10-04T10:37:44+00:00
contrib: libxml2: build with CMake

- - - - -
e9526e8f by Steve Lhomme at 2022-10-04T10:37:44+00:00
contrib: nfs: update to 5.0.2

- - - - -
48366047 by Steve Lhomme at 2022-10-04T10:37:44+00:00
contrib: nfs: build with CMake

- - - - -
531454a3 by Steve Lhomme at 2022-10-04T10:37:44+00:00
contrib: ogg: build with CMake

- - - - -
60f65663 by Steve Lhomme at 2022-10-04T10:37:44+00:00
contrib: opus: build with CMake

The generated pkgconfig file is bogus with CMake and an include file from
CMakeLists.txt was not put in the tarball...

I would send the patches upstream but I can't fork the repo so I can't submit
a MR.

- - - - -


12 changed files:

- − contrib/src/libxml2/bins.patch
- − contrib/src/libxml2/pthread.patch
- contrib/src/libxml2/rules.mak
- − contrib/src/libxml2/win32.patch
- contrib/src/nfs/SHA512SUMS
- contrib/src/nfs/rules.mak
- − contrib/src/ogg/libogg-configure.patch
- − contrib/src/ogg/libogg-disable-check.patch
- contrib/src/ogg/rules.mak
- + contrib/src/opus/0001-CMake-set-the-pkg-config-version-to-the-library-vers.patch
- + contrib/src/opus/0002-CMake-set-the-pkg-config-string-as-with-autoconf-mes.patch
- contrib/src/opus/rules.mak


Changes:

=====================================
contrib/src/libxml2/bins.patch deleted
=====================================
@@ -1,20 +0,0 @@
---- libxml2-2.9.14/Makefile.am.orig	2022-05-02 12:52:41.000000000 +0200
-+++ libxml2-2.9.14/Makefile.am	2022-05-26 19:38:23.251503583 +0200
-@@ -2,7 +2,7 @@
- 
- ACLOCAL_AMFLAGS = -I m4
- 
--SUBDIRS = include . doc example fuzz xstc $(PYTHON_SUBDIR)
-+SUBDIRS = include . fuzz xstc $(PYTHON_SUBDIR)
- 
- DIST_SUBDIRS = include . doc example fuzz python xstc
- 
-@@ -15,7 +15,7 @@
-                testReader testapi testModule runtest runsuite testchar \
- 	       testdict runxmlconf testrecurse testlimits
- 
--bin_PROGRAMS = xmllint xmlcatalog
-+bin_PROGRAMS =
- 
- bin_SCRIPTS=xml2-config
- 


=====================================
contrib/src/libxml2/pthread.patch deleted
=====================================
@@ -1,21 +0,0 @@
---- libxml2-2.9.14/configure.ac.orig	2022-05-02 13:12:33.000000000 +0200
-+++ libxml2-2.9.14/configure.ac	2022-05-26 19:45:13.697273909 +0200
-@@ -1036,11 +1036,16 @@
-     dnl Use pthread by default in other cases
-     if test -z "$THREADS_W32"; then
-         if test "$with_threads" = "pthread" || test "$with_threads" = "" || test "$with_threads" = "yes" ; then
-+            LIBS_saved="$LIBS"
-             AC_CHECK_HEADER(pthread.h,
--                AC_CHECK_LIB(pthread, pthread_join,[
--                THREAD_LIBS="-lpthread"
-+                AC_SEARCH_LIBS(pthread_join, pthread,[
-+                THREAD_LIBS="$ac_cv_search_pthread_join"
-+                if test "$THREAD_LIBS" = "none required"; then
-+                  THREAD_LIBS=""
-+                fi
-                 AC_DEFINE([HAVE_PTHREAD_H], [], [Define if <pthread.h> is there])
-                 WITH_THREADS="1"]))
-+            LIBS="$LIBS_saved"
-         fi
-     fi
- 


=====================================
contrib/src/libxml2/rules.mak
=====================================
@@ -13,45 +13,48 @@ $(TARBALLS)/libxml2-$(LIBXML2_VERSION).tar.xz:
 
 .sum-libxml2: libxml2-$(LIBXML2_VERSION).tar.xz
 
-XMLCONF = --with-minimal     \
-          --with-catalog     \
-          --with-reader      \
-          --with-tree        \
-          --with-push        \
-          --with-xptr        \
-          --with-valid       \
-          --with-xpath       \
-          --with-xinclude    \
-          --with-sax1        \
-          --without-zlib     \
-          --without-iconv    \
-          --without-http     \
-          --without-ftp      \
-          --without-docbook  \
-          --without-regexps  \
-          --without-python
+LIBXML2_CONF = \
+        -DLIBXML2_WITH_C14N=OFF \
+        -DLIBXML2_WITH_ISO8859X=OFF \
+        -DLIBXML2_WITH_SCHEMAS=OFF \
+        -DLIBXML2_WITH_SCHEMATRON=OFF \
+        -DLIBXML2_WITH_VALID=OFF \
+        -DLIBXML2_WITH_WRITER=OFF \
+        -DLIBXML2_WITH_XINCLUDE=OFF \
+        -DLIBXML2_WITH_XPATH=OFF \
+        -DLIBXML2_WITH_XPTR=OFF \
+        -DLIBXML2_WITH_MODULES=OFF \
+        -DLIBXML2_WITH_LEGACY=OFF \
+        -DLIBXML2_WITH_ZLIB=OFF    \
+        -DLIBXML2_WITH_ICONV=OFF   \
+        -DLIBXML2_WITH_HTTP=OFF    \
+        -DLIBXML2_WITH_FTP=OFF     \
+        -DLIBXML2_WITH_DOCB=OFF    \
+        -DLIBXML2_WITH_REGEXPS=OFF \
+        -DLIBXML2_WITH_PYTHON=OFF \
+        -DLIBXML2_WITH_LZMA=OFF \
+        -DLIBXML2_WITH_TESTS=OFF \
+        -DLIBXML2_WITH_PROGRAMS=OFF
 
 ifdef WITH_OPTIMIZATION
-XMLCONF+= --without-debug
+LIBXML2_CONF += -DLIBXML2_WITH_DEBUG=OFF
 endif
 
 XMLCONF += CFLAGS="$(CFLAGS) -DLIBXML_STATIC"
 
 libxml2: libxml2-$(LIBXML2_VERSION).tar.xz .sum-libxml2
 	$(UNPACK)
-	$(APPLY) $(SRC)/libxml2/win32.patch
-	$(APPLY) $(SRC)/libxml2/bins.patch
-	$(APPLY) $(SRC)/libxml2/pthread.patch
+	# fix pkg-config file using an unset variable
+	sed -e 's,"\\\$${pcfiledir}/$${PACKAGE_RELATIVE_PATH}","$${CMAKE_INSTALL_PREFIX}",' -i.orig  "$(UNPACK_DIR)/CMakeLists.txt"
 ifdef HAVE_WINSTORE
 	$(APPLY) $(SRC)/libxml2/nogetcwd.patch
 endif
 	$(call pkg_static,"libxml-2.0.pc.in")
 	$(MOVE)
 
-.libxml2: libxml2
-	$(RECONF)
-	$(MAKEBUILDDIR)
-	$(MAKECONFIGURE) $(XMLCONF)
-	+$(MAKEBUILD)
-	+$(MAKEBUILD) install
+.libxml2: libxml2 toolchain.cmake
+	$(CMAKECLEAN)
+	$(HOSTVARS) $(CMAKE) $(LIBXML2_CONF)
+	+$(CMAKEBUILD)
+	+$(CMAKEBUILD) --target install
 	touch $@


=====================================
contrib/src/libxml2/win32.patch deleted
=====================================
@@ -1,11 +0,0 @@
---- libxml2/configure.ac.orig	2018-03-05 16:54:00.000000000 +0100
-+++ libxml2/configure.ac	2018-03-07 17:29:50.093410103 +0100
-@@ -1036,7 +1036,7 @@
-        *mingw*) if test "$with_threads" != "pthread" && test "$with_threads" != "no"; then
-                WITH_THREADS="1"
-                THREADS_W32="1"
--               THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS"
-+               THREAD_CFLAGS="$THREAD_CFLAGS -DHAVE_WIN32_THREADS -DHAVE_COMPILER_TLS"
-            fi
-        ;;
-     esac


=====================================
contrib/src/nfs/SHA512SUMS
=====================================
@@ -1 +1 @@
-71f2dcfa8945c1cb6402f5fca10b1f7a4720f7589807d6130eb55361f05ef4684f9cc9a177ece4e13d3847ac6606924115fac7b27749cecc2f5aca6fa9c63ebf  libnfs-5.0.1.tar.gz
+6dcf4ea8a01b35beb53694625d20fbebd858a88725c2742671878ad6fe7877999f93d262fb58a435b00c283c3e6fb6fa7222d04bb4540bf674b7ce196e9424f5  libnfs-5.0.2.tar.gz


=====================================
contrib/src/nfs/rules.mak
=====================================
@@ -1,5 +1,5 @@
 # NFS
-NFS_VERSION := 5.0.1
+NFS_VERSION := 5.0.2
 NFS_URL := $(GITHUB)/sahlberg/libnfs/archive/libnfs-$(NFS_VERSION).tar.gz
 
 PKGS += nfs
@@ -15,15 +15,11 @@ $(TARBALLS)/libnfs-$(NFS_VERSION).tar.gz:
 nfs: libnfs-$(NFS_VERSION).tar.gz .sum-nfs
 	$(UNPACK)
 	mv libnfs-libnfs-$(NFS_VERSION) libnfs-$(NFS_VERSION)
-	$(UPDATE_AUTOCONFIG)
 	$(MOVE)
 
-NFS_CONF := --disable-examples --disable-utils --disable-werror
-
-.nfs: nfs
-	cd $< && ./bootstrap
-	$(MAKEBUILDDIR)
-	$(MAKECONFIGURE) $(NFS_CONF)
-	+$(MAKEBUILD)
-	+$(MAKEBUILD) install
+.nfs: nfs toolchain.cmake
+	$(CMAKECLEAN)
+	$(HOSTVARS_PIC) $(CMAKE)
+	+$(CMAKEBUILD)
+	+$(CMAKEBUILD) --target install
 	touch $@


=====================================
contrib/src/ogg/libogg-configure.patch deleted
=====================================
@@ -1,56 +0,0 @@
---- libogg-1.3.3/configure.ac	2017-11-07 15:33:00.000000000 -0500
-+++ libogg-1.3.3-new/configure.ac	2017-11-15 16:00:23.786278061 -0500
-@@ -27,17 +27,17 @@
-         case $host in 
-         *-*-irix*)
-                 DEBUG="-g -signed" 
--                CFLAGS="-O2 -w -signed"
-+                EXTRA_CFLAGS="-O2 -w -signed"
-                 PROFILE="-p -g3 -O2 -signed"
- 		;;
-         sparc-sun-solaris*)
-                 DEBUG="-v -g"
--                CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
-+                EXTRA_CFLAGS="-xO4 -fast -w -fsimple -native -xcg92"
-                 PROFILE="-v -xpg -g -xO4 -fast -native -fsimple -xcg92 -Dsuncc"
- 		;;
-         *)
-                 DEBUG="-g"
--                CFLAGS="-O"
-+                EXTRA_CFLAGS="-O"
-                 PROFILE="-g -p" 
- 		;;
-         esac
-@@ -45,27 +45,27 @@
-         case $host in 
-         *-*-linux*)
-                 DEBUG="-g -Wall -fsigned-char"
--                CFLAGS="-O20 -Wall -ffast-math -fsigned-char"
-+                EXTRA_CFLAGS="-O20 -Wall -ffast-math -fsigned-char"
-                 PROFILE="-Wall -W -pg -g -O20 -ffast-math -fsigned-char"
- 		;;
-         sparc-sun-*)
-                 DEBUG="-g -Wall -fsigned-char"
--                CFLAGS="-O20 -ffast-math -fsigned-char"
-+                EXTRA_CFLAGS="-O20 -ffast-math -fsigned-char"
-                 PROFILE="-pg -g -O20 -fsigned-char" 
- 		;;
- 	*-*-darwin*)
- 		DEBUG="-fno-common -g -Wall -fsigned-char"
--		CFLAGS="-fno-common -O4 -Wall -fsigned-char -ffast-math"
-+		EXTRA_CFLAGS="-fno-common -O3 -Wall -fsigned-char -ffast-math"
- 		PROFILE="-fno-common -O4 -Wall -pg -g -fsigned-char -ffast-math"
- 		;;
-         *)
-                 DEBUG="-g -Wall -fsigned-char"
--                CFLAGS="-O20 -fsigned-char"
-+                EXTRA_CFLAGS="-O20 -fsigned-char"
-                 PROFILE="-O20 -g -pg -fsigned-char" 
- 		;;
-         esac
- fi
--CFLAGS="$CFLAGS $cflags_save"
-+CFLAGS="$EXTRA_CFLAGS $cflags_save"
- DEBUG="$DEBUG $cflags_save"
- PROFILE="$PROFILE $cflags_save"
- 


=====================================
contrib/src/ogg/libogg-disable-check.patch deleted
=====================================
@@ -1,11 +0,0 @@
---- libogg-1.3.3/src/Makefile.am	2017-06-12 13:14:31.000000000 -0400
-+++ libogg-1.3.3-new/src/Makefile.am	2017-11-15 16:03:05.434272042 -0500
-@@ -9,7 +9,7 @@
- 
- # build and run the self tests on 'make check'
- 
--noinst_PROGRAMS = test_bitwise test_framing
-+noinst_PROGRAMS =
- 
- test_bitwise_SOURCES = bitwise.c
- test_bitwise_CFLAGS = -D_V_SELFTEST


=====================================
contrib/src/ogg/rules.mak
=====================================
@@ -17,16 +17,12 @@ $(TARBALLS)/libogg-$(OGG_VERSION).tar.xz:
 
 libogg: libogg-$(OGG_VERSION).tar.xz .sum-ogg
 	$(UNPACK)
-	$(APPLY) $(SRC)/ogg/libogg-configure.patch
-	$(APPLY) $(SRC)/ogg/libogg-disable-check.patch
 	$(APPLY) $(SRC)/ogg/libogg-uint-macos.patch
-	$(UPDATE_AUTOCONFIG)
 	$(MOVE)
 
-.ogg: libogg
-	$(RECONF)
-	$(MAKEBUILDDIR)
-	$(MAKECONFIGURE)
-	+$(MAKEBUILD)
-	+$(MAKEBUILD) install
+.ogg: libogg toolchain.cmake
+	$(CMAKECLEAN)
+	$(HOSTVARS) $(CMAKE)
+	+$(CMAKEBUILD)
+	+$(CMAKEBUILD) --target install
 	touch $@


=====================================
contrib/src/opus/0001-CMake-set-the-pkg-config-version-to-the-library-vers.patch
=====================================
@@ -0,0 +1,27 @@
+From e3932184ed8148b35e5a3bb58765aa12d01cb15c Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Fri, 9 Sep 2022 07:57:02 +0200
+Subject: [PATCH 1/2] CMake: set the pkg-config version to the library version
+
+Not the .so version.
+---
+ CMakeLists.txt | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 17ee3fc2..902cb835 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -316,8 +316,7 @@ if(OPUS_INSTALL_PKG_CONFIG_MODULE)
+   set(exec_prefix ${CMAKE_INSTALL_PREFIX})
+   set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
+   set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
+-  set(VERSION ${OPUS_LIBRARY_VERSION})
+-  set(VERSION ${OPUS_LIBRARY_VERSION})
++  set(VERSION ${PROJECT_VERSION})
+   if(HAVE_LIBM)
+     set(LIBM "-lm")
+   endif()
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/opus/0002-CMake-set-the-pkg-config-string-as-with-autoconf-mes.patch
=====================================
@@ -0,0 +1,31 @@
+From 77b5a3a4c024892a33c5ead0d38c707c02cef790 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Fri, 9 Sep 2022 07:58:02 +0200
+Subject: [PATCH 2/2] CMake: set the pkg-config string as with autoconf/meson
+
+---
+ CMakeLists.txt | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 902cb835..0abb677c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -317,6 +317,14 @@ if(OPUS_INSTALL_PKG_CONFIG_MODULE)
+   set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
+   set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
+   set(VERSION ${PROJECT_VERSION})
++  if(OPUS_FIXED_POINT)
++    set(PC_BUILD "fixed-point")
++  else()
++    set(PC_BUILD "floating-point")
++  endif()
++  if(OPUS_CUSTOM_MODES)
++    set(PC_BUILD "${PC_BUILD}, custom modes")
++  endif()
+   if(HAVE_LIBM)
+     set(LIBM "-lm")
+   endif()
+-- 
+2.37.3.windows.1
+


=====================================
contrib/src/opus/rules.mak
=====================================
@@ -16,17 +16,20 @@ $(TARBALLS)/opus-$(OPUS_VERSION).tar.gz:
 
 opus: opus-$(OPUS_VERSION).tar.gz .sum-opus
 	$(UNPACK)
-	$(UPDATE_AUTOCONFIG)
+	$(APPLY) $(SRC)/opus/0001-CMake-set-the-pkg-config-version-to-the-library-vers.patch
+	$(APPLY) $(SRC)/opus/0002-CMake-set-the-pkg-config-string-as-with-autoconf-mes.patch
+	# fix missing included file in packaged source
+	cd $(UNPACK_DIR) && sed -e 's,include(opus_buildtype,#include(opus_buildtype,' -i.orig CMakeLists.txt
 	$(MOVE)
 
-OPUS_CONF= --disable-extra-programs --disable-doc
+OPUS_CONF=
 ifndef HAVE_FPU
-OPUS_CONF += --enable-fixed-point
+OPUS_CONF += -DOPUS_FIXED_POINT=ON
 endif
 
-.opus: opus
-	$(MAKEBUILDDIR)
-	$(MAKECONFIGURE) $(OPUS_CONF)
-	+$(MAKEBUILD)
-	+$(MAKEBUILD) install
+.opus: opus toolchain.cmake
+	$(CMAKECLEAN)
+	$(HOSTVARS_PIC) $(CMAKE) $(OPUS_CONF)
+	+$(CMAKEBUILD)
+	+$(CMAKEBUILD) --target install
 	touch $@



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/15192dc0b26c839ca0c3d2e82e52c52d78463b64...60f65663b958b8961a8eff8e41dc93eaea9facde

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/15192dc0b26c839ca0c3d2e82e52c52d78463b64...60f65663b958b8961a8eff8e41dc93eaea9facde
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list