From dc1d659b3c052800406754aacd813301abbd6e35 Mon Sep 17 00:00:00 2001 From: Zihua Wu Date: Tue, 20 Sep 2022 14:27:43 +0800 Subject: [PATCH 01/12] Update build_tarballs.jl --- G/GStreamer/build_tarballs.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/G/GStreamer/build_tarballs.jl b/G/GStreamer/build_tarballs.jl index 08fc4c0fcd8..4803b524bb2 100644 --- a/G/GStreamer/build_tarballs.jl +++ b/G/GStreamer/build_tarballs.jl @@ -3,11 +3,11 @@ using BinaryBuilder, Pkg name = "GStreamer" -version = v"1.18.3" +version = v"1.20.3" # Collection of sources required to complete build sources = [ - ArchiveSource("https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-$(version).tar.xz", "0c2e09e18f2df69a99b5cb3bd53c597b3cc2e35cf6c98043bb86a66f3d312100") + ArchiveSource("https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-$(version).tar.xz", "607daf64bbbd5fb18af9d17e21c0d22c4d702fffe83b23cb22d1b1af2ca23a2a") ] # Bash recipe for building across all platforms From 5fa80e82b777e36eda0704e2d2d96e0ee4596dd7 Mon Sep 17 00:00:00 2001 From: Zihua Wu Date: Tue, 20 Sep 2022 14:33:31 +0800 Subject: [PATCH 02/12] Update build_tarballs.jl --- G/GStreamer/build_tarballs.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/G/GStreamer/build_tarballs.jl b/G/GStreamer/build_tarballs.jl index 4803b524bb2..0be2508802d 100644 --- a/G/GStreamer/build_tarballs.jl +++ b/G/GStreamer/build_tarballs.jl @@ -42,10 +42,10 @@ products = [ # Dependencies that must be installed before this package can be built dependencies = [ - Dependency(PackageSpec(name="Glib_jll", uuid="7746bdde-850d-59dc-9ae8-88ece973131d"), v"2.59.0"; compat="2.59.0") + Dependency(PackageSpec(name="Glib_jll", uuid="7746bdde-850d-59dc-9ae8-88ece973131d")) Dependency(PackageSpec(name="LibUnwind_jll", uuid="745a5e78-f969-53e9-954f-d19f2f74f4e3")) Dependency(PackageSpec(name="Elfutils_jll", uuid="ab5a07f8-06af-567f-a878-e8bb879eba5a")) - Dependency(PackageSpec(name="GMP_jll", uuid="781609d7-10c4-51f6-84f2-b8444358ff6d"), v"6.1.2") + Dependency(PackageSpec(name="GMP_jll", uuid="781609d7-10c4-51f6-84f2-b8444358ff6d")) Dependency(PackageSpec(name="GSL_jll", uuid="1b77fbbe-d8ee-58f0-85f9-836ddc23a7a4")) Dependency(PackageSpec(name="libcap_jll", uuid="eef66a8b-8d7a-5724-a8d2-7c31ae1e29ed")) ] From c52bc968726e95ceb6b5c03416485de459931c14 Mon Sep 17 00:00:00 2001 From: Zihua Wu Date: Tue, 20 Sep 2022 14:38:00 +0800 Subject: [PATCH 03/12] Update build_tarballs.jl --- G/GStreamer/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/G/GStreamer/build_tarballs.jl b/G/GStreamer/build_tarballs.jl index 0be2508802d..d4804aed978 100644 --- a/G/GStreamer/build_tarballs.jl +++ b/G/GStreamer/build_tarballs.jl @@ -51,4 +51,4 @@ dependencies = [ ] # Build the tarballs, and possibly a `build.jl` as well. -build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies) +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6") From e3d202e8b30a3d0ce9e8a29bd10018a1218700a8 Mon Sep 17 00:00:00 2001 From: Zihua Wu Date: Tue, 11 Oct 2022 23:47:49 +0800 Subject: [PATCH 04/12] Update build_tarballs.jl --- G/GStreamer/build_tarballs.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/G/GStreamer/build_tarballs.jl b/G/GStreamer/build_tarballs.jl index d4804aed978..aff2d5960e4 100644 --- a/G/GStreamer/build_tarballs.jl +++ b/G/GStreamer/build_tarballs.jl @@ -42,10 +42,10 @@ products = [ # Dependencies that must be installed before this package can be built dependencies = [ - Dependency(PackageSpec(name="Glib_jll", uuid="7746bdde-850d-59dc-9ae8-88ece973131d")) + Dependency(PackageSpec(name="Glib_jll", uuid="7746bdde-850d-59dc-9ae8-88ece973131d"), v"2.59.0"; compat="2.59.0") Dependency(PackageSpec(name="LibUnwind_jll", uuid="745a5e78-f969-53e9-954f-d19f2f74f4e3")) Dependency(PackageSpec(name="Elfutils_jll", uuid="ab5a07f8-06af-567f-a878-e8bb879eba5a")) - Dependency(PackageSpec(name="GMP_jll", uuid="781609d7-10c4-51f6-84f2-b8444358ff6d")) + Dependency(PackageSpec(name="GMP_jll", uuid="781609d7-10c4-51f6-84f2-b8444358ff6d"), v"6.1.2") Dependency(PackageSpec(name="GSL_jll", uuid="1b77fbbe-d8ee-58f0-85f9-836ddc23a7a4")) Dependency(PackageSpec(name="libcap_jll", uuid="eef66a8b-8d7a-5724-a8d2-7c31ae1e29ed")) ] From 26ffedd531f28884dce64336de660ec1c4b493ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Tue, 11 Oct 2022 23:41:18 +0100 Subject: [PATCH 05/12] [GStreamer] Fix compatibilities --- G/GStreamer/build_tarballs.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/G/GStreamer/build_tarballs.jl b/G/GStreamer/build_tarballs.jl index aff2d5960e4..3367584526b 100644 --- a/G/GStreamer/build_tarballs.jl +++ b/G/GStreamer/build_tarballs.jl @@ -42,11 +42,11 @@ products = [ # Dependencies that must be installed before this package can be built dependencies = [ - Dependency(PackageSpec(name="Glib_jll", uuid="7746bdde-850d-59dc-9ae8-88ece973131d"), v"2.59.0"; compat="2.59.0") + Dependency(PackageSpec(name="Glib_jll", uuid="7746bdde-850d-59dc-9ae8-88ece973131d"); compat="2.68.1") Dependency(PackageSpec(name="LibUnwind_jll", uuid="745a5e78-f969-53e9-954f-d19f2f74f4e3")) Dependency(PackageSpec(name="Elfutils_jll", uuid="ab5a07f8-06af-567f-a878-e8bb879eba5a")) - Dependency(PackageSpec(name="GMP_jll", uuid="781609d7-10c4-51f6-84f2-b8444358ff6d"), v"6.1.2") - Dependency(PackageSpec(name="GSL_jll", uuid="1b77fbbe-d8ee-58f0-85f9-836ddc23a7a4")) + Dependency(PackageSpec(name="GMP_jll", uuid="781609d7-10c4-51f6-84f2-b8444358ff6d"); compat="6.2.0") + Dependency(PackageSpec(name="GSL_jll", uuid="1b77fbbe-d8ee-58f0-85f9-836ddc23a7a4"); compat="~2.7.2") Dependency(PackageSpec(name="libcap_jll", uuid="eef66a8b-8d7a-5724-a8d2-7c31ae1e29ed")) ] From d1261b615d37cd3dab62ca7e8abf8d981a7d19a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Tue, 11 Oct 2022 23:43:47 +0100 Subject: [PATCH 06/12] [GStreamer] Target Windows 7 --- G/GStreamer/build_tarballs.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/G/GStreamer/build_tarballs.jl b/G/GStreamer/build_tarballs.jl index 3367584526b..c3a0c24d8a6 100644 --- a/G/GStreamer/build_tarballs.jl +++ b/G/GStreamer/build_tarballs.jl @@ -17,6 +17,10 @@ apk add bash-completion libcap gettext cd gstreamer-* mkdir build cd build +if [[ "${target}" == *-mingw* ]]; then + # Need to tell we're targeting at least Windows 7 so that `FILE_STANDARD_INFO` is defined + sed -ri "s/^c_args = \[(.*)\]/c_args = [\1, '-DWINVER=_WIN32_WINNT_WIN7', '-D_WIN32_WINNT=_WIN32_WINNT_WIN7']/" ${MESON_TARGET_TOOLCHAIN} +fi meson .. --cross-file=${MESON_TARGET_TOOLCHAIN} ninja -j${nproc} ninja install From 6f8a8d6b59bd3ce22b2a124a02fdd7fc6866769b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Tue, 11 Oct 2022 23:47:31 +0100 Subject: [PATCH 07/12] [GStreamer] Use libcap only on Linux --- G/GStreamer/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/G/GStreamer/build_tarballs.jl b/G/GStreamer/build_tarballs.jl index c3a0c24d8a6..ad35c4a6d4b 100644 --- a/G/GStreamer/build_tarballs.jl +++ b/G/GStreamer/build_tarballs.jl @@ -51,7 +51,7 @@ dependencies = [ Dependency(PackageSpec(name="Elfutils_jll", uuid="ab5a07f8-06af-567f-a878-e8bb879eba5a")) Dependency(PackageSpec(name="GMP_jll", uuid="781609d7-10c4-51f6-84f2-b8444358ff6d"); compat="6.2.0") Dependency(PackageSpec(name="GSL_jll", uuid="1b77fbbe-d8ee-58f0-85f9-836ddc23a7a4"); compat="~2.7.2") - Dependency(PackageSpec(name="libcap_jll", uuid="eef66a8b-8d7a-5724-a8d2-7c31ae1e29ed")) + Dependency(PackageSpec(name="libcap_jll", uuid="eef66a8b-8d7a-5724-a8d2-7c31ae1e29ed"); platforms=filter(Sys.islinux, platforms)) ] # Build the tarballs, and possibly a `build.jl` as well. From 618f26344df6b8e8364751165bcead815dd491a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Tue, 11 Oct 2022 23:47:55 +0100 Subject: [PATCH 08/12] [GStreamer] Clean up --- G/GStreamer/build_tarballs.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/G/GStreamer/build_tarballs.jl b/G/GStreamer/build_tarballs.jl index ad35c4a6d4b..37168720978 100644 --- a/G/GStreamer/build_tarballs.jl +++ b/G/GStreamer/build_tarballs.jl @@ -12,9 +12,7 @@ sources = [ # Bash recipe for building across all platforms script = raw""" -cd $WORKSPACE/srcdir -apk add bash-completion libcap gettext -cd gstreamer-* +cd $WORKSPACE/srcdir/gstreamer-* mkdir build cd build if [[ "${target}" == *-mingw* ]]; then @@ -46,6 +44,8 @@ products = [ # Dependencies that must be installed before this package can be built dependencies = [ + # Need a host gettext for msgfmt + HostBuildDependency("Gettext_jll") Dependency(PackageSpec(name="Glib_jll", uuid="7746bdde-850d-59dc-9ae8-88ece973131d"); compat="2.68.1") Dependency(PackageSpec(name="LibUnwind_jll", uuid="745a5e78-f969-53e9-954f-d19f2f74f4e3")) Dependency(PackageSpec(name="Elfutils_jll", uuid="ab5a07f8-06af-567f-a878-e8bb879eba5a")) From df07961399ba03b65094d8caffcfaec02fe2e974 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Wed, 12 Oct 2022 00:13:16 +0100 Subject: [PATCH 09/12] [GStreamer] Use right version of `pthread_time.h` on Windows --- G/GStreamer/build_tarballs.jl | 7 +- G/GStreamer/bundled/headers/pthread_time.h | 98 ++++++++++++++++++++++ 2 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 G/GStreamer/bundled/headers/pthread_time.h diff --git a/G/GStreamer/build_tarballs.jl b/G/GStreamer/build_tarballs.jl index 37168720978..03f3b467a41 100644 --- a/G/GStreamer/build_tarballs.jl +++ b/G/GStreamer/build_tarballs.jl @@ -7,7 +7,9 @@ version = v"1.20.3" # Collection of sources required to complete build sources = [ - ArchiveSource("https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-$(version).tar.xz", "607daf64bbbd5fb18af9d17e21c0d22c4d702fffe83b23cb22d1b1af2ca23a2a") + ArchiveSource("https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-$(version).tar.xz", + "607daf64bbbd5fb18af9d17e21c0d22c4d702fffe83b23cb22d1b1af2ca23a2a"), + DirectorySource("./bundled"), ] # Bash recipe for building across all platforms @@ -18,10 +20,13 @@ cd build if [[ "${target}" == *-mingw* ]]; then # Need to tell we're targeting at least Windows 7 so that `FILE_STANDARD_INFO` is defined sed -ri "s/^c_args = \[(.*)\]/c_args = [\1, '-DWINVER=_WIN32_WINNT_WIN7', '-D_WIN32_WINNT=_WIN32_WINNT_WIN7']/" ${MESON_TARGET_TOOLCHAIN} + # Install right version of `pthread_time.h` which defines `CLOCK_MONOTONIC` and `TIMER_ABSTIME` + cp -v ${WORKSPACE}/srcdir/headers/pthread_time.h "/opt/${target}/${target}/sys-root/include/pthread_time.h" fi meson .. --cross-file=${MESON_TARGET_TOOLCHAIN} ninja -j${nproc} ninja install +install_license ../COPYING """ # These are the platforms we will build for by default, unless further diff --git a/G/GStreamer/bundled/headers/pthread_time.h b/G/GStreamer/bundled/headers/pthread_time.h new file mode 100644 index 00000000000..7a7538c393f --- /dev/null +++ b/G/GStreamer/bundled/headers/pthread_time.h @@ -0,0 +1,98 @@ +/* + Copyright (c) 2011-2016 mingw-w64 project + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#ifndef WIN_PTHREADS_TIME_H +#define WIN_PTHREADS_TIME_H + +/* Posix timers are supported */ +#ifndef _POSIX_TIMERS +#define _POSIX_TIMERS 200809L +#endif + +/* Monotonic clocks are available. */ +#ifndef _POSIX_MONOTONIC_CLOCK +#define _POSIX_MONOTONIC_CLOCK 200809L +#endif + +/* CPU-time clocks are available. */ +#ifndef _POSIX_CPUTIME +#define _POSIX_CPUTIME 200809L +#endif + +/* Clock support in threads are available. */ +#ifndef _POSIX_THREAD_CPUTIME +#define _POSIX_THREAD_CPUTIME 200809L +#endif + +#ifndef __clockid_t_defined +typedef int clockid_t; +#define __clockid_t_defined 1 +#endif /* __clockid_t_defined */ + +#ifndef TIMER_ABSTIME +#define TIMER_ABSTIME 1 +#endif + +#ifndef CLOCK_REALTIME +#define CLOCK_REALTIME 0 +#endif + +#ifndef CLOCK_MONOTONIC +#define CLOCK_MONOTONIC 1 +#endif + +#ifndef CLOCK_PROCESS_CPUTIME_ID +#define CLOCK_PROCESS_CPUTIME_ID 2 +#endif + +#ifndef CLOCK_THREAD_CPUTIME_ID +#define CLOCK_THREAD_CPUTIME_ID 3 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* Make sure we provide default for WINPTHREAD_API, if not defined. */ +#pragma push_macro("WINPTHREAD_API") +#ifndef WINPTHREAD_API +#define WINPTHREAD_API +#endif + +/* These should really be dllimport'ed if using winpthread dll */ +int __cdecl WINPTHREAD_API nanosleep(const struct timespec *request, struct timespec *remain); + +int __cdecl WINPTHREAD_API clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *request, struct timespec *remain); +int __cdecl WINPTHREAD_API clock_getres(clockid_t clock_id, struct timespec *res); +int __cdecl WINPTHREAD_API clock_gettime(clockid_t clock_id, struct timespec *tp); +int __cdecl WINPTHREAD_API clock_settime(clockid_t clock_id, const struct timespec *tp); + +#pragma pop_macro("WINPTHREAD_API") + +#ifdef __cplusplus +} +#endif + +#endif /* WIN_PTHREADS_TIME_H */ + From 5fb6f852ea76100e0469ab5153986967787e8f5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Wed, 12 Oct 2022 10:11:03 +0100 Subject: [PATCH 10/12] [GStreamer] Manually disable thin static archives --- G/GStreamer/build_tarballs.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/G/GStreamer/build_tarballs.jl b/G/GStreamer/build_tarballs.jl index 03f3b467a41..e9cb5e55ac4 100644 --- a/G/GStreamer/build_tarballs.jl +++ b/G/GStreamer/build_tarballs.jl @@ -24,6 +24,12 @@ if [[ "${target}" == *-mingw* ]]; then cp -v ${WORKSPACE}/srcdir/headers/pthread_time.h "/opt/${target}/${target}/sys-root/include/pthread_time.h" fi meson .. --cross-file=${MESON_TARGET_TOOLCHAIN} + +# Meson beautifully forces thin archives, without checking whether the dynamic linker +# actually supports them: . Let's remove +# the (deprecated...) `T` option to `ar`, until they fix it in Meson. +sed -i.bak 's/csrDT/csrD/' build.ninja + ninja -j${nproc} ninja install install_license ../COPYING From 16f537122efef2bcbf647694a92c6c494768f4b5 Mon Sep 17 00:00:00 2001 From: Zihua Wu Date: Wed, 12 Oct 2022 17:35:14 +0800 Subject: [PATCH 11/12] Update G/GStreamer/build_tarballs.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mosè Giordano --- G/GStreamer/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/G/GStreamer/build_tarballs.jl b/G/GStreamer/build_tarballs.jl index e9cb5e55ac4..f10268ed693 100644 --- a/G/GStreamer/build_tarballs.jl +++ b/G/GStreamer/build_tarballs.jl @@ -58,7 +58,7 @@ dependencies = [ # Need a host gettext for msgfmt HostBuildDependency("Gettext_jll") Dependency(PackageSpec(name="Glib_jll", uuid="7746bdde-850d-59dc-9ae8-88ece973131d"); compat="2.68.1") - Dependency(PackageSpec(name="LibUnwind_jll", uuid="745a5e78-f969-53e9-954f-d19f2f74f4e3")) + Dependency(PackageSpec(name="LibUnwind_jll", uuid="745a5e78-f969-53e9-954f-d19f2f74f4e3"); platforms=filter(p -> Sys.islinux(p) || Sys.isfreebsd(p), platforms)) Dependency(PackageSpec(name="Elfutils_jll", uuid="ab5a07f8-06af-567f-a878-e8bb879eba5a")) Dependency(PackageSpec(name="GMP_jll", uuid="781609d7-10c4-51f6-84f2-b8444358ff6d"); compat="6.2.0") Dependency(PackageSpec(name="GSL_jll", uuid="1b77fbbe-d8ee-58f0-85f9-836ddc23a7a4"); compat="~2.7.2") From 8aeaa0c59addcb9f6165980f5cefae9a3412c45f Mon Sep 17 00:00:00 2001 From: Zihua Wu Date: Wed, 12 Oct 2022 17:35:22 +0800 Subject: [PATCH 12/12] Update G/GStreamer/build_tarballs.jl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Mosè Giordano --- G/GStreamer/build_tarballs.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/G/GStreamer/build_tarballs.jl b/G/GStreamer/build_tarballs.jl index f10268ed693..921108b93b6 100644 --- a/G/GStreamer/build_tarballs.jl +++ b/G/GStreamer/build_tarballs.jl @@ -59,7 +59,7 @@ dependencies = [ HostBuildDependency("Gettext_jll") Dependency(PackageSpec(name="Glib_jll", uuid="7746bdde-850d-59dc-9ae8-88ece973131d"); compat="2.68.1") Dependency(PackageSpec(name="LibUnwind_jll", uuid="745a5e78-f969-53e9-954f-d19f2f74f4e3"); platforms=filter(p -> Sys.islinux(p) || Sys.isfreebsd(p), platforms)) - Dependency(PackageSpec(name="Elfutils_jll", uuid="ab5a07f8-06af-567f-a878-e8bb879eba5a")) + Dependency(PackageSpec(name="Elfutils_jll", uuid="ab5a07f8-06af-567f-a878-e8bb879eba5a"); platforms=filter(Sys.islinux, platforms)) Dependency(PackageSpec(name="GMP_jll", uuid="781609d7-10c4-51f6-84f2-b8444358ff6d"); compat="6.2.0") Dependency(PackageSpec(name="GSL_jll", uuid="1b77fbbe-d8ee-58f0-85f9-836ddc23a7a4"); compat="~2.7.2") Dependency(PackageSpec(name="libcap_jll", uuid="eef66a8b-8d7a-5724-a8d2-7c31ae1e29ed"); platforms=filter(Sys.islinux, platforms))