diff --git a/common/shlibs b/common/shlibs index 865ebcbe799..3f35575eead 100644 --- a/common/shlibs +++ b/common/shlibs @@ -957,7 +957,7 @@ libfftw3l_omp.so.3 libfftw-3.3.5_1 libfftw3f_threads.so.3 libfftw-3.3_1 libfftw3f.so.3 libfftw-3.3_1 libfftw3f_omp.so.3 libfftw-3.3.5_1 -libfluidsynth.so.2 libfluidsynth-2.1.1_1 +libfluidsynth.so.3 libfluidsynth-2.2.0_1 liblo.so.7 liblo-0.26_1 libvamp-sdk.so.2 libvamp-plugin-sdk-2.2_1 librubberband.so.2 librubberband-1.6.0_1 diff --git a/common/xbps-src/shutils/remove_obsoletes.sh b/common/xbps-src/shutils/remove_obsoletes.sh new file mode 100644 index 00000000000..3c4222125aa --- /dev/null +++ b/common/xbps-src/shutils/remove_obsoletes.sh @@ -0,0 +1,6 @@ +remove_obsoletes () { + for repo in $XBPS_HOSTDIR/binpkgs $XBPS_HOSTDIR/binpkgs/debug $XBPS_HOSTDIR/binpkgs/nonfree $XBPS_HOSTDIR/binpkgs/multilib/ $XBPS_HOSTDIR/binpkgs/multilib/nonfree ; do + msg_normal "Cleaning $repo\n" + XBPS_ARCH=${XBPS_CROSS_BUILD:-$XBPS_MACHINE} $XBPS_RINDEX_CMD -r $repo + done +} diff --git a/srcpkgs/Carla/template b/srcpkgs/Carla/template index 2a13d9d5e8e..701fd0ea30f 100644 --- a/srcpkgs/Carla/template +++ b/srcpkgs/Carla/template @@ -1,7 +1,7 @@ # Template file for 'Carla' pkgname=Carla version=2.1 -revision=2 +revision=3 archs="x86_64* i686* aarch64* arm*" build_style=gnu-makefile pycompile_dirs="usr/share/carla" diff --git a/srcpkgs/EmptyEpsilon/template b/srcpkgs/EmptyEpsilon/template index c2028087763..f191433eec5 100644 --- a/srcpkgs/EmptyEpsilon/template +++ b/srcpkgs/EmptyEpsilon/template @@ -1,10 +1,10 @@ # Template file for 'EmptyEpsilon' pkgname=EmptyEpsilon -_ver_major=2020 -_ver_minor=11 -_ver_patch=23 +_ver_major=2021 +_ver_minor=03 +_ver_patch=31 version="${_ver_major}.${_ver_minor}.${_ver_patch}" -revision=3 +revision=1 wrksrc="EmptyEpsilon-EE-${version}" build_style=cmake configure_args="-DSERIOUS_PROTON_DIR=$XBPS_BUILDDIR/SeriousProton-EE-${version} @@ -20,5 +20,5 @@ license="GPL-2.0-only" homepage="https://daid.github.io/EmptyEpsilon/" distfiles="https://github.com/daid/EmptyEpsilon/archive/EE-${version}.tar.gz https://github.com/daid/SeriousProton/archive/EE-${version}.tar.gz>SP-${version}.tar.gz" -checksum="339df2f3b57135663cb7bd253d7e157c3c5d457137bc6ed4c9651f48e8e6bf0c - 7552ab3b2a82735401aba2215ae5bcae5fa2c9946b709ff77e0c2cc5a60abc23" +checksum="c1c4f11fefe1afac6076c795e8785c7507a297ba3f7f2be9ed30c97b1e93cb24 + 62ab03dc904bd10f017fff338e55ec97c86f0bc3903a18d6c44285b86776a2d7" diff --git a/srcpkgs/SLADE/template b/srcpkgs/SLADE/template index b7ec0f0749c..030aac7a61b 100644 --- a/srcpkgs/SLADE/template +++ b/srcpkgs/SLADE/template @@ -1,7 +1,7 @@ # Template file for 'SLADE' pkgname=SLADE version=3.1.12a -revision=4 +revision=5 build_style=cmake build_helper=cmake-wxWidgets-gtk3 hostmakedepends="pkg-config p7zip which" diff --git a/srcpkgs/alure/template b/srcpkgs/alure/template index af57f0f163c..d8c3f41648b 100644 --- a/srcpkgs/alure/template +++ b/srcpkgs/alure/template @@ -1,7 +1,7 @@ # Template file for 'alure' pkgname=alure version=1.2 -revision=2 +revision=3 build_style=cmake configure_args="-DMODPLUG=ON -DDYNLOAD=OFF" hostmakedepends="pkg-config" diff --git a/srcpkgs/android-tools/template b/srcpkgs/android-tools/template index 64382a05c39..f1ed617b748 100644 --- a/srcpkgs/android-tools/template +++ b/srcpkgs/android-tools/template @@ -1,6 +1,6 @@ # Template file for 'android-tools' pkgname=android-tools -version=31.0.0 +version=31.0.0p1 revision=1 archs="armv* aarch64* x86_64* i686* ppc64le*" build_style=cmake @@ -12,7 +12,7 @@ maintainer="John " license="Apache-2.0, ISC, GPL-2.0-only, MIT" homepage="http://developer.android.com/tools/help/adb.html" distfiles="https://github.com/nmeum/android-tools/releases/download/${version}/android-tools-${version}.tar.xz" -checksum=0b8f16370072d03e9f26de17ecba7dd44771cb042a23e86869108d57eb22f20d +checksum=51a4c3ba5f16945905449c4bd2c1c781a4df7469f6b7362f8837f4f640d8c7b6 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then makedepends+=" libatomic-devel" diff --git a/srcpkgs/ardour/template b/srcpkgs/ardour/template index 6be4257f233..b4870e26190 100644 --- a/srcpkgs/ardour/template +++ b/srcpkgs/ardour/template @@ -1,7 +1,7 @@ # Template file for 'ardour' pkgname=ardour version=6.6 -revision=1 +revision=2 _commit="e4e21f4d073ab00b1a0bb6ff6ca49f28b02fd68a" build_style=waf3 configure_args="--cxx11 --no-phone-home --with-backends=jack,alsa,dummy @@ -19,6 +19,8 @@ maintainer="tibequadorian " license="GPL-2.0-or-later" homepage="http://ardour.org" +CXXFLAGS="-fpermissive" + case "$XBPS_TARGET_MACHINE" in x86_64*) configure_args+=" --dist-target=x86_64" ;; i686*) configure_args+=" --dist-target=i686" ;; diff --git a/srcpkgs/audacious-plugins/template b/srcpkgs/audacious-plugins/template index 8c8d4d58954..d0724c54b0a 100644 --- a/srcpkgs/audacious-plugins/template +++ b/srcpkgs/audacious-plugins/template @@ -2,7 +2,7 @@ #Keep in sync with audacious! pkgname=audacious-plugins version=4.1 -revision=3 +revision=4 build_style=gnu-configure configure_args="$(vopt_enable gtk) $(vopt_enable qt)" hostmakedepends="gettext pkg-config glib-devel" diff --git a/srcpkgs/birdtray/template b/srcpkgs/birdtray/template index b77f328c4de..8695820ecce 100644 --- a/srcpkgs/birdtray/template +++ b/srcpkgs/birdtray/template @@ -6,7 +6,7 @@ build_style=cmake hostmakedepends="qt5-qmake qt5-host-tools" makedepends="qt5-svg-devel qt5-x11extras-devel qt5-tools-devel" short_desc="Run Thunderbird with a system tray icon" -maintainer="cptpcrd " +maintainer="Orphaned " license="GPL-3.0-or-later" homepage="https://github.com/gyunaev/birdtray" distfiles="https://github.com/gyunaev/birdtray/archive/v${version}.tar.gz" diff --git a/srcpkgs/budgie-desktop/patches/fix-budgie-desktop-settings-crash.patch b/srcpkgs/budgie-desktop/patches/fix-budgie-desktop-settings-crash.patch new file mode 100644 index 00000000000..84fbce6616e --- /dev/null +++ b/srcpkgs/budgie-desktop/patches/fix-budgie-desktop-settings-crash.patch @@ -0,0 +1,65 @@ +From: Joshua Strobl +Date: Mon, 12 Apr 2021 06:14:04 +0300 +Subject: [PATCH] Support moved font anti-aliasing and hinting in GSD 40. Fixes + #2121. + +--- + src/panel/meson.build | 4 ++++ + src/panel/settings/settings_fonts.vala | 11 ++++++++++- + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git src/panel/meson.build src/panel/meson.build +index ee610868..5451c278 100644 +--- src/panel/meson.build ++++ src/panel/meson.build +@@ -72,6 +72,10 @@ budgie_panel_vala_args = [ + '--gresources=' + gresource, + ] + ++if dep_gsd.version().version_compare('>=40.0') ++ budgie_panel_vala_args += ['-D', 'HAVE_GSD_40'] ++endif ++ + budgie_panel_c_args = [ + '-DWNCK_I_KNOW_THIS_IS_UNSTABLE' + ] +diff --git src/panel/settings/settings_fonts.vala src/panel/settings/settings_fonts.vala +index fc17622f..f750b926 100644 +--- src/panel/settings/settings_fonts.vala ++++ src/panel/settings/settings_fonts.vala +@@ -24,7 +24,10 @@ namespace Budgie { + + private Settings ui_settings; + private Settings wm_settings; ++ ++#if !HAVE_GSD_40 + private Settings x_settings; ++#endif + + public FontPage() { + Object(group: SETTINGS_GROUP_APPEARANCE, +@@ -135,14 +138,20 @@ namespace Budgie { + /* Hook up settings */ + ui_settings = new Settings("org.gnome.desktop.interface"); + wm_settings = new Settings("org.gnome.desktop.wm.preferences"); +- x_settings = new Settings("org.gnome.settings-daemon.plugins.xsettings"); + ui_settings.bind("document-font-name", fontbutton_document, "font-name", SettingsBindFlags.DEFAULT); + ui_settings.bind("font-name", fontbutton_interface, "font-name", SettingsBindFlags.DEFAULT); + ui_settings.bind("monospace-font-name", fontbutton_monospace, "font-name", SettingsBindFlags.DEFAULT); + wm_settings.bind("titlebar-font", fontbutton_title, "font-name", SettingsBindFlags.DEFAULT); + ui_settings.bind("text-scaling-factor", spinbutton_scaling, "value", SettingsBindFlags.DEFAULT); ++ ++#if HAVE_GSD_40 ++ ui_settings.bind("font-antialiasing", combobox_antialias, "active-id", SettingsBindFlags.DEFAULT); ++ ui_settings.bind("font-hinting", combobox_hinting, "active-id", SettingsBindFlags.DEFAULT); ++#else ++ x_settings = new Settings("org.gnome.settings-daemon.plugins.xsettings"); + x_settings.bind("hinting", combobox_hinting, "active-id", SettingsBindFlags.DEFAULT); + x_settings.bind("antialiasing", combobox_antialias, "active-id", SettingsBindFlags.DEFAULT); ++#endif + } + } + } +-- +2.31.1 + diff --git a/srcpkgs/budgie-desktop/template b/srcpkgs/budgie-desktop/template index e989feaea31..4e9a7f63b3d 100644 --- a/srcpkgs/budgie-desktop/template +++ b/srcpkgs/budgie-desktop/template @@ -1,7 +1,7 @@ # Template file for 'budgie-desktop' pkgname=budgie-desktop version=10.5.2 -revision=2 +revision=3 build_style=meson build_helper=gir configure_args="-Dwith-gtk-doc=false" diff --git a/srcpkgs/calf/template b/srcpkgs/calf/template index 8826ba7711d..929f40ad902 100644 --- a/srcpkgs/calf/template +++ b/srcpkgs/calf/template @@ -1,7 +1,7 @@ # Template file for 'calf' pkgname=calf version=0.90.3 -revision=2 +revision=3 build_style=gnu-configure configure_args="--enable-experimental" hostmakedepends="automake libtool pkg-config" diff --git a/srcpkgs/composer/template b/srcpkgs/composer/template index 2bf256dc0d2..43de0a36902 100644 --- a/srcpkgs/composer/template +++ b/srcpkgs/composer/template @@ -1,6 +1,6 @@ # Template file for 'composer' pkgname=composer -version=1.10.13 +version=2.0.12 revision=1 build_style=fetch depends="php" @@ -10,7 +10,7 @@ license="MIT" homepage="https://getcomposer.org/" distfiles="https://github.com/composer/composer/releases/download/${version}/composer.phar https://raw.githubusercontent.com/composer/composer/master/LICENSE" -checksum="5ca7445cfd48dd27c5a84aa005a47b4d9fd91132313830609875df3a6973708f +checksum="82ea8c1537cfaceb7e56f6004c7ccdf99ddafce7237c07374d920e635730a631 7855ac293067aebe7e51afdd23b9dea54b8be24187dbecc9b9142581c37f596c" do_install() { diff --git a/srcpkgs/csound/template b/srcpkgs/csound/template index b4c67632ca8..f02f97bc632 100644 --- a/srcpkgs/csound/template +++ b/srcpkgs/csound/template @@ -1,7 +1,7 @@ # Template file for 'csound' pkgname=csound version=6.15.0 -revision=1 +revision=2 build_style=cmake configure_args=" -DLUA_MODULE_INSTALL_DIR=${XBPS_CROSS_BASE}/usr/lib/lua/5.1 diff --git a/srcpkgs/curl/template b/srcpkgs/curl/template index f8a721a2cba..7a9d588d9ec 100644 --- a/srcpkgs/curl/template +++ b/srcpkgs/curl/template @@ -1,7 +1,7 @@ # Template file for 'curl' pkgname=curl -version=7.76.0 -revision=2 +version=7.76.1 +revision=1 build_style=gnu-configure configure_args="ac_cv_sizeof_off_t=8 --enable-threaded-resolver --enable-ipv6 $(vopt_with rtmp) $(vopt_with gssapi) $(vopt_enable ldap) $(vopt_with gnutls) @@ -21,15 +21,12 @@ license="MIT" homepage="https://curl.haxx.se" changelog="https://curl.haxx.se/changes.html#${version//./_}" distfiles="${homepage}/download/${pkgname}-${version}.tar.bz2" -checksum=e29bfe3633701590d75b0071bbb649ee5ca4ca73f00649268bd389639531c49a +checksum=7a8e184d7d31312c4ebf6a8cb59cd757e61b2b2833a9ed4f9bf708066e7695e9 patch_args="-Np1" build_options="gnutls gssapi ldap rtmp ssh ssl zstd" build_options_default="ssh ssl zstd" vopt_conflict ssl gnutls -# force usage of gmtime_r, fix in https://github.com/curl/curl/pull/6859 -CFLAGS="-DHAVE_GMTIME_R -DTIME_WITH_SYS_TIME" - pre_configure() { export CFLAGS="${CFLAGS/-D_FORTIFY_SOURCE=2/}" export CFLAGS="${CFLAGS/-I${XBPS_CROSS_BASE}\/usr\/include/}" diff --git a/srcpkgs/diffoscope/template b/srcpkgs/diffoscope/template index 517e9ee6465..e84df9738c9 100644 --- a/srcpkgs/diffoscope/template +++ b/srcpkgs/diffoscope/template @@ -1,6 +1,6 @@ # Template file for 'diffoscope' pkgname=diffoscope -version=171 +version=172 revision=1 build_style=python3-module # file 5.39 causes errors there, see https://bugs.astron.com/view.php?id=170 @@ -16,4 +16,4 @@ license="GPL-3.0-or-later" homepage="https://diffoscope.org/" changelog="https://salsa.debian.org/reproducible-builds/diffoscope/raw/master/debian/changelog" distfiles="${PYPI_SITE}/d/diffoscope/diffoscope-${version}.tar.gz" -checksum=a14af04a63dd526445b24f358b4856985e637891627b7a0fab90443990850f85 +checksum=5ffe7f38555c6409bc7e7edc277ed77dd78641fe1306fc38d153dbbe445ddea4 diff --git a/srcpkgs/distr0/template b/srcpkgs/distr0/template index 2ba5d01bcd6..63c658814ba 100644 --- a/srcpkgs/distr0/template +++ b/srcpkgs/distr0/template @@ -1,7 +1,7 @@ # Template file for 'distr0' pkgname=distr0 version=0.3.3 -revision=7 +revision=8 build_style=meta depends="void-repo-multilib void-repo-multilib-nonfree void-repo-nonfree lvm2 cronie socklog-void ntp xtools diff --git a/srcpkgs/distrobuilder/template b/srcpkgs/distrobuilder/template index a6847d085e2..fd58594e174 100644 --- a/srcpkgs/distrobuilder/template +++ b/srcpkgs/distrobuilder/template @@ -1,6 +1,6 @@ # Template file for 'distrobuilder' pkgname=distrobuilder -version=1.1 +version=1.2 revision=1 wrksrc="distrobuilder-distrobuilder-${version}" build_style=go @@ -13,4 +13,4 @@ maintainer="Robert Lowry " license="Apache-2.0" homepage="https://linuxcontainers.org/distrobuilder/introduction/" distfiles="https://github.com/lxc/distrobuilder/archive/distrobuilder-${version}.tar.gz" -checksum=a21b41f7d4030b923d7ea3840f90ff6912f6474e516140f488b87c8dfe970bbc +checksum=c60f8cee78a9ed6b4606a3849f1bc3288f5e80651b7c59ea62c5dd8aae3e9e45 diff --git a/srcpkgs/doctl/template b/srcpkgs/doctl/template index 6fdcf4816af..beb0376be3d 100644 --- a/srcpkgs/doctl/template +++ b/srcpkgs/doctl/template @@ -1,6 +1,6 @@ # Template file for 'doctl' pkgname=doctl -version=1.58.0 +version=1.59.0 revision=1 build_style=go go_import_path="github.com/digitalocean/doctl/cmd/doctl" @@ -10,4 +10,4 @@ maintainer="Benjamín Albiñana " license="Apache-2.0" homepage="https://github.com/digitalocean/doctl" distfiles="https://github.com/digitalocean/doctl/archive/v${version}.tar.gz" -checksum=f4a7d608f4718a2a5e9ce5d1fcec25c16ee03d05f78ebf134faf23c261abefdf +checksum=b37b693635af48da8b2b222486be3e315e9ba6eb8fdb0b0e976bff1e63f9c520 diff --git a/srcpkgs/electron12/files/musl-patches/chromium-default-pthread-stacksize.patch b/srcpkgs/electron12/files/musl-patches/chromium-default-pthread-stacksize.patch new file mode 100644 index 00000000000..16e4d21e6ed --- /dev/null +++ b/srcpkgs/electron12/files/musl-patches/chromium-default-pthread-stacksize.patch @@ -0,0 +1,29 @@ +--- base/threading/platform_thread_linux.cc.orig ++++ base/threading/platform_thread_linux.cc +@@ -99 +99,2 @@ size_t GetDefaultThreadStackSize(const p +- return 0; ++ // use 8mb like glibc to avoid running out of space ++ return (1 << 23); +--- chrome/app/shutdown_signal_handlers_posix.cc.orig ++++ chrome/app/shutdown_signal_handlers_posix.cc +@@ -184,11 +184,19 @@ + g_shutdown_pipe_read_fd = pipefd[0]; + g_shutdown_pipe_write_fd = pipefd[1]; + #if !defined(ADDRESS_SANITIZER) ++# if defined(__GLIBC__) + const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2; ++# else ++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k ++# endif + #else + // ASan instrumentation bloats the stack frames, so we need to increase the + // stack size to avoid hitting the guard page. ++# if defined(__GLIBC__) + const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4; ++# else ++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k ++# endif + #endif + ShutdownDetector* detector = new ShutdownDetector( + g_shutdown_pipe_read_fd, shutdown_callback, task_runner); + diff --git a/srcpkgs/electron12/files/musl-patches/chromium-musl-crashpad.patch b/srcpkgs/electron12/files/musl-patches/chromium-musl-crashpad.patch new file mode 100644 index 00000000000..03a0c06f3ca --- /dev/null +++ b/srcpkgs/electron12/files/musl-patches/chromium-musl-crashpad.patch @@ -0,0 +1,23 @@ +--- third_party/crashpad/crashpad/util/linux/ptracer.cc ++++ third_party/crashpad/crashpad/util/linux/ptracer.cc +@@ -26,6 +26,7 @@ + + #if defined(ARCH_CPU_X86_FAMILY) + #include ++#include + #endif + + namespace crashpad { + +--- third_party/crashpad/crashpad/compat/linux/sys/ptrace.h ++++ third_party/crashpad/crashpad/compat/linux/sys/ptrace.h +@@ -17,7 +17,9 @@ + + #include_next + ++#if defined(__GLIBC__) + #include ++#endif + + // https://sourceware.org/bugzilla/show_bug.cgi?id=22433 + #if !defined(PTRACE_GET_THREAD_AREA) && !defined(PT_GET_THREAD_AREA) && \ diff --git a/srcpkgs/electron12/files/musl-patches/chromium-musl-fixes.patch b/srcpkgs/electron12/files/musl-patches/chromium-musl-fixes.patch new file mode 100644 index 00000000000..aec60fd6209 --- /dev/null +++ b/srcpkgs/electron12/files/musl-patches/chromium-musl-fixes.patch @@ -0,0 +1,202 @@ +--- ./third_party/lss/linux_syscall_support.h.orig ++++ ./third_party/lss/linux_syscall_support.h +@@ -1127,6 +1127,12 @@ + #ifndef __NR_fallocate + #define __NR_fallocate 285 + #endif ++ ++#undef __NR_pread ++#define __NR_pread __NR_pread64 ++#undef __NR_pwrite ++#define __NR_pwrite __NR_pwrite64 ++ + /* End of x86-64 definitions */ + #elif defined(__mips__) + #if _MIPS_SIM == _MIPS_SIM_ABI32 +--- ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h.orig ++++ ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h +@@ -37,6 +37,10 @@ + #include "common/memory.h" + #include "google_breakpad/common/minidump_format.h" + ++#if !defined(__GLIBC__) ++ #define _libc_fpstate _fpstate ++#endif ++ + namespace google_breakpad { + + // Wraps platform-dependent implementations of accessors to ucontext_t structs. +--- ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h.orig ++++ ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + + #include "common/memory_range.h" + +--- ./sandbox/linux/suid/process_util.h.orig ++++ ./sandbox/linux/suid/process_util.h +@@ -11,6 +11,14 @@ + #include + #include + ++// Some additional functions ++# define TEMP_FAILURE_RETRY(expression) \ ++ (__extension__ \ ++ ({ long int __result; \ ++ do __result = (long int) (expression); \ ++ while (__result == -1L && errno == EINTR); \ ++ __result; })) ++ + // This adjusts /proc/process/oom_score_adj so the Linux OOM killer + // will prefer certain process types over others. The range for the + // adjustment is [-1000, 1000], with [0, 1000] being user accessible. +--- ./sandbox/linux/seccomp-bpf/trap.cc.orig 2020-04-12 08:26:40.184159217 -0400 ++++ ./sandbox/linux/seccomp-bpf/trap.cc 2020-04-12 08:46:16.737191222 -0400 +@@ -174,7 +174,7 @@ + // If the version of glibc doesn't include this information in + // siginfo_t (older than 2.17), we need to explicitly copy it + // into an arch_sigsys structure. +- memcpy(&sigsys, &info->_sifields, sizeof(sigsys)); ++ memcpy(&sigsys, &info->__sifields, sizeof(sigsys)); + #endif + + #if defined(__mips__) +--- ./third_party/ffmpeg/libavutil/cpu.c.orig ++++ ./third_party/ffmpeg/libavutil/cpu.c +@@ -38,7 +38,6 @@ + #include + #endif + #include +-#include + #endif + #if HAVE_UNISTD_H + #include +diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc +--- chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig 2021-03-10 07:23:00.145810088 -0500 ++++ chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc 2021-03-10 10:57:19.405962671 -0500 +@@ -55,7 +55,9 @@ + // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch + // of lacros-chrome is complete. + #if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if defined(__GLIBC__) + #include ++#endif + + #include "base/linux_util.h" + #include "base/strings/string_split.h" +@@ -316,7 +318,7 @@ + void RecordLinuxGlibcVersion() { + // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch + // of lacros-chrome is complete. +-#if defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS) ++#if defined(__GLIBC__) || BUILDFLAG(IS_CHROMEOS_LACROS) + base::Version version(gnu_get_libc_version()); + + UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE; +--- services/device/serial/serial_io_handler_posix.cc.orig 2019-07-03 10:57:32.568171835 -0400 ++++ services/device/serial/serial_io_handler_posix.cc 2019-07-03 10:57:16.867983031 -0400 +@@ -6,6 +6,7 @@ + + #include + #include ++#include + + #include + #include +diff --git a/third_party/ots/include/opentype-sanitiser.h b/third_party/ots/include/opentype-sanitiser.h +--- third_party/ots/include/opentype-sanitiser.h ++++ third_party/ots/include/opentype-sanitiser.h +@@ -20,6 +20,7 @@ typedef unsigned __int64 uint64_t; + #define htonl(x) _byteswap_ulong (x) + #define htons(x) _byteswap_ushort (x) + #else ++#include + #include + #include + #endif +--- ./base/logging.cc.orig 2021-01-20 12:09:54.227038757 -0500 ++++ ./base/logging.cc 2021-01-20 12:24:32.600301351 -0500 +@@ -557,8 +557,7 @@ + + LogMessage::~LogMessage() { + size_t stack_start = stream_.tellp(); +-#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && !defined(__UCLIBC__) && \ +- !defined(OS_AIX) ++#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__) + if (severity_ == LOGGING_FATAL && !base::debug::BeingDebugged()) { + // Include a stack trace on a fatal, unless a debugger is attached. + base::debug::StackTrace stack_trace; +--- ./third_party/blink/renderer/platform/wtf/stack_util.cc.orig ++++ ./third_party/blink/renderer/platform/wtf/stack_util.cc +@@ -28,7 +28,7 @@ + // FIXME: On Mac OSX and Linux, this method cannot estimate stack size + // correctly for the main thread. + +-#elif defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \ ++#elif defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \ + defined(OS_FUCHSIA) + // pthread_getattr_np() can fail if the thread is not invoked by + // pthread_create() (e.g., the main thread of blink_unittests). +@@ -96,7 +96,7 @@ + } + + void* GetStackStart() { +-#if defined(__GLIBC__) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \ ++#if defined(OS_LINUX) || defined(OS_ANDROID) || defined(OS_FREEBSD) || \ + defined(OS_FUCHSIA) + pthread_attr_t attr; + int error; +--- ./net/dns/dns_config_service_posix.cc.orig ++++ ./net/dns/dns_config_service_posix.cc +@@ -122,7 +122,7 @@ + ConfigParsePosixResult result; + config->unhandled_options = false; + // TODO(fuchsia): Use res_ninit() when it's implemented on Fuchsia. +-#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) ++#if defined(OS_OPENBSD) || defined(OS_FUCHSIA) || defined(_GNU_SOURCE) + // Note: res_ninit in glibc always returns 0 and sets RES_INIT. + // res_init behaves the same way. + memset(&_res, 0, sizeof(_res)); +--- third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc.orig 2019-06-18 11:51:17.000000000 -0400 ++++ third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc 2019-07-03 12:32:50.938758186 -0400 +@@ -25,7 +25,7 @@ + #include "llvm/Support/raw_ostream.h" + #include + #include +-#if HAVE_EXECINFO_H ++#if HAVE_EXECINFO_H && defined(__GLIBC__) + # include // For backtrace(). + #endif + #if HAVE_SIGNAL_H +@@ -52,6 +52,7 @@ + #include + #else + #undef HAVE__UNWIND_BACKTRACE ++#undef HAVE_BACKTRACE + #endif + #endif + +--- third_party/nasm/nasmlib/realpath.c.orig 2019-07-03 12:23:05.021949895 -0400 ++++ third_party/nasm/nasmlib/realpath.c 2019-07-03 12:24:24.246862665 -0400 +@@ -49,7 +49,7 @@ + + #include "nasmlib.h" + +-#ifdef HAVE_CANONICALIZE_FILE_NAME ++#if defined(__GLIBC__) + + /* + * GNU-specific, but avoids the realpath(..., NULL) +--- mojo/public/cpp/platform/named_platform_channel_posix.cc.orig 2020-07-19 13:26:10.696171063 -0400 ++++ mojo/public/cpp/platform/named_platform_channel_posix.cc 2020-07-19 13:26:43.680151714 -0400 +@@ -5,6 +5,7 @@ + #include "mojo/public/cpp/platform/named_platform_channel.h" + + #include ++#include + #include + #include + #include diff --git a/srcpkgs/electron12/files/musl-patches/chromium-musl-hacks.patch b/srcpkgs/electron12/files/musl-patches/chromium-musl-hacks.patch new file mode 100644 index 00000000000..edc1b060dfb --- /dev/null +++ b/srcpkgs/electron12/files/musl-patches/chromium-musl-hacks.patch @@ -0,0 +1,22 @@ +--- base/debug/stack_trace.cc.orig 2018-12-08 14:11:25.303475116 +0100 ++++ base/debug/stack_trace.cc 2018-12-08 18:00:43.874946999 +0100 +@@ -229,7 +229,7 @@ + } + std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const { + std::stringstream stream; +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + OutputToStreamWithPrefix(&stream, prefix_string); + #endif + return stream.str(); +--- net/socket/udp_socket_posix.cc.orig 2019-07-03 13:13:46.034342649 -0400 ++++ net/socket/udp_socket_posix.cc 2019-07-03 13:23:53.117081909 -0400 +@@ -1194,7 +1194,7 @@ + msg_iov->push_back({const_cast(buffer->data()), buffer->length()}); + msgvec->reserve(buffers.size()); + for (size_t j = 0; j < buffers.size(); j++) +- msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0}); ++ msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, 0, 0}, 0}); + int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0)); + SendResult send_result(0, 0, std::move(buffers)); + if (result < 0) { diff --git a/srcpkgs/electron12/files/musl-patches/chromium-musl-libc++.patch b/srcpkgs/electron12/files/musl-patches/chromium-musl-libc++.patch new file mode 100644 index 00000000000..088d80fad52 --- /dev/null +++ b/srcpkgs/electron12/files/musl-patches/chromium-musl-libc++.patch @@ -0,0 +1,55 @@ +diff --git a/buildtools/third_party/libc++/trunk/include/locale b/buildtools/third_party/libc++/trunk/include/locale +index d29a2dc..53998bc 100644 +--- buildtools/third_party/libc++/trunk/include/locale ++++ buildtools/third_party/libc++/trunk/include/locale +@@ -11,6 +11,15 @@ + #ifndef _LIBCPP_LOCALE + #define _LIBCPP_LOCALE + ++// musl doesn't define _l (with locale) variants of functions, as it only supports UTF-8. ++// we can simply make macros that will call the non-localated ones if we're using musl, or rather not-using something that has the _l ones. ++// couldn't find anything glibc #defines when it creates strtoull_l (that it doesn't undefine a few lines later), so let's test against glibc and glibc-likes. ++// almost all glibc-likes define __GNU_LIBRARY__ for compatibility ++#ifndef __GNU_LIBRARY__ ++#define strtoull_l(A, B, C, LOC) strtoull(A,B,C) ++#define strtoll_l(A, B, C, LOC) strtoll(A,B,C) ++#endif ++ + /* + locale synopsis + +diff --git a/buildtools/third_party/libc++/trunk/src/locale.cpp b/buildtools/third_party/libc++/trunk/src/locale.cpp +index 4163c2c..3d1902a 100644 +--- a/buildtools/third_party/libc++/trunk/src/locale.cpp ++++ buildtools/third_party/libc++/trunk/src/locale.cpp +@@ -1028,11 +1028,11 @@ ctype::do_narrow(const char_type* low, const char_type* high, char dfault, + return low; + } + +-#if defined(__EMSCRIPTEN__) ++//#if defined(__EMSCRIPTEN__) + extern "C" const unsigned short ** __ctype_b_loc(); + extern "C" const int ** __ctype_tolower_loc(); + extern "C" const int ** __ctype_toupper_loc(); +-#endif ++//#endif + + #ifdef _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE + const ctype::mask* +@@ -1136,12 +1136,10 @@ ctype::classic_table() _NOEXCEPT + #elif defined(_AIX) + return (const unsigned int *)__lc_ctype_ptr->obj->mask; + #else +- // Platform not supported: abort so the person doing the port knows what to +- // fix +-# warning ctype::classic_table() is not implemented +- printf("ctype::classic_table() is not implemented\n"); +- abort(); +- return NULL; ++// not sure any other libc like this exists, but there is no way to differentiate musl as of right now ++// to be fair, with the change above, this should always work ++// also, #warning is a gcc extension ++ return (const unsigned long *)*__ctype_b_loc(); + #endif + } + #endif diff --git a/srcpkgs/electron12/files/musl-patches/chromium-musl-sandbox.patch b/srcpkgs/electron12/files/musl-patches/chromium-musl-sandbox.patch new file mode 100644 index 00000000000..230bb7bbd29 --- /dev/null +++ b/srcpkgs/electron12/files/musl-patches/chromium-musl-sandbox.patch @@ -0,0 +1,92 @@ +--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc.orig 2019-07-03 11:53:21.213479736 -0400 ++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc 2019-07-03 11:57:01.304998253 -0400 +@@ -140,31 +140,14 @@ + ResultExpr RestrictCloneToThreadsAndEPERMFork() { + const Arg flags(0); + +- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2. +- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES | +- CLONE_SIGHAND | CLONE_THREAD | +- CLONE_SYSVSEM; +- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED; ++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | ++ CLONE_THREAD | CLONE_SYSVSEM; ++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID | ++ CLONE_DETACHED; ++ const BoolExpr thread_clone_ok = (flags&~safe)==required; + +- const uint64_t kGlibcPthreadFlags = +- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD | +- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID; +- const BoolExpr glibc_test = flags == kGlibcPthreadFlags; +- +- const BoolExpr android_test = +- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask, +- flags == kGlibcPthreadFlags); +- +- // The following two flags are the two important flags in any vfork-emulating +- // clone call. EPERM any clone call that contains both of them. +- const uint64_t kImportantCloneVforkFlags = CLONE_VFORK | CLONE_VM; +- +- const BoolExpr is_fork_or_clone_vfork = +- AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0, +- (flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags); +- +- return If(IsAndroid() ? android_test : glibc_test, Allow()) +- .ElseIf(is_fork_or_clone_vfork, Error(EPERM)) ++ return If(thread_clone_ok, Allow()) ++ .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM)) + .Else(CrashSIGSYSClone()); + } + +--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc.orig ++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +@@ -494,6 +494,7 @@ + case __NR_mlock: + case __NR_munlock: + case __NR_munmap: ++ case __NR_mremap: + return true; + case __NR_madvise: + case __NR_mincore: +@@ -509,7 +510,6 @@ + case __NR_modify_ldt: + #endif + case __NR_mprotect: +- case __NR_mremap: + case __NR_msync: + case __NR_munlockall: + case __NR_readahead: +diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +index 80f02c0..21fbe21 100644 +--- sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc ++++ sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +@@ -373,6 +373,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { + #if defined(__i386__) + case __NR_waitpid: + #endif ++ case __NR_set_tid_address: + return true; + case __NR_clone: // Should be parameter-restricted. + case __NR_setns: // Privileged. +@@ -385,7 +386,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { + #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) + case __NR_set_thread_area: + #endif +- case __NR_set_tid_address: + case __NR_unshare: + #if !defined(__mips__) && !defined(__aarch64__) + case __NR_vfork: +--- sandbox/policy/linux/bpf_renderer_policy_linux.cc ++++ sandbox/policy/linux/bpf_renderer_policy_linux.cc +@@ -100,9 +100,9 @@ + case __NR_uname: + case __NR_sched_getparam: + case __NR_sched_getscheduler: ++ case __NR_sched_setscheduler: + return Allow(); + case __NR_sched_getaffinity: +- case __NR_sched_setscheduler: + return RestrictSchedTarget(GetPolicyPid(), sysno); + case __NR_prlimit64: + // See crbug.com/662450 and setrlimit comment above. diff --git a/srcpkgs/electron12/files/musl-patches/chromium-musl-sync.patch b/srcpkgs/electron12/files/musl-patches/chromium-musl-sync.patch new file mode 100644 index 00000000000..bc2fa1937bd --- /dev/null +++ b/srcpkgs/electron12/files/musl-patches/chromium-musl-sync.patch @@ -0,0 +1,30 @@ +--- third_party/libsync/src/include/sync/sync.h.orig 2020-02-21 07:43:33.748325175 -0500 ++++ third_party/libsync/src/include/sync/sync.h 2020-02-21 07:44:07.288328784 -0500 +@@ -19,12 +19,16 @@ + #ifndef __SYS_CORE_SYNC_H + #define __SYS_CORE_SYNC_H + ++#if defined(__GLIBC__) + #include ++#endif + #include + + #include + +-__BEGIN_DECLS ++#ifdef __cplusplus ++extern "C" { ++#endif + + struct sync_legacy_merge_data { + int32_t fd2; +@@ -158,6 +162,8 @@ + struct sync_pt_info *itr); + void sync_fence_info_free(struct sync_fence_info_data *info); + +-__END_DECLS ++#ifdef __cplusplus ++} ++#endif + + #endif /* __SYS_CORE_SYNC_H */ diff --git a/srcpkgs/electron12/files/musl-patches/chromium-musl-xxx-ppc64le.patch b/srcpkgs/electron12/files/musl-patches/chromium-musl-xxx-ppc64le.patch new file mode 100644 index 00000000000..9001a2a854d --- /dev/null +++ b/srcpkgs/electron12/files/musl-patches/chromium-musl-xxx-ppc64le.patch @@ -0,0 +1,190 @@ +diff --git sandbox/linux/bpf_dsl/seccomp_macros.h sandbox/linux/bpf_dsl/seccomp_macros.h +index a6aec544e..2a4a7f1bc 100644 +--- sandbox/linux/bpf_dsl/seccomp_macros.h ++++ sandbox/linux/bpf_dsl/seccomp_macros.h +@@ -16,7 +16,7 @@ + #if defined(__mips__) + // sys/user.h in eglibc misses size_t definition + #include +-#elif defined(__powerpc64__) ++#elif defined(__powerpc64__) && defined(__GLIBC__) + // Manually define greg_t on ppc64 + typedef unsigned long long greg_t; + #endif +@@ -361,11 +361,11 @@ typedef struct pt_regs regs_struct; + #define SECCOMP_ARCH AUDIT_ARCH_PPC64 + #endif + +-#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg]) ++#define SECCOMP_REG(_ctx, _reg) (((struct pt_regs *)(_ctx)->uc_mcontext.regs)->gpr[_reg]) + + #define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3) + #define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0) +-#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip ++#define SECCOMP_IP(_ctx) ((struct pt_regs *)(_ctx)->uc_mcontext.regs)->nip + #define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3) + #define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4) + #define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5) +diff --git sandbox/linux/seccomp-bpf/syscall.cc sandbox/linux/seccomp-bpf/syscall.cc +index d53a7ff56..c290f0e92 100644 +--- sandbox/linux/seccomp-bpf/syscall.cc ++++ sandbox/linux/seccomp-bpf/syscall.cc +@@ -499,9 +499,9 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) { + // Same as MIPS, need to invert ret and set error register (cr0.SO) + if (ret_val <= -1 && ret_val >= -4095) { + ret_val = -ret_val; +- ctx->uc_mcontext.regs->ccr |= (1 << 28); ++ ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr |= (1 << 28); + } else { +- ctx->uc_mcontext.regs->ccr &= ~(1 << 28); ++ ((struct pt_regs *)ctx->uc_mcontext.regs)->ccr &= ~(1 << 28); + } + #endif + SECCOMP_RESULT(ctx) = static_cast(ret_val); +diff --git third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +index cdce9bf8..73d77dda 100644 +--- third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h ++++ third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.h +@@ -46,7 +46,7 @@ + + // The following platforms have an implementation of a hardware counter. + #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \ +- defined(__powerpc__) || defined(__ppc__) || \ ++ ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \ + defined(_M_IX86) || defined(_M_X64) + #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1 + #else +--- third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h ++++ third_party/abseil-cpp/absl/debugging/internal/stacktrace_config.h +@@ -64,7 +64,7 @@ + #elif defined(__i386__) || defined(__x86_64__) + #define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_x86-inl.inc" +-#elif defined(__ppc__) || defined(__PPC__) ++#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__) + #define ABSL_STACKTRACE_INL_HEADER \ + "absl/debugging/internal/stacktrace_powerpc-inl.inc" + #elif defined(__aarch64__) +diff --git third_party/breakpad/BUILD.gn third_party/breakpad/BUILD.gn +index f9a60e37..25f3a0b7 100644 +--- third_party/breakpad/BUILD.gn ++++ third_party/breakpad/BUILD.gn +@@ -637,6 +637,7 @@ if (is_linux || is_android) { + + if (current_cpu == "ppc64") { + defines = [ "HAVE_GETCONTEXT" ] ++ libs += [ "ucontext" ] + } else { + sources += [ + "breakpad/src/common/linux/breakpad_getcontext.S" +diff --git third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc +index 03afec7a..0264ecf1 100644 +--- third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc ++++ third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc +@@ -273,6 +273,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const { + + #elif defined(__powerpc64__) + ++#include ++#include ++ + uintptr_t ThreadInfo::GetInstructionPointer() const { + return mcontext.gp_regs[PT_NIP]; + } +@@ -290,9 +293,9 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const { + out->ctr = mcontext.gp_regs[PT_CTR]; + + for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++) +- out->float_save.fpregs[i] = mcontext.fp_regs[i]; ++ out->float_save.fpregs[i] = ((uint64_t *)&mcontext.fp_regs)[i]; + +- out->float_save.fpscr = mcontext.fp_regs[NFPREG-1]; ++ out->float_save.fpscr = ((uint64_t *)&mcontext.fp_regs)[ELF_NFPREG-1]; + + for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) + out->vector_save.save_vr[i] = \ +diff --git third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc +index 1090470f..e580233d 100644 +--- third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc ++++ third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc +@@ -257,6 +257,9 @@ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) { + + #elif defined(__powerpc64__) + ++#include ++#include ++ + uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { + return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]; + } +@@ -280,9 +283,9 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc, + out->ctr = uc->uc_mcontext.gp_regs[PT_CTR]; + + for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++) +- out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i]; ++ out->float_save.fpregs[i] = ((uint64_t *)&uc->uc_mcontext.fp_regs)[i]; + +- out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1]; ++ out->float_save.fpscr = ((uint64_t *)&uc->uc_mcontext.fp_regs)[ELF_NFPREG-1]; + + for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) + out->vector_save.save_vr[i] = +diff --git third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc +index 5a7ab50c..ee8b858c 100644 +--- third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc ++++ third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc +@@ -105,6 +105,11 @@ + #define PR_SET_PTRACER 0x59616d61 + #endif + ++/* musl hack, can't include asm/ptrace.h as that causes conflicts */ ++#if defined(__powerpc64__) && !defined(PT_NIP) ++#define PT_NIP 32 ++#endif ++ + namespace google_breakpad { + + namespace { +diff --git third_party/crashpad/crashpad/snapshot/linux/signal_context.h third_party/crashpad/crashpad/snapshot/linux/signal_context.h +index 8e335a09..b2a0f155 100644 +--- third_party/crashpad/crashpad/snapshot/linux/signal_context.h ++++ third_party/crashpad/crashpad/snapshot/linux/signal_context.h +@@ -469,7 +469,7 @@ struct MContext64 { + SignalThreadContext64 gp_regs; + SignalFloatContext64 fp_regs; + SignalVectorContext64 *v_regs; +- int64_t vmx_reserve[69]; ++ int64_t vmx_reserve[101]; + }; + + struct ContextTraits64 : public Traits64 { +diff --git third_party/crashpad/crashpad/util/linux/thread_info.h third_party/crashpad/crashpad/util/linux/thread_info.h +index dea0d1f3..b203e5b2 100644 +--- third_party/crashpad/crashpad/util/linux/thread_info.h ++++ third_party/crashpad/crashpad/util/linux/thread_info.h +@@ -30,6 +30,7 @@ + + #if defined(ARCH_CPU_PPC64_FAMILY) + #include ++#include + #endif + + namespace crashpad { +diff --git third_party/lss/linux_syscall_support.h third_party/lss/linux_syscall_support.h +index 9955ce44..4c1cc488 100644 +--- third_party/lss/linux_syscall_support.h ++++ third_party/lss/linux_syscall_support.h +@@ -4216,9 +4216,13 @@ struct kernel_statfs { + } + #endif + #if defined(__NR_fstatat64) ++ // musl does #define fstatat64 fstatat ++ #undef fstatat64 + LSS_INLINE _syscall4(int, fstatat64, int, d, + const char *, p, + struct kernel_stat64 *, b, int, f) ++ // set it back like it was ++ #define fstatat64 fstatat + #endif + #if defined(__NR_waitpid) + // waitpid is polyfilled below when not available. diff --git a/srcpkgs/electron12/files/musl-patches/chromium-no-mallinfo.patch b/srcpkgs/electron12/files/musl-patches/chromium-no-mallinfo.patch new file mode 100644 index 00000000000..254a1f632da --- /dev/null +++ b/srcpkgs/electron12/files/musl-patches/chromium-no-mallinfo.patch @@ -0,0 +1,54 @@ +--- base/trace_event/malloc_dump_provider.cc.orig ++++ base/trace_event/malloc_dump_provider.cc +@@ -243,7 +243,7 @@ + allocated_objects_count = main_heap_info.block_count; + #elif defined(OS_FUCHSIA) + // TODO(fuchsia): Port, see https://crbug.com/706592. +-#else ++#elif defined(__GLIBC__) + struct mallinfo info = mallinfo(); + DCHECK_GE(info.arena + info.hblkhd, info.uordblks); + +--- base/process/process_metrics_posix.cc.orig 2020-11-18 23:50:33.958223497 -0500 ++++ base/process/process_metrics_posix.cc 2020-11-18 23:53:52.024589316 -0500 +@@ -119,14 +119,14 @@ + malloc_statistics_t stats = {0}; + malloc_zone_statistics(nullptr, &stats); + return stats.size_in_use; +-#elif defined(OS_LINUX) || defined(OS_CHROMEOS) || defined(OS_ANDROID) ++#elif defined(__GLIBC__) || defined(OS_CHROMEOS) || defined(OS_ANDROID) + struct mallinfo minfo = mallinfo(); + #if BUILDFLAG(USE_TCMALLOC) + return minfo.uordblks; + #else + return minfo.hblkhd + minfo.arena; + #endif +-#elif defined(OS_FUCHSIA) ++#else + // TODO(fuchsia): Not currently exposed. https://crbug.com/735087. + return 0; + #endif +--- third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Process.inc ++++ third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Process.inc.orig +@@ -84,7 +84,7 @@ + } + + size_t Process::GetMallocUsage() { +-#if defined(HAVE_MALLINFO) ++#if defined(HAVE_MALLINFO) && defined(__GLIBC__) + struct mallinfo mi; + mi = ::mallinfo(); + return mi.uordblks; + +--- third_party/swiftshader/third_party/llvm-10.0/configs/linux/include/llvm/Config/config.h.orig 2019-09-30 13:03:42.556880537 -0400 ++++ third_party/swiftshader/third_party/llvm-10.0/configs/linux/include/llvm/Config/config.h 2019-09-30 13:07:27.989821227 -0400 +@@ -122,7 +122,9 @@ + /* #undef HAVE_MALLCTL */ + + /* Define to 1 if you have the `mallinfo' function. */ ++#if defined(__GLIBC__) + #define HAVE_MALLINFO 1 ++#endif + + /* Define to 1 if you have the header file. */ + #define HAVE_MALLOC_H 1 diff --git a/srcpkgs/electron12/files/musl-patches/chromium-resolver.patch b/srcpkgs/electron12/files/musl-patches/chromium-resolver.patch new file mode 100644 index 00000000000..29fe2d2f1f3 --- /dev/null +++ b/srcpkgs/electron12/files/musl-patches/chromium-resolver.patch @@ -0,0 +1,38 @@ +--- net/dns/host_resolver_manager.cc.orig 2020-10-09 16:39:12.064069835 -0400 ++++ net/dns/host_resolver_manager.cc 2020-10-09 16:42:49.738302772 -0400 +@@ -2779,8 +2779,7 @@ + NetworkChangeNotifier::AddConnectionTypeObserver(this); + if (system_dns_config_notifier_) + system_dns_config_notifier_->AddObserver(this); +-#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \ +- !defined(OS_ANDROID) ++#if defined(__GLIBC__) + EnsureDnsReloaderInit(); + #endif + +--- net/dns/dns_reloader.cc.orig 2020-10-09 16:39:12.064069835 -0400 ++++ net/dns/dns_reloader.cc 2020-10-09 16:44:30.442419823 -0400 +@@ -4,9 +4,8 @@ + + #include "net/dns/dns_reloader.h" + +-#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \ +- !defined(OS_ANDROID) && !defined(OS_FUCHSIA) +- ++#if defined(__GLIBC__) ++ + #include + + #include "base/lazy_instance.h" +--- net/dns/host_resolver_proc.cc.orig 2020-10-09 16:39:12.065069836 -0400 ++++ net/dns/host_resolver_proc.cc 2020-10-09 16:45:09.641466644 -0400 +@@ -159,8 +159,7 @@ + base::ScopedBlockingCall scoped_blocking_call(FROM_HERE, + base::BlockingType::WILL_BLOCK); + +-#if defined(OS_POSIX) && !defined(OS_APPLE) && !defined(OS_OPENBSD) && \ +- !defined(OS_ANDROID) && !defined(OS_FUCHSIA) ++#if defined(__GLIBC__) + DnsReloaderMaybeReload(); + #endif + base::Optional ai; diff --git a/srcpkgs/electron12/files/patches/chromium-88-glibc-2.33.patch b/srcpkgs/electron12/files/patches/chromium-88-glibc-2.33.patch new file mode 100644 index 00000000000..64306d5e429 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-88-glibc-2.33.patch @@ -0,0 +1,144 @@ +# Patch made by Kevin Kofler +# https://bugzilla.redhat.com/show_bug.cgi?id=1904652 + +diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +--- sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc.fstatfix 2021-01-25 10:11:45.427436398 -0500 ++++ sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc 2021-01-25 10:12:51.337699003 -0500 +@@ -257,6 +257,18 @@ ResultExpr EvaluateSyscallImpl(int fs_de + return RestrictKillTarget(current_pid, sysno); + } + ++#if defined(__NR_newfstatat) ++ if (sysno == __NR_newfstatat) { ++ return RewriteFstatatSIGSYS(); ++ } ++#endif ++ ++#if defined(__NR_fstatat64) ++ if (sysno == __NR_fstatat64) { ++ return RewriteFstatatSIGSYS(); ++ } ++#endif ++ + if (SyscallSets::IsFileSystem(sysno) || + SyscallSets::IsCurrentDirectory(sysno)) { + return Error(fs_denied_errno); +diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc +--- sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc.fstatfix 2021-01-25 10:13:10.179774081 -0500 ++++ sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.cc 2021-01-25 10:16:18.790525746 -0500 +@@ -6,6 +6,8 @@ + + #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" + ++#include ++#include + #include + #include + #include +@@ -355,6 +357,35 @@ intptr_t SIGSYSSchedHandler(const struct + return -ENOSYS; + } + ++intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args, ++ void* aux) { ++ switch (args.nr) { ++#if defined(__NR_newfstatat) ++ case __NR_newfstatat: ++#endif ++#if defined(__NR_fstatat64) ++ case __NR_fstatat64: ++#endif ++#if defined(__NR_newfstatat) || defined(__NR_fstatat64) ++ if (*reinterpret_cast(args.args[1]) == '\0' ++ && args.args[3] == static_cast(AT_EMPTY_PATH)) { ++ return sandbox::sys_fstat64(static_cast(args.args[0]), ++ reinterpret_cast(args.args[2])); ++ } else { ++ errno = EACCES; ++ return -1; ++ } ++ break; ++#endif ++ } ++ ++ CrashSIGSYS_Handler(args, aux); ++ ++ // Should never be reached. ++ RAW_CHECK(false); ++ return -ENOSYS; ++} ++ + bpf_dsl::ResultExpr CrashSIGSYS() { + return bpf_dsl::Trap(CrashSIGSYS_Handler, NULL); + } +@@ -387,6 +418,10 @@ bpf_dsl::ResultExpr RewriteSchedSIGSYS() + return bpf_dsl::Trap(SIGSYSSchedHandler, NULL); + } + ++bpf_dsl::ResultExpr RewriteFstatatSIGSYS() { ++ return bpf_dsl::Trap(SIGSYSFstatatHandler, NULL); ++} ++ + void AllocateCrashKeys() { + #if !defined(OS_NACL_NONSFI) + if (seccomp_crash_key) +diff -up chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h +--- sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h.fstatfix 2021-01-25 10:16:36.982598236 -0500 ++++ sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h 2021-01-25 10:18:45.705111027 -0500 +@@ -62,6 +62,10 @@ SANDBOX_EXPORT intptr_t SIGSYSPtraceFail + // sched_setparam(), sched_setscheduler() + SANDBOX_EXPORT intptr_t SIGSYSSchedHandler(const arch_seccomp_data& args, + void* aux); ++// If the fstatat syscall is actually a disguised fstat, calls the regular fstat ++// syscall, otherwise, crashes in the same way as CrashSIGSYS_Handler. ++SANDBOX_EXPORT intptr_t SIGSYSFstatatHandler(const struct arch_seccomp_data& args, ++ void* aux); + + // Variants of the above functions for use with bpf_dsl. + SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYS(); +@@ -72,6 +76,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr Crash + SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSFutex(); + SANDBOX_EXPORT bpf_dsl::ResultExpr CrashSIGSYSPtrace(); + SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteSchedSIGSYS(); ++SANDBOX_EXPORT bpf_dsl::ResultExpr RewriteFstatatSIGSYS(); + + // Allocates a crash key so that Seccomp information can be recorded. + void AllocateCrashKeys(); +diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.cc +--- sandbox/linux/services/syscall_wrappers.cc.fstatfix 2021-01-25 10:18:53.307141311 -0500 ++++ sandbox/linux/services/syscall_wrappers.cc 2021-01-25 10:19:46.982355293 -0500 +@@ -261,4 +261,13 @@ int sys_sigaction(int signum, + + #endif // defined(MEMORY_SANITIZER) + ++SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf) ++{ ++#if defined(__NR_fstat64) ++ return syscall(__NR_fstat64, fd, buf); ++#else ++ return syscall(__NR_fstat, fd, buf); ++#endif ++} ++ + } // namespace sandbox +diff -up chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h.fstatfix chromium-88.0.4324.96/sandbox/linux/services/syscall_wrappers.h +--- sandbox/linux/services/syscall_wrappers.h.fstatfix 2021-01-25 10:19:53.115379741 -0500 ++++ sandbox/linux/services/syscall_wrappers.h 2021-01-25 10:20:45.485588421 -0500 +@@ -17,6 +17,7 @@ struct sock_fprog; + struct rlimit64; + struct cap_hdr; + struct cap_data; ++struct stat64; + + namespace sandbox { + +@@ -84,6 +85,9 @@ SANDBOX_EXPORT int sys_sigaction(int sig + const struct sigaction* act, + struct sigaction* oldact); + ++// Recent glibc rewrites fstat to fstatat. ++SANDBOX_EXPORT int sys_fstat64(int fd, struct stat64 *buf); ++ + } // namespace sandbox + + #endif // SANDBOX_LINUX_SERVICES_SYSCALL_WRAPPERS_H_ diff --git a/srcpkgs/electron12/files/patches/chromium-89-AXTreeSerializer-include.patch b/srcpkgs/electron12/files/patches/chromium-89-AXTreeSerializer-include.patch new file mode 100644 index 00000000000..7372e44d154 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-89-AXTreeSerializer-include.patch @@ -0,0 +1,25 @@ +From c06ddc4935bf1394812c011ce5d93898ccc8a53a Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Tue, 09 Feb 2021 19:22:57 +0000 +Subject: [PATCH] IWYU: add ctime for std::time + +Bug: None +Change-Id: I8bdae43209984242b9f5e538d74ece4409b65e3c +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2679610 +Reviewed-by: Katie Dektar +Commit-Queue: Katie Dektar +Cr-Commit-Position: refs/heads/master@{#852287} +--- + +diff --git a/ui/accessibility/ax_tree_serializer.h b/ui/accessibility/ax_tree_serializer.h +index ddbbdcd..1790e3b 100644 +--- ui/accessibility/ax_tree_serializer.h ++++ ui/accessibility/ax_tree_serializer.h +@@ -8,6 +8,7 @@ + #include + #include + ++#include + #include + #include + #include diff --git a/srcpkgs/electron12/files/patches/chromium-89-add-dependency-on-opus-in-webcodecs.patch b/srcpkgs/electron12/files/patches/chromium-89-add-dependency-on-opus-in-webcodecs.patch new file mode 100644 index 00000000000..c25897791d9 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-89-add-dependency-on-opus-in-webcodecs.patch @@ -0,0 +1,43 @@ +From b5b80df7dafba8cafa4c6c0ba2153dfda467dfc9 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Wed, 27 Jan 2021 20:31:51 +0000 +Subject: [PATCH] add dependency on opus in webcodecs + +webcodecs uses opus, but dependency is missing. With unbundled +opus library build fails, because include path is incomplete. + +Bug: 1169758 +Change-Id: I01369364327461196a81002479636cf45017669a +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2644623 +Reviewed-by: Dale Curtis +Commit-Queue: Dale Curtis +Cr-Commit-Position: refs/heads/master@{#847754} +--- + third_party/blink/renderer/modules/webcodecs/BUILD.gn | 1 + + third_party/blink/renderer/modules/webcodecs/DEPS | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/third_party/blink/renderer/modules/webcodecs/BUILD.gn b/third_party/blink/renderer/modules/webcodecs/BUILD.gn +index fdf4ca0fafc72..01a7bf809ffca 100644 +--- third_party/blink/renderer/modules/webcodecs/BUILD.gn ++++ third_party/blink/renderer/modules/webcodecs/BUILD.gn +@@ -65,6 +65,7 @@ blink_modules_sources("webcodecs") { + "//media/mojo/clients", + "//media/mojo/mojom", + "//third_party/libyuv:libyuv", ++ "//third_party/opus", + ] + if (media_use_openh264) { + deps += [ "//third_party/openh264:encoder" ] +diff --git a/third_party/blink/renderer/modules/webcodecs/DEPS b/third_party/blink/renderer/modules/webcodecs/DEPS +index b8dd596da8caf..ea1919d12205a 100644 +--- third_party/blink/renderer/modules/webcodecs/DEPS ++++ third_party/blink/renderer/modules/webcodecs/DEPS +@@ -19,6 +19,7 @@ include_rules = [ + + "+third_party/libyuv", + "+third_party/openh264", ++ "+third_party/opus", + + "+ui/gfx/color_space.h", + "+ui/gfx/geometry/rect.h", diff --git a/srcpkgs/electron12/files/patches/chromium-89-dawn-include.patch b/srcpkgs/electron12/files/patches/chromium-89-dawn-include.patch new file mode 100644 index 00000000000..9876ba20eb5 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-89-dawn-include.patch @@ -0,0 +1,28 @@ +From 5a56bfe8d281250a1deee0d116a9fcde65b9c29a Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Fri, 15 Jan 2021 18:37:05 +0000 +Subject: [PATCH] IWYU: add various missing includes + +std::weak_ptr and std::shared_ptr require map +*int*_t types require cstdint +--- + third_party/dawn/src/dawn_wire/client/Device.h | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/third_party/dawn/src/dawn_wire/client/Device.h b/third_party/dawn/src/dawn_wire/client/Device.h +index 3f16700..1082549 100644 +--- third_party/dawn/src/dawn_wire/client/Device.h ++++ third_party/dawn/src/dawn_wire/client/Device.h +@@ -22,7 +22,9 @@ + #include "dawn_wire/client/ApiObjects_autogen.h" + #include "dawn_wire/client/ObjectBase.h" + ++#include + #include ++#include + + namespace dawn_wire { namespace client { + +-- +2.26.2 + diff --git a/srcpkgs/electron12/files/patches/chromium-89-quiche-dcheck.patch b/srcpkgs/electron12/files/patches/chromium-89-quiche-dcheck.patch new file mode 100644 index 00000000000..b2f164fac9b --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-89-quiche-dcheck.patch @@ -0,0 +1,29 @@ +From 7cd4eab0bfca6192f14d6143410e1ae774eb1c29 Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +Date: Thu, 31 Dec 2020 11:57:22 +0000 +Subject: [PATCH] GCC: do not pass unique_ptr to DCHECK_NE, but the actual + pointer + +DCHECK_NE comparison requires CheckOpValueStr to be defined for the +type, or providing an output stream operator. A unique_ptr does not +provide any. USE DCHECK instead. +--- + net/third_party/quiche/src/quic/core/quic_path_validator.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/third_party/quiche/src/quic/core/quic_path_validator.cc b/net/third_party/quiche/src/quic/core/quic_path_validator.cc +index 0722216..fb2aeaf 100644 +--- net/third_party/quiche/src/quic/core/quic_path_validator.cc ++++ net/third_party/quiche/src/quic/core/quic_path_validator.cc +@@ -68,7 +68,7 @@ void QuicPathValidator::OnPathResponse(const QuicPathFrameBuffer& probing_data, + void QuicPathValidator::StartPathValidation( + std::unique_ptr context, + std::unique_ptr result_delegate) { +- DCHECK_NE(nullptr, context); ++ DCHECK(context); + QUIC_DLOG(INFO) << "Start validating path " << *context + << " via writer: " << context->WriterToUse(); + if (path_context_ != nullptr) { +-- +2.26.2 + diff --git a/srcpkgs/electron12/files/patches/chromium-89-skia-CropRect.patch b/srcpkgs/electron12/files/patches/chromium-89-skia-CropRect.patch new file mode 100644 index 00000000000..9712c92658f --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-89-skia-CropRect.patch @@ -0,0 +1,38 @@ +diff --git a/third_party/skia/include/effects/SkImageFilters.h b/third_party/skia/include/effects/SkImageFilters.h +index 04cce0a..d06b007 100644 +--- third_party/skia/include/effects/SkImageFilters.h ++++ third_party/skia/include/effects/SkImageFilters.h +@@ -23,6 +23,9 @@ class SkColorFilter; + class SkPaint; + class SkRegion; + ++constexpr SkRect kNoCropRect = {SK_ScalarNegativeInfinity, SK_ScalarNegativeInfinity, ++ SK_ScalarInfinity, SK_ScalarInfinity}; ++ + // A set of factory functions providing useful SkImageFilter effects. For image filters that take an + // input filter, providing nullptr means it will automatically use the dynamic source image. This + // source depends on how the filter is applied, but is either the contents of a saved layer when +@@ -33,8 +36,6 @@ public: + // to those types as a crop rect for the image filter factories. It's not intended to be used + // directly. + struct CropRect { +- static constexpr SkRect kNoCropRect = {SK_ScalarNegativeInfinity, SK_ScalarNegativeInfinity, +- SK_ScalarInfinity, SK_ScalarInfinity}; + CropRect() : fCropRect(kNoCropRect) {} + // Intentionally not explicit so callers don't have to use this type but can use SkIRect or + // SkRect as desired. +diff --git a/third_party/skia/src/effects/imagefilters/SkImageFilters.cpp b/third_party/skia/src/effects/imagefilters/SkImageFilters.cpp +index 5290b00..fb97fc1 100644 +--- third_party/skia/src/effects/imagefilters/SkImageFilters.cpp ++++ third_party/skia/src/effects/imagefilters/SkImageFilters.cpp +@@ -47,10 +47,6 @@ static SkImageFilter::CropRect to_legacy_crop_rect(const SkImageFilters::CropRec + : SkImageFilter::CropRect(SkRect::MakeEmpty(), 0x0); + } + +-// Allow kNoCropRect to be referenced (for certain builds, e.g. macOS libFuzzer chromium target, +-// see crbug.com/1139725) +-constexpr SkRect SkImageFilters::CropRect::kNoCropRect; +- + void SkImageFilters::RegisterFlattenables() { + SkAlphaThresholdFilter::RegisterFlattenables(); + SkArithmeticImageFilter::RegisterFlattenables(); diff --git a/srcpkgs/electron12/files/patches/chromium-89-x11-ozone-fix-two-edge-cases.patch b/srcpkgs/electron12/files/patches/chromium-89-x11-ozone-fix-two-edge-cases.patch new file mode 100644 index 00000000000..7fb586da169 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-89-x11-ozone-fix-two-edge-cases.patch @@ -0,0 +1,135 @@ +From 5e3a738b1204941aab9f15c0eb3d06e20fefd96e Mon Sep 17 00:00:00 2001 +From: Scott Violet +Date: Mon, 8 Mar 2021 21:07:39 +0000 +Subject: [PATCH] x11/ozone: fix two edge cases + +WindowTreeHost::OnHostMovedInPixels() may trigger a nested message +loop (tab dragging), which when the stack unravels means this may +be deleted. This adds an early out if this happens. + +X11WholeScreenMoveLoop has a similar issue, in so far as notifying +the delegate may delete this. + +BUG=1185482 +TEST=WindowTreeHostPlatform.DeleteHostFromOnHostMovedInPixels + +Change-Id: Ieca1c90b3e4358da50b332abe2941fdbb50c5c25 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2743555 +Reviewed-by: Thomas Anderson +Commit-Queue: Scott Violet +Cr-Commit-Position: refs/heads/master@{#860852} +--- + ui/aura/window_tree_host_platform.cc | 10 ++++- + ui/aura/window_tree_host_platform_unittest.cc | 40 ++++++++++++++++++- + ui/base/x/x11_whole_screen_move_loop.cc | 4 ++ + 3 files changed, 51 insertions(+), 3 deletions(-) + +diff --git a/ui/aura/window_tree_host_platform.cc b/ui/aura/window_tree_host_platform.cc +index ce8395fe07..7589542026 100644 +--- ui/aura/window_tree_host_platform.cc ++++ ui/aura/window_tree_host_platform.cc +@@ -214,13 +214,21 @@ void WindowTreeHostPlatform::OnBoundsChanged(const gfx::Rect& new_bounds) { + float current_scale = compositor()->device_scale_factor(); + float new_scale = ui::GetScaleFactorForNativeView(window()); + gfx::Rect old_bounds = bounds_in_pixels_; ++ auto weak_ref = GetWeakPtr(); + bounds_in_pixels_ = new_bounds; +- if (bounds_in_pixels_.origin() != old_bounds.origin()) ++ if (bounds_in_pixels_.origin() != old_bounds.origin()) { + OnHostMovedInPixels(bounds_in_pixels_.origin()); ++ // Changing the bounds may destroy this. ++ if (!weak_ref) ++ return; ++ } + if (bounds_in_pixels_.size() != old_bounds.size() || + current_scale != new_scale) { + pending_size_ = gfx::Size(); + OnHostResizedInPixels(bounds_in_pixels_.size()); ++ // Changing the size may destroy this. ++ if (!weak_ref) ++ return; + } + DCHECK_GT(on_bounds_changed_recursion_depth_, 0); + if (--on_bounds_changed_recursion_depth_ == 0) { +diff --git a/ui/aura/window_tree_host_platform_unittest.cc b/ui/aura/window_tree_host_platform_unittest.cc +index eda14e2f0c..4de039c88a 100644 +--- ui/aura/window_tree_host_platform_unittest.cc ++++ ui/aura/window_tree_host_platform_unittest.cc +@@ -34,7 +34,7 @@ class TestWindowTreeHost : public WindowTreeHostPlatform { + // OnHostWill/DidProcessBoundsChange. Additionally, this triggers a bounds + // change from within OnHostResized(). Such a scenario happens in production + // code. +-class TestWindowTreeHostObserver : public aura::WindowTreeHostObserver { ++class TestWindowTreeHostObserver : public WindowTreeHostObserver { + public: + TestWindowTreeHostObserver(WindowTreeHostPlatform* host, + ui::PlatformWindow* platform_window) +@@ -51,7 +51,7 @@ class TestWindowTreeHostObserver : public aura::WindowTreeHostObserver { + return on_host_will_process_bounds_change_count_; + } + +- // aura::WindowTreeHostObserver: ++ // WindowTreeHostObserver: + void OnHostResized(WindowTreeHost* host) override { + if (!should_change_bounds_in_on_resized_) + return; +@@ -92,5 +92,41 @@ TEST_F(WindowTreeHostPlatformTest, HostWillProcessBoundsChangeRecursion) { + EXPECT_EQ(1, observer.on_host_will_process_bounds_change_count()); + } + ++// Deletes WindowTreeHostPlatform from OnHostMovedInPixels(). ++class DeleteHostWindowTreeHostObserver : public WindowTreeHostObserver { ++ public: ++ explicit DeleteHostWindowTreeHostObserver( ++ std::unique_ptr host) ++ : host_(std::move(host)) { ++ host_->AddObserver(this); ++ } ++ ~DeleteHostWindowTreeHostObserver() override = default; ++ ++ TestWindowTreeHost* host() { return host_.get(); } ++ ++ // WindowTreeHostObserver: ++ void OnHostMovedInPixels(WindowTreeHost* host, ++ const gfx::Point& new_origin_in_pixels) override { ++ host_->RemoveObserver(this); ++ host_.reset(); ++ } ++ ++ private: ++ std::unique_ptr host_; ++ ++ DISALLOW_COPY_AND_ASSIGN(DeleteHostWindowTreeHostObserver); ++}; ++ ++// Verifies WindowTreeHostPlatform can be safely deleted when calling ++// OnHostMovedInPixels(). ++// Regression test for https://crbug.com/1185482 ++TEST_F(WindowTreeHostPlatformTest, DeleteHostFromOnHostMovedInPixels) { ++ std::unique_ptr host = ++ std::make_unique(); ++ DeleteHostWindowTreeHostObserver observer(std::move(host)); ++ observer.host()->SetBoundsInPixels(gfx::Rect(1, 2, 3, 4)); ++ EXPECT_EQ(nullptr, observer.host()); ++} ++ + } // namespace + } // namespace aura +diff --git a/ui/base/x/x11_whole_screen_move_loop.cc b/ui/base/x/x11_whole_screen_move_loop.cc +index 5ed215db66..db678799db 100644 +--- ui/base/x/x11_whole_screen_move_loop.cc ++++ ui/base/x/x11_whole_screen_move_loop.cc +@@ -78,9 +78,13 @@ X11WholeScreenMoveLoop::~X11WholeScreenMoveLoop() { + void X11WholeScreenMoveLoop::DispatchMouseMovement() { + if (!last_motion_in_screen_) + return; ++ auto weak_ref = weak_factory_.GetWeakPtr(); + delegate_->OnMouseMovement(last_motion_in_screen_->root_location(), + last_motion_in_screen_->flags(), + last_motion_in_screen_->time_stamp()); ++ // The delegate may delete this during dispatch. ++ if (!weak_ref) ++ return; + last_motion_in_screen_.reset(); + } + diff --git a/srcpkgs/electron12/files/patches/chromium-browser-size_t.patch b/srcpkgs/electron12/files/patches/chromium-browser-size_t.patch new file mode 100644 index 00000000000..fa214d987d6 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-browser-size_t.patch @@ -0,0 +1,10 @@ +--- chrome/browser/search/background/ntp_backgrounds.h 2020-08-10 20:39:20.000000000 +0200 ++++ chrome/browser/search/background/ntp_backgrounds.h 2020-09-04 13:48:22.640023256 +0200 +@@ -6,6 +6,7 @@ + #define CHROME_BROWSER_SEARCH_BACKGROUND_NTP_BACKGROUNDS_H_ + + #include ++#include + + class GURL; + diff --git a/srcpkgs/electron12/files/patches/chromium-libc_malloc.patch b/srcpkgs/electron12/files/patches/chromium-libc_malloc.patch new file mode 100644 index 00000000000..eda11ec8663 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-libc_malloc.patch @@ -0,0 +1,26 @@ +--- base/process/memory_linux.cc.orig 2017-09-15 08:41:43.000000000 +0000 ++++ base/process/memory_linux.cc 2017-09-15 08:44:39.804995469 +0000 +@@ -21,6 +21,12 @@ + #include "third_party/tcmalloc/chromium/src/gperftools/tcmalloc.h" + #endif + ++#if defined(LIBC_GLIBC) ++extern "C" { ++extern void *__libc_malloc(size_t size); ++} ++#endif ++ + namespace base { + + size_t g_oom_size = 0U; +--- base/process/memory_linux.cc.orig 2020-08-30 14:18:35.401132593 -0400 ++++ base/process/memory_linux.cc 2020-08-30 14:19:08.030199189 -0400 +@@ -141,7 +141,7 @@ + (!defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC)) + *result = malloc(size); + #elif defined(LIBC_GLIBC) && !BUILDFLAG(USE_TCMALLOC) +- *result = __libc_malloc(size); ++ *result = ::__libc_malloc(size); + #elif BUILDFLAG(USE_TCMALLOC) + *result = tc_malloc_skip_new_handler(size); + #endif diff --git a/srcpkgs/electron12/files/patches/chromium-musl-v8-monotonic-pthread-cont_timedwait.patch b/srcpkgs/electron12/files/patches/chromium-musl-v8-monotonic-pthread-cont_timedwait.patch new file mode 100644 index 00000000000..33a8ea32c9c --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-musl-v8-monotonic-pthread-cont_timedwait.patch @@ -0,0 +1,24 @@ +Use monotonic clock for pthread_cond_timedwait with musl too. + +diff --git a/v8/src/base/platform/condition-variable.cc b/v8/src/base/platform/condition-variable.cc +index 5ea7083..c13027e 100644 +--- ./v8/src/base/platform/condition-variable.cc ++++ ./v8/src/base/platform/condition-variable.cc +@@ -16,7 +16,7 @@ namespace base { + + ConditionVariable::ConditionVariable() { + #if (V8_OS_FREEBSD || V8_OS_NETBSD || V8_OS_OPENBSD || \ +- (V8_OS_LINUX && V8_LIBC_GLIBC)) ++ V8_OS_LINUX) + // On Free/Net/OpenBSD and Linux with glibc we can change the time + // source for pthread_cond_timedwait() to use the monotonic clock. + pthread_condattr_t attr; +@@ -92,7 +92,7 @@ bool ConditionVariable::WaitFor(Mutex* mutex, const TimeDelta& rel_time) { + &native_handle_, &mutex->native_handle(), &ts); + #else + #if (V8_OS_FREEBSD || V8_OS_NETBSD || V8_OS_OPENBSD || \ +- (V8_OS_LINUX && V8_LIBC_GLIBC)) ++ V8_OS_LINUX) + // On Free/Net/OpenBSD and Linux with glibc we can change the time + // source for pthread_cond_timedwait() to use the monotonic clock. + result = clock_gettime(CLOCK_MONOTONIC, &ts); diff --git a/srcpkgs/electron12/files/patches/chromium-no-execinfo.patch b/srcpkgs/electron12/files/patches/chromium-no-execinfo.patch new file mode 100644 index 00000000000..386997e8ed1 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-no-execinfo.patch @@ -0,0 +1,72 @@ +--- base/debug/stack_trace_posix.cc.orig 2019-05-14 14:49:44.000000000 -0400 ++++ base/debug/stack_trace_posix.cc 2019-07-02 10:43:43.490045013 -0400 +@@ -27,7 +27,7 @@ + #if !defined(USE_SYMBOLIZE) + #include + #endif +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + #include + #endif + +@@ -86,7 +86,7 @@ + // Note: code in this function is NOT async-signal safe (std::string uses + // malloc internally). + +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + std::string::size_type search_from = 0; + while (search_from < text->size()) { + // Look for the start of a mangled symbol, from search_from. +@@ -121,7 +121,7 @@ + search_from = mangled_start + 2; + } + } +-#endif // !defined(__UCLIBC__) && !defined(_AIX) ++#endif // defined(__GLIBC__) && !defined(_AIX) + } + #endif // !defined(USE_SYMBOLIZE) + +@@ -133,7 +133,7 @@ + virtual ~BacktraceOutputHandler() = default; + }; + +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + void OutputPointer(void* pointer, BacktraceOutputHandler* handler) { + // This should be more than enough to store a 64-bit number in hex: + // 16 hex digits + 1 for null-terminator. +@@ -216,7 +216,7 @@ + } + #endif // defined(USE_SYMBOLIZE) + } +-#endif // !defined(__UCLIBC__) && !defined(_AIX) ++#endif // defined(__GLIBC__) && !defined(_AIX) + + void PrintToStderr(const char* output) { + // NOTE: This code MUST be async-signal safe (it's used by in-process +@@ -812,7 +812,7 @@ + // NOTE: This code MUST be async-signal safe (it's used by in-process + // stack dumping signal handler). NO malloc or stdio is allowed here. + +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + // Though the backtrace API man page does not list any possible negative + // return values, we take no chance. + return base::saturated_cast(backtrace(trace, count)); +@@ -825,13 +825,13 @@ + // NOTE: This code MUST be async-signal safe (it's used by in-process + // stack dumping signal handler). NO malloc or stdio is allowed here. + +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + PrintBacktraceOutputHandler handler; + ProcessBacktrace(trace_, count_, prefix_string, &handler); + #endif + } + +-#if !defined(__UCLIBC__) && !defined(_AIX) ++#if defined(__GLIBC__) && !defined(_AIX) + void StackTrace::OutputToStreamWithPrefix(std::ostream* os, + const char* prefix_string) const { + StreamBacktraceOutputHandler handler(os); diff --git a/srcpkgs/electron12/files/patches/chromium-no-getcontext.patch b/srcpkgs/electron12/files/patches/chromium-no-getcontext.patch new file mode 100644 index 00000000000..b2a498734c9 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-no-getcontext.patch @@ -0,0 +1,27 @@ +--- third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc.orig 2015-12-06 09:59:55.554536646 +0100 ++++ third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc 2015-12-06 10:01:16.818238035 +0100 +@@ -477,7 +477,9 @@ bool ExceptionHandler::SimulateSignalDel + siginfo.si_code = SI_USER; + siginfo.si_pid = getpid(); + ucontext_t context; ++#if defined(__GLIBC__) + getcontext(&context); ++#endif + return HandleSignal(sig, &siginfo, &context); + } + +@@ -647,9 +649,14 @@ bool ExceptionHandler::WriteMinidump() { + sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); + + CrashContext context; ++ ++#if defined(__GLIBC__) + int getcontext_result = getcontext(&context.context); + if (getcontext_result) + return false; ++#else ++ return false; ++#endif + + #if defined(__i386__) + // In CPUFillFromUContext in minidumpwriter.cc the stack pointer is retrieved diff --git a/srcpkgs/electron12/files/patches/chromium-sandbox-membarrier.patch b/srcpkgs/electron12/files/patches/chromium-sandbox-membarrier.patch new file mode 100644 index 00000000000..86ca16fc2d7 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-sandbox-membarrier.patch @@ -0,0 +1,10 @@ +--- sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc ++++ sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +@@ -370,6 +370,7 @@ + switch (sysno) { + case __NR_exit: + case __NR_exit_group: ++ case __NR_membarrier: + case __NR_wait4: + case __NR_waitid: + #if defined(__i386__) diff --git a/srcpkgs/electron12/files/patches/chromium-sandbox-sched_getparam.patch b/srcpkgs/electron12/files/patches/chromium-sandbox-sched_getparam.patch new file mode 100644 index 00000000000..ba8af49c5f8 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-sandbox-sched_getparam.patch @@ -0,0 +1,20 @@ +Allow SYS_sched_getparam and SYS_sched_getscheduler +musl uses them for pthread_getschedparam() + +source: https://git.alpinelinux.org/aports/commit/community/chromium?id=54af9f8ac24f52d382c5758e2445bf0206eff40e + +--- sandbox/policy/linux/bpf_renderer_policy_linux.cc.orig 2019-10-08 21:03:18.253080425 +0200 ++++ sandbox/policy/linux/bpf_renderer_policy_linux.cc 2019-10-08 21:04:19.648549718 +0200 +@@ -88,10 +88,10 @@ + case __NR_sysinfo: + case __NR_times: + case __NR_uname: +- return Allow(); +- case __NR_sched_getaffinity: + case __NR_sched_getparam: + case __NR_sched_getscheduler: ++ return Allow(); ++ case __NR_sched_getaffinity: + case __NR_sched_setscheduler: + return sandbox::RestrictSchedTarget(GetPolicyPid(), sysno); + case __NR_prlimit64: diff --git a/srcpkgs/electron12/files/patches/chromium-sndio.patch b/srcpkgs/electron12/files/patches/chromium-sndio.patch new file mode 100644 index 00000000000..d313b4a667c --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-sndio.patch @@ -0,0 +1,886 @@ +diff -Naur chromium-83.0.4103.97.orig/media/BUILD.gn chromium-83.0.4103.97/media/BUILD.gn +--- media/BUILD.gn.orig 2020-06-03 20:40:26.000000000 +0200 ++++ media/BUILD.gn 2020-06-13 17:32:28.510395975 +0200 +@@ -65,6 +65,9 @@ + defines += [ "DLOPEN_PULSEAUDIO" ] + } + } ++ if (use_sndio) { ++ defines += [ "USE_SNDIO" ] ++ } + if (use_cras) { + defines += [ "USE_CRAS" ] + } +diff -Naur chromium-83.0.4103.97.orig/media/audio/BUILD.gn chromium-83.0.4103.97/media/audio/BUILD.gn +--- media/audio/BUILD.gn.orig 2020-06-03 20:39:37.000000000 +0200 ++++ media/audio/BUILD.gn 2020-06-13 17:32:28.511395969 +0200 +@@ -236,6 +236,17 @@ + sources += [ "linux/audio_manager_linux.cc" ] + } + ++ if (use_sndio) { ++ libs += [ "sndio" ] ++ sources += [ ++ "sndio/audio_manager_sndio.cc", ++ "sndio/sndio_input.cc", ++ "sndio/sndio_input.h", ++ "sndio/sndio_output.cc", ++ "sndio/sndio_output.h" ++ ] ++ } ++ + if (use_alsa) { + libs += [ "asound" ] + sources += [ +diff -Naur chromium-83.0.4103.97.orig/media/audio/linux/audio_manager_linux.cc chromium-83.0.4103.97/media/audio/linux/audio_manager_linux.cc +--- media/audio/linux/audio_manager_linux.cc.orig 2020-06-03 20:39:37.000000000 +0200 ++++ media/audio/linux/audio_manager_linux.cc 2020-06-13 18:09:43.623333167 +0200 +@@ -19,6 +19,11 @@ + #include "media/audio/pulse/audio_manager_pulse.h" + #include "media/audio/pulse/pulse_util.h" + #endif ++#if defined(USE_SNDIO) ++#include "media/audio/sndio/audio_manager_sndio.h" ++#include "media/audio/sndio/sndio_input.h" ++#include "media/audio/sndio/sndio_output.h" ++#endif + + namespace media { + +@@ -26,7 +31,8 @@ + kPulse, + kAlsa, + kCras, +- kAudioIOMax = kCras // Must always be equal to largest logged entry. ++ kSndio, ++ kAudioIOMax = kSndio // Must always be equal to largest logged entry. + }; + + std::unique_ptr CreateAudioManager( +@@ -39,6 +45,16 @@ + audio_log_factory); + } + ++#if defined(USE_SNDIO) ++ struct sio_hdl *hdl = sio_open(SIO_DEVANY, SIO_PLAY, 0); ++ if (hdl != NULL) { ++ sio_close(hdl); ++ UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kSndio, kAudioIOMax + 1); ++ return std::make_unique(std::move(audio_thread), ++ audio_log_factory); ++ } ++#endif ++ + #if defined(USE_CRAS) + if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseCras)) { + UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kCras, kAudioIOMax + 1); +diff -Naur chromium-83.0.4103.97.orig/media/audio/sndio/audio_manager_sndio.cc chromium-83.0.4103.97/media/audio/sndio/audio_manager_sndio.cc +--- media/audio/sndio/audio_manager_sndio.cc.orig 1970-01-01 01:00:00.000000000 +0100 ++++ media/audio/sndio/audio_manager_sndio.cc 2020-06-13 17:32:28.511395969 +0200 +@@ -0,0 +1,148 @@ ++// Copyright (c) 2012 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "media/audio/sndio/audio_manager_sndio.h" ++ ++#include "base/metrics/histogram_macros.h" ++#include "base/memory/ptr_util.h" ++#include "media/audio/audio_device_description.h" ++#include "media/audio/audio_output_dispatcher.h" ++#include "media/audio/sndio/sndio_input.h" ++#include "media/audio/sndio/sndio_output.h" ++#include "media/base/limits.h" ++#include "media/base/media_switches.h" ++ ++namespace media { ++ ++ ++// Maximum number of output streams that can be open simultaneously. ++static const int kMaxOutputStreams = 4; ++ ++// Default sample rate for input and output streams. ++static const int kDefaultSampleRate = 48000; ++ ++void AddDefaultDevice(AudioDeviceNames* device_names) { ++ DCHECK(device_names->empty()); ++ device_names->push_front(AudioDeviceName::CreateDefault()); ++} ++ ++bool AudioManagerSndio::HasAudioOutputDevices() { ++ return true; ++} ++ ++bool AudioManagerSndio::HasAudioInputDevices() { ++ return true; ++} ++ ++void AudioManagerSndio::GetAudioInputDeviceNames( ++ AudioDeviceNames* device_names) { ++ DCHECK(device_names->empty()); ++ AddDefaultDevice(device_names); ++} ++ ++void AudioManagerSndio::GetAudioOutputDeviceNames( ++ AudioDeviceNames* device_names) { ++ AddDefaultDevice(device_names); ++} ++ ++const char* AudioManagerSndio::GetName() { ++ return "SNDIO"; ++} ++ ++AudioParameters AudioManagerSndio::GetInputStreamParameters( ++ const std::string& device_id) { ++ static const int kDefaultInputBufferSize = 1024; ++ ++ int user_buffer_size = GetUserBufferSize(); ++ int buffer_size = user_buffer_size ? ++ user_buffer_size : kDefaultInputBufferSize; ++ ++ return AudioParameters( ++ AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO, ++ kDefaultSampleRate, buffer_size); ++} ++ ++AudioManagerSndio::AudioManagerSndio(std::unique_ptr audio_thread, ++ AudioLogFactory* audio_log_factory) ++ : AudioManagerBase(std::move(audio_thread), ++ audio_log_factory) { ++ DLOG(WARNING) << "AudioManagerSndio"; ++ SetMaxOutputStreamsAllowed(kMaxOutputStreams); ++} ++ ++AudioManagerSndio::~AudioManagerSndio() { ++ Shutdown(); ++} ++ ++AudioOutputStream* AudioManagerSndio::MakeLinearOutputStream( ++ const AudioParameters& params, ++ const LogCallback& log_callback) { ++ DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); ++ return MakeOutputStream(params); ++} ++ ++AudioOutputStream* AudioManagerSndio::MakeLowLatencyOutputStream( ++ const AudioParameters& params, ++ const std::string& device_id, ++ const LogCallback& log_callback) { ++ DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!"; ++ DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); ++ return MakeOutputStream(params); ++} ++ ++AudioInputStream* AudioManagerSndio::MakeLinearInputStream( ++ const AudioParameters& params, ++ const std::string& device_id, ++ const LogCallback& log_callback) { ++ DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); ++ return MakeInputStream(params); ++} ++ ++AudioInputStream* AudioManagerSndio::MakeLowLatencyInputStream( ++ const AudioParameters& params, ++ const std::string& device_id, ++ const LogCallback& log_callback) { ++ DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); ++ return MakeInputStream(params); ++} ++ ++AudioParameters AudioManagerSndio::GetPreferredOutputStreamParameters( ++ const std::string& output_device_id, ++ const AudioParameters& input_params) { ++ // TODO(tommi): Support |output_device_id|. ++ DLOG_IF(ERROR, !output_device_id.empty()) << "Not implemented!"; ++ static const int kDefaultOutputBufferSize = 2048; ++ ++ ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO; ++ int sample_rate = kDefaultSampleRate; ++ int buffer_size = kDefaultOutputBufferSize; ++ if (input_params.IsValid()) { ++ sample_rate = input_params.sample_rate(); ++ channel_layout = input_params.channel_layout(); ++ buffer_size = std::min(buffer_size, input_params.frames_per_buffer()); ++ } ++ ++ int user_buffer_size = GetUserBufferSize(); ++ if (user_buffer_size) ++ buffer_size = user_buffer_size; ++ ++ return AudioParameters( ++ AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, ++ sample_rate, buffer_size); ++} ++ ++AudioInputStream* AudioManagerSndio::MakeInputStream( ++ const AudioParameters& params) { ++ DLOG(WARNING) << "MakeInputStream"; ++ return new SndioAudioInputStream(this, ++ AudioDeviceDescription::kDefaultDeviceId, params); ++} ++ ++AudioOutputStream* AudioManagerSndio::MakeOutputStream( ++ const AudioParameters& params) { ++ DLOG(WARNING) << "MakeOutputStream"; ++ return new SndioAudioOutputStream(params, this); ++} ++ ++} // namespace media +diff -Naur chromium-83.0.4103.97.orig/media/audio/sndio/audio_manager_sndio.h chromium-83.0.4103.97/media/audio/sndio/audio_manager_sndio.h +--- media/audio/sndio/audio_manager_sndio.h.orig 1970-01-01 01:00:00.000000000 +0100 ++++ media/audio/sndio/audio_manager_sndio.h 2020-06-13 17:32:28.511395969 +0200 +@@ -0,0 +1,65 @@ ++// Copyright (c) 2012 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef MEDIA_AUDIO_SNDIO_AUDIO_MANAGER_SNDIO_H_ ++#define MEDIA_AUDIO_SNDIO_AUDIO_MANAGER_SNDIO_H_ ++ ++#include ++ ++#include "base/compiler_specific.h" ++#include "base/macros.h" ++#include "base/memory/ref_counted.h" ++#include "base/threading/thread.h" ++#include "media/audio/audio_manager_base.h" ++ ++namespace media { ++ ++class MEDIA_EXPORT AudioManagerSndio : public AudioManagerBase { ++ public: ++ AudioManagerSndio(std::unique_ptr audio_thread, ++ AudioLogFactory* audio_log_factory); ++ ~AudioManagerSndio() override; ++ ++ // Implementation of AudioManager. ++ bool HasAudioOutputDevices() override; ++ bool HasAudioInputDevices() override; ++ void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; ++ void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override; ++ AudioParameters GetInputStreamParameters( ++ const std::string& device_id) override; ++ const char* GetName() override; ++ ++ // Implementation of AudioManagerBase. ++ AudioOutputStream* MakeLinearOutputStream( ++ const AudioParameters& params, ++ const LogCallback& log_callback) override; ++ AudioOutputStream* MakeLowLatencyOutputStream( ++ const AudioParameters& params, ++ const std::string& device_id, ++ const LogCallback& log_callback) override; ++ AudioInputStream* MakeLinearInputStream( ++ const AudioParameters& params, ++ const std::string& device_id, ++ const LogCallback& log_callback) override; ++ AudioInputStream* MakeLowLatencyInputStream( ++ const AudioParameters& params, ++ const std::string& device_id, ++ const LogCallback& log_callback) override; ++ ++ protected: ++ AudioParameters GetPreferredOutputStreamParameters( ++ const std::string& output_device_id, ++ const AudioParameters& input_params) override; ++ ++ private: ++ // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream. ++ AudioOutputStream* MakeOutputStream(const AudioParameters& params); ++ AudioInputStream* MakeInputStream(const AudioParameters& params); ++ ++ DISALLOW_COPY_AND_ASSIGN(AudioManagerSndio); ++}; ++ ++} // namespace media ++ ++#endif // MEDIA_AUDIO_SNDIO_AUDIO_MANAGER_SNDIO_H_ +diff -Naur chromium-83.0.4103.97.orig/media/audio/sndio/sndio_input.cc chromium-83.0.4103.97/media/audio/sndio/sndio_input.cc +--- media/audio/sndio/sndio_input.cc.orig 1970-01-01 01:00:00.000000000 +0100 ++++ media/audio/sndio/sndio_input.cc 2020-06-13 17:32:28.511395969 +0200 +@@ -0,0 +1,200 @@ ++// Copyright 2013 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "base/bind.h" ++#include "base/logging.h" ++#include "base/macros.h" ++#include "media/base/audio_timestamp_helper.h" ++#include "media/audio/sndio/audio_manager_sndio.h" ++#include "media/audio/audio_manager.h" ++#include "media/audio/sndio/sndio_input.h" ++ ++namespace media { ++ ++static const SampleFormat kSampleFormat = kSampleFormatS16; ++ ++void SndioAudioInputStream::OnMoveCallback(void *arg, int delta) ++{ ++ SndioAudioInputStream* self = static_cast(arg); ++ ++ self->hw_delay += delta; ++} ++ ++void *SndioAudioInputStream::ThreadEntry(void *arg) { ++ SndioAudioInputStream* self = static_cast(arg); ++ ++ self->ThreadLoop(); ++ return NULL; ++} ++ ++SndioAudioInputStream::SndioAudioInputStream(AudioManagerBase* manager, ++ const std::string& device_name, ++ const AudioParameters& params) ++ : manager(manager), ++ params(params), ++ audio_bus(AudioBus::Create(params)), ++ state(kClosed) { ++} ++ ++SndioAudioInputStream::~SndioAudioInputStream() { ++ if (state != kClosed) ++ Close(); ++} ++ ++bool SndioAudioInputStream::Open() { ++ struct sio_par par; ++ int sig; ++ ++ if (state != kClosed) ++ return false; ++ ++ if (params.format() != AudioParameters::AUDIO_PCM_LINEAR && ++ params.format() != AudioParameters::AUDIO_PCM_LOW_LATENCY) { ++ LOG(WARNING) << "Unsupported audio format."; ++ return false; ++ } ++ ++ sio_initpar(&par); ++ par.rate = params.sample_rate(); ++ par.rchan = params.channels(); ++ par.bits = SampleFormatToBitsPerChannel(kSampleFormat); ++ par.bps = par.bits / 8; ++ par.sig = sig = par.bits != 8 ? 1 : 0; ++ par.le = SIO_LE_NATIVE; ++ par.appbufsz = params.frames_per_buffer(); ++ ++ hdl = sio_open(SIO_DEVANY, SIO_REC, 0); ++ ++ if (hdl == NULL) { ++ LOG(ERROR) << "Couldn't open audio device."; ++ return false; ++ } ++ ++ if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) { ++ LOG(ERROR) << "Couldn't set audio parameters."; ++ goto bad_close; ++ } ++ ++ if (par.rate != (unsigned int)params.sample_rate() || ++ par.rchan != (unsigned int)params.channels() || ++ par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) || ++ par.sig != (unsigned int)sig || ++ (par.bps > 1 && par.le != SIO_LE_NATIVE) || ++ (par.bits != par.bps * 8)) { ++ LOG(ERROR) << "Unsupported audio parameters."; ++ goto bad_close; ++ } ++ state = kStopped; ++ buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)]; ++ sio_onmove(hdl, &OnMoveCallback, this); ++ return true; ++bad_close: ++ sio_close(hdl); ++ return false; ++} ++ ++void SndioAudioInputStream::Start(AudioInputCallback* cb) { ++ ++ StartAgc(); ++ ++ state = kRunning; ++ hw_delay = 0; ++ callback = cb; ++ sio_start(hdl); ++ if (pthread_create(&thread, NULL, &ThreadEntry, this) != 0) { ++ LOG(ERROR) << "Failed to create real-time thread for recording."; ++ sio_stop(hdl); ++ state = kStopped; ++ } ++} ++ ++void SndioAudioInputStream::Stop() { ++ ++ if (state == kStopped) ++ return; ++ ++ state = kStopWait; ++ pthread_join(thread, NULL); ++ sio_stop(hdl); ++ state = kStopped; ++ ++ StopAgc(); ++} ++ ++void SndioAudioInputStream::Close() { ++ ++ if (state == kClosed) ++ return; ++ ++ if (state == kRunning) ++ Stop(); ++ ++ state = kClosed; ++ delete [] buffer; ++ sio_close(hdl); ++ ++ manager->ReleaseInputStream(this); ++} ++ ++double SndioAudioInputStream::GetMaxVolume() { ++ // Not supported ++ return 0.0; ++} ++ ++void SndioAudioInputStream::SetVolume(double volume) { ++ // Not supported. Do nothing. ++} ++ ++double SndioAudioInputStream::GetVolume() { ++ // Not supported. ++ return 0.0; ++} ++ ++bool SndioAudioInputStream::IsMuted() { ++ // Not supported. ++ return false; ++} ++ ++void SndioAudioInputStream::SetOutputDeviceForAec( ++ const std::string& output_device_id) { ++ // Not supported. ++} ++ ++void SndioAudioInputStream::ThreadLoop(void) { ++ size_t todo, n; ++ char *data; ++ unsigned int nframes; ++ double normalized_volume = 0.0; ++ ++ nframes = audio_bus->frames(); ++ ++ while (state == kRunning && !sio_eof(hdl)) { ++ ++ GetAgcVolume(&normalized_volume); ++ ++ // read one block ++ todo = nframes * params.GetBytesPerFrame(kSampleFormat); ++ data = buffer; ++ while (todo > 0) { ++ n = sio_read(hdl, data, todo); ++ if (n == 0) ++ return; // unrecoverable I/O error ++ todo -= n; ++ data += n; ++ } ++ hw_delay -= nframes; ++ ++ // convert frames count to TimeDelta ++ const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay, ++ params.sample_rate()); ++ ++ // push into bus ++ audio_bus->FromInterleaved(buffer, nframes, SampleFormatToBytesPerChannel(kSampleFormat)); ++ ++ // invoke callback ++ callback->OnData(audio_bus.get(), base::TimeTicks::Now() - delay, 1.); ++ } ++} ++ ++} // namespace media +diff -Naur chromium-83.0.4103.97.orig/media/audio/sndio/sndio_input.h chromium-83.0.4103.97/media/audio/sndio/sndio_input.h +--- media/audio/sndio/sndio_input.h.orig 1970-01-01 01:00:00.000000000 +0100 ++++ media/audio/sndio/sndio_input.h 2020-06-13 17:32:28.511395969 +0200 +@@ -0,0 +1,91 @@ ++// Copyright 2013 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_ ++#define MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_ ++ ++#include ++#include ++#include ++ ++#include "base/compiler_specific.h" ++#include "base/macros.h" ++#include "base/memory/weak_ptr.h" ++#include "base/time/time.h" ++#include "media/audio/agc_audio_stream.h" ++#include "media/audio/audio_io.h" ++#include "media/audio/audio_device_description.h" ++#include "media/base/audio_parameters.h" ++ ++namespace media { ++ ++class AudioManagerBase; ++ ++// Implementation of AudioOutputStream using sndio(7) ++class SndioAudioInputStream : public AgcAudioStream { ++ public: ++ // Pass this to the constructor if you want to attempt auto-selection ++ // of the audio recording device. ++ static const char kAutoSelectDevice[]; ++ ++ // Create a PCM Output stream for the SNDIO device identified by ++ // |device_name|. If unsure of what to use for |device_name|, use ++ // |kAutoSelectDevice|. ++ SndioAudioInputStream(AudioManagerBase* audio_manager, ++ const std::string& device_name, ++ const AudioParameters& params); ++ ++ ~SndioAudioInputStream() override; ++ ++ // Implementation of AudioInputStream. ++ bool Open() override; ++ void Start(AudioInputCallback* callback) override; ++ void Stop() override; ++ void Close() override; ++ double GetMaxVolume() override; ++ void SetVolume(double volume) override; ++ double GetVolume() override; ++ bool IsMuted() override; ++ void SetOutputDeviceForAec(const std::string& output_device_id) override; ++ ++ private: ++ ++ enum StreamState { ++ kClosed, // Not opened yet ++ kStopped, // Device opened, but not started yet ++ kRunning, // Started, device playing ++ kStopWait // Stopping, waiting for the real-time thread to exit ++ }; ++ ++ // C-style call-backs ++ static void OnMoveCallback(void *arg, int delta); ++ static void* ThreadEntry(void *arg); ++ ++ // Continuously moves data from the device to the consumer ++ void ThreadLoop(); ++ // Our creator, the audio manager needs to be notified when we close. ++ AudioManagerBase* manager; ++ // Parameters of the source ++ AudioParameters params; ++ // We store data here for consumer ++ std::unique_ptr audio_bus; ++ // Call-back that consumes recorded data ++ AudioInputCallback* callback; // Valid during a recording session. ++ // Handle of the audio device ++ struct sio_hdl* hdl; ++ // Current state of the stream ++ enum StreamState state; ++ // High priority thread running ThreadLoop() ++ pthread_t thread; ++ // Number of frames buffered in the hardware ++ int hw_delay; ++ // Temporary buffer where data is stored sndio-compatible format ++ char* buffer; ++ ++ DISALLOW_COPY_AND_ASSIGN(SndioAudioInputStream); ++}; ++ ++} // namespace media ++ ++#endif // MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_ +diff -Naur chromium-83.0.4103.97.orig/media/audio/sndio/sndio_output.cc chromium-83.0.4103.97/media/audio/sndio/sndio_output.cc +--- media/audio/sndio/sndio_output.cc.orig 1970-01-01 01:00:00.000000000 +0100 ++++ media/audio/sndio/sndio_output.cc 2020-06-13 17:32:28.511395969 +0200 +@@ -0,0 +1,183 @@ ++// Copyright (c) 2012 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#include "base/logging.h" ++#include "base/time/time.h" ++#include "base/time/default_tick_clock.h" ++#include "media/audio/audio_manager_base.h" ++#include "media/base/audio_timestamp_helper.h" ++#include "media/audio/sndio/sndio_output.h" ++ ++namespace media { ++ ++static const SampleFormat kSampleFormat = kSampleFormatS16; ++ ++void SndioAudioOutputStream::OnMoveCallback(void *arg, int delta) { ++ SndioAudioOutputStream* self = static_cast(arg); ++ ++ self->hw_delay -= delta; ++} ++ ++void SndioAudioOutputStream::OnVolCallback(void *arg, unsigned int vol) { ++ SndioAudioOutputStream* self = static_cast(arg); ++ ++ self->vol = vol; ++} ++ ++void *SndioAudioOutputStream::ThreadEntry(void *arg) { ++ SndioAudioOutputStream* self = static_cast(arg); ++ ++ self->ThreadLoop(); ++ return NULL; ++} ++ ++SndioAudioOutputStream::SndioAudioOutputStream(const AudioParameters& params, ++ AudioManagerBase* manager) ++ : manager(manager), ++ params(params), ++ audio_bus(AudioBus::Create(params)), ++ state(kClosed), ++ mutex(PTHREAD_MUTEX_INITIALIZER) { ++} ++ ++SndioAudioOutputStream::~SndioAudioOutputStream() { ++ if (state != kClosed) ++ Close(); ++} ++ ++bool SndioAudioOutputStream::Open() { ++ struct sio_par par; ++ int sig; ++ ++ if (params.format() != AudioParameters::AUDIO_PCM_LINEAR && ++ params.format() != AudioParameters::AUDIO_PCM_LOW_LATENCY) { ++ LOG(WARNING) << "Unsupported audio format."; ++ return false; ++ } ++ sio_initpar(&par); ++ par.rate = params.sample_rate(); ++ par.pchan = params.channels(); ++ par.bits = SampleFormatToBitsPerChannel(kSampleFormat); ++ par.bps = par.bits / 8; ++ par.sig = sig = par.bits != 8 ? 1 : 0; ++ par.le = SIO_LE_NATIVE; ++ par.appbufsz = params.frames_per_buffer(); ++ ++ hdl = sio_open(SIO_DEVANY, SIO_PLAY, 0); ++ if (hdl == NULL) { ++ LOG(ERROR) << "Couldn't open audio device."; ++ return false; ++ } ++ if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) { ++ LOG(ERROR) << "Couldn't set audio parameters."; ++ goto bad_close; ++ } ++ if (par.rate != (unsigned int)params.sample_rate() || ++ par.pchan != (unsigned int)params.channels() || ++ par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) || ++ par.sig != (unsigned int)sig || ++ (par.bps > 1 && par.le != SIO_LE_NATIVE) || ++ (par.bits != par.bps * 8)) { ++ LOG(ERROR) << "Unsupported audio parameters."; ++ goto bad_close; ++ } ++ state = kStopped; ++ volpending = 0; ++ vol = 0; ++ buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)]; ++ sio_onmove(hdl, &OnMoveCallback, this); ++ sio_onvol(hdl, &OnVolCallback, this); ++ return true; ++ bad_close: ++ sio_close(hdl); ++ return false; ++} ++ ++void SndioAudioOutputStream::Close() { ++ if (state == kClosed) ++ return; ++ if (state == kRunning) ++ Stop(); ++ state = kClosed; ++ delete [] buffer; ++ sio_close(hdl); ++ manager->ReleaseOutputStream(this); // Calls the destructor ++} ++ ++void SndioAudioOutputStream::Start(AudioSourceCallback* callback) { ++ state = kRunning; ++ hw_delay = 0; ++ source = callback; ++ sio_start(hdl); ++ if (pthread_create(&thread, NULL, &ThreadEntry, this) != 0) { ++ LOG(ERROR) << "Failed to create real-time thread."; ++ sio_stop(hdl); ++ state = kStopped; ++ } ++} ++ ++void SndioAudioOutputStream::Stop() { ++ if (state == kStopped) ++ return; ++ state = kStopWait; ++ pthread_join(thread, NULL); ++ sio_stop(hdl); ++ state = kStopped; ++} ++ ++void SndioAudioOutputStream::SetVolume(double v) { ++ pthread_mutex_lock(&mutex); ++ vol = v * SIO_MAXVOL; ++ volpending = 1; ++ pthread_mutex_unlock(&mutex); ++} ++ ++void SndioAudioOutputStream::GetVolume(double* v) { ++ pthread_mutex_lock(&mutex); ++ *v = vol * (1. / SIO_MAXVOL); ++ pthread_mutex_unlock(&mutex); ++} ++ ++// This stream is always used with sub second buffer sizes, where it's ++// sufficient to simply always flush upon Start(). ++void SndioAudioOutputStream::Flush() {} ++ ++void SndioAudioOutputStream::ThreadLoop(void) { ++ int avail, count, result; ++ ++ while (state == kRunning) { ++ // Update volume if needed ++ pthread_mutex_lock(&mutex); ++ if (volpending) { ++ volpending = 0; ++ sio_setvol(hdl, vol); ++ } ++ pthread_mutex_unlock(&mutex); ++ ++ // Get data to play ++ const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay, ++ params.sample_rate()); ++ count = source->OnMoreData(delay, base::TimeTicks::Now(), 0, audio_bus.get()); ++ audio_bus->ToInterleaved(count, SampleFormatToBytesPerChannel(kSampleFormat), buffer); ++ if (count == 0) { ++ // We have to submit something to the device ++ count = audio_bus->frames(); ++ memset(buffer, 0, count * params.GetBytesPerFrame(kSampleFormat)); ++ LOG(WARNING) << "No data to play, running empty cycle."; ++ } ++ ++ // Submit data to the device ++ avail = count * params.GetBytesPerFrame(kSampleFormat); ++ result = sio_write(hdl, buffer, avail); ++ if (result == 0) { ++ LOG(WARNING) << "Audio device disconnected."; ++ break; ++ } ++ ++ // Update hardware pointer ++ hw_delay += count; ++ } ++} ++ ++} // namespace media +diff -Naur chromium-83.0.4103.97.orig/media/audio/sndio/sndio_output.h chromium-83.0.4103.97/media/audio/sndio/sndio_output.h +--- media/audio/sndio/sndio_output.h.orig 1970-01-01 01:00:00.000000000 +0100 ++++ media/audio/sndio/sndio_output.h 2020-06-13 17:32:28.511395969 +0200 +@@ -0,0 +1,86 @@ ++// Copyright (c) 2012 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_ ++#define MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_ ++ ++#include ++#include ++ ++#include "base/time/tick_clock.h" ++#include "base/time/time.h" ++#include "media/audio/audio_io.h" ++ ++namespace media { ++ ++class AudioManagerBase; ++ ++// Implementation of AudioOutputStream using sndio(7) ++class SndioAudioOutputStream : public AudioOutputStream { ++ public: ++ // The manager is creating this object ++ SndioAudioOutputStream(const AudioParameters& params, ++ AudioManagerBase* manager); ++ virtual ~SndioAudioOutputStream(); ++ ++ // Implementation of AudioOutputStream. ++ bool Open() override; ++ void Close() override; ++ void Start(AudioSourceCallback* callback) override; ++ void Stop() override; ++ void SetVolume(double volume) override; ++ void GetVolume(double* volume) override; ++ void Flush() override; ++ ++ friend void sndio_onmove(void *arg, int delta); ++ friend void sndio_onvol(void *arg, unsigned int vol); ++ friend void *sndio_threadstart(void *arg); ++ ++ private: ++ enum StreamState { ++ kClosed, // Not opened yet ++ kStopped, // Device opened, but not started yet ++ kRunning, // Started, device playing ++ kStopWait // Stopping, waiting for the real-time thread to exit ++ }; ++ ++ // C-style call-backs ++ static void OnMoveCallback(void *arg, int delta); ++ static void OnVolCallback(void *arg, unsigned int vol); ++ static void* ThreadEntry(void *arg); ++ ++ // Continuously moves data from the producer to the device ++ void ThreadLoop(void); ++ ++ // Our creator, the audio manager needs to be notified when we close. ++ AudioManagerBase* manager; ++ // Parameters of the source ++ AudioParameters params; ++ // Source stores data here ++ std::unique_ptr audio_bus; ++ // Call-back that produces data to play ++ AudioSourceCallback* source; ++ // Handle of the audio device ++ struct sio_hdl* hdl; ++ // Current state of the stream ++ enum StreamState state; ++ // High priority thread running ThreadLoop() ++ pthread_t thread; ++ // Protects vol, volpending and hw_delay ++ pthread_mutex_t mutex; ++ // Current volume in the 0..SIO_MAXVOL range ++ int vol; ++ // Set to 1 if volumes must be refreshed in the realtime thread ++ int volpending; ++ // Number of frames buffered in the hardware ++ int hw_delay; ++ // Temporary buffer where data is stored sndio-compatible format ++ char* buffer; ++ ++ DISALLOW_COPY_AND_ASSIGN(SndioAudioOutputStream); ++}; ++ ++} // namespace media ++ ++#endif // MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_ +diff -Naur chromium-83.0.4103.97.orig/media/media_options.gni chromium-83.0.4103.97/media/media_options.gni +--- media/media_options.gni.orig 2020-06-03 20:40:26.000000000 +0200 ++++ media/media_options.gni 2020-06-13 17:32:28.512395963 +0200 +@@ -119,6 +119,9 @@ + # Enables runtime selection of ALSA library for audio. + use_alsa = false + ++ # Enable runtime selection of sndio(7) ++ use_sndio = false ++ + # Alsa should be used on non-Android, non-Mac POSIX systems. + # Alsa should be used on desktop Chromecast and audio-only Chromecast builds. + if (is_posix && !is_android && !is_mac && diff --git a/srcpkgs/electron12/files/patches/chromium-system-nodejs.patch b/srcpkgs/electron12/files/patches/chromium-system-nodejs.patch new file mode 100644 index 00000000000..99d653955f0 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-system-nodejs.patch @@ -0,0 +1,22 @@ +diff --git third_party/node/node.py third_party/node/node.py +index 8097e2c49..10e6a16ea 100755 +--- third_party/node/node.py ++++ third_party/node/node.py +@@ -10,11 +10,12 @@ import sys + + + def GetBinaryPath(): +- return os_path.join(os_path.dirname(__file__), *{ +- 'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'), +- 'Linux': ('linux', 'node-linux-x64', 'bin', 'node'), +- 'Windows': ('win', 'node.exe'), +- }[platform.system()]) ++ return "/usr/bin/node" ++ #return os_path.join(os_path.dirname(__file__), *{ ++ # 'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'), ++ # 'Linux': ('linux', 'node-linux-x64', 'bin', 'node'), ++ # 'Windows': ('win', 'node.exe'), ++ #}[platform.system()]) + + + def RunNode(cmd_parts, stdout=None): diff --git a/srcpkgs/electron12/files/patches/chromium-time64.patch b/srcpkgs/electron12/files/patches/chromium-time64.patch new file mode 100644 index 00000000000..b1ad9359003 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-time64.patch @@ -0,0 +1,51 @@ +Description: allow sandboxed code to call gettime64 + Add __NR_clock_gettime64 and __NR_clock_nanosleep_time64 to syscall whitelist + and clock selection parameter filtering code. + + Add __NR_utimensat_time64 to syscall whitelist + + Conditionalise additions on the new calls existing, because they do not exist + on 64-bit architectures. +Author: Peter Michael Green + +Index: chromium-83.0.4103.116/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +=================================================================== +--- sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc ++++ sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +@@ -148,7 +148,11 @@ ResultExpr EvaluateSyscallImpl(int fs_de + return Allow(); + #endif + ++#ifdef __NR_clock_gettime64 ++ if (sysno == __NR_clock_gettime || sysno == __NR_clock_gettime64 || sysno == __NR_clock_nanosleep || sysno == __NR_clock_nanosleep_time64) { ++#else + if (sysno == __NR_clock_gettime || sysno == __NR_clock_nanosleep) { ++#endif + return RestrictClockID(); + } + +Index: chromium-83.0.4103.116/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +=================================================================== +--- sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc ++++ sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +@@ -38,6 +38,10 @@ bool SyscallSets::IsAllowedGettime(int s + case __NR_clock_getres: // Allowed only on Android with parameters + // filtered by RestrictClokID(). + case __NR_clock_gettime: // Parameters filtered by RestrictClockID(). ++#ifdef __NR_clock_gettime64 ++ case __NR_clock_gettime64: // Parameters filtered by RestrictClockID(). ++ case __NR_clock_nanosleep_time64: // Parameters filtered by RestrictClockID(). ++#endif + case __NR_clock_nanosleep: // Parameters filtered by RestrictClockID(). + case __NR_clock_settime: // Privileged. + #if defined(__i386__) || \ +@@ -159,6 +163,9 @@ bool SyscallSets::IsFileSystem(int sysno + case __NR_utime: + #endif + case __NR_utimensat: // New. ++#ifdef __NR_utimensat_time64 ++ case __NR_utimensat_time64: ++#endif + return true; + default: + return false; diff --git a/srcpkgs/electron12/files/patches/chromium-webrtc-include.patch b/srcpkgs/electron12/files/patches/chromium-webrtc-include.patch new file mode 100644 index 00000000000..92ec272a89a --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-webrtc-include.patch @@ -0,0 +1,10 @@ +--- third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc.orig 2019-02-21 21:21:24.488058990 +0100 ++++ third_party/webrtc/modules/desktop_capture/linux/window_capturer_x11.cc 2019-02-21 21:21:36.151961064 +0100 +@@ -16,6 +16,7 @@ + + #include + #include ++#include + #include + + #include "modules/desktop_capture/desktop_frame.h" diff --git a/srcpkgs/electron12/files/patches/chromium-webrtc-r0.patch b/srcpkgs/electron12/files/patches/chromium-webrtc-r0.patch new file mode 100644 index 00000000000..70bbede472f --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-webrtc-r0.patch @@ -0,0 +1,33 @@ +Upstream: Yes, https://webrtc-review.googlesource.com/9384 +Reason: Fixes musl builds of webrtc + +From 7f90e2cceda0458cf56026eb6ccffb961a47804b Mon Sep 17 00:00:00 2001 +From: Raphael Kubo da Costa +Date: Fri, 13 Oct 2017 15:49:32 +0200 +Subject: [PATCH] IWYU: Include math.h for round(3). + +math.h was being implicitly included, which can break the build with +alternative libc implementations. + +Bug: None +Change-Id: I969b320b65d0f44abb33d3e1036cfbcb859a4952 +Reviewed-on: https://webrtc-review.googlesource.com/9384 +Reviewed-by: Tommi +Commit-Queue: Raphael Kubo da Costa (rakuco) +Cr-Commit-Position: refs/heads/master@{#20292} +--- + +--- third_party/webrtc/p2p/base/port.cc ++++ third_party/webrtc/p2p/base/port.cc +@@ -10,6 +10,8 @@ + + #include "p2p/base/port.h" + ++#include ++ + #include + #include + +-- +2.15.0.rc2 + diff --git a/srcpkgs/electron12/files/patches/chromium-webrtc-size_t.patch b/srcpkgs/electron12/files/patches/chromium-webrtc-size_t.patch new file mode 100644 index 00000000000..ef7ea09cf63 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-webrtc-size_t.patch @@ -0,0 +1,10 @@ +--- third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h 2020-08-10 20:42:29.000000000 +0200 ++++ third_party/webrtc/modules/audio_processing/aec3/clockdrift_detector.h 2020-09-04 12:47:07.014833633 +0200 +@@ -12,6 +12,7 @@ + #define MODULES_AUDIO_PROCESSING_AEC3_CLOCKDRIFT_DETECTOR_H_ + + #include ++#include + + namespace webrtc { + diff --git a/srcpkgs/electron12/files/patches/chromium-xxx-ppc64le-libvpx.patch b/srcpkgs/electron12/files/patches/chromium-xxx-ppc64le-libvpx.patch new file mode 100644 index 00000000000..792befb3a39 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-xxx-ppc64le-libvpx.patch @@ -0,0 +1,72 @@ +Uses generic target for now. To use ppc64le, change --target to ppc64le-gnu +and add --enable-vsx, and change generic to ppc for the rtcd header. + +From 18e6c5c55cfae0cfb458d8210d7bc709360a0e90 Mon Sep 17 00:00:00 2001 +From: q66 +Date: Wed, 9 Sep 2020 19:08:25 +0200 +Subject: [PATCH] enable generation of ppc64 libvpx bits + +this doesn't update the gni file, that's done from +the template by running the appropriate scripts +--- + third_party/libvpx/BUILD.gn | 4 ++++ + third_party/libvpx/generate_gni.sh | 9 +++++++++ + 2 files changed, 13 insertions(+) + +diff --git third_party/libvpx/BUILD.gn third_party/libvpx/BUILD.gn +index 7198e59..3300485 100644 +--- third_party/libvpx/BUILD.gn ++++ third_party/libvpx/BUILD.gn +@@ -336,6 +336,8 @@ static_library("libvpx") { + } else { + sources = libvpx_srcs_arm64 + } ++ } else if (current_cpu == "ppc64") { ++ sources = libvpx_srcs_ppc64 + } + + configs -= [ "//build/config/compiler:chromium_code" ] +diff --git third_party/libvpx/generate_gni.sh third_party/libvpx/generate_gni.sh +index bcf84b0..8a3f4f1 100755 +--- third_party/libvpx/generate_gni.sh ++++ third_party/libvpx/generate_gni.sh +@@ -361,6 +361,7 @@ gen_config_files linux/arm-neon-highbd "--target=armv7-linux-gcc ${all_platforms + gen_config_files linux/arm64-highbd "--target=armv8-linux-gcc ${all_platforms} ${HIGHBD}" + gen_config_files linux/mipsel "--target=mips32-linux-gcc ${all_platforms}" + gen_config_files linux/mips64el "--target=mips64-linux-gcc ${all_platforms}" ++gen_config_files linux/ppc64 "--target=generic-gnu $HIGHBD ${all_platforms}" + gen_config_files linux/generic "--target=generic-gnu $HIGHBD ${all_platforms}" + gen_config_files win/arm64 "--target=arm64-win64-vs15 ${all_platforms} ${HIGHBD}" + gen_config_files win/ia32 "--target=x86-win32-vs14 ${all_platforms} ${x86_platforms}" +@@ -386,6 +387,7 @@ lint_config linux/arm-neon-highbd + lint_config linux/arm64-highbd + lint_config linux/mipsel + lint_config linux/mips64el ++lint_config linux/ppc64 + lint_config linux/generic + lint_config win/arm64 + lint_config win/ia32 +@@ -415,6 +417,7 @@ gen_rtcd_header linux/arm-neon-highbd armv7 + gen_rtcd_header linux/arm64-highbd armv8 + gen_rtcd_header linux/mipsel mipsel + gen_rtcd_header linux/mips64el mips64el ++gen_rtcd_header linux/ppc64 generic + gen_rtcd_header linux/generic generic + gen_rtcd_header win/arm64 armv8 + gen_rtcd_header win/ia32 x86 "${require_sse2}" +@@ -500,6 +503,12 @@ if [ -z $ONLY_CONFIGS ]; then + + echo "MIPS64 source list is identical to MIPS source list. No need to generate it." + ++ echo "Generate ppc64 source list." ++ config=$(print_config_basic linux/ppc64) ++ make_clean ++ make libvpx_srcs.txt target=libs $config > /dev/null ++ convert_srcs_to_project_files libvpx_srcs.txt libvpx_srcs_ppc64 ++ + echo "Generate NaCl source list." + config=$(print_config_basic nacl) + make_clean +-- +2.28.0 + diff --git a/srcpkgs/electron12/files/patches/chromium-xxx-ppc64le-support.patch b/srcpkgs/electron12/files/patches/chromium-xxx-ppc64le-support.patch new file mode 100644 index 00000000000..389ac3b7aa2 --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-xxx-ppc64le-support.patch @@ -0,0 +1,3635 @@ +commit 2c013a317b1114ef67cdbbc30824b28907b9ea94 +Author: Daniel Kolesa +Date: Wed Mar 3 19:08:29 2021 +0100 + + ppc64le support + +diff --git build/download_nacl_toolchains.py build/download_nacl_toolchains.py +index 286a92a27..ec36a85d3 100755 +--- build/download_nacl_toolchains.py ++++ build/download_nacl_toolchains.py +@@ -13,6 +13,10 @@ import sys + + + def Main(args): ++ # If `disable_nacl=1` is in GYP_DEFINES, exit ++ if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''): ++ return 0 ++ + script_dir = os.path.dirname(os.path.abspath(__file__)) + src_dir = os.path.dirname(script_dir) + nacl_dir = os.path.join(src_dir, 'native_client') +diff --git chrome/installer/linux/BUILD.gn chrome/installer/linux/BUILD.gn +index 35f01d0a4..28f2e7475 100644 +--- chrome/installer/linux/BUILD.gn ++++ chrome/installer/linux/BUILD.gn +@@ -94,8 +94,6 @@ packaging_files = packaging_files_binaries + [ + "$root_out_dir/xdg-mime", + "$root_out_dir/xdg-settings", + "$root_out_dir/locales/en-US.pak", +- "$root_out_dir/MEIPreload/manifest.json", +- "$root_out_dir/MEIPreload/preloaded_data.pb", + ] + + action_foreach("calculate_deb_dependencies") { +@@ -315,7 +313,6 @@ group("installer_deps") { + ":theme_files", + "//chrome", + "//chrome:packed_resources", +- "//chrome/browser/resources/media/mei_preload:component", + "//sandbox/linux:chrome_sandbox", + "//third_party/crashpad/crashpad/handler:crashpad_handler", + ] +diff --git sandbox/features.gni sandbox/features.gni +index db30ae6d6..9dc09bf53 100644 +--- sandbox/features.gni ++++ sandbox/features.gni +@@ -11,7 +11,8 @@ import("//build/config/nacl/config.gni") + use_seccomp_bpf = (is_linux || is_chromeos || is_android) && + (current_cpu == "x86" || current_cpu == "x64" || + current_cpu == "arm" || current_cpu == "arm64" || +- current_cpu == "mipsel" || current_cpu == "mips64el") ++ current_cpu == "mipsel" || current_cpu == "mips64el" || ++ current_cpu == "ppc64") + + use_seccomp_bpf = use_seccomp_bpf || is_nacl_nonsfi + +diff --git sandbox/linux/BUILD.gn sandbox/linux/BUILD.gn +index e9a94b461..cca1a5da5 100644 +--- sandbox/linux/BUILD.gn ++++ sandbox/linux/BUILD.gn +@@ -427,6 +427,8 @@ component("sandbox_services") { + + source_set("sandbox_services_headers") { + sources = [ ++ "system_headers/ppc64_linux_syscalls.h", ++ "system_headers/ppc64_linux_ucontext.h", + "system_headers/arm64_linux_syscalls.h", + "system_headers/arm_linux_syscalls.h", + "system_headers/arm_linux_ucontext.h", +diff --git sandbox/linux/bpf_dsl/linux_syscall_ranges.h sandbox/linux/bpf_dsl/linux_syscall_ranges.h +index 313511f22..0ca3a326f 100644 +--- sandbox/linux/bpf_dsl/linux_syscall_ranges.h ++++ sandbox/linux/bpf_dsl/linux_syscall_ranges.h +@@ -56,6 +56,13 @@ + #define MAX_PUBLIC_SYSCALL __NR_syscalls + #define MAX_SYSCALL MAX_PUBLIC_SYSCALL + ++#elif defined(__powerpc64__) ++ ++#include ++#define MIN_SYSCALL 0u ++#define MAX_PUBLIC_SYSCALL 386u ++#define MAX_SYSCALL MAX_PUBLIC_SYSCALL ++ + #else + #error "Unsupported architecture" + #endif +diff --git sandbox/linux/bpf_dsl/seccomp_macros.h sandbox/linux/bpf_dsl/seccomp_macros.h +index 1a407b952..a6aec544e 100644 +--- sandbox/linux/bpf_dsl/seccomp_macros.h ++++ sandbox/linux/bpf_dsl/seccomp_macros.h +@@ -16,6 +16,9 @@ + #if defined(__mips__) + // sys/user.h in eglibc misses size_t definition + #include ++#elif defined(__powerpc64__) ++// Manually define greg_t on ppc64 ++typedef unsigned long long greg_t; + #endif + #endif + +@@ -346,6 +349,51 @@ struct regs_struct { + #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3] + #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4] + #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5] ++ ++#elif defined(__powerpc64__) ++#include ++ ++typedef struct pt_regs regs_struct; ++ ++#ifdef ARCH_CPU_LITTLE_ENDIAN ++#define SECCOMP_ARCH AUDIT_ARCH_PPC64LE ++#else ++#define SECCOMP_ARCH AUDIT_ARCH_PPC64 ++#endif ++ ++#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.regs->gpr[_reg]) ++ ++#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, 3) ++#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, 0) ++#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.regs->nip ++#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, 3) ++#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, 4) ++#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, 5) ++#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, 6) ++#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, 7) ++#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, 8) ++ ++#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr)) ++#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch)) ++#define SECCOMP_IP_MSB_IDX \ ++ (offsetof(struct arch_seccomp_data, instruction_pointer) + 4) ++#define SECCOMP_IP_LSB_IDX \ ++ (offsetof(struct arch_seccomp_data, instruction_pointer) + 0) ++#define SECCOMP_ARG_MSB_IDX(nr) \ ++ (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4) ++#define SECCOMP_ARG_LSB_IDX(nr) \ ++ (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0) ++ ++#define SECCOMP_PT_RESULT(_regs) (_regs).gpr[3] ++#define SECCOMP_PT_SYSCALL(_regs) (_regs).gpr[0] ++#define SECCOMP_PT_IP(_regs) (_regs).nip ++#define SECCOMP_PT_PARM1(_regs) (_regs).gpr[3] ++#define SECCOMP_PT_PARM2(_regs) (_regs).gpr[4] ++#define SECCOMP_PT_PARM3(_regs) (_regs).gpr[5] ++#define SECCOMP_PT_PARM4(_regs) (_regs).gpr[6] ++#define SECCOMP_PT_PARM5(_regs) (_regs).gpr[7] ++#define SECCOMP_PT_PARM6(_regs) (_regs).gpr[8] ++ + #else + #error Unsupported target platform + +diff --git sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +index 6a1ec2389..f20c582dd 100644 +--- sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc ++++ sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc +@@ -88,7 +88,8 @@ bool IsBaselinePolicyWatched(int sysno) { + SyscallSets::IsPrctl(sysno) || + SyscallSets::IsProcessGroupOrSession(sysno) || + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + SyscallSets::IsSocketCall(sysno) || + #endif + #if defined(__arm__) +@@ -227,7 +228,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno, + } + + #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ +- defined(__aarch64__) ++ defined(__aarch64__) || defined(__powerpc64__) + if (sysno == __NR_mmap) + return RestrictMmapFlags(); + #endif +@@ -245,7 +246,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno, + return RestrictPrctl(); + + #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ +- defined(__aarch64__) ++ defined(__aarch64__) || defined(__powerpc64__) + if (sysno == __NR_socketpair) { + // Only allow AF_UNIX, PF_UNIX. Crash if anything else is seen. + static_assert(AF_UNIX == PF_UNIX, +@@ -285,7 +286,8 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno, + } + + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + if (SyscallSets::IsSocketCall(sysno)) + return RestrictSocketcallCommand(); + #endif +diff --git sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc +index 01c046dda..7e5a6be82 100644 +--- sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc ++++ sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc +@@ -302,7 +302,7 @@ TEST_BASELINE_SIGSYS(__NR_sysinfo) + TEST_BASELINE_SIGSYS(__NR_syslog) + TEST_BASELINE_SIGSYS(__NR_timer_create) + +-#if !defined(__aarch64__) ++#if !defined(__aarch64__) && !defined(__powerpc64__) + TEST_BASELINE_SIGSYS(__NR_eventfd) + TEST_BASELINE_SIGSYS(__NR_inotify_init) + TEST_BASELINE_SIGSYS(__NR_vserver) +diff --git sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +index 2a97d3916..8e81aa6cf 100644 +--- sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc ++++ sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +@@ -40,7 +40,8 @@ + #include + #if (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ + !defined(__arm__) && !defined(__aarch64__) && \ +- !defined(PTRACE_GET_THREAD_AREA) ++ !defined(PTRACE_GET_THREAD_AREA) && \ ++ !defined(__powerpc64__) + // Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance + // the one in Ubuntu 16.04 LTS) is missing PTRACE_GET_THREAD_AREA. + // asm/ptrace-abi.h doesn't exist on arm32 and PTRACE_GET_THREAD_AREA isn't +@@ -49,6 +50,11 @@ + #endif + #endif // !OS_NACL_NONSFI + ++// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h ++#ifdef __powerpc64__ ++#include ++#endif ++ + #if defined(OS_ANDROID) + + #if !defined(F_DUPFD_CLOEXEC) +@@ -98,6 +104,15 @@ inline bool IsArchitectureMips() { + #endif + } + ++inline bool IsArchitecturePPC64() { ++#if defined(__powerpc64__) ++ return true; ++#else ++ return false; ++#endif ++} ++ ++ + // Ubuntu's version of glibc has a race condition in sem_post that can cause + // it to call futex(2) with bogus op arguments. To workaround this, we need + // to allow those futex(2) calls to fail with EINVAL, instead of crashing the +@@ -239,6 +254,8 @@ ResultExpr RestrictFcntlCommands() { + uint64_t kOLargeFileFlag = O_LARGEFILE; + if (IsArchitectureX86_64() || IsArchitectureI386() || IsArchitectureMips()) + kOLargeFileFlag = 0100000; ++ else if (IsArchitecturePPC64()) ++ kOLargeFileFlag = 0200000; + + const Arg cmd(1); + const Arg long_arg(2); +@@ -253,14 +270,23 @@ ResultExpr RestrictFcntlCommands() { + F_SETLKW, + F_GETLK, + F_DUPFD, +- F_DUPFD_CLOEXEC), +- Allow()) ++ F_DUPFD_CLOEXEC ++#if defined(__powerpc64__) ++// On PPC64, F_SETLK, F_GETLK, F_SETLKW are defined as the 64-bit variants ++// but glibc will sometimes still use the 32-bit versions. Allow both. ++ , ++ 5, /* F_GETLK (32) */ ++ 6, /* F_SETLK (32) */ ++ 7 /* F_SETLKW (32) */ ++#endif ++ ), ++ Allow()) + .Case(F_SETFL, + If((long_arg & ~kAllowedMask) == 0, Allow()).Else(CrashSIGSYS())) + .Default(CrashSIGSYS()); + } + +-#if defined(__i386__) || defined(__mips__) ++#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__) + ResultExpr RestrictSocketcallCommand() { + // Unfortunately, we are unable to restrict the first parameter to + // socketpair(2). Whilst initially sounding bad, it's noteworthy that very +@@ -413,7 +439,7 @@ ResultExpr RestrictPtrace() { + #endif + return Switch(request) + .CASES(( +-#if !defined(__aarch64__) ++#if !defined(__aarch64__) && !defined(__powerpc64__) + PTRACE_GETREGS, PTRACE_GETFPREGS, PTRACE_GET_THREAD_AREA, + PTRACE_GETREGSET, + #endif +diff --git sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h +index ba4289f05..9a4d5ab2d 100644 +--- sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h ++++ sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.h +@@ -48,7 +48,7 @@ SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictMprotectFlags(); + // O_NONBLOCK | O_SYNC | O_LARGEFILE | O_CLOEXEC | O_NOATIME. + SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictFcntlCommands(); + +-#if defined(__i386__) || defined(__mips__) ++#if defined(__i386__) || defined(__mips__) || defined(__powerpc64__) + // Restrict socketcall(2) to only allow socketpair(2), send(2), recv(2), + // sendto(2), recvfrom(2), shutdown(2), sendmsg(2) and recvmsg(2). + SANDBOX_EXPORT bpf_dsl::ResultExpr RestrictSocketcallCommand(); +diff --git sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +index 642df7207..34f47eb73 100644 +--- sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc ++++ sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc +@@ -29,7 +29,8 @@ bool SyscallSets::IsAllowedGettime(int sysno) { + switch (sysno) { + case __NR_gettimeofday: + #if defined(__i386__) || defined(__x86_64__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_time: + #endif + return true; +@@ -45,12 +46,14 @@ bool SyscallSets::IsAllowedGettime(int sysno) { + case __NR_clock_nanosleep: // Parameters filtered by RestrictClockID(). + case __NR_clock_settime: // Privileged. + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_ftime: // Obsolete. + #endif + case __NR_settimeofday: // Privileged. + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_stime: + #endif + default: +@@ -116,7 +119,7 @@ bool SyscallSets::IsFileSystem(int sysno) { + case __NR_faccessat: // EPERM not a valid errno. + case __NR_fchmodat: + case __NR_fchownat: // Should be called chownat ? +-#if defined(__x86_64__) || defined(__aarch64__) ++#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__) + case __NR_newfstatat: // fstatat(). EPERM not a valid errno. + #elif defined(__i386__) || defined(__arm__) || \ + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) +@@ -135,7 +138,7 @@ bool SyscallSets::IsFileSystem(int sysno) { + case __NR_memfd_create: + case __NR_mkdirat: + case __NR_mknodat: +-#if defined(__i386__) ++#if defined(__i386__) || defined(__powerpc64__) + case __NR_oldlstat: + case __NR_oldstat: + #endif +@@ -149,7 +152,8 @@ bool SyscallSets::IsFileSystem(int sysno) { + #endif + case __NR_statfs: // EPERM not a valid errno. + #if defined(__i386__) || defined(__arm__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_statfs64: + #endif + case __NR_symlinkat: +@@ -159,7 +163,8 @@ bool SyscallSets::IsFileSystem(int sysno) { + case __NR_truncate64: + #endif + case __NR_unlinkat: +-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) ++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ ++ defined(__powerpc64__) + case __NR_utime: + #endif + case __NR_utimensat: // New. +@@ -181,7 +186,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) { + #endif + return true; + // TODO(jln): these should be denied gracefully as well (moved below). +-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) ++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ ++ defined(__powerpc64__) + case __NR_fadvise64: // EPERM not a valid errno. + #endif + #if defined(__i386__) +@@ -194,11 +200,12 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) { + case __NR_flock: // EPERM not a valid errno. + case __NR_fstatfs: // Give information about the whole filesystem. + #if defined(__i386__) || defined(__arm__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_fstatfs64: + #endif + case __NR_fsync: // EPERM not a valid errno. +-#if defined(__i386__) ++#if defined(__i386__) || defined(__powerpc64__) + case __NR_oldfstat: + #endif + #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ +@@ -206,6 +213,8 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) { + case __NR_sync_file_range: // EPERM not a valid errno. + #elif defined(__arm__) + case __NR_arm_sync_file_range: // EPERM not a valid errno. ++#elif defined(__powerpc64__) ++ case __NR_sync_file_range2: // EPERM not a valid errno. + #endif + default: + return false; +@@ -231,7 +240,8 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) { + #endif + case __NR_getdents64: // EPERM not a valid errno. + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_readdir: + #endif + return true; +@@ -272,7 +282,7 @@ bool SyscallSets::IsGetSimpleId(int sysno) { + bool SyscallSets::IsProcessPrivilegeChange(int sysno) { + switch (sysno) { + case __NR_capset: +-#if defined(__i386__) || defined(__x86_64__) ++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__) + case __NR_ioperm: // Intel privilege. + case __NR_iopl: // Intel privilege. + #endif +@@ -323,7 +333,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) { + case __NR_rt_sigreturn: + case __NR_rt_sigtimedwait: + #if defined(__i386__) || defined(__arm__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_sigaction: + case __NR_sigprocmask: + case __NR_sigreturn: +@@ -339,7 +350,8 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) { + #endif + case __NR_signalfd4: + #if defined(__i386__) || defined(__arm__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_sigpending: + case __NR_sigsuspend: + #endif +@@ -363,7 +375,7 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) { + #endif + case __NR_dup3: + #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ +- defined(__aarch64__) ++ defined(__aarch64__) || defined(__powerpc64__) + case __NR_shutdown: + #endif + return true; +@@ -397,7 +409,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { + case __NR_membarrier: + case __NR_wait4: + case __NR_waitid: +-#if defined(__i386__) ++#if defined(__i386__) || defined(__powerpc64__) + case __NR_waitpid: + #endif + return true; +@@ -414,7 +426,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) { + #endif + case __NR_set_tid_address: + case __NR_unshare: +-#if !defined(__mips__) && !defined(__aarch64__) ++#if !defined(__mips__) && !defined(__aarch64__) || defined(__powerpc64__) + case __NR_vfork: + #endif + default: +@@ -463,7 +475,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) { + return true; + default: + #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ +- defined(__aarch64__) ++ defined(__aarch64__) || defined(__powerpc64__) + case __NR_socketpair: // We will want to inspect its argument. + #endif + return false; +@@ -473,7 +485,7 @@ bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) { + bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) { + switch (sysno) { + #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ +- defined(__aarch64__) ++ defined(__aarch64__) || defined(__powerpc64__) + case __NR_accept: + case __NR_accept4: + case __NR_bind: +@@ -488,7 +500,8 @@ bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) { + } + + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + // Big multiplexing system call for sockets. + bool SyscallSets::IsSocketCall(int sysno) { + switch (sysno) { +@@ -502,7 +515,8 @@ bool SyscallSets::IsSocketCall(int sysno) { + } + #endif + +-#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) ++#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ ++ defined(__powerpc64__) + bool SyscallSets::IsNetworkSocketInformation(int sysno) { + switch (sysno) { + case __NR_getpeername: +@@ -527,7 +541,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) { + case __NR_mincore: + case __NR_mlockall: + #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ +- defined(__aarch64__) ++ defined(__aarch64__) || defined(__powerpc64__) + case __NR_mmap: + #endif + #if defined(__i386__) || defined(__arm__) || \ +@@ -557,7 +571,8 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) { + switch (sysno) { + case __NR_lseek: + #if defined(__i386__) || defined(__arm__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR__llseek: + #endif + #if !defined(__aarch64__) +@@ -569,26 +584,28 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) { + case __NR_readv: + case __NR_pread64: + #if defined(__arm__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_recv: + #endif + #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ +- defined(__aarch64__) ++ defined(__aarch64__) || defined(__powerpc64__) + case __NR_recvfrom: // Could specify source. + case __NR_recvmsg: // Could specify source. + #endif +-#if defined(__i386__) || defined(__x86_64__) ++#if defined(__i386__) || defined(__x86_64__) || defined(__powerpc64__) + case __NR_select: + #endif +-#if defined(__i386__) || defined(__arm__) || defined(__mips__) ++#if defined(__i386__) || defined(__arm__) || defined(__mips__) || defined(__powerpc64__) + case __NR__newselect: + #endif + #if defined(__arm__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_send: + #endif + #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ +- defined(__aarch64__) ++ defined(__aarch64__) || defined(__powerpc64__) + case __NR_sendmsg: // Could specify destination. + case __NR_sendto: // Could specify destination. + #endif +@@ -645,7 +662,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) { + return true; + case __NR_getpriority: + #if defined(__i386__) || defined(__arm__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_nice: + #endif + case __NR_setpriority: +@@ -657,7 +675,8 @@ bool SyscallSets::IsAllowedBasicScheduler(int sysno) { + bool SyscallSets::IsAdminOperation(int sysno) { + switch (sysno) { + #if defined(__i386__) || defined(__arm__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_bdflush: + #endif + case __NR_kexec_load: +@@ -673,7 +692,8 @@ bool SyscallSets::IsAdminOperation(int sysno) { + + bool SyscallSets::IsKernelModule(int sysno) { + switch (sysno) { +-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) ++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ ++ defined(__powerpc64__) + case __NR_create_module: + case __NR_get_kernel_syms: // Should ENOSYS. + case __NR_query_module: +@@ -706,7 +726,8 @@ bool SyscallSets::IsFsControl(int sysno) { + case __NR_swapoff: + case __NR_swapon: + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_umount: + #endif + case __NR_umount2: +@@ -722,7 +743,7 @@ bool SyscallSets::IsNuma(int sysno) { + case __NR_getcpu: + case __NR_mbind: + #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ +- defined(__aarch64__) ++ defined(__aarch64__) || defined(__powerpc64__) + case __NR_migrate_pages: + #endif + case __NR_move_pages: +@@ -751,14 +772,15 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) { + switch (sysno) { + case __NR_acct: // Privileged. + #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ +- defined(__aarch64__) ++ defined(__aarch64__) || defined(__powerpc64__) + case __NR_getrlimit: + #endif +-#if defined(__i386__) || defined(__arm__) ++#if defined(__i386__) || defined(__arm__) || defined(__powerpc64__) + case __NR_ugetrlimit: + #endif + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_ulimit: + #endif + case __NR_getrusage: +@@ -792,7 +814,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) { + #endif + case __NR_sysinfo: + case __NR_uname: +-#if defined(__i386__) ++#if defined(__i386__) || defined(__powerpc64__) + case __NR_olduname: + case __NR_oldolduname: + #endif +@@ -854,8 +876,16 @@ bool SyscallSets::IsSystemVSemaphores(int sysno) { + } + #endif + ++/* shitty hack around Void's 4.19 kernel headers missing those numbers */ ++#if defined(__powerpc64__) && !defined(__NR_shmget) ++#define __NR_shmget 395 ++#define __NR_shmctl 396 ++#define __NR_shmat 397 ++#define __NR_shmdt 398 ++#endif ++ + #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \ +- defined(__aarch64__) || \ ++ defined(__aarch64__) || defined(__powerpc64__) || \ + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) + // These give a lot of ambient authority and bypass the setuid sandbox. + bool SyscallSets::IsSystemVSharedMemory(int sysno) { +@@ -887,7 +917,8 @@ bool SyscallSets::IsSystemVMessageQueue(int sysno) { + #endif + + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + // Big system V multiplexing system call. + bool SyscallSets::IsSystemVIpc(int sysno) { + switch (sysno) { +@@ -907,7 +938,8 @@ bool SyscallSets::IsAnySystemV(int sysno) { + return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) || + IsSystemVSharedMemory(sysno); + #elif defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + return IsSystemVIpc(sysno); + #endif + } +@@ -960,7 +992,8 @@ bool SyscallSets::IsFaNotify(int sysno) { + bool SyscallSets::IsTimer(int sysno) { + switch (sysno) { + case __NR_getitimer: +-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) ++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ ++ defined(__powerpc64__) + case __NR_alarm: + #endif + case __NR_setitimer: +@@ -1019,18 +1052,22 @@ bool SyscallSets::IsMisc(int sysno) { + case __NR_syncfs: + case __NR_vhangup: + // The system calls below are not implemented. +-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) ++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ ++ defined(__powerpc64__) + case __NR_afs_syscall: + #endif + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_break: + #endif +-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) ++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ ++ defined(__powerpc64__) + case __NR_getpmsg: + #endif + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_gtty: + case __NR_idle: + case __NR_lock: +@@ -1038,20 +1075,22 @@ bool SyscallSets::IsMisc(int sysno) { + case __NR_prof: + case __NR_profil: + #endif +-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) ++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ ++ defined(__powerpc64__) + case __NR_putpmsg: + #endif + #if defined(__x86_64__) + case __NR_security: + #endif + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + case __NR_stty: + #endif +-#if defined(__x86_64__) ++#if defined(__x86_64__) || defined(__powerpc64__) + case __NR_tuxcall: + #endif +-#if !defined(__aarch64__) ++#if !defined(__aarch64__) && !defined(__powerpc64__) + case __NR_vserver: + #endif + return true; +diff --git sandbox/linux/seccomp-bpf-helpers/syscall_sets.h sandbox/linux/seccomp-bpf-helpers/syscall_sets.h +index 923533ec9..411f72acd 100644 +--- sandbox/linux/seccomp-bpf-helpers/syscall_sets.h ++++ sandbox/linux/seccomp-bpf-helpers/syscall_sets.h +@@ -43,13 +43,14 @@ class SANDBOX_EXPORT SyscallSets { + static bool IsDeniedGetOrModifySocket(int sysno); + + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + // Big multiplexing system call for sockets. + static bool IsSocketCall(int sysno); + #endif + + #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \ +- defined(__aarch64__) ++ defined(__aarch64__) || defined(__powerpc64__) + static bool IsNetworkSocketInformation(int sysno); + #endif + +@@ -76,7 +77,7 @@ class SANDBOX_EXPORT SyscallSets { + static bool IsSystemVSemaphores(int sysno); + #endif + #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \ +- defined(__aarch64__) || \ ++ defined(__aarch64__) || defined(__powerpc64__) || \ + (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) + // These give a lot of ambient authority and bypass the setuid sandbox. + static bool IsSystemVSharedMemory(int sysno); +@@ -88,7 +89,8 @@ class SANDBOX_EXPORT SyscallSets { + #endif + + #if defined(__i386__) || \ +- (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) ++ (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS)) || \ ++ defined(__powerpc64__) + // Big system V multiplexing system call. + static bool IsSystemVIpc(int sysno); + #endif +diff --git sandbox/linux/seccomp-bpf/syscall.cc sandbox/linux/seccomp-bpf/syscall.cc +index e47e98bf5..d53a7ff56 100644 +--- sandbox/linux/seccomp-bpf/syscall.cc ++++ sandbox/linux/seccomp-bpf/syscall.cc +@@ -18,7 +18,7 @@ namespace sandbox { + namespace { + + #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \ +- defined(ARCH_CPU_MIPS_FAMILY) ++ defined(ARCH_CPU_MIPS_FAMILY) || defined (ARCH_CPU_PPC64_FAMILY) + // Number that's not currently used by any Linux kernel ABIs. + const int kInvalidSyscallNumber = 0x351d3; + #else +@@ -310,12 +310,56 @@ asm(// We need to be able to tell the kernel exactly where we made a + // Enter the kernel + "svc 0\n" + "2:ret\n" ++ ".cfi_endproc\n" ++ ".size SyscallAsm, .-SyscallAsm\n" ++#elif defined(__powerpc64__) ++ ".text\n" ++ ".align 4\n" ++ ".type SyscallAsm @function\n" ++ "SyscallAsm:\n" ++ ".cfi_startproc\n" ++ ++ // Check if r3 is negative ++ "cmpdi 3, 0\n" ++ "bgt 2f\n" ++ ++ // Load address of 3f into r3 and return ++ "mflr 10\n" ++ "bl 1f\n" ++ "1: mflr 3\n" ++ "mtlr 10\n" ++ "addi 3, 3, 4*13\n" ++ "blr\n" ++ ++ // Load arguments from array into r3-8 ++ // save param 3 in r10 ++ "2:\n" ++ "mr 0, 3\n" ++ "ld 3, 0(4)\n" ++ "ld 5, 16(4)\n" ++ "ld 6, 24(4)\n" ++ "ld 7, 32(4)\n" ++ "ld 8, 40(4)\n" ++ "ld 4, 8(4)\n" ++ "li 9, 0\n" ++ ++ // Enter kernel ++ "sc\n" ++ ++ // Magic return address ++ "3:\n" ++ // Like MIPS, ppc64 return values are always positive. ++ // Check for error in cr0.SO and negate upon error ++ "bc 4, 3, 4f\n" ++ "neg 3, 3\n" ++ "4: blr\n" ++ + ".cfi_endproc\n" + ".size SyscallAsm, .-SyscallAsm\n" + #endif + ); // asm + +-#if defined(__x86_64__) ++#if defined(__x86_64__) || defined(__powerpc64__) + extern "C" { + intptr_t SyscallAsm(intptr_t nr, const intptr_t args[6]); + } +@@ -429,6 +473,8 @@ intptr_t Syscall::Call(int nr, + ret = inout; + } + ++#elif defined(__powerpc64__) ++ intptr_t ret = SyscallAsm(nr, args); + #else + #error "Unimplemented architecture" + #endif +@@ -445,8 +491,18 @@ void Syscall::PutValueInUcontext(intptr_t ret_val, ucontext_t* ctx) { + // needs to be changed back. + ret_val = -ret_val; + SECCOMP_PARM4(ctx) = 1; +- } else ++ } else { + SECCOMP_PARM4(ctx) = 0; ++ } ++#endif ++#if defined(__powerpc64__) ++ // Same as MIPS, need to invert ret and set error register (cr0.SO) ++ if (ret_val <= -1 && ret_val >= -4095) { ++ ret_val = -ret_val; ++ ctx->uc_mcontext.regs->ccr |= (1 << 28); ++ } else { ++ ctx->uc_mcontext.regs->ccr &= ~(1 << 28); ++ } + #endif + SECCOMP_RESULT(ctx) = static_cast(ret_val); + } +diff --git sandbox/linux/seccomp-bpf/trap.cc sandbox/linux/seccomp-bpf/trap.cc +index f5b86a73a..5e6c4a068 100644 +--- sandbox/linux/seccomp-bpf/trap.cc ++++ sandbox/linux/seccomp-bpf/trap.cc +@@ -232,6 +232,20 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) { + SetIsInSigHandler(); + } + ++#if defined(__powerpc64__) ++ // On ppc64+glibc, some syscalls seem to accidentally negate the first ++ // parameter which causes checks against it to fail. For now, manually ++ // negate them back. ++ // TODO(shawn@anastas.io): investigate this issue further ++ auto nr = SECCOMP_SYSCALL(ctx); ++ if (nr == __NR_openat || nr == __NR_mkdirat || nr == __NR_faccessat || nr == __NR_readlinkat || ++ nr == __NR_renameat || nr == __NR_renameat2 || nr == __NR_newfstatat || nr == __NR_unlinkat) { ++ if (static_cast(SECCOMP_PARM1(ctx)) > 0) { ++ SECCOMP_PARM1(ctx) = -SECCOMP_PARM1(ctx); ++ } ++ } ++#endif ++ + // Copy the seccomp-specific data into a arch_seccomp_data structure. This + // is what we are showing to TrapFnc callbacks that the system call + // evaluator registered with the sandbox. +diff --git sandbox/linux/services/credentials.cc sandbox/linux/services/credentials.cc +index d7b5d8c44..4adc6d0d4 100644 +--- sandbox/linux/services/credentials.cc ++++ sandbox/linux/services/credentials.cc +@@ -81,7 +81,7 @@ bool ChrootToSafeEmptyDir() { + pid_t pid = -1; + alignas(16) char stack_buf[PTHREAD_STACK_MIN]; + #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \ +- defined(ARCH_CPU_MIPS_FAMILY) ++ defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY) + // The stack grows downward. + void* stack = stack_buf + sizeof(stack_buf); + #else +diff --git sandbox/linux/services/syscall_wrappers.cc sandbox/linux/services/syscall_wrappers.cc +index fcfd2aa12..f6eb32fb7 100644 +--- sandbox/linux/services/syscall_wrappers.cc ++++ sandbox/linux/services/syscall_wrappers.cc +@@ -58,7 +58,7 @@ long sys_clone(unsigned long flags, + #if defined(ARCH_CPU_X86_64) + return syscall(__NR_clone, flags, child_stack, ptid, ctid, tls); + #elif defined(ARCH_CPU_X86) || defined(ARCH_CPU_ARM_FAMILY) || \ +- defined(ARCH_CPU_MIPS_FAMILY) ++ defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_PPC64_FAMILY) + // CONFIG_CLONE_BACKWARDS defined. + return syscall(__NR_clone, flags, child_stack, ptid, tls, ctid); + #endif +diff --git sandbox/linux/syscall_broker/broker_process.cc sandbox/linux/syscall_broker/broker_process.cc +index d72c9d238..77f1d95f5 100644 +--- sandbox/linux/syscall_broker/broker_process.cc ++++ sandbox/linux/syscall_broker/broker_process.cc +@@ -169,7 +169,7 @@ bool BrokerProcess::IsSyscallBrokerable(int sysno, bool fast_check) const { + #if defined(__NR_fstatat64) + case __NR_fstatat64: + #endif +-#if defined(__x86_64__) || defined(__aarch64__) ++#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__) + case __NR_newfstatat: + #endif + return !fast_check || allowed_command_set_.test(COMMAND_STAT); +diff --git sandbox/linux/system_headers/linux_seccomp.h sandbox/linux/system_headers/linux_seccomp.h +index 1fa47ed09..39cc9ab53 100644 +--- sandbox/linux/system_headers/linux_seccomp.h ++++ sandbox/linux/system_headers/linux_seccomp.h +@@ -41,6 +41,9 @@ + #ifndef EM_AARCH64 + #define EM_AARCH64 183 + #endif ++#ifndef EM_PPC64 ++#define EM_PPC64 21 ++#endif + + #ifndef __AUDIT_ARCH_64BIT + #define __AUDIT_ARCH_64BIT 0x80000000 +@@ -73,6 +76,12 @@ + #ifndef AUDIT_ARCH_AARCH64 + #define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE) + #endif ++#ifndef AUDIT_ARCH_PPC64 ++#define AUDIT_ARCH_PPC64 (EM_PPC64 | __AUDIT_ARCH_64BIT) ++#endif ++#ifndef AUDIT_ARCH_PPC64LE ++#define AUDIT_ARCH_PPC64LE (EM_PPC64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE) ++#endif + + // For prctl.h + #ifndef PR_SET_SECCOMP +diff --git sandbox/linux/system_headers/linux_signal.h sandbox/linux/system_headers/linux_signal.h +index f5a736761..515b21a5f 100644 +--- sandbox/linux/system_headers/linux_signal.h ++++ sandbox/linux/system_headers/linux_signal.h +@@ -13,7 +13,7 @@ + // (not undefined, but defined different values and in different memory + // layouts). So, fill the gap here. + #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \ +- defined(__aarch64__) ++ defined(__aarch64__) || defined(__powerpc64__) + + #define LINUX_SIGHUP 1 + #define LINUX_SIGINT 2 +diff --git sandbox/linux/system_headers/linux_syscalls.h sandbox/linux/system_headers/linux_syscalls.h +index 2b78a0cc3..0a70f5ea5 100644 +--- sandbox/linux/system_headers/linux_syscalls.h ++++ sandbox/linux/system_headers/linux_syscalls.h +@@ -35,5 +35,9 @@ + #include "sandbox/linux/system_headers/arm64_linux_syscalls.h" + #endif + ++#if defined(__powerpc64__) ++#include "sandbox/linux/system_headers/ppc64_linux_syscalls.h" ++#endif ++ + #endif // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_ + +diff --git sandbox/linux/system_headers/linux_ucontext.h sandbox/linux/system_headers/linux_ucontext.h +index 22ce78027..a69b024c2 100644 +--- sandbox/linux/system_headers/linux_ucontext.h ++++ sandbox/linux/system_headers/linux_ucontext.h +@@ -11,6 +11,8 @@ + #include "sandbox/linux/system_headers/arm_linux_ucontext.h" + #elif defined(__i386__) + #include "sandbox/linux/system_headers/i386_linux_ucontext.h" ++#elif defined(__powerpc64__) ++#include "sandbox/linux/system_headers/ppc64_linux_ucontext.h" + #else + #error "No support for your architecture in PNaCl header" + #endif +diff --git sandbox/linux/system_headers/ppc64_linux_syscalls.h sandbox/linux/system_headers/ppc64_linux_syscalls.h +new file mode 100644 +index 000000000..ccacffe22 +--- /dev/null ++++ sandbox/linux/system_headers/ppc64_linux_syscalls.h +@@ -0,0 +1,12 @@ ++// Copyright 2014 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_ ++#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_ ++ ++#include ++ ++//TODO: is it necessary to redefine syscall numbers for PPC64? ++ ++#endif // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_SYSCALLS_H_ +diff --git sandbox/linux/system_headers/ppc64_linux_ucontext.h sandbox/linux/system_headers/ppc64_linux_ucontext.h +new file mode 100644 +index 000000000..07728e087 +--- /dev/null ++++ sandbox/linux/system_headers/ppc64_linux_ucontext.h +@@ -0,0 +1,12 @@ ++// Copyright 2014 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_ ++#define SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_ ++ ++#include ++ ++//TODO: is it necessary to redefine ucontext on PPC64? ++ ++#endif // SANDBOX_LINUX_SYSTEM_HEADERS_PPC64_LINUX_UCONTEXT_H_ +diff --git sandbox/policy/linux/bpf_renderer_policy_linux.cc sandbox/policy/linux/bpf_renderer_policy_linux.cc +index 2588fc792..d455c4601 100644 +--- sandbox/policy/linux/bpf_renderer_policy_linux.cc ++++ sandbox/policy/linux/bpf_renderer_policy_linux.cc +@@ -15,6 +15,11 @@ + #include "sandbox/linux/system_headers/linux_syscalls.h" + #include "sandbox/policy/linux/sandbox_linux.h" + ++// On PPC64, TCGETS is defined in terms of struct termios, so we must include termios.h ++#ifdef __powerpc64__ ++#include ++#endif ++ + // TODO(vignatti): replace the local definitions below with #include + // once kernel version 4.6 becomes widely used. + #include +diff --git third_party/angle/src/compiler/translator/InfoSink.h third_party/angle/src/compiler/translator/InfoSink.h +index 3a807e1e3..5258617a7 100644 +--- third_party/angle/src/compiler/translator/InfoSink.h ++++ third_party/angle/src/compiler/translator/InfoSink.h +@@ -92,7 +92,16 @@ class TInfoSinkBase + stream.precision(8); + stream << f; + } +- sink.append(stream.str()); ++ ++ // Hack to work around a bug where negative floating point values ++ // are rendered like '.0.5' instead of '-0.5' ++ std::string res(stream.str()); ++ ++ if (signbit(f)) { // test if f is negative ++ res[0] = '-'; ++ } ++ ++ sink.append(res); + return *this; + } + // Write boolean values as their names instead of integral value. +diff --git third_party/angle/src/libANGLE/Constants.h third_party/angle/src/libANGLE/Constants.h +index fcbc9246a..39ae66148 100644 +--- third_party/angle/src/libANGLE/Constants.h ++++ third_party/angle/src/libANGLE/Constants.h +@@ -9,6 +9,7 @@ + #ifndef LIBANGLE_CONSTANTS_H_ + #define LIBANGLE_CONSTANTS_H_ + ++#include + #include "common/platform.h" + + #include +diff --git third_party/boringssl/BUILD.gn third_party/boringssl/BUILD.gn +index 17cf9cda9..8ce96bd32 100644 +--- third_party/boringssl/BUILD.gn ++++ third_party/boringssl/BUILD.gn +@@ -103,6 +103,13 @@ if (is_win && !is_msan && current_cpu != "arm64") { + } else { + public_configs = [ ":no_asm_config" ] + } ++ } else if (current_cpu == "ppc64") { ++ if (is_linux) { ++ # TODO: ppc64 (be) check ++ sources += crypto_sources_linux_ppc64le ++ } else { ++ public_configs = [ ":no_asm_config" ] ++ } + } else { + public_configs = [ ":no_asm_config" ] + } +diff --git third_party/breakpad/BUILD.gn third_party/breakpad/BUILD.gn +index 4af3d7bbf..adbf54159 100644 +--- third_party/breakpad/BUILD.gn ++++ third_party/breakpad/BUILD.gn +@@ -596,7 +596,6 @@ if (is_linux || is_chromeos || is_android) { + "breakpad/src/client/minidump_file_writer.h", + "breakpad/src/common/convert_UTF.cc", + "breakpad/src/common/convert_UTF.h", +- "breakpad/src/common/linux/breakpad_getcontext.S", + "breakpad/src/common/linux/elf_core_dump.cc", + "breakpad/src/common/linux/elf_core_dump.h", + "breakpad/src/common/linux/elfutils.cc", +@@ -634,6 +633,14 @@ if (is_linux || is_chromeos || is_android) { + + libs = [ "dl" ] + ++ if (current_cpu == "ppc64") { ++ defines = [ "HAVE_GETCONTEXT" ] ++ } else { ++ sources += [ ++ "breakpad/src/common/linux/breakpad_getcontext.S" ++ ] ++ } ++ + include_dirs = [ + ".", + "breakpad/src", +@@ -682,7 +689,6 @@ if (is_linux || is_chromeos || is_android) { + "breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc", + "breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc", + "breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc", +- "breakpad/src/common/linux/breakpad_getcontext_unittest.cc", + "breakpad/src/common/linux/elf_core_dump_unittest.cc", + "breakpad/src/common/linux/file_id_unittest.cc", + "breakpad/src/common/linux/linux_libc_support_unittest.cc", +diff --git third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h +index 07d9171a0..9aed4cb36 100644 +--- third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h ++++ third_party/breakpad/breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h +@@ -44,6 +44,8 @@ typedef MDRawContextARM RawContextCPU; + typedef MDRawContextARM64_Old RawContextCPU; + #elif defined(__mips__) + typedef MDRawContextMIPS RawContextCPU; ++#elif defined(__powerpc64__) ++typedef MDRawContextPPC64 RawContextCPU; + #else + #error "This code has not been ported to your platform yet." + #endif +diff --git third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc +index aae1dc13b..03afec7a5 100644 +--- third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc ++++ third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.cc +@@ -270,7 +270,42 @@ void ThreadInfo::FillCPUContext(RawContextCPU* out) const { + out->float_save.fir = mcontext.fpc_eir; + #endif + } +-#endif // __mips__ ++ ++#elif defined(__powerpc64__) ++ ++uintptr_t ThreadInfo::GetInstructionPointer() const { ++ return mcontext.gp_regs[PT_NIP]; ++} ++ ++void ThreadInfo::FillCPUContext(RawContextCPU* out) const { ++ out->context_flags = MD_CONTEXT_PPC64_FULL; ++ for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++) ++ out->gpr[i] = mcontext.gp_regs[i]; ++ ++ out->lr = mcontext.gp_regs[PT_LNK]; ++ out->srr0 = mcontext.gp_regs[PT_NIP]; ++ out->srr1 = mcontext.gp_regs[PT_MSR]; ++ out->cr = mcontext.gp_regs[PT_CCR]; ++ out->xer = mcontext.gp_regs[PT_XER]; ++ out->ctr = mcontext.gp_regs[PT_CTR]; ++ ++ for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++) ++ out->float_save.fpregs[i] = mcontext.fp_regs[i]; ++ ++ out->float_save.fpscr = mcontext.fp_regs[NFPREG-1]; ++ ++ for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) ++ out->vector_save.save_vr[i] = \ ++ {(((uint64_t)vregs.vrregs[i][0]) << 32) ++ | vregs.vrregs[i][1], ++ (((uint64_t)vregs.vrregs[i][2]) << 32) ++ | vregs.vrregs[i][3]}; ++ ++ out->vrsave = vregs.vrsave; ++ out->vector_save.save_vscr = {0, vregs.vscr.vscr_word}; ++ out->vector_save.save_vrvalid = 0xFFFFFFFF; ++} ++#endif // __powerpc64__ + + void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) { + assert(gp_regs || size); +@@ -279,6 +314,11 @@ void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) { + *gp_regs = mcontext.gregs; + if (size) + *size = sizeof(mcontext.gregs); ++#elif defined(__powerpc64__) ++ if (gp_regs) ++ *gp_regs = mcontext.gp_regs; ++ if (size) ++ *size = sizeof(mcontext.gp_regs); + #else + if (gp_regs) + *gp_regs = ®s; +@@ -294,6 +334,11 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) { + *fp_regs = &mcontext.fpregs; + if (size) + *size = sizeof(mcontext.fpregs); ++#elif defined(__powerpc64__) ++ if (fp_regs) ++ *fp_regs = &mcontext.fp_regs; ++ if (size) ++ *size = sizeof(mcontext.fp_regs); + #else + if (fp_regs) + *fp_regs = &fpregs; +@@ -302,4 +347,13 @@ void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) { + #endif + } + ++#if defined(__powerpc64__) ++void ThreadInfo::GetVectorRegisters(void** v_regs, size_t* size) { ++ if (v_regs) ++ *v_regs = &vregs; ++ if (size) ++ *size = sizeof(vregs); ++} ++#endif ++ + } // namespace google_breakpad +diff --git third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h +index fb216fa6d..593aac822 100644 +--- third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h ++++ third_party/breakpad/breakpad/src/client/linux/dump_writer_common/thread_info.h +@@ -68,6 +68,10 @@ struct ThreadInfo { + // Use the structures defined in + struct user_regs_struct regs; + struct user_fpsimd_struct fpregs; ++#elif defined(__powerpc64__) ++ // Use the structures defined in . ++ mcontext_t mcontext; ++ vrregset_t vregs; + #elif defined(__mips__) + // Use the structure defined in . + mcontext_t mcontext; +@@ -84,6 +88,11 @@ struct ThreadInfo { + + // Returns the pointer and size of float point register area. + void GetFloatingPointRegisters(void** fp_regs, size_t* size); ++ ++#if defined(__powerpc64__) ++ // Returns the pointer and size of the vector register area. (PPC64 only) ++ void GetVectorRegisters(void** v_regs, size_t* size); ++#endif + }; + + } // namespace google_breakpad +diff --git third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc +index 6eec1be24..741983a1a 100644 +--- third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc ++++ third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc +@@ -254,6 +254,48 @@ void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc) { + out->float_save.fir = uc->uc_mcontext.fpc_eir; // Unused. + #endif + } ++ ++#elif defined(__powerpc64__) ++ ++uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) { ++ return uc->uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]; ++} ++ ++uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) { ++ return uc->uc_mcontext.gp_regs[PT_NIP]; ++} ++ ++void UContextReader::FillCPUContext(RawContextCPU* out, const ucontext_t* uc, ++ const vrregset_t* vregs) { ++ out->context_flags = MD_CONTEXT_PPC64_FULL; ++ ++ for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++) ++ out->gpr[i] = uc->uc_mcontext.gp_regs[i]; ++ ++ out->lr = uc->uc_mcontext.gp_regs[PT_LNK]; ++ out->srr0 = uc->uc_mcontext.gp_regs[PT_NIP]; ++ out->srr1 = uc->uc_mcontext.gp_regs[PT_MSR]; ++ out->cr = uc->uc_mcontext.gp_regs[PT_CCR]; ++ out->xer = uc->uc_mcontext.gp_regs[PT_XER]; ++ out->ctr = uc->uc_mcontext.gp_regs[PT_CTR]; ++ ++ for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++) ++ out->float_save.fpregs[i] = uc->uc_mcontext.fp_regs[i]; ++ ++ out->float_save.fpscr = uc->uc_mcontext.fp_regs[NFPREG-1]; ++ ++ for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) ++ out->vector_save.save_vr[i] = ++ {(((uint64_t)vregs->vrregs[i][0]) << 32) ++ | vregs->vrregs[i][1], ++ (((uint64_t)vregs->vrregs[i][2]) << 32) ++ | vregs->vrregs[i][3]}; ++ ++ out->vrsave = vregs->vrsave; ++ out->vector_save.save_vscr = {0, vregs->vscr.vscr_word}; ++ out->vector_save.save_vrvalid = 0xFFFFFFFF; ++} ++ + #endif + + } // namespace google_breakpad +diff --git third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h +index 7d4100881..c122ac92e 100644 +--- third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h ++++ third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h +@@ -55,6 +55,9 @@ struct UContextReader { + #elif defined(__aarch64__) + static void FillCPUContext(RawContextCPU* out, const ucontext_t* uc, + const struct fpsimd_context* fpregs); ++#elif defined(__powerpc64__) ++ static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc, ++ const vrregset_t* vregs); + #else + static void FillCPUContext(RawContextCPU* out, const ucontext_t* uc); + #endif +diff --git third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc +index a6cb5f984..ae16b64d9 100644 +--- third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc ++++ third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc +@@ -461,9 +461,16 @@ bool ExceptionHandler::HandleSignal(int /*sig*/, siginfo_t* info, void* uc) { + memcpy(&g_crash_context_.float_state, fp_ptr, + sizeof(g_crash_context_.float_state)); + } ++#elif defined(__powerpc64__) ++ // On PPC64, we must copy VR state ++ ucontext_t* uc_ptr = (ucontext_t*)uc; ++ if (uc_ptr->uc_mcontext.v_regs) { ++ memcpy(&g_crash_context_.vector_state, uc_ptr->uc_mcontext.v_regs, ++ sizeof(g_crash_context_.vector_state)); ++ } + #elif !defined(__ARM_EABI__) && !defined(__mips__) + // FP state is not part of user ABI on ARM Linux. +- // In case of MIPS Linux FP state is already part of ucontext_t ++ // In case of MIPS, Linux FP state is already part of ucontext_t + // and 'float_state' is not a member of CrashContext. + ucontext_t* uc_ptr = (ucontext_t*)uc; + if (uc_ptr->uc_mcontext.fpregs) { +@@ -708,11 +715,19 @@ bool ExceptionHandler::WriteMinidump() { + } + #endif + +-#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) ++#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__) \ ++ && !defined(__powerpc64__) + // FPU state is not part of ARM EABI ucontext_t. + memcpy(&context.float_state, context.context.uc_mcontext.fpregs, + sizeof(context.float_state)); + #endif ++ ++#if defined(__powerpc64__) ++ // Vector registers must be copied on PPC64 ++ memcpy(&context.vector_state, context.context.uc_mcontext.v_regs, ++ sizeof(context.vector_state)); ++#endif ++ + context.tid = sys_gettid(); + + // Add an exception stream to the minidump for better reporting. +@@ -733,6 +748,9 @@ bool ExceptionHandler::WriteMinidump() { + #elif defined(__mips__) + context.siginfo.si_addr = + reinterpret_cast(context.context.uc_mcontext.pc); ++#elif defined(__powerpc64__) ++ context.siginfo.si_addr = ++ reinterpret_cast(context.context.uc_mcontext.gp_regs[PT_NIP]); + #else + #error "This code has not been ported to your platform yet." + #endif +diff --git third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h +index f80843ea7..260dd10f7 100644 +--- third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h ++++ third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.h +@@ -192,7 +192,11 @@ class ExceptionHandler { + siginfo_t siginfo; + pid_t tid; // the crashing thread. + ucontext_t context; +-#if !defined(__ARM_EABI__) && !defined(__mips__) ++#if defined(__powerpc64__) ++ // PPC64's FP state is a part of ucontext_t like MIPS but the vector ++ // state is not, so a struct is needed. ++ vstate_t vector_state; ++#elif !defined(__ARM_EABI__) && !defined(__mips__) + // #ifdef this out because FP state is not part of user ABI for Linux ARM. + // In case of MIPS Linux FP state is already part of ucontext_t so + // 'float_state' is not required. +diff --git third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc +index 35dcbfd4d..7934370fd 100644 +--- third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc ++++ third_party/breakpad/breakpad/src/client/linux/handler/exception_handler_unittest.cc +@@ -307,7 +307,7 @@ TEST(ExceptionHandlerTest, ParallelChildCrashesDontHang) { + } + + // Wait a while until the child should have crashed. +- usleep(1000000); ++ usleep(2000000); + // Kill the child if it is still running. + kill(child, SIGKILL); + +@@ -559,6 +559,8 @@ const unsigned char kIllegalInstruction[] = { + #if defined(__mips__) + // mfc2 zero,Impl - usually illegal in userspace. + 0x48, 0x00, 0x00, 0x48 ++#elif defined(__powerpc64__) ++ 0x01, 0x01, 0x01, 0x01 // Crashes on a tested POWER9 cpu + #else + // This crashes with SIGILL on x86/x86-64/arm. + 0xff, 0xff, 0xff, 0xff +@@ -754,10 +756,10 @@ TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) { + + // These are defined here so the parent can use them to check the + // data from the minidump afterwards. +- // Use 4k here because the OS will hand out a single page even ++ // Use the page size here because the OS will hand out a single page even + // if a smaller size is requested, and this test wants to + // test the upper bound of the memory range. +- const uint32_t kMemorySize = 4096; // bytes ++ const uint32_t kMemorySize = getpagesize(); // bytes + const int kOffset = kMemorySize - sizeof(kIllegalInstruction); + + const pid_t child = fork(); +diff --git third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc +index fa3c1713a..6ce709e2f 100644 +--- third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc ++++ third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer.cc +@@ -138,7 +138,9 @@ class MicrodumpWriter { + const MicrodumpExtraInfo& microdump_extra_info, + LinuxDumper* dumper) + : ucontext_(context ? &context->context : NULL), +-#if !defined(__ARM_EABI__) && !defined(__mips__) ++#if defined(__powerpc64__) ++ vector_state_(context ? &context->vector_state : NULL), ++#elif !defined(__ARM_EABI__) && !defined(__mips__) + float_state_(context ? &context->float_state : NULL), + #endif + dumper_(dumper), +@@ -337,6 +339,8 @@ class MicrodumpWriter { + # else + # error "This mips ABI is currently not supported (n32)" + #endif ++#elif defined(__powerpc64__) ++ const char kArch[] = "ppc64"; + #else + #error "This code has not been ported to your platform yet" + #endif +@@ -409,7 +413,9 @@ class MicrodumpWriter { + void DumpCPUState() { + RawContextCPU cpu; + my_memset(&cpu, 0, sizeof(RawContextCPU)); +-#if !defined(__ARM_EABI__) && !defined(__mips__) ++#if defined(__powerpc64__) ++ UContextReader::FillCPUContext(&cpu, ucontext_, vector_state_); ++#elif !defined(__ARM_EABI__) && !defined(__mips__) + UContextReader::FillCPUContext(&cpu, ucontext_, float_state_); + #else + UContextReader::FillCPUContext(&cpu, ucontext_); +@@ -605,7 +611,9 @@ class MicrodumpWriter { + void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); } + + const ucontext_t* const ucontext_; +-#if !defined(__ARM_EABI__) && !defined(__mips__) ++#if defined(__powerpc64__) ++ const google_breakpad::vstate_t* const vector_state_; ++#elif !defined(__ARM_EABI__) && !defined(__mips__) + const google_breakpad::fpstate_t* const float_state_; + #endif + LinuxDumper* dumper_; +diff --git third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc +index 6339ac0cd..291af106b 100644 +--- third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc ++++ third_party/breakpad/breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc +@@ -279,10 +279,19 @@ TEST(MicrodumpWriterTest, BasicWithMappings) { + CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf); + ASSERT_TRUE(ContainsMicrodump(buf)); + ++ int page_size = getpagesize(); + #ifdef __LP64__ +- ASSERT_NE(std::string::npos, +- buf.find("M 0000000000001000 000000000000002A 0000000000001000 " +- "33221100554477668899AABBCCDDEEFF0 libfoo.so")); ++ // This test is only available for the following page sizes ++ ASSERT_TRUE((page_size == 4096) || (page_size == 65536)); ++ if (page_size == 4096) { ++ ASSERT_NE(std::string::npos, ++ buf.find("M 0000000000001000 000000000000002A 0000000000001000 " ++ "33221100554477668899AABBCCDDEEFF0 libfoo.so")); ++ } else { ++ ASSERT_NE(std::string::npos, ++ buf.find("M 0000000000010000 000000000000002A 0000000000010000 " ++ "33221100554477668899AABBCCDDEEFF0 libfoo.so")); ++ } + #else + ASSERT_NE(std::string::npos, + buf.find("M 00001000 0000002A 00001000 " +diff --git third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc +index 415068983..b93e4afcf 100644 +--- third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc ++++ third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc +@@ -112,6 +112,9 @@ bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) { + #elif defined(__mips__) + stack_pointer = + reinterpret_cast(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]); ++#elif defined(__powerpc64__) ++ stack_pointer = ++ reinterpret_cast(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]); + #else + #error "This code hasn't been ported to your platform yet." + #endif +@@ -197,7 +200,10 @@ bool LinuxCoreDumper::EnumerateThreads() { + memset(&info, 0, sizeof(ThreadInfo)); + info.tgid = status->pr_pgrp; + info.ppid = status->pr_ppid; +-#if defined(__mips__) ++#if defined(__powerpc64__) ++ for (int i = 0; i < 31; i++) ++ info.mcontext.gp_regs[i] = status->pr_reg[i]; ++#elif defined(__mips__) + #if defined(__ANDROID__) + for (int i = EF_R0; i <= EF_R31; i++) + info.mcontext.gregs[i - EF_R0] = status->pr_reg[i]; +diff --git third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc +index 7fd6532ad..199cbfffd 100644 +--- third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc ++++ third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.cc +@@ -765,7 +765,9 @@ bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len, + reinterpret_cast(int_stack_pointer & ~(page_size - 1)); + + // The number of bytes of stack which we try to capture. +- static const ptrdiff_t kStackToCapture = 32 * 1024; ++ // This now depends on page_size to avoid missing data ++ // on systems with larger page sizes. ++ static const ptrdiff_t kStackToCapture = 8 * page_size; + + const MappingInfo* mapping = FindMapping(stack_pointer); + if (!mapping) +diff --git third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h +index 7bee160f1..07bb2b81a 100644 +--- third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h ++++ third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper.h +@@ -63,7 +63,8 @@ namespace google_breakpad { + (defined(__mips__) && _MIPS_SIM == _ABIO32) + typedef Elf32_auxv_t elf_aux_entry; + #elif defined(__x86_64) || defined(__aarch64__) || \ +- (defined(__mips__) && _MIPS_SIM != _ABIO32) ++ (defined(__mips__) && _MIPS_SIM != _ABIO32) || \ ++ defined(__powerpc64__) + typedef Elf64_auxv_t elf_aux_entry; + #endif + +diff --git third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +index 331f4bb34..3f722947f 100644 +--- third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc ++++ third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc +@@ -51,6 +51,8 @@ + #define TID_PTR_REGISTER "rcx" + #elif defined(__mips__) + #define TID_PTR_REGISTER "$1" ++#elif defined(__powerpc64__) ++#define TID_PTR_REGISTER "r8" + #else + #error This test has not been ported to this platform. + #endif +diff --git third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc +index e3ddb81a6..fa28575ef 100644 +--- third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc ++++ third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc +@@ -149,19 +149,27 @@ bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child, + return true; + } + +-bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid) +-{ ++bool LinuxPtraceDumper::ReadRegisterSet(ThreadInfo* info, pid_t tid) { + #ifdef PTRACE_GETREGSET + struct iovec io; + info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len); +- if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) { ++ if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) { + return false; + } + + info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len); +- if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) { ++ if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) { + return false; + } ++ ++#if defined(__powerpc64__) ++ // Grab the vector registers on PPC64 too ++ info->GetVectorRegisters(&io.iov_base, &io.iov_len); ++ if (ptrace(PTRACE_GETREGSET, tid, (void*)NT_PPC_VMX, (void*)&io) == -1) { ++ return false; ++ } ++#endif // defined(__powerpc64__) ++ + return true; + #else + return false; +@@ -298,6 +306,9 @@ bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) { + #elif defined(__mips__) + stack_pointer = + reinterpret_cast(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]); ++#elif defined(__powerpc64__) ++ stack_pointer = ++ reinterpret_cast(info->mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP]); + #else + #error "This code hasn't been ported to your platform yet." + #endif +diff --git third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc +index da71e15dc..12bfb317a 100644 +--- third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc ++++ third_party/breakpad/breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc +@@ -462,6 +462,9 @@ TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) { + #elif defined(__mips__) + pid_t* process_tid_location = + reinterpret_cast(one_thread.mcontext.gregs[1]); ++#elif defined(__powerpc64__) ++ pid_t* process_tid_location = ++ reinterpret_cast(one_thread.mcontext.gp_regs[8]); + #else + #error This test has not been ported to this platform. + #endif +@@ -559,6 +562,8 @@ TEST_F(LinuxPtraceDumperTest, SanitizeStackCopy) { + uintptr_t heap_addr = thread_info.regs.rcx; + #elif defined(__mips__) + uintptr_t heap_addr = thread_info.mcontext.gregs[1]; ++#elif defined(__powerpc64__) ++ uintptr_t heap_addr = thread_info.mcontext.gp_regs[8]; + #else + #error This test has not been ported to this platform. + #endif +diff --git third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc +index 32634ef00..2a56948de 100644 +--- third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc ++++ third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.cc +@@ -136,7 +136,9 @@ class MinidumpWriter { + : fd_(minidump_fd), + path_(minidump_path), + ucontext_(context ? &context->context : NULL), +-#if !defined(__ARM_EABI__) && !defined(__mips__) ++#if defined(__powerpc64__) ++ vector_state_(context ? &context->vector_state : NULL), ++#elif !defined(__ARM_EABI__) && !defined(__mips__) + float_state_(context ? &context->float_state : NULL), + #endif + dumper_(dumper), +@@ -468,7 +470,9 @@ class MinidumpWriter { + if (!cpu.Allocate()) + return false; + my_memset(cpu.get(), 0, sizeof(RawContextCPU)); +-#if !defined(__ARM_EABI__) && !defined(__mips__) ++#if defined(__powerpc64__) ++ UContextReader::FillCPUContext(cpu.get(), ucontext_, vector_state_); ++#elif !defined(__ARM_EABI__) && !defined(__mips__) + UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_); + #else + UContextReader::FillCPUContext(cpu.get(), ucontext_); +@@ -897,7 +901,7 @@ class MinidumpWriter { + dirent->location.rva = 0; + } + +-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) ++#if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || defined(__powerpc64__) + bool WriteCPUInformation(MDRawSystemInfo* sys_info) { + char vendor_id[sizeof(sys_info->cpu.x86_cpu_info.vendor_id) + 1] = {0}; + static const char vendor_id_name[] = "vendor_id"; +@@ -917,7 +921,9 @@ class MinidumpWriter { + + // processor_architecture should always be set, do this first + sys_info->processor_architecture = +-#if defined(__mips__) ++#if defined(__powerpc64__) ++ MD_CPU_ARCHITECTURE_PPC64; ++#elif defined(__mips__) + # if _MIPS_SIM == _ABIO32 + MD_CPU_ARCHITECTURE_MIPS; + # elif _MIPS_SIM == _ABI64 +@@ -1333,7 +1339,9 @@ class MinidumpWriter { + const char* path_; // Path to the file where the minidum should be written. + + const ucontext_t* const ucontext_; // also from the signal handler +-#if !defined(__ARM_EABI__) && !defined(__mips__) ++#if defined(__powerpc64__) ++ const google_breakpad::vstate_t* const vector_state_; ++#elif !defined(__ARM_EABI__) && !defined(__mips__) + const google_breakpad::fpstate_t* const float_state_; // ditto + #endif + LinuxDumper* dumper_; +diff --git third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h +index e3b0b16da..ccd8aa0a4 100644 +--- third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h ++++ third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer.h +@@ -48,6 +48,8 @@ class ExceptionHandler; + + #if defined(__aarch64__) + typedef struct fpsimd_context fpstate_t; ++#elif defined(__powerpc64__) ++typedef vrregset_t vstate_t; + #elif !defined(__ARM_EABI__) && !defined(__mips__) + typedef std::remove_pointer::type fpstate_t; + #endif +diff --git third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc +index d192e5cbb..fc1bfa8d7 100644 +--- third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc ++++ third_party/breakpad/breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc +@@ -715,6 +715,9 @@ TEST(MinidumpWriterTest, InvalidStackPointer) { + #elif defined(__mips__) + context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] = + invalid_stack_pointer; ++#elif defined(__powerpc64__) ++ context.context.uc_mcontext.gp_regs[MD_CONTEXT_PPC64_REG_SP] = ++ invalid_stack_pointer; + #else + # error "This code has not been ported to your platform yet." + #endif +diff --git third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc +index 99362945c..c54ba7145 100644 +--- third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc ++++ third_party/breakpad/breakpad/src/common/linux/memory_mapped_file.cc +@@ -65,8 +65,7 @@ bool MemoryMappedFile::Map(const char* path, size_t offset) { + } + + #if defined(__x86_64__) || defined(__aarch64__) || \ +- (defined(__mips__) && _MIPS_SIM == _ABI64) +- ++ (defined(__mips__) && _MIPS_SIM == _ABI64) || defined(__powerpc64__) + struct kernel_stat st; + if (sys_fstat(fd, &st) == -1 || st.st_size < 0) { + #else +diff --git third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc +index fad59f40c..616496d67 100644 +--- third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc ++++ third_party/breakpad/breakpad/src/common/linux/memory_mapped_file_unittest.cc +@@ -176,9 +176,10 @@ TEST_F(MemoryMappedFileTest, RemapAfterMap) { + TEST_F(MemoryMappedFileTest, MapWithOffset) { + // Put more data in the test file this time. Offsets can only be + // done on page boundaries, so we need a two page file to test this. +- const int page_size = 4096; +- char data1[2 * page_size]; +- size_t data1_size = sizeof(data1); ++ const int page_size = getpagesize(); ++ char *data1 = static_cast(malloc(2 * page_size)); ++ EXPECT_TRUE(data1 != NULL); ++ size_t data1_size = (2 * page_size); + for (size_t i = 0; i < data1_size; ++i) { + data1[i] = i & 0x7f; + } +diff --git third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc +index 5803b90d5..2a1cf14f0 100644 +--- third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc ++++ third_party/breakpad/breakpad/src/common/memory_allocator_unittest.cc +@@ -57,8 +57,9 @@ TEST(PageAllocatorTest, LargeObject) { + + EXPECT_EQ(0U, allocator.pages_allocated()); + uint8_t* p = reinterpret_cast(allocator.Alloc(10000)); ++ uint64_t expected_pages = 1 + ((10000 - 1) / getpagesize()); + ASSERT_FALSE(p == NULL); +- EXPECT_EQ(3U, allocator.pages_allocated()); ++ EXPECT_EQ(expected_pages, allocator.pages_allocated()); + for (unsigned i = 1; i < 10; ++i) { + uint8_t* p = reinterpret_cast(allocator.Alloc(i)); + ASSERT_FALSE(p == NULL); +diff --git third_party/breakpad/breakpad/src/processor/exploitability_linux.cc third_party/breakpad/breakpad/src/processor/exploitability_linux.cc +index 798056dfa..22bd81fff 100644 +--- third_party/breakpad/breakpad/src/processor/exploitability_linux.cc ++++ third_party/breakpad/breakpad/src/processor/exploitability_linux.cc +@@ -202,12 +202,14 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) { + // Check architecture and set architecture variable to corresponding flag + // in objdump. + switch (context->GetContextCPU()) { ++#if defined(__i386) || defined(__x86_64) + case MD_CONTEXT_X86: + architecture = "i386"; + break; + case MD_CONTEXT_AMD64: + architecture = "i386:x86-64"; + break; ++#endif + default: + // Unsupported architecture. Note that ARM architectures are not + // supported because objdump does not support ARM. +diff --git third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc +index 528ee5f21..72764d6c1 100644 +--- third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc ++++ third_party/breakpad/breakpad/src/processor/exploitability_unittest.cc +@@ -104,6 +104,8 @@ ExploitabilityFor(const string& filename) { + } + + TEST(ExploitabilityTest, TestWindowsEngine) { ++// The following tests are only executable on an x86-class linux machine. ++#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64)) + ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH, + ExploitabilityFor("ascii_read_av.dmp")); + ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH, +@@ -136,9 +138,12 @@ TEST(ExploitabilityTest, TestWindowsEngine) { + ExploitabilityFor("read_av_clobber_write.dmp")); + ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW, + ExploitabilityFor("read_av_conditional.dmp")); ++#endif + } + + TEST(ExploitabilityTest, TestLinuxEngine) { ++// The following tests are only executable on an x86-class linux machine. ++#if defined(__i386) || defined(__x86_64) + ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING, + ExploitabilityFor("linux_null_read_av.dmp")); + ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH, +@@ -171,7 +176,8 @@ TEST(ExploitabilityTest, TestLinuxEngine) { + ExploitabilityFor("linux_executable_heap.dmp")); + ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH, + ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp")); +-#ifndef _WIN32 ++#endif ++#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64)) + ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH, + ExploitabilityFor("linux_write_to_nonwritable_module.dmp")); + ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH, +@@ -182,10 +188,10 @@ TEST(ExploitabilityTest, TestLinuxEngine) { + ExploitabilityFor("linux_write_to_outside_module_via_math.dmp")); + ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING, + ExploitabilityFor("linux_write_to_under_4k.dmp")); +-#endif // _WIN32 ++#endif // !defined(_WIN32) && (!defined(__i386) && !defined(__x86_64)) + } + +-#ifndef _WIN32 ++#if !defined(_WIN32) && (defined(__i386) || defined(__x86_64)) + TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) { + ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL)); + uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0}; +@@ -301,6 +307,7 @@ TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) { + context, + &write_address)); + } +-#endif // _WIN32 ++#endif // !defined(_WIN32) && (defined(__i386) || defined(__x86_64)) ++ + + } // namespace +diff --git third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc +index aade82c99..195aa73f3 100644 +--- third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc ++++ third_party/breakpad/breakpad/src/tools/linux/md2core/minidump-2-core.cc +@@ -77,6 +77,8 @@ + #define ELF_ARCH EM_MIPS + #elif defined(__aarch64__) + #define ELF_ARCH EM_AARCH64 ++#elif defined(__powerpc64__) ++ #define ELF_ARCH EM_PPC64 + #endif + + #if defined(__arm__) +@@ -87,6 +89,8 @@ typedef user_regs user_regs_struct; + #elif defined (__mips__) + // This file-local typedef simplifies the source code. + typedef gregset_t user_regs_struct; ++#elif defined(__powerpc64__) ++typedef struct pt_regs user_regs_struct; + #endif + + using google_breakpad::MDTypeHelper; +@@ -321,6 +325,9 @@ struct CrashedProcess { + #endif + #if defined(__aarch64__) + user_fpsimd_struct fpregs; ++#endif ++#if defined(__powerpc64__) ++ mcontext_t mcontext; + #endif + uintptr_t stack_addr; + const uint8_t* stack; +@@ -535,6 +542,38 @@ ParseThreadRegisters(CrashedProcess::Thread* thread, + thread->mcontext.fpc_eir = rawregs->float_save.fir; + #endif + } ++#elif defined(__powerpc64__) ++static void ++ParseThreadRegisters(CrashedProcess::Thread* thread, ++ const MinidumpMemoryRange& range) { ++ const MDRawContextPPC64* rawregs = range.GetData(0); ++ ++ for (int i = 0; i < MD_CONTEXT_PPC64_GPR_COUNT; i++) ++ thread->mcontext.gp_regs[i] = rawregs->gpr[i]; ++ ++ thread->mcontext.gp_regs[PT_LNK] = rawregs->lr; ++ thread->mcontext.gp_regs[PT_NIP] = rawregs->srr0; ++ thread->mcontext.gp_regs[PT_MSR] = rawregs->srr1; ++ thread->mcontext.gp_regs[PT_CCR] = rawregs->cr; ++ thread->mcontext.gp_regs[PT_XER] = rawregs->xer; ++ thread->mcontext.gp_regs[PT_CTR] = rawregs->ctr; ++ thread->mcontext.v_regs->vrsave = rawregs->vrsave; ++ ++ for (int i = 0; i < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT; i++) ++ thread->mcontext.fp_regs[i] = rawregs->float_save.fpregs[i]; ++ ++ thread->mcontext.fp_regs[NFPREG-1] = rawregs->float_save.fpscr; ++ ++ for (int i = 0; i < MD_VECTORSAVEAREA_PPC_VR_COUNT; i++) { ++ thread->mcontext.v_regs->vrregs[i][0] = rawregs->vector_save.save_vr[i].high >> 32; ++ thread->mcontext.v_regs->vrregs[i][1] = rawregs->vector_save.save_vr[i].high; ++ thread->mcontext.v_regs->vrregs[i][2] = rawregs->vector_save.save_vr[i].low >> 32; ++ thread->mcontext.v_regs->vrregs[i][3] = rawregs->vector_save.save_vr[i].low; ++ } ++ ++ thread->mcontext.v_regs->vscr.vscr_word = rawregs->vector_save.save_vscr.low & 0xFFFFFFFF; ++} ++ + #else + #error "This code has not been ported to your platform yet" + #endif +@@ -623,6 +662,12 @@ ParseSystemInfo(const Options& options, CrashedProcess* crashinfo, + # else + # error "This mips ABI is currently not supported (n32)" + # endif ++#elif defined(__powerpc64__) ++ if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_PPC64) { ++ fprintf(stderr, ++ "This version of minidump-2-core only supports PPC64.\n"); ++ exit(1); ++ } + #else + #error "This code has not been ported to your platform yet" + #endif +diff --git third_party/crashpad/crashpad/CONTRIBUTORS third_party/crashpad/crashpad/CONTRIBUTORS +index 8724b7f32..8e29424ef 100644 +--- third_party/crashpad/crashpad/CONTRIBUTORS ++++ third_party/crashpad/crashpad/CONTRIBUTORS +@@ -13,3 +13,4 @@ Mark Mentovai + Robert Sesek + Scott Graham + Joshua Peraza ++Shawn Anastasio +diff --git third_party/crashpad/crashpad/compat/linux/sys/user.h third_party/crashpad/crashpad/compat/linux/sys/user.h +index 6ed77a98e..1fd83469a 100644 +--- third_party/crashpad/crashpad/compat/linux/sys/user.h ++++ third_party/crashpad/crashpad/compat/linux/sys/user.h +@@ -15,6 +15,7 @@ + #ifndef CRASHPAD_COMPAT_LINUX_SYS_USER_H_ + #define CRASHPAD_COMPAT_LINUX_SYS_USER_H_ + ++#include + #include_next + + #include +diff --git third_party/crashpad/crashpad/minidump/minidump_context.h third_party/crashpad/crashpad/minidump/minidump_context.h +index 3a3e603cb..3118d9e9f 100644 +--- third_party/crashpad/crashpad/minidump/minidump_context.h ++++ third_party/crashpad/crashpad/minidump/minidump_context.h +@@ -592,6 +592,70 @@ struct MinidumpContextMIPS64 { + uint64_t fir; + }; + ++//! \brief ppc64-specific flags for MinidumpPPC64::context_flags ++//! Based on minidump_cpu_ppc64.h from breakpad ++enum MinidumpContextPPC64Flags : uint32_t { ++ //! \brief Identifies the context as PPC64. ++ kMinidumpContextPPC64 = 0x01000000, ++ ++ //! \brief Indicates the validity of general purpose registers. ++ //! ++ //! Registers `r0`-`r31`, `nip`, `msr`, `lr`, etc. are valid. ++ kMinidumpContextPPC64Base = kMinidumpContextPPC64 | 0x00000001, ++ ++ //! \brief Indicates the validity of floating point registers. ++ //! ++ //! Registers `fp0`-`fp31`, `fpscr` are valid. ++ kMinidumpContextPPC64Floating = kMinidumpContextPPC64 | 0x00000008, ++ ++ //! \brief Indicates the validity of Altivec/VMX registers. ++ //! ++ //! Registers `v0`-`v31`, `vscr`, `vrsave`. ++ kMinidumpContextPPC64Vector = kMinidumpContextPPC64 | 0x00000020, ++ ++ //! \brief Indicates the validity of all registers ++ kMinidumpContextPPC64All = kMinidumpContextPPC64Base | ++ kMinidumpContextPPC64Floating | ++ kMinidumpContextPPC64Vector ++}; ++ ++//! \brief A PPC64 CPU context carried in a minidump file. ++//! Based on minidump_cpu_ppc64.h from breakpad. ++struct MinidumpContextPPC64 { ++ uint64_t context_flags; ++ ++ //! \brief General purpose registers. ++ uint64_t nip; ++ uint64_t msr; ++ uint64_t regs[32]; ++ uint64_t ccr; ++ uint64_t xer; ++ uint64_t lnk; ++ uint64_t ctr; ++ ++ //! \brief Floating point registers. ++ double fpregs[32]; ++ ++ //! \brief FPU status register. ++ double fpscr; ++ ++ //! \brief Altivec/VMX vector registers. ++ struct { ++ //! \brief Vector registers are 128bits. ++ uint128_struct save_vr[32]; ++ uint128_struct save_vscr; ++ ++ //! \brief Padding included for breakpad compatibiltiy. ++ uint32_t save_pad5[4]; ++ ++ //! \brief VRSAVE register. ++ uint32_t save_vrsave; ++ ++ //! \brief Padding included for breakpad compatibiltiy. ++ uint32_t save_pad6[7]; ++ } vregs; ++}; ++ + } // namespace crashpad + + #endif // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_H_ +diff --git third_party/crashpad/crashpad/minidump/minidump_context_writer.cc third_party/crashpad/crashpad/minidump/minidump_context_writer.cc +index d7e53a493..d89eb9e01 100644 +--- third_party/crashpad/crashpad/minidump/minidump_context_writer.cc ++++ third_party/crashpad/crashpad/minidump/minidump_context_writer.cc +@@ -101,6 +101,13 @@ MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) { + break; + } + ++ case kCPUArchitecturePPC64: { ++ context = std::make_unique(); ++ reinterpret_cast(context.get()) ++ ->InitalizeFromSnapshot(context_snapshot->ppc64); ++ break; ++ } ++ + default: { + LOG(ERROR) << "unknown context architecture " + << context_snapshot->architecture; +@@ -453,4 +460,47 @@ size_t MinidumpContextMIPS64Writer::ContextSize() const { + return sizeof(context_); + } + ++MinidumpContextPPC64Writer::MinidumpContextPPC64Writer() ++ : MinidumpContextWriter(), context_() { ++ context_.context_flags = kMinidumpContextPPC64; ++} ++ ++MinidumpContextPPC64Writer::~MinidumpContextPPC64Writer() = default; ++ ++void MinidumpContextPPC64Writer::InitalizeFromSnapshot( ++ const CPUContextPPC64* context_snapshot) { ++ DCHECK_EQ(state(), kStateMutable); ++ DCHECK_EQ(context_.context_flags, kMinidumpContextPPC64); ++ ++ context_.context_flags = kMinidumpContextPPC64All; ++ ++ memcpy(context_.regs, context_snapshot->regs, sizeof(context_.regs)); ++ context_.nip = context_snapshot->nip; ++ context_.msr = context_snapshot->msr; ++ context_.ccr = context_snapshot->ccr; ++ context_.xer = context_snapshot->xer; ++ context_.lnk = context_snapshot->lnk; ++ context_.ctr = context_snapshot->ctr; ++ ++ memcpy(context_.fpregs, context_snapshot->fpregs, sizeof(context_.fpregs)); ++ context_.fpscr = context_snapshot->fpscr; ++ ++ memcpy(context_.vregs.save_vr, context_snapshot->vregs.save_vr, ++ sizeof(context_.vregs.save_vr)); ++ memcpy(&context_.vregs.save_vscr, &context_snapshot->vregs.save_vscr, ++ sizeof(context_.vregs.save_vscr)); ++ context_.vregs.save_vrsave = context_snapshot->vregs.save_vrsave; ++} ++ ++bool MinidumpContextPPC64Writer::WriteObject( ++ FileWriterInterface* file_writer) { ++ DCHECK_EQ(state(), kStateWritable); ++ return file_writer->Write(&context_, sizeof(context_)); ++} ++ ++size_t MinidumpContextPPC64Writer::ContextSize() const { ++ DCHECK_GE(state(), kStateFrozen); ++ return sizeof(context_); ++} ++ + } // namespace crashpad +diff --git third_party/crashpad/crashpad/minidump/minidump_context_writer.h third_party/crashpad/crashpad/minidump/minidump_context_writer.h +index d4ab936ee..1d22fc59c 100644 +--- third_party/crashpad/crashpad/minidump/minidump_context_writer.h ++++ third_party/crashpad/crashpad/minidump/minidump_context_writer.h +@@ -315,6 +315,45 @@ class MinidumpContextMIPS64Writer final : public MinidumpContextWriter { + DISALLOW_COPY_AND_ASSIGN(MinidumpContextMIPS64Writer); + }; + ++class MinidumpContextPPC64Writer final : public MinidumpContextWriter { ++ public: ++ MinidumpContextPPC64Writer(); ++ ~MinidumpContextPPC64Writer() override; ++ ++ //! \brief Initalizes the MinidumpContextPPC64 based on \a context_snapshot. ++ //! ++ //! \param[in] context_snapshot The context snapshot to use as source data. ++ //! ++ //! \note Valid in #kStateMutable. No mutation of context() may be done before ++ //! calling this method, and it is not normally necessary to alter ++ //! context() after calling this method. ++ void InitalizeFromSnapshot(const CPUContextPPC64* context_snapshot); ++ ++ //! \brief Returns a pointer to the context structure that this object will ++ //! write. ++ //! ++ //! \attention This returns a non-`const` pointer to this object’s private ++ //! data so that a caller can populate the context structure directly. ++ //! This is done because providing setter interfaces to each field in the ++ //! context structure would be unwieldy and cumbersome. Care must be taken ++ //! to populate the context structure correctly. The context structure ++ //! must only be modified while this object is in the #kStateMutable ++ //! state. ++ MinidumpContextPPC64* context() { return &context_; } ++ ++ protected: ++ // MinidumpWritable: ++ bool WriteObject(FileWriterInterface* file_writer) override; ++ ++ // MinidumpContextWriter: ++ size_t ContextSize() const override; ++ ++ private: ++ MinidumpContextPPC64 context_; ++ ++ DISALLOW_COPY_AND_ASSIGN(MinidumpContextPPC64Writer); ++}; ++ + } // namespace crashpad + + #endif // CRASHPAD_MINIDUMP_MINIDUMP_CONTEXT_WRITER_H_ +diff --git third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc +index 3216a906b..a9fcbe9d8 100644 +--- third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc ++++ third_party/crashpad/crashpad/minidump/minidump_context_writer_test.cc +@@ -213,6 +213,21 @@ TEST(MinidumpContextWriter, MIPS64_FromSnapshot) { + context, ExpectMinidumpContextMIPS64, kSeed); + } + ++TEST(MinidumpContextWriter, PPC64_Zeros) { ++ EmptyContextTest( ++ ExpectMinidumpContextPPC64); ++} ++ ++TEST(MinidumpContextWriter, PPC64_FromSnapshot) { ++ constexpr uint32_t kSeed = 64; ++ CPUContextPPC64 context_ppc64; ++ CPUContext context; ++ context.ppc64 = &context_ppc64; ++ InitializeCPUContextPPC64(&context, kSeed); ++ FromSnapshotTest( ++ context, ExpectMinidumpContextPPC64, kSeed); ++} ++ + } // namespace + } // namespace test + } // namespace crashpad +diff --git third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc +index 0974e3ddf..b71ec5880 100644 +--- third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc ++++ third_party/crashpad/crashpad/minidump/minidump_misc_info_writer.cc +@@ -135,6 +135,8 @@ std::string MinidumpMiscInfoDebugBuildString() { + static constexpr char kCPU[] = "mips"; + #elif defined(ARCH_CPU_MIPS64EL) + static constexpr char kCPU[] = "mips64"; ++#elif defined(ARCH_CPU_PPC64) ++ static constexpr char kCPU[] = "ppc64"; + #else + #error define kCPU for this CPU + #endif +diff --git third_party/crashpad/crashpad/snapshot/capture_memory.cc third_party/crashpad/crashpad/snapshot/capture_memory.cc +index 7a1b2763c..beda8da9e 100644 +--- third_party/crashpad/crashpad/snapshot/capture_memory.cc ++++ third_party/crashpad/crashpad/snapshot/capture_memory.cc +@@ -112,6 +112,11 @@ void CaptureMemory::PointedToByContext(const CPUContext& context, + for (size_t i = 0; i < base::size(context.mipsel->regs); ++i) { + MaybeCaptureMemoryAround(delegate, context.mipsel->regs[i]); + } ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ MaybeCaptureMemoryAround(delegate, context.ppc64->nip); ++ for (size_t i = 0; i < base::size(context.ppc64->regs); ++i) { ++ MaybeCaptureMemoryAround(delegate, context.ppc64->regs[i]); ++ } + #else + #error Port. + #endif +diff --git third_party/crashpad/crashpad/snapshot/cpu_architecture.h third_party/crashpad/crashpad/snapshot/cpu_architecture.h +index 811a72095..f4f83981d 100644 +--- third_party/crashpad/crashpad/snapshot/cpu_architecture.h ++++ third_party/crashpad/crashpad/snapshot/cpu_architecture.h +@@ -43,7 +43,10 @@ enum CPUArchitecture { + kCPUArchitectureMIPSEL, + + //! \brief 64-bit MIPSEL. +- kCPUArchitectureMIPS64EL ++ kCPUArchitectureMIPS64EL, ++ ++ //! \brief 64-bit PPC64. ++ kCPUArchitecturePPC64 + }; + + } // namespace crashpad +diff --git third_party/crashpad/crashpad/snapshot/cpu_context.cc third_party/crashpad/crashpad/snapshot/cpu_context.cc +index c75b5555e..aeade577a 100644 +--- third_party/crashpad/crashpad/snapshot/cpu_context.cc ++++ third_party/crashpad/crashpad/snapshot/cpu_context.cc +@@ -169,6 +169,8 @@ uint64_t CPUContext::InstructionPointer() const { + return arm->pc; + case kCPUArchitectureARM64: + return arm64->pc; ++ case kCPUArchitecturePPC64: ++ return ppc64->nip; + default: + NOTREACHED(); + return ~0ull; +@@ -185,6 +187,8 @@ uint64_t CPUContext::StackPointer() const { + return arm->sp; + case kCPUArchitectureARM64: + return arm64->sp; ++ case kCPUArchitecturePPC64: ++ return ppc64->regs[1]; + default: + NOTREACHED(); + return ~0ull; +@@ -196,6 +200,7 @@ bool CPUContext::Is64Bit() const { + case kCPUArchitectureX86_64: + case kCPUArchitectureARM64: + case kCPUArchitectureMIPS64EL: ++ case kCPUArchitecturePPC64: + return true; + case kCPUArchitectureX86: + case kCPUArchitectureARM: +diff --git third_party/crashpad/crashpad/snapshot/cpu_context.h third_party/crashpad/crashpad/snapshot/cpu_context.h +index fb23c4679..eebede63c 100644 +--- third_party/crashpad/crashpad/snapshot/cpu_context.h ++++ third_party/crashpad/crashpad/snapshot/cpu_context.h +@@ -352,6 +352,24 @@ struct CPUContextMIPS64 { + uint64_t fir; + }; + ++//! \brief A context structure carrying PPC64 CPU state. ++struct CPUContextPPC64 { ++ uint64_t nip; ++ uint64_t msr; ++ uint64_t regs[32]; ++ uint64_t ccr; ++ uint64_t xer; ++ uint64_t lnk; ++ uint64_t ctr; ++ double fpregs[32]; ++ double fpscr; ++ struct { ++ uint128_struct save_vr[32]; ++ uint128_struct save_vscr; ++ uint32_t save_vrsave; ++ } vregs; ++}; ++ + //! \brief A context structure capable of carrying the context of any supported + //! CPU architecture. + struct CPUContext { +@@ -382,6 +400,7 @@ struct CPUContext { + CPUContextARM64* arm64; + CPUContextMIPS* mipsel; + CPUContextMIPS64* mips64; ++ CPUContextPPC64* ppc64; + }; + }; + +diff --git third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h +index 9f46a4897..aa677c4eb 100644 +--- third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h ++++ third_party/crashpad/crashpad/snapshot/linux/cpu_context_linux.h +@@ -15,6 +15,7 @@ + #ifndef CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_ + #define CRASHPAD_SNAPSHOT_LINUX_CPU_CONTEXT_LINUX_H_ + ++#include + #include "build/build_config.h" + #include "snapshot/cpu_context.h" + #include "snapshot/linux/signal_context.h" +@@ -174,6 +175,78 @@ void InitializeCPUContextMIPS( + + #endif // ARCH_CPU_MIPS_FAMILY || DOXYGEN + ++#if defined(ARCH_CPU_PPC64_FAMILY) || DOXYGEN ++ ++//! \brief Initalizes a CPUContextPPC64 structure from native context ++//! structures on Linux. ++//! ++//! \param[in] thread_context The native thread context. ++//! \param[in] float_context The native float context. ++//! \param[in] vector_context The native vector context. ++//! \param[out] context The CPUContextPPC64 structure to initalize. ++template ++void InitializeCPUContextPPC64( ++ const ThreadContext::t64_t& thread_context, ++ const FloatContext::f64_t& float_context, ++ const VectorContext::v64_t& vector_context, ++ typename Traits::CPUContext* context) { ++ ++ memcpy(context->regs, thread_context.gpr, sizeof(context->regs)); ++ context->nip = thread_context.nip; ++ context->msr = thread_context.msr; ++ context->ccr = thread_context.ccr; ++ context->xer = thread_context.xer; ++ context->lnk = thread_context.lnk; ++ context->ctr = thread_context.ctr; ++ ++ memcpy(context->fpregs, float_context.fpregs, sizeof(context->fpregs)); ++ context->fpscr = float_context.fpscr; ++ ++ for (uint8_t i = 0; i < 32; i++) { ++ context->vregs.save_vr[i] = { ++ (((uint64_t)vector_context.vrregs[i][0]) << 32) | ++ vector_context.vrregs[i][1], ++ (((uint64_t)vector_context.vrregs[i][2]) << 32) | ++ vector_context.vrregs[i][3] ++ }; ++ } ++ context->vregs.save_vrsave = vector_context.vrsave; ++ context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word}; ++} ++ ++template ++void InitializeCPUContextPPC64( ++ const SignalThreadContext64 &thread_context, ++ const SignalFloatContext64 &float_context, ++ const SignalVectorContext64 &vector_context, ++ typename Traits::CPUContext* context) { ++ ++ memcpy(context->regs, thread_context.regs, sizeof(context->regs)); ++ context->nip = thread_context.nip; ++ context->msr = thread_context.msr; ++ context->ccr = thread_context.ccr; ++ context->xer = thread_context.xer; ++ context->lnk = thread_context.lnk; ++ context->ctr = thread_context.ctr; ++ ++ memcpy(context->fpregs, float_context.regs, sizeof(context->fpregs)); ++ context->fpscr = float_context.fpscr; ++ ++ for (uint8_t i = 0; i < 32; i++) { ++ context->vregs.save_vr[i] = { ++ (((uint64_t)vector_context.vrregs[i][0]) << 32) | ++ vector_context.vrregs[i][1], ++ (((uint64_t)vector_context.vrregs[i][2]) << 32) | ++ vector_context.vrregs[i][3] ++ }; ++ } ++ context->vregs.save_vrsave = vector_context.vrsave; ++ context->vregs.save_vscr = {0, (uint64_t)vector_context.vscr.vscr_word}; ++} ++ ++ ++#endif ++ + } // namespace internal + } // namespace crashpad + +diff --git third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc +index d32bd1937..2dd538c2b 100644 +--- third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc ++++ third_party/crashpad/crashpad/snapshot/linux/debug_rendezvous_test.cc +@@ -192,6 +192,8 @@ void TestAgainstTarget(PtraceConnection* connection) { + device == 0 && inode == 0 && mapping_name == "[vdso]"; + #if defined(ARCH_CPU_X86) + static constexpr char kPrefix[] = "linux-gate.so."; ++#elif defined(ARCH_CPU_PPC64) ++ static constexpr char kPrefix[] = "linux-vdso64.so."; + #else + static constexpr char kPrefix[] = "linux-vdso.so."; + #endif +diff --git third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc +index cd40b3b12..6bcf23b6f 100644 +--- third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc ++++ third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.cc +@@ -323,6 +323,69 @@ bool ExceptionSnapshotLinux::ReadContext( + reader, context_address, context_.mips64); + } + ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ ++template ++static bool ReadContext(ProcessReaderLinux* reader, ++ LinuxVMAddress context_address, ++ typename Traits::CPUContext* dest_context) { ++ const ProcessMemory* memory = reader->Memory(); ++ ++ LinuxVMAddress gp_regs_address = context_address + ++ offsetof(UContext, mcontext) + ++ offsetof(typename Traits::MContext, gp_regs); ++ ++ typename Traits::SignalThreadContext thread_context; ++ if (!memory->Read(gp_regs_address, sizeof(thread_context), &thread_context)) { ++ LOG(ERROR) << "Couldn't read gp_regs!"; ++ return false; ++ } ++ ++ LinuxVMAddress fp_regs_address = context_address + ++ offsetof(UContext, mcontext) + ++ offsetof(typename Traits::MContext, fp_regs); ++ ++ typename Traits::SignalFloatContext fp_context; ++ if (!memory->Read(fp_regs_address, sizeof(fp_context), &fp_context)) { ++ LOG(ERROR) << "Couldn't read fp_regs!"; ++ return false; ++ } ++ ++ LinuxVMAddress v_regs_ptr_address = context_address + ++ offsetof(UContext, mcontext) + ++ offsetof(typename Traits::MContext, vmx_reserve) + 8; ++ ++ typename Traits::SignalVectorContext v_context; ++ if (!memory->Read(v_regs_ptr_address, sizeof(v_context), &v_context)) { ++ LOG(ERROR) << "Couldn't read v_regs!"; ++ return false; ++ } ++ ++ InitializeCPUContextPPC64(thread_context, fp_context, ++ v_context, dest_context); ++ ++ return true; ++} ++ ++template<> ++bool ExceptionSnapshotLinux::ReadContext( ++ ProcessReaderLinux* reader, ++ LinuxVMAddress context_address) { ++ context_.architecture = kCPUArchitecturePPC64; ++ context_.ppc64 = &context_union_.ppc64; ++ ++ return internal::ReadContext( ++ reader, context_address, context_.ppc64); ++} ++ ++template<> ++bool ExceptionSnapshotLinux::ReadContext( ++ ProcessReaderLinux* reader, ++ LinuxVMAddress context_address) { ++ // PPC64 is 64-bit ++ return false; ++} ++ + #endif // ARCH_CPU_X86_FAMILY + + bool ExceptionSnapshotLinux::Initialize(ProcessReaderLinux* process_reader, +diff --git third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h +index ea0cd2106..e42df520f 100644 +--- third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h ++++ third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux.h +@@ -84,6 +84,8 @@ class ExceptionSnapshotLinux final : public ExceptionSnapshot { + #elif defined(ARCH_CPU_MIPS_FAMILY) + CPUContextMIPS mipsel; + CPUContextMIPS64 mips64; ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ CPUContextPPC64 ppc64; + #endif + } context_union_; + CPUContext context_; +diff --git third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc +index c17170b43..b6a714cc6 100644 +--- third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc ++++ third_party/crashpad/crashpad/snapshot/linux/exception_snapshot_linux_test.cc +@@ -296,7 +296,28 @@ void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) { + 0); + #undef CPU_ARCH_NAME + } ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++using NativeCPUContext = ucontext_t; ++ ++void InitializeContext(NativeCPUContext* context) { ++ for (size_t reg = 0; reg < 32; ++reg) { ++ context->uc_mcontext.gp_regs[reg] = reg; ++ } ++ ++ memset(&context->uc_mcontext.fp_regs, 44, ++ sizeof(context->uc_mcontext.fp_regs)); ++} + ++void ExpectContext(const CPUContext& actual, const NativeCPUContext& expected) { ++ EXPECT_EQ(actual.architecture, kCPUArchitecturePPC64); ++ ++ for (size_t reg = 0; reg < 32; ++reg) { ++ EXPECT_EQ(actual.ppc64->regs[reg], expected.uc_mcontext.gp_regs[reg]); ++ } ++ ++ EXPECT_EQ(memcmp(actual.ppc64->fpregs, expected.uc_mcontext.fp_regs, ++ sizeof(actual.ppc64->fpregs)), 0); ++} + #else + #error Port. + #endif +diff --git third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc +index ee246e8bc..9555dce04 100644 +--- third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc ++++ third_party/crashpad/crashpad/snapshot/linux/process_reader_linux.cc +@@ -108,6 +108,8 @@ void ProcessReaderLinux::Thread::InitializeStack(ProcessReaderLinux* reader) { + #elif defined(ARCH_CPU_MIPS_FAMILY) + stack_pointer = reader->Is64Bit() ? thread_info.thread_context.t64.regs[29] + : thread_info.thread_context.t32.regs[29]; ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ stack_pointer = thread_info.thread_context.t64.gpr[1]; + #else + #error Port. + #endif +diff --git third_party/crashpad/crashpad/snapshot/linux/signal_context.h third_party/crashpad/crashpad/snapshot/linux/signal_context.h +index 110024680..a1f2da259 100644 +--- third_party/crashpad/crashpad/snapshot/linux/signal_context.h ++++ third_party/crashpad/crashpad/snapshot/linux/signal_context.h +@@ -422,6 +422,89 @@ static_assert(offsetof(UContext, mcontext.fpregs) == + "context offset mismatch"); + #endif + ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ ++struct SignalThreadContext64 { ++ uint64_t regs[32]; ++ uint64_t nip; ++ uint64_t msr; ++ uint64_t orig_r3; ++ uint64_t ctr; ++ uint64_t lnk; ++ uint64_t xer; ++ uint64_t ccr; ++ uint64_t softe; ++ uint64_t trap; ++ uint64_t dar; ++ uint64_t dsisr; ++ uint64_t result; ++ uint64_t dscr; ++ uint64_t fpr0[3]; ++}; ++ ++struct SignalFloatContext64 { ++ double regs[32]; ++ double fpscr; ++}; ++ ++struct SignalVectorContext64 { ++ int32_t vrregs[32][4]; ++ struct { ++ int32_t __pad[3]; ++ int32_t vscr_word; ++ } vscr; ++ int32_t vrsave; ++ int32_t __pad[3]; ++} __attribute__((__aligned__(16))); ++ ++ ++#pragma pack(pop) ++struct MContext64 { ++ uint64_t reserved[4]; ++ int32_t signal; ++ int32_t __pad0; ++ uint64_t handler; ++ uint64_t oldmask; ++ uint64_t pt_regs_ptr; ++ SignalThreadContext64 gp_regs; ++ SignalFloatContext64 fp_regs; ++ SignalVectorContext64 *v_regs; ++ int64_t vmx_reserve[69]; ++}; ++ ++struct ContextTraits64 : public Traits64 { ++ using MContext = MContext64; ++ using SignalThreadContext = SignalThreadContext64; ++ using SignalFloatContext = SignalFloatContext64; ++ using SignalVectorContext = SignalVectorContext64; ++ using CPUContext = CPUContextPPC64; ++}; ++ ++struct ContextTraits32 : public Traits32 {}; ++ ++struct UContext { ++ uint64_t flags; ++ uint64_t link; ++ SignalStack stack; ++ Sigset sigmask; ++ MContext64 mcontext; ++}; ++#pragma pack(push, 1) ++ ++static_assert(sizeof(UContext) == sizeof(ucontext_t), ++ "ucontext_t size mismatch"); ++static_assert(sizeof(MContext64) == sizeof(mcontext_t), ++ "mcontext_t size mismatch"); ++static_assert(sizeof(SignalThreadContext64) == sizeof(gregset_t), ++ "gregset_t size mismatch"); ++static_assert(sizeof(SignalFloatContext64) == sizeof(fpregset_t), ++ "fpregset_t size mismatch"); ++static_assert(sizeof(SignalVectorContext64) == sizeof(vrregset_t), ++ "vrregset_t size mismatch"); ++static_assert(offsetof(UContext, mcontext) == ++ offsetof(ucontext_t, uc_mcontext), "mcontext offset mismatch"); ++static_assert(offsetof(MContext64, gp_regs) == ++ offsetof(mcontext_t, gp_regs), "gp_regs offset mismatch"); + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +diff --git third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc +index a99da3e4b..03b973083 100644 +--- third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc ++++ third_party/crashpad/crashpad/snapshot/linux/system_snapshot_linux.cc +@@ -204,6 +204,8 @@ CPUArchitecture SystemSnapshotLinux::GetCPUArchitecture() const { + #elif defined(ARCH_CPU_MIPS_FAMILY) + return process_reader_->Is64Bit() ? kCPUArchitectureMIPS64EL + : kCPUArchitectureMIPSEL; ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ return kCPUArchitecturePPC64; + #else + #error port to your architecture + #endif +@@ -219,6 +221,9 @@ uint32_t SystemSnapshotLinux::CPURevision() const { + #elif defined(ARCH_CPU_MIPS_FAMILY) + // Not implementable on MIPS + return 0; ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ // Not yet implemented on PPC64 ++ return 0; + #else + #error port to your architecture + #endif +@@ -239,6 +244,9 @@ std::string SystemSnapshotLinux::CPUVendor() const { + #elif defined(ARCH_CPU_MIPS_FAMILY) + // Not implementable on MIPS + return std::string(); ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ // Not yet implemented on PPC64 ++ return std::string(); + #else + #error port to your architecture + #endif +@@ -372,6 +380,9 @@ bool SystemSnapshotLinux::NXEnabled() const { + #elif defined(ARCH_CPU_MIPS_FAMILY) + // Not implementable on MIPS + return false; ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ // Not yet implemented on PPC64 ++ return false; + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +diff --git third_party/crashpad/crashpad/snapshot/linux/test_modules.cc third_party/crashpad/crashpad/snapshot/linux/test_modules.cc +index b2450c206..7ba78b2ae 100644 +--- third_party/crashpad/crashpad/snapshot/linux/test_modules.cc ++++ third_party/crashpad/crashpad/snapshot/linux/test_modules.cc +@@ -110,6 +110,8 @@ bool WriteTestModule(const base::FilePath& module_path, + module.ehdr.e_machine = EM_AARCH64; + #elif defined(ARCH_CPU_MIPSEL) || defined(ARCH_CPU_MIPS64EL) + module.ehdr.e_machine = EM_MIPS; ++#elif defined(ARCH_CPU_PPC64) ++ module.ehdr.e_machine = EM_PPC64; + #endif + + module.ehdr.e_version = EV_CURRENT; +diff --git third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc +index e3e2bebdd..8ef43752e 100644 +--- third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc ++++ third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.cc +@@ -186,6 +186,14 @@ bool ThreadSnapshotLinux::Initialize(ProcessReaderLinux* process_reader, + thread.thread_info.float_context.f32, + context_.mipsel); + } ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ context_.architecture = kCPUArchitecturePPC64; ++ context_.ppc64 = &context_union_.ppc64; ++ InitializeCPUContextPPC64( ++ thread.thread_info.thread_context.t64, ++ thread.thread_info.float_context.f64, ++ thread.thread_info.vector_context.v64, ++ context_.ppc64); + #else + #error Port. + #endif +diff --git third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h +index 44cc6f6d9..d4136461e 100644 +--- third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h ++++ third_party/crashpad/crashpad/snapshot/linux/thread_snapshot_linux.h +@@ -68,6 +68,8 @@ class ThreadSnapshotLinux final : public ThreadSnapshot { + #elif defined(ARCH_CPU_MIPS_FAMILY) + CPUContextMIPS mipsel; + CPUContextMIPS64 mips64; ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ CPUContextPPC64 ppc64; + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +diff --git third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc +index d3d5ebdfb..3fd730cb5 100644 +--- third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc ++++ third_party/crashpad/crashpad/util/linux/auxiliary_vector.cc +@@ -56,6 +56,11 @@ bool AuxiliaryVector::Read(PtraceConnection* connection) { + if (type == AT_IGNORE) { + continue; + } ++#if defined(ARCH_CPU_PPC64_FAMILY) ++ if (type == AT_IGNOREPPC) { ++ continue; ++ } ++#endif + if (!MapInsertOrReplace(&values_, type, value, nullptr)) { + LOG(ERROR) << "duplicate auxv entry"; + return false; +diff --git third_party/crashpad/crashpad/util/linux/ptracer.cc third_party/crashpad/crashpad/util/linux/ptracer.cc +index 557e0d363..08ae434b8 100644 +--- third_party/crashpad/crashpad/util/linux/ptracer.cc ++++ third_party/crashpad/crashpad/util/linux/ptracer.cc +@@ -398,6 +398,64 @@ bool GetThreadArea64(pid_t tid, + return true; + } + ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++// PPC64 has had HAVE_ARCH_TRACEHOOK set since 2.6.27 (even before x86 had it). ++// That means we can simply use PTRACE_GETREGESET. ++ ++template ++bool GetRegisterSet(pid_t tid, int set, Destination* dest, bool can_log) { ++ iovec iov; ++ iov.iov_base = reinterpret_cast(dest); ++ iov.iov_len = sizeof(*dest); ++ if (ptrace(PTRACE_GETREGSET, tid, reinterpret_cast(set), &iov) != 0) { ++ PLOG_IF(ERROR, can_log) << "ptrace"; ++ return false; ++ } ++ if (iov.iov_len != sizeof(*dest)) { ++ LOG_IF(ERROR, can_log) << "Unexpected registers size"; ++ return false; ++ } ++ return true; ++} ++ ++bool GetVectorRegisters64(pid_t tid, ++ VectorContext* context, ++ bool can_log) { ++ return GetRegisterSet(tid, NT_PPC_VMX, &context->v64, can_log); ++} ++ ++bool GetFloatingPointRegisters64(pid_t tid, ++ FloatContext* context, ++ bool can_log) { ++ return GetRegisterSet(tid, NT_PRFPREG, &context->f64, can_log); ++} ++ ++bool GetThreadArea64(pid_t tid, ++ const ThreadContext& context, ++ LinuxVMAddress* address, ++ bool can_log) { ++ // PPC64 doesn't have PTRACE_GET_THREAD_AREA since the thread pointer ++ // is stored in GPR 13. ++ ThreadContext::t64_t tc; ++ if (!GetRegisterSet(tid, NT_PRSTATUS, &tc, can_log)) { ++ LOG_IF(ERROR, can_log) << "Unable to get thread pointer!"; ++ return false; ++ } ++ ++ *address = tc.gpr[13]; ++ ++ return true; ++} ++ ++// Stubs for 32-bit functions not applicable on PPC64 ++bool GetFloatingPointRegisters32(pid_t tid, ++ FloatContext* context, ++ bool can_log) { return false; } ++bool GetThreadArea32(pid_t tid, ++ const ThreadContext &context, ++ LinuxVMAddress *address, ++ bool can_log) { return false; } ++ + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +@@ -494,6 +552,9 @@ bool Ptracer::GetThreadInfo(pid_t tid, ThreadInfo* info) { + if (is_64_bit_) { + return GetGeneralPurposeRegisters64(tid, &info->thread_context, can_log_) && + GetFloatingPointRegisters64(tid, &info->float_context, can_log_) && ++#if defined(ARCH_CPU_PPC64_FAMILY) ++ GetVectorRegisters64(tid, &info->vector_context, can_log_) && ++#endif + GetThreadArea64(tid, + info->thread_context, + &info->thread_specific_data_address, +diff --git third_party/crashpad/crashpad/util/linux/thread_info.h third_party/crashpad/crashpad/util/linux/thread_info.h +index 5b55c24a7..dea0d1f39 100644 +--- third_party/crashpad/crashpad/util/linux/thread_info.h ++++ third_party/crashpad/crashpad/util/linux/thread_info.h +@@ -28,6 +28,10 @@ + #include + #endif + ++#if defined(ARCH_CPU_PPC64_FAMILY) ++#include ++#endif ++ + namespace crashpad { + + //! \brief The set of general purpose registers for an architecture family. +@@ -79,6 +83,8 @@ union ThreadContext { + uint32_t cp0_status; + uint32_t cp0_cause; + uint32_t padding1_; ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ // PPC64 is 64-bit + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +@@ -132,6 +138,21 @@ union ThreadContext { + uint64_t cp0_badvaddr; + uint64_t cp0_status; + uint64_t cp0_cause; ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ // Reflects struct pt_regs in asm/ptrace.h. ++ uint64_t gpr[32]; ++ uint64_t nip; ++ uint64_t msr; ++ uint64_t orig_gpr3; ++ uint64_t ctr; ++ uint64_t lnk; ++ uint64_t xer; ++ uint64_t ccr; ++ uint64_t softe; ++ uint64_t trap; ++ uint64_t dar; ++ uint64_t dsisr; ++ uint64_t result; + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +@@ -143,6 +164,8 @@ union ThreadContext { + using NativeThreadContext = user_regs; + #elif defined(ARCH_CPU_MIPS_FAMILY) + // No appropriate NativeThreadsContext type available for MIPS ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ using NativeThreadContext = struct pt_regs; + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY || ARCH_CPU_ARM64 +@@ -218,6 +241,9 @@ union FloatContext { + } fpregs[32]; + uint32_t fpcsr; + uint32_t fpu_id; ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ // Crashpad's PPC support is 64-bit only, so this ++ // 32bit-only struct is declared as empty. + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +@@ -252,6 +278,10 @@ union FloatContext { + double fpregs[32]; + uint32_t fpcsr; + uint32_t fpu_id; ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ // Reflects fpregset_t in sys/ucontext.h ++ double fpregs[32]; ++ double fpscr; + #else + #error Port. + #endif // ARCH_CPU_X86_FAMILY +@@ -280,6 +310,8 @@ union FloatContext { + static_assert(sizeof(f64) == sizeof(user_fpsimd_struct), "Size mismatch"); + #elif defined(ARCH_CPU_MIPS_FAMILY) + // No appropriate floating point context native type for available MIPS. ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ static_assert(sizeof(f64) == sizeof(fpregset_t), "Size mismatch"); + #else + #error Port. + #endif // ARCH_CPU_X86 +@@ -287,6 +319,26 @@ union FloatContext { + static_assert(std::is_standard_layout::value, + "Not standard layout"); + ++//! \brief The vector registers used for an architecture family ++union VectorContext { ++ struct v32_t {} v32; ++#if defined(ARCH_CPU_PPC64_FAMILY) ++ __attribute__((__aligned__(16))) // Vector context must be doubleword aligned. ++#endif ++ struct v64_t { ++#if defined(ARCH_CPU_PPC64_FAMILY) ++ // Reflects vrregset_t in sys/ucontext.h ++ uint32_t vrregs[32][4]; ++ struct { ++ uint32_t __pad[3]; ++ uint32_t vscr_word; ++ } vscr; ++ uint32_t vrsave; ++ uint32_t __pad[3]; ++#endif ++ } v64; ++}; ++ + //! \brief A collection of `ptrace`-able information about a thread. + struct ThreadInfo { + ThreadInfo(); +@@ -298,6 +350,9 @@ struct ThreadInfo { + //! \brief The floating point registers for the thread. + FloatContext float_context; + ++ //! \brief (Optional) The vector registers used for the thread. ++ VectorContext vector_context; ++ + //! \brief The thread-local storage address for the thread. + LinuxVMAddress thread_specific_data_address; + }; +diff --git third_party/crashpad/crashpad/util/misc/capture_context.h third_party/crashpad/crashpad/util/misc/capture_context.h +index d21a24f19..acc325349 100644 +--- third_party/crashpad/crashpad/util/misc/capture_context.h ++++ third_party/crashpad/crashpad/util/misc/capture_context.h +@@ -69,6 +69,7 @@ using NativeCPUContext = ucontext_t; + //! macOS/Linux/Fuchsia | x86_64 | `%%rdi` + //! Linux | ARM/ARM64 | `r0`/`x0` + //! Linux | MIPS/MIPS64 | `$a0` ++//! Linux | PPC64 | `r3` + //! + //! Additionally, the value `LR` on ARM/ARM64 will be the return address of + //! this function. +diff --git third_party/crashpad/crashpad/util/misc/capture_context_linux.S third_party/crashpad/crashpad/util/misc/capture_context_linux.S +index 52215ee5d..b3e4a3ec7 100644 +--- third_party/crashpad/crashpad/util/misc/capture_context_linux.S ++++ third_party/crashpad/crashpad/util/misc/capture_context_linux.S +@@ -32,7 +32,7 @@ + .balign 4, 0x0 + .type CAPTURECONTEXT_SYMBOL, %function + .type CAPTURECONTEXT_SYMBOL2, %function +-#elif defined(__mips__) ++#elif defined(__mips__) || defined(__powerpc64__) + .balign 4, 0x0 + #endif + +@@ -423,4 +423,214 @@ CAPTURECONTEXT_SYMBOL2: + jr $ra + + .set at ++#elif defined(__powerpc64__) ++ // Store r0-r31 ++ std 0, 0xe8(3) // context->uc_mcontext.gp_regs[0] ++ std 1, 0xf0(3) // context->uc_mcontext.gp_regs[1] ++ std 2, 0xf8(3) // context->uc_mcontext.gp_regs[2] ++ // note that r3's original value was lost ++ std 3, 0x100(3) // context->uc_mcontext.gp_regs[3] ++ std 4, 0x108(3) // context->uc_mcontext.gp_regs[4] ++ std 5, 0x110(3) // context->uc_mcontext.gp_regs[5] ++ std 6, 0x118(3) // context->uc_mcontext.gp_regs[6] ++ std 7, 0x120(3) // context->uc_mcontext.gp_regs[7] ++ std 8, 0x128(3) // context->uc_mcontext.gp_regs[8] ++ std 9, 0x130(3) // context->uc_mcontext.gp_regs[9] ++ std 10, 0x138(3) // context->uc_mcontext.gp_regs[10] ++ std 11, 0x140(3) // context->uc_mcontext.gp_regs[11] ++ std 12, 0x148(3) // context->uc_mcontext.gp_regs[12] ++ std 13, 0x150(3) // context->uc_mcontext.gp_regs[13] ++ std 14, 0x158(3) // context->uc_mcontext.gp_regs[14] ++ std 15, 0x160(3) // context->uc_mcontext.gp_regs[15] ++ std 16, 0x168(3) // context->uc_mcontext.gp_regs[16] ++ std 17, 0x170(3) // context->uc_mcontext.gp_regs[17] ++ std 18, 0x178(3) // context->uc_mcontext.gp_regs[18] ++ std 19, 0x180(3) // context->uc_mcontext.gp_regs[19] ++ std 20, 0x188(3) // context->uc_mcontext.gp_regs[20] ++ std 21, 0x190(3) // context->uc_mcontext.gp_regs[21] ++ std 22, 0x198(3) // context->uc_mcontext.gp_regs[22] ++ std 23, 0x1a0(3) // context->uc_mcontext.gp_regs[23] ++ std 24, 0x1a8(3) // context->uc_mcontext.gp_regs[24] ++ std 25, 0x1b0(3) // context->uc_mcontext.gp_regs[25] ++ std 26, 0x1b8(3) // context->uc_mcontext.gp_regs[26] ++ std 27, 0x1c0(3) // context->uc_mcontext.gp_regs[27] ++ std 28, 0x1c8(3) // context->uc_mcontext.gp_regs[28] ++ std 29, 0x1d0(3) // context->uc_mcontext.gp_regs[29] ++ std 30, 0x1d8(3) // context->uc_mcontext.gp_regs[30] ++ std 31, 0x1e0(3) // context->uc_mcontext.gp_regs[31] ++ ++ // For NIP, we can use the value in the link register ++ mflr 0 ++ std 0, 0x1e8(3) // context->uc_mcontext.gp_regs[PT_NIP] ++ ++ // CTR ++ mfctr 0 ++ std 0, 0x200(3) // context->uc_mcontext.gp_regs[PT_CTR] ++ ++ // For LNK, we'll use the caller's LR save area (2 stack frames up). ++ // r4 can be used as a scratch register since it has already been saved. ++ ld 4, 0(1) ++ ld 4, 16(4) ++ std 4, 0x208(3) // context->uc_mcontext.gp_regs[PT_LNK] ++ ++ // XER ++ mfxer 0 ++ std 0, 0x210(3) // context->uc_mcontext.gp_regs[PT_XER] ++ ++ // CCR ++ mfcr 0 ++ std 0, 0x218(3) // context->uc_mcontext.gp_regs[PT_CCR] ++ ++ // MSR, orig_r3, MQ, TRAP, DAR, DSISR, RESULT, DSCR, ++ // not used or not relevant, zero them out. ++ li 4, 0 ++ std 4, 0x1f0(3) // context->uc_mcontext.gp_regs[PT_MSR] ++ std 4, 0x1f8(3) // context->uc_mcontext.gp_regs[PT_ORIG_R3] ++ std 4, 0x220(3) // context->uc_mcontext.gp_regs[PT_MQ] ++ std 4, 0x228(3) // context->uc_mcontext.gp_regs[PT_TRAP] ++ std 4, 0x230(3) // context->uc_mcontext.gp_regs[PT_DAR] ++ std 4, 0x238(3) // context->uc_mcontext.gp_regs[PT_DSISR] ++ std 4, 0x240(3) // context->uc_mcontext.gp_regs[PT_RESULT] ++ std 4, 0x248(3) // context->uc_mcontext.gp_regs[PT_DSCR] ++ ++ // Update context->uc_mcontext.regs to point to gp_regs ++ addi 0, 3, 0xe8 ++ std 0, 0xe0(3) ++ ++ // Save floating point registers 0-31 ++ stfd 0, 0x268(3) // context->uc_mcontext.fp_regs[0] ++ stfd 1, 0x270(3) // context->uc_mcontext.fp_regs[1] ++ stfd 2, 0x278(3) // context->uc_mcontext.fp_regs[2] ++ stfd 3, 0x280(3) // context->uc_mcontext.fp_regs[3] ++ stfd 4, 0x288(3) // context->uc_mcontext.fp_regs[4] ++ stfd 5, 0x290(3) // context->uc_mcontext.fp_regs[5] ++ stfd 6, 0x298(3) // context->uc_mcontext.fp_regs[6] ++ stfd 7, 0x2a0(3) // context->uc_mcontext.fp_regs[7] ++ stfd 8, 0x2a8(3) // context->uc_mcontext.fp_regs[8] ++ stfd 9, 0x2b0(3) // context->uc_mcontext.fp_regs[9] ++ stfd 10, 0x2b8(3) // context->uc_mcontext.fp_regs[10] ++ stfd 11, 0x2c0(3) // context->uc_mcontext.fp_regs[11] ++ stfd 12, 0x2c8(3) // context->uc_mcontext.fp_regs[12] ++ stfd 13, 0x2d0(3) // context->uc_mcontext.fp_regs[13] ++ stfd 14, 0x2d8(3) // context->uc_mcontext.fp_regs[14] ++ stfd 15, 0x2e0(3) // context->uc_mcontext.fp_regs[15] ++ stfd 16, 0x2e8(3) // context->uc_mcontext.fp_regs[16] ++ stfd 17, 0x2f0(3) // context->uc_mcontext.fp_regs[17] ++ stfd 18, 0x2f8(3) // context->uc_mcontext.fp_regs[18] ++ stfd 19, 0x300(3) // context->uc_mcontext.fp_regs[19] ++ stfd 20, 0x308(3) // context->uc_mcontext.fp_regs[20] ++ stfd 21, 0x310(3) // context->uc_mcontext.fp_regs[21] ++ stfd 22, 0x318(3) // context->uc_mcontext.fp_regs[22] ++ stfd 23, 0x320(3) // context->uc_mcontext.fp_regs[23] ++ stfd 24, 0x328(3) // context->uc_mcontext.fp_regs[24] ++ stfd 25, 0x330(3) // context->uc_mcontext.fp_regs[25] ++ stfd 26, 0x338(3) // context->uc_mcontext.fp_regs[26] ++ stfd 27, 0x340(3) // context->uc_mcontext.fp_regs[27] ++ stfd 28, 0x348(3) // context->uc_mcontext.fp_regs[28] ++ stfd 29, 0x350(3) // context->uc_mcontext.fp_regs[29] ++ stfd 30, 0x358(3) // context->uc_mcontext.fp_regs[30] ++ stfd 31, 0x360(3) // context->uc_mcontext.fp_regs[31] ++ ++ // FPSCR ++ mffs 0 ++ stfd 0, 0x368(3) // context->uc_mcontext.fp_regs[32] ++ ++ // Save VMX Vector registers ++ // Update r4 to contain the base address of vmx_reserve ++ addi 4, 3, 0x378 ++ // Ensure that it is quadword aligned ++ andi. 5, 4, 0xF ++ beq 1f // No alignment is necessary ++ // Address is doubleword aligned and not quadword aligned, add 8 ++ addi 4, 4, 8 ++ ++1: ++ // Store VMX registers 0-31 ++ // r4 will contain the base address ++ // r5 will contain the index ++ li 5, 0 ++ stvx 0, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 0] ++ addi 5, 5, 16 ++ stvx 1, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 1] ++ addi 5, 5, 16 ++ stvx 2, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 2] ++ addi 5, 5, 16 ++ stvx 3, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 3] ++ addi 5, 5, 16 ++ stvx 4, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 4] ++ addi 5, 5, 16 ++ stvx 5, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 5] ++ addi 5, 5, 16 ++ stvx 6, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 6] ++ addi 5, 5, 16 ++ stvx 7, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 7] ++ addi 5, 5, 16 ++ stvx 8, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 8] ++ addi 5, 5, 16 ++ stvx 9, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 9] ++ addi 5, 5, 16 ++ stvx 10, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 10] ++ addi 5, 5, 16 ++ stvx 11, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 11] ++ addi 5, 5, 16 ++ stvx 12, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 12] ++ addi 5, 5, 16 ++ stvx 13, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 13] ++ addi 5, 5, 16 ++ stvx 14, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 14] ++ addi 5, 5, 16 ++ stvx 15, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 15] ++ addi 5, 5, 16 ++ stvx 16, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 16] ++ addi 5, 5, 16 ++ stvx 17, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 17] ++ addi 5, 5, 16 ++ stvx 18, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 18] ++ addi 5, 5, 16 ++ stvx 19, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 19] ++ addi 5, 5, 16 ++ stvx 20, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 20] ++ addi 5, 5, 16 ++ stvx 21, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 21] ++ addi 5, 5, 16 ++ stvx 22, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 22] ++ addi 5, 5, 16 ++ stvx 23, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 23] ++ addi 5, 5, 16 ++ stvx 24, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 24] ++ addi 5, 5, 16 ++ stvx 25, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 25] ++ addi 5, 5, 16 ++ stvx 26, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 26] ++ addi 5, 5, 16 ++ stvx 27, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 27] ++ addi 5, 5, 16 ++ stvx 28, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 28] ++ addi 5, 5, 16 ++ stvx 29, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 29] ++ addi 5, 5, 16 ++ stvx 30, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 30] ++ addi 5, 5, 16 ++ stvx 31, 4, 5 // context->uc_mcontext.vmx_reserve[(align) + 31] ++ addi 5, 5, 16 ++ ++ // VSCR ++ mfvscr 0 ++ stvx 0, 4, 5 ++ addi 5, 5, 16 ++ ++ // VRSAVE ++ mfvrsave 0 ++ stwx 0, 4, 5 ++ ++ // Update context->uc_mcontext.v_regs to point to vmx_reserve + alignment. ++ std 4, 0x370(3) ++ ++ // Zero out all unused fields ++ li 4, 0 ++ std 4, 0xc8(3) // context->uc_mcontext.signal ++ std 4, 0xd0(3) // context->uc_mcontext.handler ++ std 4, 0xd8(3) // context->uc_mcontext.oldmask ++ ++ blr + #endif // __i386__ +diff --git third_party/crashpad/crashpad/util/misc/capture_context_test.cc third_party/crashpad/crashpad/util/misc/capture_context_test.cc +index cf23c2def..5f264bc92 100644 +--- third_party/crashpad/crashpad/util/misc/capture_context_test.cc ++++ third_party/crashpad/crashpad/util/misc/capture_context_test.cc +@@ -57,7 +57,7 @@ void TestCaptureContext() { + uintptr_t pc = ProgramCounterFromContext(context_1); + + #if !defined(ADDRESS_SANITIZER) && !defined(ARCH_CPU_MIPS_FAMILY) && \ +- !defined(MEMORY_SANITIZER) ++ !defined(MEMORY_SANITIZER) && !defined(ARCH_CPU_PPC64_FAMILY) + // Sanitizers can cause enough code bloat that the “nearby” check would + // likely fail. + const uintptr_t kReferencePC = +diff --git third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc +index 30a2ab21d..60509f21d 100644 +--- third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc ++++ third_party/crashpad/crashpad/util/misc/capture_context_test_util_linux.cc +@@ -35,6 +35,8 @@ void SanityCheckContext(const NativeCPUContext& context) { + EXPECT_EQ(context.uc_mcontext.regs[0], FromPointerCast(&context)); + #elif defined(ARCH_CPU_MIPS_FAMILY) + EXPECT_EQ(context.uc_mcontext.gregs[4], FromPointerCast(&context)); ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ EXPECT_EQ(context.uc_mcontext.gp_regs[3], FromPointerCast(&context)); + #endif + } + +@@ -49,6 +51,8 @@ uintptr_t ProgramCounterFromContext(const NativeCPUContext& context) { + return context.uc_mcontext.pc; + #elif defined(ARCH_CPU_MIPS_FAMILY) + return context.uc_mcontext.pc; ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ return context.uc_mcontext.gp_regs[PT_NIP]; + #endif + } + +@@ -63,6 +67,8 @@ uintptr_t StackPointerFromContext(const NativeCPUContext& context) { + return context.uc_mcontext.sp; + #elif defined(ARCH_CPU_MIPS_FAMILY) + return context.uc_mcontext.gregs[29]; ++#elif defined(ARCH_CPU_PPC64_FAMILY) ++ return context.uc_mcontext.gp_regs[1]; + #endif + } + +diff --git third_party/crashpad/crashpad/util/posix/signals_test.cc third_party/crashpad/crashpad/util/posix/signals_test.cc +index 54cc2f19f..298b5c993 100644 +--- third_party/crashpad/crashpad/util/posix/signals_test.cc ++++ third_party/crashpad/crashpad/util/posix/signals_test.cc +@@ -46,9 +46,9 @@ bool CanCauseSignal(int sig) { + return sig == SIGABRT || + sig == SIGALRM || + sig == SIGBUS || +-#if !defined(ARCH_CPU_ARM64) ++#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64) + sig == SIGFPE || +-#endif // !defined(ARCH_CPU_ARM64) ++#endif // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64) + #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL) + sig == SIGILL || + #endif // defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL) +@@ -117,9 +117,11 @@ void CauseSignal(int sig) { + break; + } + +-#if !defined(ARCH_CPU_ARM64) ++#if !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64) + // ARM64 has hardware integer division instructions that don’t generate a + // trap for divide-by-zero, so this doesn’t produce SIGFPE. ++ // ++ // PPC64 fixed-point division by zero also doesn't produce a SIGFPE. + case SIGFPE: { + // Optimization makes this tricky, so get zero from a system call likely + // to succeed, and try to do something with the result. +@@ -137,7 +139,7 @@ void CauseSignal(int sig) { + fstat(quotient, &stat_buf); + break; + } +-#endif // ARCH_CPU_ARM64 ++#endif // !defined(ARCH_CPU_ARM64) && !defined(ARCH_CPU_PPC64) + + #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARMEL) + case SIGILL: { +diff --git third_party/dav1d/BUILD.gn third_party/dav1d/BUILD.gn +index 6b4566fc3..c07f732ad 100644 +--- third_party/dav1d/BUILD.gn ++++ third_party/dav1d/BUILD.gn +@@ -184,6 +184,8 @@ static_library("dav1d_8bit") { + sources += arm_template_sources + } else if (current_cpu == "arm64") { + sources += arm_template_sources ++ } else if (current_cpu == "ppc64") { ++ sources += ppc64_template_sources + } + + cflags = dav1d_copts +@@ -212,6 +214,8 @@ static_library("dav1d_10bit") { + sources += arm_template_sources + } else if (current_cpu == "arm64") { + sources += arm_template_sources ++ } else if (current_cpu == "ppc64") { ++ sources += ppc64_template_sources + } + + cflags = dav1d_copts +@@ -263,6 +267,21 @@ if (current_cpu == "x86" || current_cpu == "x64") { + defines = [ "PREFIX" ] + } + ++ cflags = dav1d_copts ++ } ++} else if (current_cpu == "ppc64") { ++ static_library("dav1d_ppc") { ++ sources = [ ++ "libdav1d/src/ppc/cpu.c", ++ "libdav1d/src/ppc/cpu.h", ++ ] ++ ++ configs -= [ "//build/config/compiler:chromium_code" ] ++ configs += [ ++ "//build/config/compiler:no_chromium_code", ++ ":dav1d_config", ++ ] ++ + cflags = dav1d_copts + } + } +@@ -292,5 +311,7 @@ static_library("dav1d") { + } + } else if (current_cpu == "arm" || current_cpu == "arm64") { + deps += [ ":dav1d_arm" ] ++ } else if (current_cpu == "ppc64") { ++ deps += [ ":dav1d_ppc" ] + } + } +diff --git third_party/dav1d/config/linux/ppc64/config.h third_party/dav1d/config/linux/ppc64/config.h +new file mode 100644 +index 000000000..9fbbf75cc +--- /dev/null ++++ third_party/dav1d/config/linux/ppc64/config.h +@@ -0,0 +1,39 @@ ++/* ++ * Autogenerated by the Meson build system. ++ * Do not edit, your changes will be lost. ++ */ ++ ++#pragma once ++ ++#define ARCH_AARCH64 0 ++ ++#define ARCH_ARM 0 ++ ++#define ARCH_PPC64LE 1 ++ ++#define ARCH_X86 0 ++ ++#define ARCH_X86_32 0 ++ ++#define ARCH_X86_64 0 ++ ++#define CONFIG_16BPC 1 ++ ++#define CONFIG_8BPC 1 ++ ++// #define CONFIG_LOG 1 -- Logging is controlled by Chromium ++ ++#define ENDIANNESS_BIG 0 ++ ++#define HAVE_ASM 1 ++ ++#define HAVE_CLOCK_GETTIME 1 ++ ++#define HAVE_DLSYM 1 ++ ++#define HAVE_GETAUXVAL 1 ++ ++#define HAVE_POSIX_MEMALIGN 1 ++ ++#define HAVE_UNISTD_H 1 ++ +diff --git third_party/dav1d/dav1d_generated.gni third_party/dav1d/dav1d_generated.gni +index c59cb0821..3060284a8 100644 +--- third_party/dav1d/dav1d_generated.gni ++++ third_party/dav1d/dav1d_generated.gni +@@ -82,6 +82,11 @@ arm_template_sources = [ + "libdav1d/src/arm/mc_init_tmpl.c", + ] + ++ppc64_template_sources = [ ++ "libdav1d/src/ppc/cdef_init_tmpl.c", ++ "libdav1d/src/ppc/looprestoration_init_tmpl.c", ++] ++ + template_sources = [ + "libdav1d/src/cdef_apply_tmpl.c", + "libdav1d/src/cdef_tmpl.c", +diff --git third_party/dav1d/generate_source.py third_party/dav1d/generate_source.py +index 9ab5e00b8..ad3feffee 100755 +--- third_party/dav1d/generate_source.py ++++ third_party/dav1d/generate_source.py +@@ -50,7 +50,8 @@ def WriteGn(fd): + WriteArray(fd, "arm32_asm_sources", glob.glob("libdav1d/src/arm/32/*.S")) + WriteArray(fd, "arm64_asm_sources", glob.glob("libdav1d/src/arm/64/*.S")) + WriteArray(fd, "arm_template_sources", glob.glob("libdav1d/src/arm/*_tmpl.c")) +- ++ WriteArray(fd, "ppc64_template_sources", glob.glob("libdav1d/src/ppc/*_tmpl.c")) ++ + template_sources = glob.glob("libdav1d/src/*_tmpl.c") + WriteArray(fd, "template_sources", template_sources) + +diff --git third_party/dav1d/libdav1d/src/ppc/types.h third_party/dav1d/libdav1d/src/ppc/types.h +index 0b4bd72f0..a0caa5e71 100644 +--- third_party/dav1d/libdav1d/src/ppc/types.h ++++ third_party/dav1d/libdav1d/src/ppc/types.h +@@ -51,4 +51,19 @@ + #define u16l_to_i32(v) ((i32x4) vec_mergel((u16x8) v, vec_splat_u16(0))) + #define i16l_to_i32(v) ((i32x4) vec_unpackl((i16x8)v)) + ++#if defined(__clang__) ++#undef vec_splats ++#define vec_splats(N) \ ++ _Generic((N), \ ++ unsigned char: ((u8x16)(N)), \ ++ signed char: ((i8x16)(N)), \ ++ unsigned short: ((u16x8)(N)), \ ++ signed short: ((i16x8)(N)), \ ++ unsigned int: ((u32x4)(N)), \ ++ signed int: ((i32x4)(N)), \ ++ unsigned long long: ((u64x2)(N)), \ ++ signed long long: ((i64x2)(N)) \ ++ ) ++#endif ++ + #endif /* DAV1D_SRC_PPC_TYPES_H */ +diff --git third_party/lss/linux_syscall_support.h third_party/lss/linux_syscall_support.h +index e4ac22644..1c57015db 100644 +--- third_party/lss/linux_syscall_support.h ++++ third_party/lss/linux_syscall_support.h +@@ -3947,7 +3947,7 @@ struct kernel_statfs { + LSS_REG(2, buf); + LSS_BODY(void*, mmap2, "0"(__r2)); + } +-#else ++#elif !defined(__powerpc64__) /* ppc64 doesn't have mmap2 */ + #define __NR__mmap2 __NR_mmap2 + LSS_INLINE _syscall6(void*, _mmap2, void*, s, + size_t, l, int, p, +@@ -4058,7 +4058,7 @@ struct kernel_statfs { + #if defined(__i386__) || \ + defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \ + (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \ +- defined(__PPC__) || \ ++ (defined(__PPC__) && !defined(__powerpc64__)) || \ + (defined(__s390__) && !defined(__s390x__)) + /* On these architectures, implement mmap() with mmap2(). */ + LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d, +diff --git third_party/pffft/src/pffft.c third_party/pffft/src/pffft.c +index bdac4d784..51e0f2cac 100644 +--- third_party/pffft/src/pffft.c ++++ third_party/pffft/src/pffft.c +@@ -100,6 +100,7 @@ + Altivec support macros + */ + #if !defined(PFFFT_SIMD_DISABLE) && (defined(__ppc__) || defined(__ppc64__)) ++#include + typedef vector float v4sf; + # define SIMD_SZ 4 + # define VZERO() ((vector float) vec_splat_u8(0)) +diff --git third_party/skia/src/sksl/SkSLString.cpp third_party/skia/src/sksl/SkSLString.cpp +index ec3e56964..4cf8999a2 100644 +--- third_party/skia/src/sksl/SkSLString.cpp ++++ third_party/skia/src/sksl/SkSLString.cpp +@@ -234,7 +234,12 @@ String to_string(double value) { + if (needsDotZero) { + buffer << ".0"; + } +- return String(buffer.str().c_str()); ++ ++ std::string ret(buffer.str()); ++ if (signbit(value) && ret[0] == '.') { ++ ret[0] = '-'; ++ } ++ return String(ret.c_str()); + } + + bool stod(const StringFragment& s, SKSL_FLOAT* value) { +diff --git third_party/sqlite/src/amalgamation/sqlite3.c third_party/sqlite/src/amalgamation/sqlite3.c +index 6b4a7899d..b8c7fe414 100644 +--- third_party/sqlite/src/amalgamation/sqlite3.c ++++ third_party/sqlite/src/amalgamation/sqlite3.c +@@ -14474,7 +14474,8 @@ typedef INT16_TYPE LogEst; + # if defined(i386) || defined(__i386__) || defined(_M_IX86) || \ + defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \ + defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \ +- defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) ++ defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) || \ ++ defined(__powerpc64__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) + # define SQLITE_BYTEORDER 1234 + # elif defined(sparc) || defined(__ppc__) || \ + defined(__ARMEB__) || defined(__AARCH64EB__) +diff --git third_party/sqlite/src/amalgamation_dev/sqlite3.c third_party/sqlite/src/amalgamation_dev/sqlite3.c +index d30c9b7de..cf75a69d9 100644 +--- third_party/sqlite/src/amalgamation_dev/sqlite3.c ++++ third_party/sqlite/src/amalgamation_dev/sqlite3.c +@@ -14487,7 +14487,8 @@ typedef INT16_TYPE LogEst; + # if defined(i386) || defined(__i386__) || defined(_M_IX86) || \ + defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \ + defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \ +- defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) ++ defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) || \ ++ defined(__powerpc64__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) + # define SQLITE_BYTEORDER 1234 + # elif defined(sparc) || defined(__ppc__) || \ + defined(__ARMEB__) || defined(__AARCH64EB__) +diff --git third_party/sqlite/src/ext/rtree/rtree.c third_party/sqlite/src/ext/rtree/rtree.c +index f5b57a5e2..80a2d0ad8 100644 +--- third_party/sqlite/src/ext/rtree/rtree.c ++++ third_party/sqlite/src/ext/rtree/rtree.c +@@ -450,7 +450,7 @@ struct RtreeMatchArg { + #if defined(i386) || defined(__i386__) || defined(_M_IX86) || \ + defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \ + defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \ +- defined(__arm__) ++ defined(__arm__) || defined(__powerpc64__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) + # define SQLITE_BYTEORDER 1234 + #elif defined(sparc) || defined(__ppc__) + # define SQLITE_BYTEORDER 4321 +diff --git third_party/sqlite/src/src/sqliteInt.h third_party/sqlite/src/src/sqliteInt.h +index 245070d4f..b25164e95 100644 +--- third_party/sqlite/src/src/sqliteInt.h ++++ third_party/sqlite/src/src/sqliteInt.h +@@ -877,7 +877,8 @@ typedef INT16_TYPE LogEst; + # if defined(i386) || defined(__i386__) || defined(_M_IX86) || \ + defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \ + defined(_M_AMD64) || defined(_M_ARM) || defined(__x86) || \ +- defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) ++ defined(__ARMEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) || \ ++ defined(__powerpc64__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) + # define SQLITE_BYTEORDER 1234 + # elif defined(sparc) || defined(__ppc__) || \ + defined(__ARMEB__) || defined(__AARCH64EB__) +diff --git third_party/webrtc/modules/desktop_capture/differ_block.cc third_party/webrtc/modules/desktop_capture/differ_block.cc +index 4f0c5430c..54ee0829e 100644 +--- third_party/webrtc/modules/desktop_capture/differ_block.cc ++++ third_party/webrtc/modules/desktop_capture/differ_block.cc +@@ -30,11 +30,7 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) { + static bool (*diff_proc)(const uint8_t*, const uint8_t*) = nullptr; + + if (!diff_proc) { +-#if defined(WEBRTC_ARCH_ARM_FAMILY) || defined(WEBRTC_ARCH_MIPS_FAMILY) +- // For ARM and MIPS processors, always use C version. +- // TODO(hclam): Implement a NEON version. +- diff_proc = &VectorDifference_C; +-#else ++#if defined(WEBRTC_ARCH_X86_FAMILY) + bool have_sse2 = GetCPUInfo(kSSE2) != 0; + // For x86 processors, check if SSE2 is supported. + if (have_sse2 && kBlockSize == 32) { +@@ -44,6 +40,10 @@ bool VectorDifference(const uint8_t* image1, const uint8_t* image2) { + } else { + diff_proc = &VectorDifference_C; + } ++#else ++ // For other processors, always use C version. ++ // TODO(hclam): Implement a NEON version. ++ diff_proc = &VectorDifference_C; + #endif + } + +diff --git third_party/webrtc/rtc_base/system/arch.h third_party/webrtc/rtc_base/system/arch.h +index be2367b85..be4ee4233 100644 +--- third_party/webrtc/rtc_base/system/arch.h ++++ third_party/webrtc/rtc_base/system/arch.h +@@ -79,6 +79,18 @@ + #elif defined(__EMSCRIPTEN__) + #define WEBRTC_ARCH_32_BITS + #define WEBRTC_ARCH_LITTLE_ENDIAN ++#elif defined(__PPC__) ++#define WEBRTC_ARCH_PPC_FAMILY ++#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ ++#define WEBRTC_ARCH_LITTLE_ENDIAN ++#else ++#define WEBRTC_ARCH_BIG_ENDIAN ++#endif ++#if defined(__LP64__) ++#define WEBRTC_ARCH_64_BITS ++#else ++#define WEBRTC_ARCH_32_BITS ++#endif + #else + #error Please add support for your architecture in rtc_base/system/arch.h + #endif +diff --git v8/BUILD.gn v8/BUILD.gn +index f39529a3a..e84fc449e 100644 +--- v8/BUILD.gn ++++ v8/BUILD.gn +@@ -850,6 +850,12 @@ config("toolchain") { + } + if (host_byteorder == "little") { + defines += [ "V8_TARGET_ARCH_PPC_LE" ] ++ cflags += [ ++ # Enable usage of AltiVec, VSX, and other POWER8 and higher features ++ "-mcpu=power8", ++ "-maltivec", ++ "-mvsx", ++ ] + } else if (host_byteorder == "big") { + defines += [ "V8_TARGET_ARCH_PPC_BE" ] + if (current_os == "aix") { +diff --git ui/gl/features.gni ui/gl/features.gni +index 5fda9b6..3d2dd8b 100644 +--- ui/gl/features.gni ++++ ui/gl/features.gni +@@ -32,5 +32,6 @@ declare_args() { + (is_mac && use_egl) || is_chromeos_ash || is_fuchsia) && + (target_cpu == "x86" || target_cpu == "x64" || + target_cpu == "arm" || target_cpu == "arm64" || +- target_cpu == "mipsel" || target_cpu == "mips64el") ++ target_cpu == "mipsel" || target_cpu == "mips64el" || ++ target_cpu == "ppc64") + } +diff --git v8/test/BUILD.gn v8/test/BUILD.gn +index fb872ad39..45fc585dd 100644 +--- v8/test/BUILD.gn ++++ v8/test/BUILD.gn +@@ -36,7 +36,7 @@ group("gn_all") { + "benchmarks/cpp:gn_all", + "cctest:cctest", + "cctest:generate-bytecode-expectations", +- "unittests:unittests", ++ #"unittests:unittests", + ] + } + } +@@ -78,7 +78,7 @@ group("v8_bot_default") { + "message:v8_message", + "mjsunit:v8_mjsunit", + "mkgrokdump:mkgrokdump", +- "unittests:unittests", ++ #"unittests:unittests", + "wasm-api-tests:wasm_api_tests", + "wasm-js:v8_wasm_js", + "wasm-spec-tests:v8_wasm_spec_tests", +@@ -98,7 +98,7 @@ group("v8_default") { + "message:v8_message", + "mjsunit:v8_mjsunit", + "mkgrokdump:mkgrokdump", +- "unittests:unittests", ++ #"unittests:unittests", + "wasm-api-tests:wasm_api_tests", + "wasm-js:v8_wasm_js", + "wasm-spec-tests:v8_wasm_spec_tests", diff --git a/srcpkgs/electron12/files/patches/chromium-xxx-ppc64le-swiftshader.patch b/srcpkgs/electron12/files/patches/chromium-xxx-ppc64le-swiftshader.patch new file mode 100644 index 00000000000..53549d17f5a --- /dev/null +++ b/srcpkgs/electron12/files/patches/chromium-xxx-ppc64le-swiftshader.patch @@ -0,0 +1,18 @@ +--- third_party/swiftshader/third_party/llvm-10.0/BUILD.gn ++++ third_party/swiftshader/third_party/llvm-10.0/BUILD.gn +@@ -574,6 +574,7 @@ swiftshader_llvm_source_set("swiftshader + "llvm/lib/MC/MCAsmInfoCOFF.cpp", + "llvm/lib/MC/MCAsmInfoDarwin.cpp", + "llvm/lib/MC/MCAsmInfoELF.cpp", ++ "llvm/lib/MC/MCAsmInfoXCOFF.cpp", + "llvm/lib/MC/MCAsmMacro.cpp", + "llvm/lib/MC/MCAsmStreamer.cpp", + "llvm/lib/MC/MCAssembler.cpp", +@@ -629,6 +630,7 @@ swiftshader_llvm_source_set("swiftshader + "llvm/lib/MC/MCWinCOFFStreamer.cpp", + "llvm/lib/MC/MCWinEH.cpp", + "llvm/lib/MC/MCXCOFFStreamer.cpp", ++ "llvm/lib/MC/MCXCOFFObjectTargetWriter.cpp", + "llvm/lib/MC/MachObjectWriter.cpp", + "llvm/lib/MC/StringTableBuilder.cpp", + "llvm/lib/MC/SubtargetFeature.cpp", diff --git a/srcpkgs/electron12/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch b/srcpkgs/electron12/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch new file mode 100644 index 00000000000..916dba9dc3b --- /dev/null +++ b/srcpkgs/electron12/files/patches/electron-Add-a-script-to-list-patch-targets.patch.patch @@ -0,0 +1,42 @@ +From ff4122f236b70c272c746d0c336cdbd588d78cd1 Mon Sep 17 00:00:00 2001 +From: Elvis Pranskevichus +Date: Thu, 12 Dec 2019 16:12:18 -0500 +Subject: [PATCH] Add a script to list patch targets + +--- + script/list_patch_targets.py | 23 +++++++++++++++++++++++ + 1 file changed, 23 insertions(+) + create mode 100755 script/list_patch_targets.py + +diff --git a/script/list_patch_targets.py b/script/list_patch_targets.py +new file mode 100755 +index 000000000..55173bac9 +--- /dev/null ++++ b/script/list_patch_targets.py +@@ -0,0 +1,23 @@ ++#!/usr/bin/env python ++ ++import argparse ++import json ++ ++ ++def parse_args(): ++ parser = argparse.ArgumentParser(description='Apply Electron patches') ++ parser.add_argument('config', nargs='+', ++ type=argparse.FileType('r'), ++ help='patches\' config(s) in the JSON format') ++ return parser.parse_args() ++ ++ ++def main(): ++ configs = parse_args().config ++ for config_json in configs: ++ for patch_dir, repo in json.load(config_json).iteritems(): ++ print(repo) ++ ++ ++if __name__ == '__main__': ++ main() +-- +2.23.0 + diff --git a/srcpkgs/electron12/files/patches/electron-Build-fixes.patch.patch b/srcpkgs/electron12/files/patches/electron-Build-fixes.patch.patch new file mode 100644 index 00000000000..298bfa9bcb2 --- /dev/null +++ b/srcpkgs/electron12/files/patches/electron-Build-fixes.patch.patch @@ -0,0 +1,47 @@ +diff --git a/build/args/release.gn b/build/args/release.gn +index e5017f6e1..59207b389 100644 +--- a/build/args/release.gn ++++ b/build/args/release.gn +@@ -1,6 +1,4 @@ + import("all.gn") +-is_component_build = false +-is_official_build = true + + # This may be guarded behind is_chrome_branded alongside + # proprietary_codecs https://webrtc-review.googlesource.com/c/src/+/36321, +@@ -8,9 +6,3 @@ is_official_build = true + # The initialization of the decoder depends on whether ffmpeg has + # been built with H.264 support. + rtc_use_h264 = proprietary_codecs +- +-# By default, Electron builds ffmpeg with proprietary codecs enabled. In order +-# to facilitate users who don't want to ship proprietary codecs in ffmpeg, or +-# who have an LGPL requirement to ship ffmpeg as a dynamically linked library, +-# we build ffmpeg as a shared library. +-is_component_ffmpeg = true +diff --git a/build/npm.gni b/build/npm.gni +index a1987d095..fb33a14c3 100644 +--- a/build/npm.gni ++++ b/build/npm.gni +@@ -35,7 +35,6 @@ template("npm_action") { + if (!defined(deps)) { + deps = [] + } +- deps += [ ":npm_pre_flight_" + target_name ] + + script = "//electron/build/npm-run.py" + args = [ +diff --git a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch +index 0dc9916be..7eaa46bf5 100644 +--- a/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch ++++ b/patches/node/fix_add_default_values_for_enable_lto_and_build_v8_with_gn_in.patch +@@ -30,7 +30,7 @@ + + # these values being accurate. + + 'build_v8_with_gn': 'false', + + 'enable_lto%': 'false', +-+ +++ 'openssl_fips': '', + 'conditions': [ + ['target_arch=="arm64"', { + # Disabled pending https://github.com/nodejs/node/issues/23913. + diff --git a/srcpkgs/electron12/files/patches/electron-dont-assume-python-is-python2.patch b/srcpkgs/electron12/files/patches/electron-dont-assume-python-is-python2.patch new file mode 100644 index 00000000000..fb134748025 --- /dev/null +++ b/srcpkgs/electron12/files/patches/electron-dont-assume-python-is-python2.patch @@ -0,0 +1,17 @@ +--- a/build/zip.py.orig 2020-04-27 17:59:53.499281667 +0200 ++++ b/build/zip.py 2020-04-27 17:59:57.655839143 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python2 + from __future__ import print_function + import os + import subprocess + +--- a/build/npm-run.py.orig 2020-04-27 17:59:50.829351807 +0200 ++++ b/build/npm-run.py 2020-04-27 18:00:02.702373256 +0200 +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python2 + from __future__ import print_function + import os + import subprocess diff --git a/srcpkgs/electron12/files/patches/electron-exclude-content-test-patches.patch b/srcpkgs/electron12/files/patches/electron-exclude-content-test-patches.patch new file mode 100644 index 00000000000..45622364427 --- /dev/null +++ b/srcpkgs/electron12/files/patches/electron-exclude-content-test-patches.patch @@ -0,0 +1,10 @@ +--- a/script/apply_all_patches.py 2020-08-22 17:46:41.796707506 +0200 ++++ - 2020-08-22 17:47:05.887813512 +0200 +@@ -14,6 +14,7 @@ + for patch_dir, repo in dirs.items(): + git.import_patches(repo=repo, patch_data=patch_from_dir(patch_dir), + threeway=threeway is not None, ++ exclude=['test/mjsunit/**', 'content/test/**', 'test/cctest/**', 'test/unittests/**', 'third_party/blink/web_tests/**'], + committer_name="Electron Scripts", committer_email="scripts@electron") + + diff --git a/srcpkgs/electron12/files/sndio-files/audio_manager_openbsd.cc b/srcpkgs/electron12/files/sndio-files/audio_manager_openbsd.cc new file mode 100644 index 00000000000..2c7aa8efa66 --- /dev/null +++ b/srcpkgs/electron12/files/sndio-files/audio_manager_openbsd.cc @@ -0,0 +1,148 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/metrics/histogram_macros.h" +#include "base/memory/ptr_util.h" + +#include "media/audio/openbsd/audio_manager_openbsd.h" + +#include "media/audio/audio_device_description.h" +#include "media/audio/audio_output_dispatcher.h" +#include "media/audio/sndio/sndio_input.h" +#include "media/audio/sndio/sndio_output.h" +#include "media/base/limits.h" +#include "media/base/media_switches.h" + +namespace media { + +// Maximum number of output streams that can be open simultaneously. +static const int kMaxOutputStreams = 4; + +// Default sample rate for input and output streams. +static const int kDefaultSampleRate = 48000; + +void AddDefaultDevice(AudioDeviceNames* device_names) { + DCHECK(device_names->empty()); + device_names->push_front(AudioDeviceName::CreateDefault()); +} + +bool AudioManagerOpenBSD::HasAudioOutputDevices() { + return true; +} + +bool AudioManagerOpenBSD::HasAudioInputDevices() { + return true; +} + +void AudioManagerOpenBSD::GetAudioInputDeviceNames( + AudioDeviceNames* device_names) { + DCHECK(device_names->empty()); + AddDefaultDevice(device_names); +} + +void AudioManagerOpenBSD::GetAudioOutputDeviceNames( + AudioDeviceNames* device_names) { + AddDefaultDevice(device_names); +} + +const char* AudioManagerOpenBSD::GetName() { + return "SNDIO"; +} + +AudioParameters AudioManagerOpenBSD::GetInputStreamParameters( + const std::string& device_id) { + static const int kDefaultInputBufferSize = 1024; + + int user_buffer_size = GetUserBufferSize(); + int buffer_size = user_buffer_size ? + user_buffer_size : kDefaultInputBufferSize; + + return AudioParameters( + AudioParameters::AUDIO_PCM_LOW_LATENCY, CHANNEL_LAYOUT_STEREO, + kDefaultSampleRate, buffer_size); +} + +AudioManagerOpenBSD::AudioManagerOpenBSD(std::unique_ptr audio_thread, + AudioLogFactory* audio_log_factory) + : AudioManagerBase(std::move(audio_thread), + audio_log_factory) { + DLOG(WARNING) << "AudioManagerOpenBSD"; + SetMaxOutputStreamsAllowed(kMaxOutputStreams); +} + +AudioManagerOpenBSD::~AudioManagerOpenBSD() { + Shutdown(); +} + +AudioOutputStream* AudioManagerOpenBSD::MakeLinearOutputStream( + const AudioParameters& params, + const LogCallback& log_callback) { + DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); + return MakeOutputStream(params); +} + +AudioOutputStream* AudioManagerOpenBSD::MakeLowLatencyOutputStream( + const AudioParameters& params, + const std::string& device_id, + const LogCallback& log_callback) { + DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!"; + DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); + return MakeOutputStream(params); +} + +AudioInputStream* AudioManagerOpenBSD::MakeLinearInputStream( + const AudioParameters& params, + const std::string& device_id, + const LogCallback& log_callback) { + DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); + return MakeInputStream(params); +} + +AudioInputStream* AudioManagerOpenBSD::MakeLowLatencyInputStream( + const AudioParameters& params, + const std::string& device_id, + const LogCallback& log_callback) { + DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); + return MakeInputStream(params); +} + +AudioParameters AudioManagerOpenBSD::GetPreferredOutputStreamParameters( + const std::string& output_device_id, + const AudioParameters& input_params) { + // TODO(tommi): Support |output_device_id|. + DLOG_IF(ERROR, !output_device_id.empty()) << "Not implemented!"; + static const int kDefaultOutputBufferSize = 2048; + + ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO; + int sample_rate = kDefaultSampleRate; + int buffer_size = kDefaultOutputBufferSize; + if (input_params.IsValid()) { + sample_rate = input_params.sample_rate(); + channel_layout = input_params.channel_layout(); + buffer_size = std::min(buffer_size, input_params.frames_per_buffer()); + } + + int user_buffer_size = GetUserBufferSize(); + if (user_buffer_size) + buffer_size = user_buffer_size; + + return AudioParameters( + AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, + sample_rate, buffer_size); +} + +AudioInputStream* AudioManagerOpenBSD::MakeInputStream( + const AudioParameters& params) { + DLOG(WARNING) << "MakeInputStream"; + return new SndioAudioInputStream(this, + AudioDeviceDescription::kDefaultDeviceId, params); +} + +AudioOutputStream* AudioManagerOpenBSD::MakeOutputStream( + const AudioParameters& params) { + DLOG(WARNING) << "MakeOutputStream"; + return new SndioAudioOutputStream(params, this); +} + +} // namespace media diff --git a/srcpkgs/electron12/files/sndio-files/audio_manager_openbsd.h b/srcpkgs/electron12/files/sndio-files/audio_manager_openbsd.h new file mode 100644 index 00000000000..8c99db966d6 --- /dev/null +++ b/srcpkgs/electron12/files/sndio-files/audio_manager_openbsd.h @@ -0,0 +1,65 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef MEDIA_AUDIO_OPENBSD_AUDIO_MANAGER_OPENBSD_H_ +#define MEDIA_AUDIO_OPENBSD_AUDIO_MANAGER_OPENBSD_H_ + +#include + +#include "base/compiler_specific.h" +#include "base/macros.h" +#include "base/memory/ref_counted.h" +#include "base/threading/thread.h" +#include "media/audio/audio_manager_base.h" + +namespace media { + +class MEDIA_EXPORT AudioManagerOpenBSD : public AudioManagerBase { + public: + AudioManagerOpenBSD(std::unique_ptr audio_thread, + AudioLogFactory* audio_log_factory); + ~AudioManagerOpenBSD() override; + + // Implementation of AudioManager. + bool HasAudioOutputDevices() override; + bool HasAudioInputDevices() override; + void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; + void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) override; + AudioParameters GetInputStreamParameters( + const std::string& device_id) override; + const char* GetName() override; + + // Implementation of AudioManagerBase. + AudioOutputStream* MakeLinearOutputStream( + const AudioParameters& params, + const LogCallback& log_callback) override; + AudioOutputStream* MakeLowLatencyOutputStream( + const AudioParameters& params, + const std::string& device_id, + const LogCallback& log_callback) override; + AudioInputStream* MakeLinearInputStream( + const AudioParameters& params, + const std::string& device_id, + const LogCallback& log_callback) override; + AudioInputStream* MakeLowLatencyInputStream( + const AudioParameters& params, + const std::string& device_id, + const LogCallback& log_callback) override; + + protected: + AudioParameters GetPreferredOutputStreamParameters( + const std::string& output_device_id, + const AudioParameters& input_params) override; + + private: + // Called by MakeLinearOutputStream and MakeLowLatencyOutputStream. + AudioOutputStream* MakeOutputStream(const AudioParameters& params); + AudioInputStream* MakeInputStream(const AudioParameters& params); + + DISALLOW_COPY_AND_ASSIGN(AudioManagerOpenBSD); +}; + +} // namespace media + +#endif // MEDIA_AUDIO_OPENBSD_AUDIO_MANAGER_OPENBSD_H_ diff --git a/srcpkgs/electron12/files/sndio-files/sndio_input.cc b/srcpkgs/electron12/files/sndio-files/sndio_input.cc new file mode 100644 index 00000000000..ef5439b49a0 --- /dev/null +++ b/srcpkgs/electron12/files/sndio-files/sndio_input.cc @@ -0,0 +1,200 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/bind.h" +#include "base/logging.h" +#include "base/macros.h" +#include "media/base/audio_timestamp_helper.h" +#include "media/audio/openbsd/audio_manager_openbsd.h" +#include "media/audio/audio_manager.h" +#include "media/audio/sndio/sndio_input.h" + +namespace media { + +static const SampleFormat kSampleFormat = kSampleFormatS16; + +void SndioAudioInputStream::OnMoveCallback(void *arg, int delta) +{ + SndioAudioInputStream* self = static_cast(arg); + + self->hw_delay += delta; +} + +void *SndioAudioInputStream::ThreadEntry(void *arg) { + SndioAudioInputStream* self = static_cast(arg); + + self->ThreadLoop(); + return NULL; +} + +SndioAudioInputStream::SndioAudioInputStream(AudioManagerBase* manager, + const std::string& device_name, + const AudioParameters& params) + : manager(manager), + params(params), + audio_bus(AudioBus::Create(params)), + state(kClosed) { +} + +SndioAudioInputStream::~SndioAudioInputStream() { + if (state != kClosed) + Close(); +} + +bool SndioAudioInputStream::Open() { + struct sio_par par; + int sig; + + if (state != kClosed) + return false; + + if (params.format() != AudioParameters::AUDIO_PCM_LINEAR && + params.format() != AudioParameters::AUDIO_PCM_LOW_LATENCY) { + LOG(WARNING) << "Unsupported audio format."; + return false; + } + + sio_initpar(&par); + par.rate = params.sample_rate(); + par.rchan = params.channels(); + par.bits = SampleFormatToBitsPerChannel(kSampleFormat); + par.bps = par.bits / 8; + par.sig = sig = par.bits != 8 ? 1 : 0; + par.le = SIO_LE_NATIVE; + par.appbufsz = params.frames_per_buffer(); + + hdl = sio_open(SIO_DEVANY, SIO_REC, 0); + + if (hdl == NULL) { + LOG(ERROR) << "Couldn't open audio device."; + return false; + } + + if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) { + LOG(ERROR) << "Couldn't set audio parameters."; + goto bad_close; + } + + if (par.rate != (unsigned int)params.sample_rate() || + par.rchan != (unsigned int)params.channels() || + par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) || + par.sig != (unsigned int)sig || + (par.bps > 1 && par.le != SIO_LE_NATIVE) || + (par.bits != par.bps * 8)) { + LOG(ERROR) << "Unsupported audio parameters."; + goto bad_close; + } + state = kStopped; + buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)]; + sio_onmove(hdl, &OnMoveCallback, this); + return true; +bad_close: + sio_close(hdl); + return false; +} + +void SndioAudioInputStream::Start(AudioInputCallback* cb) { + + StartAgc(); + + state = kRunning; + hw_delay = 0; + callback = cb; + sio_start(hdl); + if (pthread_create(&thread, NULL, &ThreadEntry, this) != 0) { + LOG(ERROR) << "Failed to create real-time thread for recording."; + sio_stop(hdl); + state = kStopped; + } +} + +void SndioAudioInputStream::Stop() { + + if (state == kStopped) + return; + + state = kStopWait; + pthread_join(thread, NULL); + sio_stop(hdl); + state = kStopped; + + StopAgc(); +} + +void SndioAudioInputStream::Close() { + + if (state == kClosed) + return; + + if (state == kRunning) + Stop(); + + state = kClosed; + delete [] buffer; + sio_close(hdl); + + manager->ReleaseInputStream(this); +} + +double SndioAudioInputStream::GetMaxVolume() { + // Not supported + return 0.0; +} + +void SndioAudioInputStream::SetVolume(double volume) { + // Not supported. Do nothing. +} + +double SndioAudioInputStream::GetVolume() { + // Not supported. + return 0.0; +} + +bool SndioAudioInputStream::IsMuted() { + // Not supported. + return false; +} + +void SndioAudioInputStream::SetOutputDeviceForAec( + const std::string& output_device_id) { + // Not supported. +} + +void SndioAudioInputStream::ThreadLoop(void) { + size_t todo, n; + char *data; + unsigned int nframes; + double normalized_volume = 0.0; + + nframes = audio_bus->frames(); + + while (state == kRunning && !sio_eof(hdl)) { + + GetAgcVolume(&normalized_volume); + + // read one block + todo = nframes * params.GetBytesPerFrame(kSampleFormat); + data = buffer; + while (todo > 0) { + n = sio_read(hdl, data, todo); + if (n == 0) + return; // unrecoverable I/O error + todo -= n; + data += n; + } + hw_delay -= nframes; + + // convert frames count to TimeDelta + const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay, + params.sample_rate()); + + // push into bus + audio_bus->FromInterleaved(buffer, nframes, SampleFormatToBytesPerChannel(kSampleFormat)); + + // invoke callback + callback->OnData(audio_bus.get(), base::TimeTicks::Now() - delay, 1.); + } +} + +} // namespace media diff --git a/srcpkgs/electron12/files/sndio-files/sndio_input.h b/srcpkgs/electron12/files/sndio-files/sndio_input.h new file mode 100644 index 00000000000..d868e0469db --- /dev/null +++ b/srcpkgs/electron12/files/sndio-files/sndio_input.h @@ -0,0 +1,91 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_ +#define MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_ + +#include +#include +#include + +#include "base/compiler_specific.h" +#include "base/macros.h" +#include "base/memory/weak_ptr.h" +#include "base/time/time.h" +#include "media/audio/agc_audio_stream.h" +#include "media/audio/audio_io.h" +#include "media/audio/audio_device_description.h" +#include "media/base/audio_parameters.h" + +namespace media { + +class AudioManagerBase; + +// Implementation of AudioOutputStream using sndio(7) +class SndioAudioInputStream : public AgcAudioStream { + public: + // Pass this to the constructor if you want to attempt auto-selection + // of the audio recording device. + static const char kAutoSelectDevice[]; + + // Create a PCM Output stream for the SNDIO device identified by + // |device_name|. If unsure of what to use for |device_name|, use + // |kAutoSelectDevice|. + SndioAudioInputStream(AudioManagerBase* audio_manager, + const std::string& device_name, + const AudioParameters& params); + + ~SndioAudioInputStream() override; + + // Implementation of AudioInputStream. + bool Open() override; + void Start(AudioInputCallback* callback) override; + void Stop() override; + void Close() override; + double GetMaxVolume() override; + void SetVolume(double volume) override; + double GetVolume() override; + bool IsMuted() override; + void SetOutputDeviceForAec(const std::string& output_device_id) override; + + private: + + enum StreamState { + kClosed, // Not opened yet + kStopped, // Device opened, but not started yet + kRunning, // Started, device playing + kStopWait // Stopping, waiting for the real-time thread to exit + }; + + // C-style call-backs + static void OnMoveCallback(void *arg, int delta); + static void* ThreadEntry(void *arg); + + // Continuously moves data from the device to the consumer + void ThreadLoop(); + // Our creator, the audio manager needs to be notified when we close. + AudioManagerBase* manager; + // Parameters of the source + AudioParameters params; + // We store data here for consumer + std::unique_ptr audio_bus; + // Call-back that consumes recorded data + AudioInputCallback* callback; // Valid during a recording session. + // Handle of the audio device + struct sio_hdl* hdl; + // Current state of the stream + enum StreamState state; + // High priority thread running ThreadLoop() + pthread_t thread; + // Number of frames buffered in the hardware + int hw_delay; + // Temporary buffer where data is stored sndio-compatible format + char* buffer; + + DISALLOW_COPY_AND_ASSIGN(SndioAudioInputStream); +}; + +} // namespace media + +#endif // MEDIA_AUDIO_SNDIO_SNDIO_INPUT_H_ diff --git a/srcpkgs/electron12/files/sndio-files/sndio_output.cc b/srcpkgs/electron12/files/sndio-files/sndio_output.cc new file mode 100644 index 00000000000..a6719f9aac8 --- /dev/null +++ b/srcpkgs/electron12/files/sndio-files/sndio_output.cc @@ -0,0 +1,183 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/logging.h" +#include "base/time/time.h" +#include "base/time/default_tick_clock.h" +#include "media/audio/audio_manager_base.h" +#include "media/base/audio_timestamp_helper.h" +#include "media/audio/sndio/sndio_output.h" + +namespace media { + +static const SampleFormat kSampleFormat = kSampleFormatS16; + +void SndioAudioOutputStream::OnMoveCallback(void *arg, int delta) { + SndioAudioOutputStream* self = static_cast(arg); + + self->hw_delay -= delta; +} + +void SndioAudioOutputStream::OnVolCallback(void *arg, unsigned int vol) { + SndioAudioOutputStream* self = static_cast(arg); + + self->vol = vol; +} + +void *SndioAudioOutputStream::ThreadEntry(void *arg) { + SndioAudioOutputStream* self = static_cast(arg); + + self->ThreadLoop(); + return NULL; +} + +SndioAudioOutputStream::SndioAudioOutputStream(const AudioParameters& params, + AudioManagerBase* manager) + : manager(manager), + params(params), + audio_bus(AudioBus::Create(params)), + state(kClosed), + mutex(PTHREAD_MUTEX_INITIALIZER) { +} + +SndioAudioOutputStream::~SndioAudioOutputStream() { + if (state != kClosed) + Close(); +} + +bool SndioAudioOutputStream::Open() { + struct sio_par par; + int sig; + + if (params.format() != AudioParameters::AUDIO_PCM_LINEAR && + params.format() != AudioParameters::AUDIO_PCM_LOW_LATENCY) { + LOG(WARNING) << "Unsupported audio format."; + return false; + } + sio_initpar(&par); + par.rate = params.sample_rate(); + par.pchan = params.channels(); + par.bits = SampleFormatToBitsPerChannel(kSampleFormat); + par.bps = par.bits / 8; + par.sig = sig = par.bits != 8 ? 1 : 0; + par.le = SIO_LE_NATIVE; + par.appbufsz = params.frames_per_buffer(); + + hdl = sio_open(SIO_DEVANY, SIO_PLAY, 0); + if (hdl == NULL) { + LOG(ERROR) << "Couldn't open audio device."; + return false; + } + if (!sio_setpar(hdl, &par) || !sio_getpar(hdl, &par)) { + LOG(ERROR) << "Couldn't set audio parameters."; + goto bad_close; + } + if (par.rate != (unsigned int)params.sample_rate() || + par.pchan != (unsigned int)params.channels() || + par.bits != (unsigned int)SampleFormatToBitsPerChannel(kSampleFormat) || + par.sig != (unsigned int)sig || + (par.bps > 1 && par.le != SIO_LE_NATIVE) || + (par.bits != par.bps * 8)) { + LOG(ERROR) << "Unsupported audio parameters."; + goto bad_close; + } + state = kStopped; + volpending = 0; + vol = 0; + buffer = new char[audio_bus->frames() * params.GetBytesPerFrame(kSampleFormat)]; + sio_onmove(hdl, &OnMoveCallback, this); + sio_onvol(hdl, &OnVolCallback, this); + return true; + bad_close: + sio_close(hdl); + return false; +} + +void SndioAudioOutputStream::Close() { + if (state == kClosed) + return; + if (state == kRunning) + Stop(); + state = kClosed; + delete [] buffer; + sio_close(hdl); + manager->ReleaseOutputStream(this); // Calls the destructor +} + +void SndioAudioOutputStream::Start(AudioSourceCallback* callback) { + state = kRunning; + hw_delay = 0; + source = callback; + sio_start(hdl); + if (pthread_create(&thread, NULL, &ThreadEntry, this) != 0) { + LOG(ERROR) << "Failed to create real-time thread."; + sio_stop(hdl); + state = kStopped; + } +} + +void SndioAudioOutputStream::Stop() { + if (state == kStopped) + return; + state = kStopWait; + pthread_join(thread, NULL); + sio_stop(hdl); + state = kStopped; +} + +void SndioAudioOutputStream::SetVolume(double v) { + pthread_mutex_lock(&mutex); + vol = v * SIO_MAXVOL; + volpending = 1; + pthread_mutex_unlock(&mutex); +} + +void SndioAudioOutputStream::GetVolume(double* v) { + pthread_mutex_lock(&mutex); + *v = vol * (1. / SIO_MAXVOL); + pthread_mutex_unlock(&mutex); +} + +// This stream is always used with sub second buffer sizes, where it's +// sufficient to simply always flush upon Start(). +void SndioAudioOutputStream::Flush() {} + +void SndioAudioOutputStream::ThreadLoop(void) { + int avail, count, result; + + while (state == kRunning) { + // Update volume if needed + pthread_mutex_lock(&mutex); + if (volpending) { + volpending = 0; + sio_setvol(hdl, vol); + } + pthread_mutex_unlock(&mutex); + + // Get data to play + const base::TimeDelta delay = AudioTimestampHelper::FramesToTime(hw_delay, + params.sample_rate()); + count = source->OnMoreData(delay, base::TimeTicks::Now(), 0, audio_bus.get()); + audio_bus->ToInterleaved(count, SampleFormatToBytesPerChannel(kSampleFormat), buffer); + if (count == 0) { + // We have to submit something to the device + count = audio_bus->frames(); + memset(buffer, 0, count * params.GetBytesPerFrame(kSampleFormat)); + LOG(WARNING) << "No data to play, running empty cycle."; + } + + // Submit data to the device + avail = count * params.GetBytesPerFrame(kSampleFormat); + result = sio_write(hdl, buffer, avail); + if (result == 0) { + LOG(WARNING) << "Audio device disconnected."; + break; + } + + // Update hardware pointer + hw_delay += count; + } +} + +} // namespace media diff --git a/srcpkgs/electron12/files/sndio-files/sndio_output.h b/srcpkgs/electron12/files/sndio-files/sndio_output.h new file mode 100644 index 00000000000..ead220ca96e --- /dev/null +++ b/srcpkgs/electron12/files/sndio-files/sndio_output.h @@ -0,0 +1,86 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_ +#define MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_ + +#include +#include + +#include "base/time/tick_clock.h" +#include "base/time/time.h" +#include "media/audio/audio_io.h" + +namespace media { + +class AudioManagerBase; + +// Implementation of AudioOutputStream using sndio(7) +class SndioAudioOutputStream : public AudioOutputStream { + public: + // The manager is creating this object + SndioAudioOutputStream(const AudioParameters& params, + AudioManagerBase* manager); + virtual ~SndioAudioOutputStream(); + + // Implementation of AudioOutputStream. + bool Open() override; + void Close() override; + void Start(AudioSourceCallback* callback) override; + void Stop() override; + void SetVolume(double volume) override; + void GetVolume(double* volume) override; + void Flush() override; + + friend void sndio_onmove(void *arg, int delta); + friend void sndio_onvol(void *arg, unsigned int vol); + friend void *sndio_threadstart(void *arg); + + private: + enum StreamState { + kClosed, // Not opened yet + kStopped, // Device opened, but not started yet + kRunning, // Started, device playing + kStopWait // Stopping, waiting for the real-time thread to exit + }; + + // C-style call-backs + static void OnMoveCallback(void *arg, int delta); + static void OnVolCallback(void *arg, unsigned int vol); + static void* ThreadEntry(void *arg); + + // Continuously moves data from the producer to the device + void ThreadLoop(void); + + // Our creator, the audio manager needs to be notified when we close. + AudioManagerBase* manager; + // Parameters of the source + AudioParameters params; + // Source stores data here + std::unique_ptr audio_bus; + // Call-back that produces data to play + AudioSourceCallback* source; + // Handle of the audio device + struct sio_hdl* hdl; + // Current state of the stream + enum StreamState state; + // High priority thread running ThreadLoop() + pthread_t thread; + // Protects vol, volpending and hw_delay + pthread_mutex_t mutex; + // Current volume in the 0..SIO_MAXVOL range + int vol; + // Set to 1 if volumes must be refreshed in the realtime thread + int volpending; + // Number of frames buffered in the hardware + int hw_delay; + // Temporary buffer where data is stored sndio-compatible format + char* buffer; + + DISALLOW_COPY_AND_ASSIGN(SndioAudioOutputStream); +}; + +} // namespace media + +#endif // MEDIA_AUDIO_SNDIO_SNDIO_OUTPUT_H_ diff --git a/srcpkgs/electron12/files/sndio-patches/media_audio_linux_audio_manager_linux.cc.patch b/srcpkgs/electron12/files/sndio-patches/media_audio_linux_audio_manager_linux.cc.patch new file mode 100644 index 00000000000..cf8e81b11d6 --- /dev/null +++ b/srcpkgs/electron12/files/sndio-patches/media_audio_linux_audio_manager_linux.cc.patch @@ -0,0 +1,43 @@ +diff --git a/chromium/media/audio/linux/audio_manager_linux.cc b/chromium/media/audio/linux/audio_manager_linux.cc +index 5d703549372..9e60b40c749 100644 +--- media/audio/linux/audio_manager_linux.cc ++++ media/audio/linux/audio_manager_linux.cc +@@ -20,6 +20,10 @@ + #include "media/audio/pulse/audio_manager_pulse.h" + #include "media/audio/pulse/pulse_util.h" + #endif ++#if defined(USE_SNDIO) ++#include ++#include "media/audio/openbsd/audio_manager_openbsd.h" ++#endif + + namespace media { + +@@ -27,7 +31,8 @@ enum LinuxAudioIO { + kPulse, + kAlsa, + kCras, +- kAudioIOMax = kCras // Must always be equal to largest logged entry. ++ kSndio, ++ kAudioIOMax = kSndio // Must always be equal to largest logged entry. + }; + + std::unique_ptr CreateAudioManager( +@@ -41,6 +46,17 @@ std::unique_ptr CreateAudioManager( + } + #endif + ++#if defined(USE_SNDIO) ++ struct sio_hdl * hdl = NULL; ++ if ((hdl=sio_open(SIO_DEVANY, SIO_PLAY, 1)) != NULL) { ++ sio_close(hdl); ++ UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kSndio, kAudioIOMax +1); ++ return std::make_unique(std::move(audio_thread), ++ audio_log_factory); ++ } ++ DVLOG(1) << "Sndio is not available on the OS"; ++#endif ++ + #if defined(USE_PULSEAUDIO) + pa_threaded_mainloop* pa_mainloop = nullptr; + pa_context* pa_context = nullptr; diff --git a/srcpkgs/electron12/files/sndio-patches/src_3rdparty_chromium_media_BUILD.gn.patch b/srcpkgs/electron12/files/sndio-patches/src_3rdparty_chromium_media_BUILD.gn.patch new file mode 100644 index 00000000000..ec604002668 --- /dev/null +++ b/srcpkgs/electron12/files/sndio-patches/src_3rdparty_chromium_media_BUILD.gn.patch @@ -0,0 +1,12 @@ +--- media/BUILD.gn 2020-03-24 10:16:30.000000000 +0100 ++++ - 2020-04-06 14:32:27.960817513 +0200 +@@ -65,6 +65,9 @@ + if (use_cras) { + defines += [ "USE_CRAS" ] + } ++ if (use_sndio) { ++ defines += [ "USE_SNDIO" ] ++ } + } + + # Internal grouping of the configs necessary to support sub-folders having their diff --git a/srcpkgs/electron12/files/sndio-patches/src_3rdparty_chromium_media_audio_BUILD.gn.patch b/srcpkgs/electron12/files/sndio-patches/src_3rdparty_chromium_media_audio_BUILD.gn.patch new file mode 100644 index 00000000000..c856de0bf2e --- /dev/null +++ b/srcpkgs/electron12/files/sndio-patches/src_3rdparty_chromium_media_audio_BUILD.gn.patch @@ -0,0 +1,23 @@ +--- media/audio/BUILD.gn 2020-03-24 10:16:30.000000000 +0100 ++++ - 2020-04-06 14:31:28.871450217 +0200 +@@ -232,9 +232,19 @@ + deps += [ "//media/base/android:media_jni_headers" ] + } + +- if (is_linux) { ++ if (is_linux) { + sources += [ "linux/audio_manager_linux.cc" ] + } ++ if (use_sndio) { ++ libs += [ "sndio" ] ++ sources += [ ++ "openbsd/audio_manager_openbsd.cc", ++ "sndio/sndio_input.cc", ++ "sndio/sndio_input.h", ++ "sndio/sndio_output.cc", ++ "sndio/sndio_output.h" ++ ] ++ } + + if (use_alsa) { + libs += [ "asound" ] diff --git a/srcpkgs/electron12/files/sndio-patches/src_3rdparty_chromium_media_media__options.gni.patch b/srcpkgs/electron12/files/sndio-patches/src_3rdparty_chromium_media_media__options.gni.patch new file mode 100644 index 00000000000..14807d8e1d3 --- /dev/null +++ b/srcpkgs/electron12/files/sndio-patches/src_3rdparty_chromium_media_media__options.gni.patch @@ -0,0 +1,12 @@ +--- media/media_options.gni 2020-03-24 10:16:30.000000000 +0100 ++++ - 2020-04-06 14:29:22.958630783 +0200 +@@ -114,6 +114,9 @@ + # Enables runtime selection of ALSA library for audio. + use_alsa = false + ++ # Enables runtime selection of sndio library for audio. ++ use_sndio = false ++ + # Alsa should be used on non-Android, non-Mac POSIX systems. + # Alsa should be used on desktop Chromecast and audio-only Chromecast builds. + if (is_posix && !is_android && !is_mac && diff --git a/srcpkgs/electron12/template b/srcpkgs/electron12/template new file mode 100644 index 00000000000..7d1d14eec96 --- /dev/null +++ b/srcpkgs/electron12/template @@ -0,0 +1,385 @@ +# Template file for 'electron12' +pkgname=electron12 +version=12.0.2 +_nodever=14.16.0 +_chromiumver=89.0.4389.90 +revision=1 +archs="x86_64* i686* aarch64* ppc64le*" +build_wrksrc="src" +create_wrksrc=yes +hostmakedepends="$(vopt_if clang clang) python pkgconf perl gperf bison ninja nodejs hwids + libwebp-devel freetype-devel harfbuzz-devel libpng-devel nss-devel which git libevent-devel + pciutils-devel libatomic-devel ffmpeg-devel libxml2-devel libglib-devel yarn openjdk libxslt-devel + opus-devel libXcursor-devel libXcomposite-devel libXtst-devel libXrandr-devel libXScrnSaver-devel + alsa-lib-devel re2-devel snappy-devel mit-krb5-devel $(vopt_if pulseaudio pulseaudio-devel) + $(vopt_if sndio sndio-devel) jq" +makedepends="libpng-devel gtk+-devel gtk+3-devel nss-devel pciutils-devel + libXi-devel libgcrypt-devel libgnome-keyring-devel cups-devel elfutils-devel + libXcomposite-devel speech-dispatcher-devel libXrandr-devel mit-krb5-devel + libXScrnSaver-devel alsa-lib-devel snappy-devel libdrm-devel + libxml2-devel libxslt-devel $(vopt_if pulseaudio pulseaudio-devel) libexif-devel + libXcursor-devel libflac-devel speex-devel libmtp-devel libwebp-devel + libjpeg-turbo-devel libevent-devel json-c-devel harfbuzz-devel + minizip-devel jsoncpp-devel zlib-devel libcap-devel libXdamage-devel + re2-devel fontconfig-devel freetype-devel opus-devel libatomic-devel + $(vopt_if sndio sndio-devel) ffmpeg-devel libva-devel libuv-devel c-ares-devel libnotify-devel + $(vopt_if pipewire pipewire-devel) wayland-devel" +short_desc="Cross platform application development framework based on web technologies" +maintainer="John " +license="BSD-3-Clause" +homepage="https://electronjs.org" +distfiles="https://github.com/electron/electron/archive/v$version.tar.gz>electron-${version}.tar.gz + https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$_chromiumver.tar.xz + https://github.com/nodejs/node/archive/v$_nodever.tar.gz>node-$_nodever.tar.gz" +checksum="e4e15ec16bd8a1541b066b98c9b204da4c01be20aa18808b4fe77f22793458de + 11c6089c5fdd921216aa4eb34b52818a9b091cad655a24aed0982d29e65b279a + bcdf869b0743405515ee897b1047b5e851a717e426b4974d26537c9b10dfd53a" + +case "$XBPS_TARGET_MACHINE" in + ppc64*-musl) makedepends+=" libucontext-devel" ;; +esac + +no_generic_pkgconfig_link=yes +lib32disabled=yes +nopie=yes # contains tools that are not PIE, enables PIE itself + +build_options="pulseaudio sndio clang pipewire" +build_options_default="pulseaudio clang pipewire" + +if [ "$build_option_clang" ]; then + nocross="No proper setup for using clang as cross compiler in void yet" +elif [ "${XBPS_TARGET_MACHINE%%-musl}" = "aarch64" ]; then + broken="Falls apart at runtime when compiled with gcc" +fi + +_buildtype=Release +_is_debug=false + +CFLAGS="-Wno-unknown-warning-option -fPIC" +CXXFLAGS="-Wno-unknown-warning-option -fPIC" + +_apply_patch() { + local args="$1" pname="$(basename $2)" + + if [ ! -f ".${pname}_done" ]; then + msg_normal "$pkgver: patching: ${pname}.\n" + patch -N $args -i $2 + touch .${pname}_done + fi +} + +_get_chromium_arch() { + case "$1" in + x86_64*) echo x64 ;; + i686*) echo x86 ;; + arm*) echo arm ;; + aarch64*) echo arm64 ;; + ppc64*) echo ppc64 ;; + ppc*) echo ppc ;; + mipsel*) echo mipsel ;; + mips*) echo mips ;; + *) msg_error "$pkgver: cannot be compiled for ${XBPS_TARGET_MACHINE}.\n" ;; + esac +} + +post_extract() { + ln -s chromium-$_chromiumver src + mkdir -p src/third_party/ + ln -s ../../node-$_nodever src/third_party/electron_node + ln -s ../electron-${version} src/electron + +} +post_patch() { + cd $wrksrc + for x in $FILESDIR/patches/*; do + case "${x##*/}" in + electron*.patch) + cd src/electron + _apply_patch -p1 "$x" + cd "$wrksrc";; + esac + done + + # Sigh, electron uses git am... + if [ ! -f ".electron_patches_done" ]; then + mv src/electron/patches/config.json config.json.old + jq 'del(."src/electron/patches/Mantle", ."src/electron/patches/ReactiveObjC", + ."src/electron/patches/squirrel.mac", ."src/electron/patches/nan")' \ + config.json.old > src/electron/patches/config.json + + python2 src/electron/script/list_patch_targets.py src/electron/patches/config.json | while read -r repopath; do + cd "$wrksrc"/"$repopath" + git init -q + git config "gc.auto" 0 + if [ "$repopath" != "src" ]; then + echo "/${repopath#src/}" >> "$wrksrc/$build_wrksrc/.gitignore" + fi + git add . + git -c 'user.name=Electron build' -c 'user.email=electron@ebuild' \ + commit -q -m "." || true + done + cd $wrksrc + python2 src/electron/script/apply_all_patches.py src/electron/patches/config.json + touch .electron_patches_done + fi + + for x in $FILESDIR/patches/*; do + case "${x##*/}" in + chromium*.patch) + cd src + _apply_patch -p0 "$x" + cd "$wrksrc";; + esac + done + + if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + for x in $FILESDIR/musl-patches/*; do + case "${x##*/}" in + chromium*.patch) + cd src + _apply_patch -p0 "$x" + cd "$wrksrc";; + electron*.patch) + cd src/electron + _apply_patch -p1 "$x" + cd "$wrksrc";; + esac + done + fi + if [ "$build_option_sndio" ]; then + mkdir -p ${wrksrc}/${build_wrksrc}/media/audio/{sndio,openbsd} + cp ${FILESDIR}/sndio-files/sndio_*put.* \ + ${wrksrc}/${build_wrksrc}/media/audio/sndio + cp ${FILESDIR}/sndio-files/audio_manager_openbsd.* \ + ${wrksrc}/${build_wrksrc}/media/audio/openbsd + for f in "${FILESDIR}"/sndio-patches/*.patch; do + cd src + _apply_patch -p0 "$f" + cd "$wrksrc" + done + fi +} + +pre_configure() { + cd "$wrksrc/$build_wrksrc" + + # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/9JX1N2nf4PU/discussion + touch chrome/test/data/webui/i18n_process_css_test.html + # Use the file at run time instead of effectively compiling it in + sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \ + -i services/device/public/cpp/usb/BUILD.gn + + mkdir -p third_party/node/linux/node-linux-x64/bin + ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/ + + # compile gn early, so it can be used to generate gni stuff + msg_normal "Bootstrapping GN\n" + CC="${CC_FOR_BUILD:-$CC}" CXX="${CXX_FOR_BUILD:-$CXX}" LD="${LD_FOR_BUILD:-$LD}" \ + CFLAGS="${CFLAGS_FOR_BUILD:-$CFLAGS}" CXXFLAGS="${CXXFLAGS_FOR_BUILD:-$CXXFLAGS}" \ + LDFLAGS="${XBPS_LDFLAGS}" \ + python2 tools/gn/bootstrap/bootstrap.py -s -v --skip-generate-buildfiles + + # we need to generate ppc64 stuff for libvpx as it's not shipped + # this has to be done before unbundling, but after gn is built + # comment out if we switch back to system libvpx again later + case "$XBPS_TARGET_MACHINE" in + ppc64*) + pushd third_party/libvpx + mkdir -p source/config/linux/ppc64 + # need PATH to find gn + PATH="${wrksrc}/${build_wrksrc}/out/Release:$PATH" \ + ./generate_gni.sh || \ + msg_error "failed to generate libvpx gni" + popd + ;; + esac + + # reusable system library settings + local use_system=" + ffmpeg + flac + fontconfig + freetype + harfbuzz-ng + libdrm + libevent + libjpeg + libpng + libwebp + libxml + libxslt + opus + re2 + snappy + " + for _lib in $use_system libjpeg_turbo; do + msg_normal "Removing buildscripts for system provided $_lib\n" + find -type f -path "*third_party/$_lib/*" \ + \! -path "*third_party/$_lib/chromium/*" \ + \! -path "*third_party/$_lib/google/*" \ + \! -path './base/third_party/icu/*' \ + \! -path './third_party/pdfium/third_party/freetype/include/pstables.h' \ + \! -path './third_party/harfbuzz-ng/utils/hb_scoped.h' \ + \! -regex '.*\.\(gn\|gni\|isolate\|py\)' \ + -delete + done + + + msg_normal "Replacing gn files\n" + python2 build/linux/unbundle/replace_gn_files.py --system-libraries \ + $use_system + third_party/libaddressinput/chromium/tools/update-strings.py +} + +do_configure() { + local target_arch="$(_get_chromium_arch ${XBPS_TARGET_MACHINE})" + local host_arch="$(_get_chromium_arch ${XBPS_MACHINE})" + # the build system will set march for use, adding it to cflags will break builds + export CXXFLAGS=$( shopt -s extglob; echo ${CXXFLAGS/-march=*([^ ])} ) + export CFLAGS=$( shopt -s extglob; echo ${CFLAGS/-march=*([^ ])} ) + export CFLAGS=${CFLAGS/-g/} + export CXXFLAGS=${CXXFLAGS/-g/} + local conf=() + cd third_party/electron_node + if [ "$CROSS_BUILD" ]; then + conf_args=" --dest-cpu=${target_arch} --cross-compiling" + fi + ./configure --prefix=/usr \ + --shared-zlib \ + --shared-libuv \ + --shared-openssl \ + --shared-cares \ + --openssl-use-def-ca-store \ + --without-npm \ + --without-dtrace \ + --without-bundled-v8 \ + ${conf_args} + + cd "$wrksrc/$build_wrksrc"/electron + yarn install + cd "$wrksrc/$build_wrksrc" + + if [ "$build_option_clang" ]; then + export CC=clang + export CXX=clang++ + export HOST_CC=clang + export HOST_CXX=clang++ + else + export CXXFLAGS="$CXXFLAGS -fpermissive" + export BUILD_CXXFLAGS="$BUILD_CXXFLAGS -fpermissive" + export BUILD_AR="$AR_host" + export BUILD_NM="$NM_host" + fi + + # Google API keys (see http://www.chromium.org/developers/how-tos/api-keys) + # Note: These are for Void Linux use ONLY. + conf+=( + 'google_api_key="AIzaSyA9gWazKaHaNIPPg2hrMj6_ZSG8AFmq738"' + 'google_default_client_id="126659149423-hoo6ickbk3p1u2qjsdsp0ddciurfvb4t.apps.googleusercontent.com"' + 'google_default_client_secret="_ozIx2D-DKm_se_2NPwV4l5b"' + ) + + conf+=( + 'blink_symbol_level=0' + 'clang_use_chrome_plugins=false' + 'custom_toolchain="//build/toolchain/linux/unbundle:default"' + ) + if [ "$CROSS_BUILD" ]; then + conf+=( + 'host_toolchain="//build/toolchain/linux/unbundle:host"' + 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:host"' + "host_pkg_config=\"$PKG_CONFIG_FOR_BUILD\"" + "pkg_config=\"$PKG_CONFIG\"" + ) + else + conf+=( + 'host_toolchain="//build/toolchain/linux/unbundle:default"' + 'v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"' + ) + fi + if [ "$build_option_sndio" ]; then + conf+=( + 'use_sndio=true' + ) + fi + if [ -n "$XBPS_DEBUG_PKGS" ]; then + conf+=('symbol_level=1') + else + conf+=('symbol_level=0') + fi + conf+=( + 'enable_hangout_services_extension=true' + 'enable_nacl_nonsfi=false' + 'enable_nacl=false' + 'enable_precompiled_headers=false' + 'fatal_linker_warnings=false' + 'ffmpeg_branding="Chrome"' + 'fieldtrial_testing_like_official_build=true' + 'gold_path="/usr/bin/ld.gold"' + 'icu_use_data_file=true' + "is_clang=$(vopt_if clang true false)" + 'is_component_build=false' + "is_debug=$_is_debug" + 'proprietary_codecs=true' + 'treat_warnings_as_errors=false' + 'use_allocator_shim=false' + 'use_allocator="none"' + 'use_cups=true' + 'use_custom_libcxx=false' + 'use_gnome_keyring=false' + 'use_gold=false' + 'use_lld=false' + 'use_system_libwayland=true' + "use_pulseaudio=$(vopt_if pulseaudio 'true' 'false')" + "rtc_use_pipewire=$(vopt_if pipewire true false)" + 'rtc_pipewire_version="0.3"' + 'use_sysroot=false' + 'use_system_harfbuzz=true' + "target_cpu=\"$target_arch\"" + "host_cpu=\"$host_arch\"" + 'import("//electron/build/args/release.gn")' + ) + + msg_normal "Configuring build\n" + out/Release/gn gen out/$_buildtype --args="${conf[*]}" +} + +do_build() { + export CXXFLAGS=$( shopt -s extglob; echo ${CXXFLAGS/-march=*([^ ])} ) + export CFLAGS=$( shopt -s extglob; echo ${CFLAGS/-march=*([^ ])} ) + export CFLAGS=${CFLAGS/-g/} + export CXXFLAGS=${CXXFLAGS/-g/} + if [ "$build_option_clang" ]; then + export CC=clang + export CXX=clang++ + export HOST_CC=clang + export HOST_CXX=clang++ + else + export BUILD_CXXFLAGS="$BUILD_CXXFLAGS -fpermissive" + export CXXFLAGS="$CXXFLAGS -fpermissive" + export BUILD_AR="$AR_host" + export BUILD_NM="$NM_host" + fi + msg_normal "Ninja turtles GO!\n" + ninja ${makejobs} -C out/$_buildtype electron third_party/electron_node:headers + # finish rest of the build + strip -s out/$_buildtype/electron + ninja ${makejobs} -C out/$_buildtype electron_dist_zip +} + +do_install() { + vmkdir /usr/lib/$pkgname + vmkdir /usr/include/$pkgname + bsdtar -xf out/$_buildtype/dist.zip -C "$DESTDIR/usr/lib/$pkgname" + + chmod u+s "$DESTDIR/usr/lib/$pkgname/chrome-sandbox" + + cp out/$_buildtype/gen/node_headers.tar.gz "$DESTDIR"/usr/include/$pkgname + + vlicense ${wrksrc}/src/LICENSE chromium.LICENSE + vlicense ${wrksrc}/src/electron/LICENSE electron.LICENSE + vlicense ${wrksrc}/src/third_party/electron_node/LICENSE node.LICENSE + + vmkdir /usr/bin + ln -s ../lib/$pkgname/electron "$DESTDIR"/usr/bin/$pkgname +} diff --git a/srcpkgs/electron12/update b/srcpkgs/electron12/update new file mode 100644 index 00000000000..3af8e58b535 --- /dev/null +++ b/srcpkgs/electron12/update @@ -0,0 +1,2 @@ +site=https://www.electronjs.org/releases/stable?version=${version%%.*} +pattern='tag/v\K[\d\.]+(?=")' diff --git a/srcpkgs/element-desktop/files/element-desktop b/srcpkgs/element-desktop/files/element-desktop index 41a9b404020..bf3f41f39d5 100644 --- a/srcpkgs/element-desktop/files/element-desktop +++ b/srcpkgs/element-desktop/files/element-desktop @@ -1,2 +1,2 @@ #!/bin/sh -exec electron10 /usr/lib/element-desktop/resources/app.asar "$@" +exec electron12 /usr/lib/element-desktop/resources/app.asar "$@" diff --git a/srcpkgs/element-desktop/template b/srcpkgs/element-desktop/template index a83ef4ac93a..2f6c753e247 100644 --- a/srcpkgs/element-desktop/template +++ b/srcpkgs/element-desktop/template @@ -1,6 +1,6 @@ # Template file for 'element-desktop' pkgname=element-desktop -version=1.7.24 +version=1.7.25 revision=1 wrksrc="element-web-${version}" conf_files="/etc/${pkgname}/config.json" @@ -9,7 +9,7 @@ hostmakedepends="git yarn nodejs rust cargo python3 curl app-builder" makedepends="libsecret-devel" depends="c-ares ffmpeg gtk+3 http-parser libevent - libxslt minizip nss re2 snappy sqlcipher electron10" + libxslt minizip nss re2 snappy sqlcipher electron12" short_desc="Glossy Matrix collaboration client, desktop version" maintainer="projectmoon " license="Apache-2.0" @@ -18,8 +18,8 @@ _ghpage="https://github.com/vector-im" _archive="archive/v${version}.tar.gz" distfiles="${_ghpage}/element-desktop/${_archive}>element-desktop.tar.gz ${_ghpage}/element-web/${_archive}>element-web.tar.gz" -checksum="b7031155c52985992f4ae920e3a37d6f6f37fe49d70552bcdcb58a59b768d898 - 57dcb4cd5a4387ef009047b66eaf40be7b7eb202e81dd2e22152c70dcb40e39d" +checksum="33ddceb3538b9bf5ae6104c14d01ea2148e89c689b24d724dd5e60182bf5fe95 + c38fc7e77c82c655457b244b0e7e5802618aa088ddbbaa9bae4db4185236b972" export USE_SYSTEM_APP_BUILDER=true diff --git a/srcpkgs/exa/template b/srcpkgs/exa/template index ea3ad487fa4..fd5d7266f58 100644 --- a/srcpkgs/exa/template +++ b/srcpkgs/exa/template @@ -1,6 +1,6 @@ # Template file for 'exa' pkgname=exa -version=0.10.0 +version=0.10.1 revision=1 build_style=cargo hostmakedepends="pkg-config libgit2-devel" @@ -11,8 +11,8 @@ license="MIT" homepage="https://the.exa.website/" distfiles="https://github.com/ogham/exa/archive/v${version}.tar.gz https://github.com/ogham/exa/releases/download/v${version}/exa-accoutrements-v${version}.zip" -checksum="27420f7b805941988399d63f388be4f6077eee94a505bf01c2fb0e7d15cbf78d - c1ab340af63e64bc3fd854c03f6161aa240a533e928688036a7d4544aecabc05" +checksum="ff0fa0bfc4edef8bdbbb3cabe6fdbd5481a71abbbcc2159f402dea515353ae7c + 531596a1ef2a757c7728087529528150e6eb52bb8224fe575aa00a5f1b762849" post_extract() { mkdir -p accoutrements diff --git a/srcpkgs/exiftool/template b/srcpkgs/exiftool/template index 8a29db2e1e3..b8bf1d7970e 100644 --- a/srcpkgs/exiftool/template +++ b/srcpkgs/exiftool/template @@ -1,6 +1,6 @@ # Template file for 'exiftool' pkgname=exiftool -version=12.23 +version=12.24 revision=1 wrksrc="Image-ExifTool-${version}" build_style=perl-module @@ -10,4 +10,4 @@ license="Artistic-1.0-Perl, GPL-1.0-or-later" homepage="https://exiftool.org/" changelog="https://exiftool.org/history.html" distfiles="https://exiftool.org/Image-ExifTool-${version}.tar.gz" -checksum=825188ea0721b6db9c35a2fa4cd680342a129f6fa5bae41bb17da2d4299771d1 +checksum=4bbc925eda0072426ffb3b0a6dcedeff173da798fde1efff846a7579854a2f98 diff --git a/srcpkgs/exo/template b/srcpkgs/exo/template index 67f2d595f2c..65ff908fb98 100644 --- a/srcpkgs/exo/template +++ b/srcpkgs/exo/template @@ -1,6 +1,6 @@ # Template file for 'exo' pkgname=exo -version=4.16.1 +version=4.16.2 revision=1 build_style=gnu-configure configure_args="--disable-static --with-locales-dir=/usr/share/locale" @@ -12,7 +12,7 @@ maintainer="Orphaned " license="GPL-2.0-or-later, LGPL-2.1-or-later" homepage="https://xfce.org/" distfiles="https://archive.xfce.org/src/xfce/exo/${version%.*}/exo-${version}.tar.bz2" -checksum=528dac256315ffc2a4a53b3b421979327962121989886e3cf920aeff9912b53b +checksum=4e89f5536afbf1cb9191cceb720fb2764df1a4fae3459512b7320841ab5a9e9d pre_configure() { if [ "$CROSS_BUILD" ]; then diff --git a/srcpkgs/fluidsynth/template b/srcpkgs/fluidsynth/template index ab9f741e9b9..91a6b55a33c 100644 --- a/srcpkgs/fluidsynth/template +++ b/srcpkgs/fluidsynth/template @@ -1,6 +1,6 @@ # Template file for 'fluidsynth' pkgname=fluidsynth -version=2.1.8 +version=2.2.0 revision=1 build_style=cmake make_check_target=check @@ -13,7 +13,7 @@ maintainer="Orphaned " license="LGPL-2.1-or-later" homepage="http://www.fluidsynth.org/" distfiles="https://github.com/FluidSynth/fluidsynth/archive/v${version}.tar.gz" -checksum=a254efceff5d99f8d658d12d25318317f37307e6df852ec9baeb7da173496967 +checksum=928fb16f307507485bd1d9b010dafba8c747bce5de2ba47ab1705944c87013b6 libfluidsynth_package() { short_desc+=" - runtime library" diff --git a/srcpkgs/geis/template b/srcpkgs/geis/template index e31cd8bc785..ddad320d93a 100644 --- a/srcpkgs/geis/template +++ b/srcpkgs/geis/template @@ -1,15 +1,15 @@ # Template file for 'geis' pkgname=geis version=2.2.17 -revision=7 -hostmakedepends="pkg-config python3-devel" -makedepends="dbus-devel grail-devel frame-devel libXi-devel python3-devel xorg-server-devel" +revision=8 build_style="gnu-configure" configure_args="--disable-static" -maintainer="Enno Boland " -license="GPL-3" -homepage="https://launchpad.net/geis" +hostmakedepends="pkg-config python3-devel" +makedepends="dbus-devel grail-devel frame-devel libXi-devel python3-devel xorg-server-devel" short_desc="Gesture Engine Interface and Support" +maintainer="Enno Boland " +license="GPL-3.0-only" +homepage="https://launchpad.net/geis" distfiles="https://launchpad.net/geis/trunk/$version/+download/geis-$version.tar.xz" checksum=8a60f5683852094038904e690d23cc5a90a980fc52da67f0f28890baa25c70eb @@ -27,7 +27,6 @@ geis-devel_package() { } } geis-python3_package() { - pycompile_module="geis geisview" short_desc+=" - Python3 bindings" pkg_install() { vmove usr/bin/pygeis diff --git a/srcpkgs/genext2fs/template b/srcpkgs/genext2fs/template index 987cfaaa272..284df842872 100644 --- a/srcpkgs/genext2fs/template +++ b/srcpkgs/genext2fs/template @@ -1,12 +1,12 @@ # Template file for 'genext2fs' pkgname=genext2fs version=1.4.1 -revision=2 +revision=3 build_style=gnu-configure configure_args="ac_cv_have_working_snprintf=yes ac_cv_have_working_vsnprintf=yes" short_desc="Generates an ext2 filesystem as a normal (i.e. non-root) user" maintainer="Orphaned " -license="GPL-2" +license="GPL-2.0-only" homepage="http://genext2fs.sourceforge.net" distfiles="${SOURCEFORGE_SITE}/$pkgname/$pkgname-$version.tar.gz" checksum=404dbbfa7a86a6c3de8225c8da254d026b17fd288e05cec4df2cc7e1f4feecfc diff --git a/srcpkgs/geoip/template b/srcpkgs/geoip/template index 2c08ba395a7..dcdf5897186 100644 --- a/srcpkgs/geoip/template +++ b/srcpkgs/geoip/template @@ -1,7 +1,7 @@ # Template file for 'geoip' pkgname=geoip version=1.6.12 -revision=2 +revision=3 wrksrc="GeoIP-${version}" build_style=gnu-configure configure_args="--mandir=/usr/share/man --sysconfdir=/etc/geoip" @@ -9,8 +9,8 @@ hostmakedepends="automake libtool" makedepends="zlib-devel" short_desc="Non-DNS IP-to-country resolver C library and utilities" maintainer="Orphaned " +license="LGPL-2.1-or-later" homepage="http://www.maxmind.com/app/c" -license="GPL-2" distfiles="https://github.com/maxmind/geoip-api-c/releases/download/v$version/GeoIP-$version.tar.gz" checksum=1dfb748003c5e4b7fd56ba8c4cd786633d5d6f409547584f6910398389636f80 diff --git a/srcpkgs/gforth/template b/srcpkgs/gforth/template index 71117b69f47..f0df0399108 100644 --- a/srcpkgs/gforth/template +++ b/srcpkgs/gforth/template @@ -1,17 +1,17 @@ # Template file for 'gforth' pkgname=gforth version=0.7.3 -revision=2 +revision=3 build_style=gnu-configure -disable_parallel_build=yes hostmakedepends="m4" makedepends="libffi-devel" short_desc="GNU Forth, a fast and portable implementation of ANS Forth" maintainer="ZweiSpeedruns " -license="GPL-3" +license="GPL-3.0-or-later" homepage="https://www.gnu.org/software/gforth/" distfiles="${GNU_SITE}/gforth/gforth-${version}.tar.gz" checksum=2f62f2233bf022c23d01c920b1556aa13eab168e3236b13352ac5e9f18542bb0 +disable_parallel_build=yes nocross="Configure script is picky: https://api.travis-ci.org/jobs/158049419/log.txt?deansi=true" case "${XBPS_TARGET_MACHINE}" in diff --git a/srcpkgs/gftp/template b/srcpkgs/gftp/template index 2ce0a9e872f..0820b29da2d 100644 --- a/srcpkgs/gftp/template +++ b/srcpkgs/gftp/template @@ -1,13 +1,13 @@ # Template file for 'gftp' pkgname=gftp version=2.0.19 -revision=8 +revision=9 build_style=gnu-configure hostmakedepends="pkg-config" makedepends="gtk+-devel openssl-devel" short_desc="Graphical file transfer client" maintainer="psylence " -license="GPL-2" +license="GPL-2.0-or-later" homepage="https://www.gftp.org" distfiles="https://sources.voidlinux.org/gftp-${version}/gftp-${version}.tar.bz2" checksum=5306a46be96d6f4d23906cb1836fb3d732039621a6c7fcfa921acc21ac110bfd diff --git a/srcpkgs/git-crypt/template b/srcpkgs/git-crypt/template index 0f81c8dc313..f5c4c79b664 100644 --- a/srcpkgs/git-crypt/template +++ b/srcpkgs/git-crypt/template @@ -1,16 +1,16 @@ # Template file for 'git-crypt' pkgname=git-crypt version=0.6.0 -revision=7 +revision=8 build_style=gnu-makefile make_use_env=yes -makedepends="openssl-devel" -hostmakedepends="libxslt docbook-xsl" make_build_args="ENABLE_MAN=yes" make_install_args="ENABLE_MAN=yes" +hostmakedepends="libxslt docbook-xsl" +makedepends="openssl-devel" short_desc="Transparent file encryption in git" maintainer="Andy Cobaugh " -license="GPL-3" +license="GPL-3.0-or-later" homepage="https://www.agwa.name/projects/git-crypt/" distfiles="https://github.com/AGWA/git-crypt/archive/${version}.tar.gz" checksum=777c0c7aadbbc758b69aff1339ca61697011ef7b92f1d1ee9518a8ee7702bb78 @@ -21,6 +21,4 @@ post_install() { vdoc NEWS vdoc doc/multiple_keys.md vman man/man1/git-crypt.1 - vlicense COPYING } - diff --git a/srcpkgs/git-extras/template b/srcpkgs/git-extras/template index 8aa97990db5..948e5e01f92 100644 --- a/srcpkgs/git-extras/template +++ b/srcpkgs/git-extras/template @@ -1,6 +1,6 @@ # Template file for 'git-extras' pkgname=git-extras -version=6.1.0 +version=6.2.0 revision=1 build_style=gnu-makefile depends="bash git" @@ -9,7 +9,7 @@ maintainer="Orphaned " license="MIT" homepage="https://github.com/tj/git-extras" distfiles="https://github.com/tj/git-extras/archive/${version}.tar.gz" -checksum=7be0b15ee803d76d2c2e8036f5d9db6677f2232bb8d2c4976691ff7ae026a22f +checksum=151bc129f717179c1f7b6c83faf1d4829eeddef8b7c501dac05dc38c28270c3e post_patch() { vsed -i 's|$(SYSCONFDIR)/bash_completion.d|/usr/share/bash-completion/completions|' Makefile diff --git a/srcpkgs/glpk/template b/srcpkgs/glpk/template index b98f24f344a..6724c10e5dd 100644 --- a/srcpkgs/glpk/template +++ b/srcpkgs/glpk/template @@ -1,13 +1,13 @@ # Template file for 'glpk' pkgname=glpk version=5.0 -revision=1 +revision=2 build_style=gnu-configure configure_args="--with-gmp" makedepends="gmp-devel" short_desc="GNU Linear Programming Kit to solve LP, MIP and other problems" maintainer="Leah Neukirchen " -license="GPL-3" +license="GPL-3.0-or-later" homepage="http://www.gnu.org/software/glpk/glpk.html" distfiles="${GNU_SITE}/glpk/${pkgname}-${version}.tar.gz" checksum=4a1013eebb50f728fc601bdd833b0b2870333c3b3e5a816eeba921d95bec6f15 diff --git a/srcpkgs/glu/template b/srcpkgs/glu/template index f6f079e03b5..b655d49fe56 100644 --- a/srcpkgs/glu/template +++ b/srcpkgs/glu/template @@ -1,14 +1,14 @@ # Template file for 'glu' pkgname=glu version=9.0.1 -revision=1 +revision=2 build_style=gnu-configure configure_args="--disable-static" hostmakedepends="pkg-config" makedepends="MesaLib-devel" short_desc="Mesa OpenGL utility library (GLU)" maintainer="Orphaned " -license="LGPL-2.1" +license="SGI-B-2.0" homepage="http://cgit.freedesktop.org/mesa/glu/" distfiles="https://mesa.freedesktop.org/archive/glu/glu-${version}.tar.gz" checksum=f6f484cfcd51e489afe88031afdea1e173aa652697e4c19ddbcb8260579a10f7 diff --git a/srcpkgs/glyr/template b/srcpkgs/glyr/template index eb59ece2e9c..30dbe4e87f8 100644 --- a/srcpkgs/glyr/template +++ b/srcpkgs/glyr/template @@ -1,20 +1,20 @@ # Template file for 'glyr' pkgname=glyr -version="1.0.10" -revision=1 +version=1.0.10 +revision=2 build_style=cmake hostmakedepends="pkg-config" makedepends="libcurl-devel glib-devel sqlite-devel" -short_desc="A music metadata searchengine utility and library" +short_desc="Music metadata searchengine utility and library" maintainer="Michal Koutenský " -license="LGPL-3" +license="LGPL-3.0-or-later" homepage="https://github.com/sahib/glyr" distfiles="https://github.com/sahib/glyr/archive/${version}.tar.gz" checksum=77e8da60221c8d27612e4a36482069f26f8ed74a1b2768ebc373c8144ca806e8 glyr-devel_package() { depends="glyr>=${version}_${revision}" - short_desc="A music metadata searchengine utility and library - development files" + short_desc="Music metadata searchengine utility and library - development files" pkg_install() { vmove usr/include vmove usr/lib/pkgconfig diff --git a/srcpkgs/gmtp/template b/srcpkgs/gmtp/template index 69de28c2c3d..55516a91660 100644 --- a/srcpkgs/gmtp/template +++ b/srcpkgs/gmtp/template @@ -1,14 +1,14 @@ # Template file for 'gmtp' pkgname=gmtp version=1.3.11 -revision=1 +revision=2 build_style=gnu-configure hostmakedepends="pkg-config glib-devel" makedepends="libmtp-devel libflac-devel libid3tag-devel libvorbis-devel gtk+3-devel" depends="desktop-file-utils" -short_desc="A simple MP3 player client for MTP based devices" +short_desc="Simple MP3 player client for MTP based devices" maintainer="Orphaned " -license="BSD" +license="BSD-3-Clause" homepage="http://gmtp.sourceforge.net" distfiles="${SOURCEFORGE_SITE}/gmtp/gmtp-${version}.tar.gz" checksum=5a830c9c448aa2caf7a844aaa9ba38c2ac0239547366c1e6874e0080bd5f0613 diff --git a/srcpkgs/gnome-epub-thumbnailer/template b/srcpkgs/gnome-epub-thumbnailer/template index c6e1c02b9d3..a9fae3dc680 100644 --- a/srcpkgs/gnome-epub-thumbnailer/template +++ b/srcpkgs/gnome-epub-thumbnailer/template @@ -1,13 +1,13 @@ # Template file for 'gnome-epub-thumbnailer' pkgname=gnome-epub-thumbnailer version=1.6 -revision=1 +revision=2 build_style=gnu-configure hostmakedepends="pkg-config" makedepends="gdk-pixbuf-devel libarchive-devel libxml2-devel" short_desc="Thumbnailer for EPub and MOBI books" maintainer="Alif Rachmawadi " -license="GPL-3" +license="GPL-2.0-or-later" homepage="https://git.gnome.org/browse/gnome-epub-thumbnailer" distfiles="${GNOME_SITE}/${pkgname}/${version}/${pkgname}-${version}.tar.xz" checksum=b502420d9b02ea0b0fc7986ef5a091a12b2286be14fed9e47594fe9fa0c5898e diff --git a/srcpkgs/gnugo/template b/srcpkgs/gnugo/template index 81c21903ea8..30b4f91184b 100644 --- a/srcpkgs/gnugo/template +++ b/srcpkgs/gnugo/template @@ -1,14 +1,14 @@ # Template file for 'gnugo' pkgname=gnugo version=3.8 -revision=1 -nocross=yes +revision=2 build_style=gnu-configure short_desc="Free program that plays the game Go" maintainer="Brandon Wilson " -license="GPL-3" +license="GPL-3.0-or-later" homepage="https://www.gnu.org/software/gnugo/" distfiles="${GNU_SITE}/gnugo/${pkgname}-${version}.tar.gz" checksum=da68d7a65f44dcf6ce6e4e630b6f6dd9897249d34425920bfdd4e07ff1866a72 +nocross=yes CFLAGS="-fcommon" diff --git a/srcpkgs/gnupod/template b/srcpkgs/gnupod/template index 91b09322135..09c35988a9d 100644 --- a/srcpkgs/gnupod/template +++ b/srcpkgs/gnupod/template @@ -1,14 +1,14 @@ # Template file for 'gnupod' pkgname=gnupod version=0.99.8 -revision=3 +revision=4 build_style=gnu-configure hostmakedepends="perl-Digest-SHA1 perl-XML-Parser perl-Unicode-String perl-MP3-Info perl-TimeDate" makedepends="${hostmakedepends}" depends="${makedepends}" short_desc="Command line tools for managing data on iPods" maintainer="Evan Deaubl " -license="GPL-3" +license="GPL-3.0-or-later" homepage="http://www.gnu.org/software/gnupod/" distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tgz" checksum=bd566295a2e14352e6d05f5c816cab36b0e80d3ab36d29c4bbb45c581d3f3c31 diff --git a/srcpkgs/gnurobbo/template b/srcpkgs/gnurobbo/template index 49d4b52577f..d8225df323d 100644 --- a/srcpkgs/gnurobbo/template +++ b/srcpkgs/gnurobbo/template @@ -1,14 +1,14 @@ # Template file for 'gnurobbo' pkgname=gnurobbo version=0.68 -revision=3 +revision=4 build_wrksrc=gnurobbo build_style=gnu-makefile hostmakedepends="pkg-config" makedepends="SDL_mixer-devel SDL_image-devel SDL_ttf-devel" short_desc="Reimplementation of Janusz Pelc's Robbo for Atari XE/XL" maintainer="Orphaned " -license="GPL-2" +license="GPL-2.0-or-later" homepage="http://gnurobbo.sourceforge.net/" distfiles="${SOURCEFORGE_SITE}/gnurobbo/gnurobbo/gnurobbo%20${version}/gnurobbo-${version}-source.tar.gz" checksum=6c7e9e425655da02c2442d13b5fa8f542af62d2c8f253db2fb63470c5c0c3db8 @@ -16,7 +16,7 @@ checksum=6c7e9e425655da02c2442d13b5fa8f542af62d2c8f253db2fb63470c5c0c3db8 CFLAGS="-fcommon" pre_build() { - sed -i Makefile \ + vsed -i Makefile \ -e "s;\(CFLAGS\?+=\)-d;\1;" \ -e "s;CFLAGS+\?=;\0 ${CFLAGS} ;" \ -e "s;LDFLAGS+\?=;\0 ${LDFLAGS} ;" \ diff --git a/srcpkgs/go/template b/srcpkgs/go/template index 652abe8806b..7ab8307d697 100644 --- a/srcpkgs/go/template +++ b/srcpkgs/go/template @@ -1,6 +1,6 @@ # Template file for 'go' pkgname=go -version=1.16.2 +version=1.16.3 revision=1 create_wrksrc=yes build_wrksrc=go @@ -11,7 +11,7 @@ license="BSD-3-Clause" homepage="http://golang.org/" changelog="https://golang.org/doc/devel/release.html" distfiles="https://golang.org/dl/go${version}.src.tar.gz" -checksum=37ca14287a23cb8ba2ac3f5c3dd8adbc1f7a54b9701a57824bf19a0b271f83ea +checksum=b298d29de9236ca47a023e382313bcc2d2eed31dfa706b60a04103ce83a71a25 nostrip=yes noverifyrdeps=yes diff --git a/srcpkgs/google-chrome/template b/srcpkgs/google-chrome/template index a9663b7e894..ce901a7eb54 100644 --- a/srcpkgs/google-chrome/template +++ b/srcpkgs/google-chrome/template @@ -1,5 +1,5 @@ # Template file for 'google-chrome' -_chromeVersion=89.0.4389.114 +_chromeVersion=89.0.4389.128 _chromeRevision=1 _channel=stable @@ -22,7 +22,7 @@ _chromeUrl="${_baseUrl}/${_filename}" _licenseUrl="https://www.google.com/intl/en/chrome/terms/" distfiles="$_chromeUrl" -checksum=0ab92895e8b1b93a8d2591e0f89b32554af2ffc5a6f2bf9c1860a4ecb7a78b1b +checksum=1903d5f17ccdbc47bf8e07e15529a22118b192b847846a1b74f54883b11fa41e do_extract() { mkdir -p ${DESTDIR} diff --git a/srcpkgs/gopm/template b/srcpkgs/gopm/template index cf9e8258395..ae3a0d2ca49 100644 --- a/srcpkgs/gopm/template +++ b/srcpkgs/gopm/template @@ -1,14 +1,14 @@ -# Template build file for 'gopm' +# Template file for 'gopm' pkgname=gopm version=0.7.2.20150801 -revision=14 +revision=15 _commit=4295c22189eb27deedc13fd33e05c1a4da07aa3d wrksrc="${pkgname}-${_commit}" build_style=go go_import_path="github.com/gpmgo/gopm" short_desc="Go Package Manager" maintainer="John Regan " -license="Apache" -homepage="http://gopm.io/" +license="Apache-2.0" +homepage="https://github.com/gpmgo/gopm" distfiles="https://github.com/gpmgo/gopm/archive/${_commit}.tar.gz" checksum="67fd6c8940eab9adca178f880d217095ef54db8c608b0d000144d9ba7880c3f8" diff --git a/srcpkgs/gosh/template b/srcpkgs/gosh/template index 34388757f28..dc364cfba67 100644 --- a/srcpkgs/gosh/template +++ b/srcpkgs/gosh/template @@ -1,12 +1,12 @@ # Template file for 'gosh' pkgname=gosh version=0.2.3 -revision=12 +revision=13 build_style=go go_import_path="github.com/mkouhei/gosh" short_desc="Interactive shell for Golang" maintainer="Diogo Leal " -license="GPL-3" +license="GPL-3.0-or-later" homepage="https://github.com/mkouhei/gosh" distfiles="https://github.com/mkouhei/gosh/archive/v${version}.tar.gz" checksum=0b601b467a57d809134a13c8e52c4986eb328931a4db3c237630cdcd9891a707 diff --git a/srcpkgs/govendor/template b/srcpkgs/govendor/template index 76b83b36abb..e18a8fb0d11 100644 --- a/srcpkgs/govendor/template +++ b/srcpkgs/govendor/template @@ -1,12 +1,12 @@ # Template file for 'govendor' pkgname=govendor version=1.0.9 -revision=2 +revision=3 build_style=go go_import_path="github.com/kardianos/govendor" short_desc="Go vendor tool that works with the standard vendor file" maintainer="lemmi " -license="BSD" +license="BSD-3-Clause" homepage="https://github.com/kardianos/govendor" distfiles="https://github.com/kardianos/govendor/archive/v${version}.tar.gz" checksum=d303abf194838792234a1451c3a1e87885d1b2cd21774867b592c1f7db00551e diff --git a/srcpkgs/gperf/template b/srcpkgs/gperf/template index 4fb373ec885..023fe89d6c5 100644 --- a/srcpkgs/gperf/template +++ b/srcpkgs/gperf/template @@ -1,11 +1,11 @@ # Template file for 'gperf' pkgname=gperf version=3.1 -revision=2 +revision=3 build_style=gnu-configure short_desc="Perfect hash function generator" -homepage="https://www.gnu.org/software/gperf/" -license="GPL-3" maintainer="Orphaned " +license="GPL-3.0-or-later" +homepage="https://www.gnu.org/software/gperf/" distfiles="${GNU_SITE}/$pkgname/$pkgname-$version.tar.gz" checksum=588546b945bba4b70b6a3a616e80b4ab466e3f33024a352fc2198112cdbb3ae2 diff --git a/srcpkgs/gpm/template b/srcpkgs/gpm/template index d95a6c1a637..360f58668c5 100644 --- a/srcpkgs/gpm/template +++ b/srcpkgs/gpm/template @@ -1,13 +1,13 @@ # Template file for 'gpm' pkgname=gpm version=1.20.7 -revision=9 +revision=10 build_style=gnu-configure hostmakedepends="automake libtool flex texinfo" makedepends="ncurses-devel libfl-devel" short_desc="Mouse server for the console and xterm" maintainer="Orphaned " -license="GPL-2" +license="GPL-2.0-or-later" homepage="http://www.nico.schottelius.org/software/gpm/" distfiles="http://www.nico.schottelius.org/software/gpm/archives/gpm-${version}.tar.lzma" checksum=a955053b36556ffa7c628ce18fd6de7d625966573fa412fb08869533d8f7385c diff --git a/srcpkgs/grail/template b/srcpkgs/grail/template index 7d4a374512b..3f4382a7f3f 100644 --- a/srcpkgs/grail/template +++ b/srcpkgs/grail/template @@ -1,17 +1,17 @@ -# Template build file for 'grail' +# Template file for 'grail' pkgname=grail version=3.1.1 -revision=1 +revision=2 build_style=gnu-configure +configure_args="--with-x11" +hostmakedepends="pkg-config" +makedepends="frame-devel libXfixes-devel libXi-devel" short_desc="Gesture Recognition And Instantiation Library" maintainer="Enno Boland " -license="LGPL-3" +license="LGPL-3.0-only" homepage="https://launchpad.net/grail" distfiles="https://launchpad.net/${pkgname}/trunk/${version}/+download/${pkgname}-${version}.tar.bz2" checksum=5eed1f650f042481daa3a2de5e7d43261fe343b2a1b1e240f3b7fc26572c9df3 -hostmakedepends="pkg-config" -makedepends="frame-devel libXfixes-devel libXi-devel" -configure_args="--with-x11" grail-devel_package() { depends="grail>=${version}_${revision}" diff --git a/srcpkgs/grub-btrfs/patches/no-root-please.patch b/srcpkgs/grub-btrfs/patches/no-root-please.patch new file mode 100644 index 00000000000..4e0a32803fd --- /dev/null +++ b/srcpkgs/grub-btrfs/patches/no-root-please.patch @@ -0,0 +1,15 @@ +Index: grub-btrfs-4.9/Makefile +=================================================================== +--- grub-btrfs-4.9.orig/Makefile ++++ grub-btrfs-4.9/Makefile +@@ -9,10 +9,6 @@ LIB_DIR = $(DESTDIR)$(PREFIX)/lib + .PHONY: install uninstall help + + install: +- @if test "$(shell id -u)" != 0; then \ +- echo "You are not root, run this target as root please."; \ +- exit 1; \ +- fi + @install -Dm755 -t "$(DESTDIR)/etc/grub.d/" 41_snapshots-btrfs + @install -Dm644 -t "$(DESTDIR)/etc/default/grub-btrfs/" config + @install -Dm644 -t "$(LIB_DIR)/systemd/system/" grub-btrfs.service diff --git a/srcpkgs/grub-btrfs/template b/srcpkgs/grub-btrfs/template index 8c1a2f5954c..2527806d699 100644 --- a/srcpkgs/grub-btrfs/template +++ b/srcpkgs/grub-btrfs/template @@ -1,6 +1,6 @@ # Template file for 'grub-btrfs' pkgname=grub-btrfs -version=4.8.1 +version=4.9 revision=1 build_style=gnu-makefile depends="grub bash" @@ -9,7 +9,8 @@ maintainer="Anjandev Momi " license="GPL-3.0-or-later" homepage="https://github.com/Antynea/grub-btrfs" distfiles="https://github.com/Antynea/grub-btrfs/archive/v${version}.tar.gz" -checksum=a0092e705adc91fbb73804327abe68002fa705ea7a4948bb21467134c7f69830 +checksum=62461133c697643e98a608239773f500edee3e4055c5729fef6639d1cd610243 +patch_args=-Np1 post_install() { rm -rf -- "${DESTDIR}"/usr/lib/systemd diff --git a/srcpkgs/gsimplecal-gtk2/template b/srcpkgs/gsimplecal-gtk2/template index 4712e1d854d..73cf3bd39b8 100644 --- a/srcpkgs/gsimplecal-gtk2/template +++ b/srcpkgs/gsimplecal-gtk2/template @@ -1,20 +1,21 @@ # Template file for 'gsimplecal-gtk2' pkgname=gsimplecal-gtk2 version=2.1 -revision=3 +revision=4 wrksrc="${pkgname%-*}-${version}" build_style=gnu-configure configure_args="--enable-gtk2" -makedepends="gtk+-devel" hostmakedepends="automake pkg-config" -replaces="gsimplecal-gtk3>=0" +makedepends="gtk+-devel" short_desc="Simple and lightweight GTK calendar" maintainer="Jarbowski " -license="BSD" +license="BSD-3-Clause" homepage="http://dmedvinsky.github.io/gsimplecal/" distfiles="https://github.com/dmedvinsky/${pkgname%-*}/archive/v${version}.tar.gz" checksum="660cac7333d3507203a008e142e2b8f5dfcf0735b6ccabdd8d3d902b5d2c40e9" +replaces="gsimplecal-gtk3>=0" + pre_configure() { ./autogen.sh } diff --git a/srcpkgs/gsimplecal-gtk3/template b/srcpkgs/gsimplecal-gtk3/template index 57b595e0f4f..52acc624d51 100644 --- a/srcpkgs/gsimplecal-gtk3/template +++ b/srcpkgs/gsimplecal-gtk3/template @@ -1,19 +1,20 @@ # Template file for 'gsimplecal-gtk3' pkgname=gsimplecal-gtk3 version=2.1 -revision=3 +revision=4 wrksrc="${pkgname%-*}-${version}" build_style=gnu-configure -makedepends="gtk+3-devel" hostmakedepends="automake pkg-config" -replaces="gsimplecal-gtk2>=0" +makedepends="gtk+3-devel" short_desc="Simple and lightweight GTK calendar" maintainer="Jarbowski " -license="BSD" +license="BSD-3-Clause" homepage="http://dmedvinsky.github.io/gsimplecal/" distfiles="https://github.com/dmedvinsky/${pkgname%-*}/archive/v${version}.tar.gz" checksum="660cac7333d3507203a008e142e2b8f5dfcf0735b6ccabdd8d3d902b5d2c40e9" +replaces="gsimplecal-gtk2>=0" + pre_configure() { ./autogen.sh } diff --git a/srcpkgs/gsl-ucg/template b/srcpkgs/gsl-ucg/template index 840a2be23e0..5ae1d27e5f8 100644 --- a/srcpkgs/gsl-ucg/template +++ b/srcpkgs/gsl-ucg/template @@ -1,14 +1,14 @@ # Template file for 'gsl-ucg' pkgname=gsl-ucg version=4.1.5 -revision=1 +revision=2 wrksrc="gsl-${version}" build_wrksrc="src" build_style=gnu-makefile makedepends="pcre-devel" short_desc="Generator Scripting Language - Universal Code Generator" maintainer="Toyam Cox " -license="GPL-3" +license="GPL-3.0-or-later" homepage="https://github.com/zeromq/gsl" distfiles="https://github.com/zeromq/gsl/archive/v${version}.tar.gz" checksum=c1c3d61a1d89b65d0d1161c803bcdd6364045cc20d7e0c1f67f0955cd9b326b0 diff --git a/srcpkgs/gsmartcontrol/template b/srcpkgs/gsmartcontrol/template index ac519e56c3c..3574f4a6377 100644 --- a/srcpkgs/gsmartcontrol/template +++ b/srcpkgs/gsmartcontrol/template @@ -1,14 +1,14 @@ # Template file for 'gsmartcontrol' pkgname=gsmartcontrol version=1.1.3 -revision=4 +revision=5 build_style=gnu-configure hostmakedepends="pkg-config" makedepends="gtkmm-devel pcre-devel desktop-file-utils" depends="smartmontools hicolor-icon-theme" short_desc="GUI to smartmontools" maintainer="yopito " -license="GPL-3" +license="GPL-2.0-or-later" homepage="http://gsmartcontrol.sourceforge.net/" distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.bz2" checksum=b64f62cffa4430a90b6d06cd52ebadd5bcf39d548df581e67dfb275a673b12a9 diff --git a/srcpkgs/gst-plugins-bad1/template b/srcpkgs/gst-plugins-bad1/template index 446eac2f409..7b97a3e3184 100644 --- a/srcpkgs/gst-plugins-bad1/template +++ b/srcpkgs/gst-plugins-bad1/template @@ -1,7 +1,7 @@ # Template file for 'gst-plugins-bad1' pkgname=gst-plugins-bad1 version=1.18.4 -revision=2 +revision=3 wrksrc="${pkgname/1/}-${version}" build_helper="gir" build_style=meson diff --git a/srcpkgs/gst123/template b/srcpkgs/gst123/template index 95cf767befd..f3a2d41316b 100644 --- a/srcpkgs/gst123/template +++ b/srcpkgs/gst123/template @@ -1,15 +1,15 @@ # Template file for 'gst123' pkgname=gst123 version=0.3.5 -revision=1 +revision=2 build_style=gnu-configure hostmakedepends="automake pkg-config" makedepends="ncurses-devel gtk+-devel libxml2-devel gst-plugins-base1-devel gst-plugins-good1" depends="gst-plugins-good1" short_desc="GStreamer based CLI player" maintainer="Orphaned " +license="LGPL-2.1-or-later" homepage="http://space.twc.de/~stefan/gst123.php/" -license="LGPL-2.1" distfiles="http://space.twc.de/~stefan/gst123/gst123-$version.tar.bz2" checksum=c7b4729773f66cc679e94df76bcc6a95a2222192730f906e527e72624f084a7d diff --git a/srcpkgs/gtk-theme-config/template b/srcpkgs/gtk-theme-config/template index bb927821042..6dd97132c14 100644 --- a/srcpkgs/gtk-theme-config/template +++ b/srcpkgs/gtk-theme-config/template @@ -2,14 +2,14 @@ pkgname=gtk-theme-config reverts=20140605_1 version=1.0 -revision=2 +revision=3 build_style=gnu-makefile hostmakedepends="pkg-config vala-devel" makedepends="glib-devel vala-devel gtk+3-devel hicolor-icon-theme desktop-file-utils" depends="hicolor-icon-theme desktop-file-utils" short_desc="Utility to set GTK Theme Preferences" maintainer="Orphaned " -license="GPL-3" +license="GPL-3.0-only" homepage="https://github.com/satya164/gtk-theme-config" distfiles="$homepage/archive/v$version.tar.gz" checksum=174aac3ea43966168d120dbd9e0f23d7900d095ee1b0cf32472d59b0fdea8448 @@ -26,5 +26,5 @@ pre_build() { _ldflags="${_ldflags} -X $_p" done # Add to VALACFLAGS - sed -i Makefile -e "s;^VALACFLAGS.*;& $_cflags $_ldflags;" + vsed -i Makefile -e "s;^VALACFLAGS.*;& $_cflags $_ldflags;" } diff --git a/srcpkgs/gtypist/template b/srcpkgs/gtypist/template index 723bc166446..d4bf9dc4184 100644 --- a/srcpkgs/gtypist/template +++ b/srcpkgs/gtypist/template @@ -1,15 +1,16 @@ +# Template file for 'gtypist' pkgname=gtypist version=2.9.5 -revision=1 -short_desc="A universal typing tutor" +revision=2 +build_style=gnu-configure +hostmakedepends="automake" +makedepends="ncurses-devel" +short_desc="Universal typing tutor" maintainer="Phileas Vöcking " -license="GPL-3" +license="GPL-3.0-or-later" homepage="https://www.gnu.org/software/gtypist/" distfiles="$GNU_SITE/gtypist/gtypist-${version}.tar.xz" checksum="c13af40b12479f8219ffa6c66020618c0ce305ad305590fde02d2c20eb9cf977" -build_style=gnu-configure -makedepends="ncurses-devel" -hostmakedepends="automake" pre_configure() { autoreconf diff --git a/srcpkgs/gv/template b/srcpkgs/gv/template index e15cfeb71f7..60d34b5f472 100644 --- a/srcpkgs/gv/template +++ b/srcpkgs/gv/template @@ -1,12 +1,8 @@ # Template file for 'gv' pkgname=gv version=3.7.4 -revision=4 +revision=5 build_style=gnu-configure -maintainer="Orphaned " -homepage="http://www.gnu.org/software/gv/" -license="GPL-2" -short_desc="Postscript and PDF viewer" configure_args=" --with-x --enable-backing-pixmap --enable-international --with-default-papersize=a4" hostmakedepends="pkg-config xorgproto" @@ -14,6 +10,10 @@ makedepends="libX11-devel libXmu-devel libXpm-devel libXext-devel libXt-devel libICE-devel libXaw3d-devel zlib-devel bzip2-devel libXinerama-devel ghostscript" depends="ghostscript" +short_desc="Postscript and PDF viewer" +maintainer="Orphaned " +license="GPL-3.0-or-later" +homepage="http://www.gnu.org/software/gv/" distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.gz" checksum="2162b3b3a95481d3855b3c4e28f974617eef67824523e56e20b56f12fe201a61" diff --git a/srcpkgs/hans/template b/srcpkgs/hans/template index 58624c9802c..6a63dbd5f32 100644 --- a/srcpkgs/hans/template +++ b/srcpkgs/hans/template @@ -1,10 +1,10 @@ # Template file for 'hans' pkgname=hans version=1.0 -revision=1 +revision=2 short_desc="ICMP tunneling software" maintainer="Andrea Brancaleoni " -license="GPL-3" +license="GPL-3.0-or-later" homepage="http://code.gerade.org/hans/" distfiles="https://github.com/friedrich/$pkgname/archive/v$version.tar.gz" checksum=53090083d440466e573b35f2eeab0b4b0dcd3e6290f797c999b4f5a0b5caaba2 diff --git a/srcpkgs/hdf5/template b/srcpkgs/hdf5/template index e035fa670ab..915d287cd32 100644 --- a/srcpkgs/hdf5/template +++ b/srcpkgs/hdf5/template @@ -1,14 +1,14 @@ # Template file for 'hdf5' pkgname=hdf5 version=1.10.5 -revision=1 +revision=2 build_style=gnu-configure configure_args="--enable-cxx --enable-fortran" hostmakedepends="gcc-fortran" makedepends="zlib-devel" short_desc="Data model, library, and file format for storing and managing data" maintainer="pulux " -license="custom" +license="custom:BSD-3-Clause-LBNL-alike" homepage="https://hdfgroup.org" distfiles="https://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-${version}.tar.gz" checksum=6d4ce8bf902a97b050f6f491f4268634e252a63dadd6656a1a9be5b7b7726fa8 diff --git a/srcpkgs/hex2hcd/template b/srcpkgs/hex2hcd/template index 60e4997021a..c8d066ed3a4 100644 --- a/srcpkgs/hex2hcd/template +++ b/srcpkgs/hex2hcd/template @@ -1,12 +1,12 @@ # Template file for 'hex2hcd' pkgname=hex2hcd version=2016.02.21 -revision=2 +revision=3 build_style=gnu-makefile short_desc="Convert *.hex firmware files to *.hcd format" maintainer="Antonio Malcolm " +license="GPL-2.0-or-later" homepage="https://github.com/antonio-malcolm/hex2hcd" -license="GPL-2" distfiles="${homepage}/archive/${version}.tar.gz" checksum=45cab33daa404c6e66979abea975f11cb5705152c7723a2a16391f5fd1ba847b conflicts="bluez" # /usr/bin/hex2hcd diff --git a/srcpkgs/heyu/template b/srcpkgs/heyu/template index 6c2999fd29f..93b3ad7cc58 100644 --- a/srcpkgs/heyu/template +++ b/srcpkgs/heyu/template @@ -1,13 +1,13 @@ # Template file for 'heyu' pkgname=heyu version=2.10.1 -revision=2 +revision=3 build_style=configure configure_script="./Configure" configure_args="linux" short_desc="X10 automation for Linux" maintainer="Michael Aldridge " -license="GPL-3" +license="GPL-3.0-or-later" homepage="http://www.heyu.org" distfiles="https://github.com/HeyuX10Automation/heyu/archive/v${version}.tar.gz" checksum=621a20f45eef62070b3f95ad17ecbc3e7e1f7352d25dac86093ff6938b606baa diff --git a/srcpkgs/hitori/template b/srcpkgs/hitori/template index 061990af505..8a50efea3e6 100644 --- a/srcpkgs/hitori/template +++ b/srcpkgs/hitori/template @@ -1,13 +1,14 @@ # Template file for 'hitori' pkgname=hitori -version=3.38.0 +version=3.38.1 revision=1 build_style=meson hostmakedepends="gettext glib-devel intltool itstool pkg-config" makedepends="gtk+3-devel" +checkdepends="gtk+3-demo" short_desc="GNOME eponymous puzzle game" maintainer="Orphaned " -license="GPL-2" +license="GPL-3.0-or-later" homepage="https://wiki.gnome.org/Apps/Hitori" distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz" -checksum=d8bd64e91e2eef2e65614374508d5b070a285de4fc3c2989e21c55ff085c4b3e +checksum=02bd2c421d4e2180265714e854bd12efd3c6d156ddf21f79e7df60011d4e4184 diff --git a/srcpkgs/hnb/template b/srcpkgs/hnb/template index 5721e32d121..45460afa1fd 100644 --- a/srcpkgs/hnb/template +++ b/srcpkgs/hnb/template @@ -1,11 +1,11 @@ # Template file for 'hnb' pkgname=hnb version=1.9.17 -revision=2 +revision=3 makedepends="ncurses-devel" -short_desc="A curses program to structure many kinds of data in one place" +short_desc="Curses program to structure many kinds of data in one place" maintainer="Diogo Leal " -license="GPL-2" +license="GPL-2.0-or-later" homepage="http://hnb.sourceforge.net/" distfiles="${SOURCEFORGE_SITE}/hnb/hnb/${version}/hnb-${version}.tar.gz" checksum=c233c00aaef5b7fb93759d7888c885f99f40aec689a7f3e0d5d8b5797bf80cd4 diff --git a/srcpkgs/httpry/template b/srcpkgs/httpry/template index fca0351703b..b1f1890cdac 100644 --- a/srcpkgs/httpry/template +++ b/srcpkgs/httpry/template @@ -1,19 +1,19 @@ # Template file for 'httpry' pkgname=httpry version=0.1.8 -revision=1 +revision=2 +wrksrc="${pkgname}-${pkgname}-${version}" build_style=gnu-makefile makedepends="libpcap-devel" short_desc="HTTP logging and information retrieval tool" maintainer="Florian Wagner " +license="GPL-2.0-only" homepage="http://dumpsterventures.com/jason/httpry/" -license="GPL-2" distfiles="https://github.com/jbittel/${pkgname}/archive/${pkgname}-${version}.tar.gz" checksum=b3bcbec3fc6b72342022e940de184729d9cdecb30aa754a2c994073447468cf0 -wrksrc="${pkgname}-${pkgname}-${version}" post_extract() { - sed -i -e'/^CC /d' \ + vsed -i -e'/^CC /d' \ -e 's/^CCFLAGS .*/CCFLAGS=$(CFLAGS) $(LDFLAGS)/' Makefile } diff --git a/srcpkgs/httrack/template b/srcpkgs/httrack/template index 090ec56ca85..31dcf7ebe1e 100644 --- a/srcpkgs/httrack/template +++ b/srcpkgs/httrack/template @@ -1,16 +1,16 @@ # Template file for 'httrack' pkgname=httrack version=3.49.2 -revision=7 +revision=8 build_style=gnu-configure configure_args="--disable-static --with-zlib=${XBPS_CROSS_BASE}/usr" -short_desc="A free and easy-to-use offline browser utility" +makedepends="zlib-devel openssl-devel" +short_desc="Free and easy-to-use offline browser utility" maintainer="mid-kid " -license="GPL-3" +license="GPL-3.0-or-later" homepage="http://www.httrack.com" distfiles="http://mirror.httrack.com/httrack-${version}.tar.gz" checksum=3477a0e5568e241c63c9899accbfcdb6aadef2812fcce0173688567b4c7d4025 -makedepends="zlib-devel openssl-devel" httrack-devel_package() { short_desc+=" - development files" diff --git a/srcpkgs/hunspell-fr_FR/INSTALL.msg b/srcpkgs/hunspell-fr_FR/INSTALL.msg deleted file mode 100644 index be1ddea8be9..00000000000 --- a/srcpkgs/hunspell-fr_FR/INSTALL.msg +++ /dev/null @@ -1,20 +0,0 @@ - NOTICE: - ----------------------------------------------------------------------- - This Package install the "classique" variant of the french dictionary: - - If you don't like this variant select the package with your desidered - variant of the dictionary following this table: - - - hunspell-fr_FR_moderne ==> Dictionnaire “Moderne” - - hunspell-fr_FR_reforme1990 ==> Dictionnaire “Réforme 1990” - - hunspell-fr_FR_toutesvariantes ==> Dictionnaire “Toutes variantes” - - See the README_dict_fr.txt in the doc directory for the explanation of - the variants. - - - ----------------------------------------------------------------------- - Void Mantainers diff --git a/srcpkgs/hunspell-fr_FR/files/README.voidlinux b/srcpkgs/hunspell-fr_FR/files/README.voidlinux new file mode 100644 index 00000000000..662f74cbc61 --- /dev/null +++ b/srcpkgs/hunspell-fr_FR/files/README.voidlinux @@ -0,0 +1,14 @@ + The hunspell-fr-FR package installs the "classique" variant of the + french dictionary. + + If you don't like this variant, select the package with your desidered + variant of the dictionary following this table: + + hunspell-fr_FR_moderne ==> Dictionnaire “Moderne” + + hunspell-fr_FR_reforme1990 ==> Dictionnaire “Réforme 1990” + + hunspell-fr_FR_toutesvariantes ==> Dictionnaire “Toutes variantes” + + See the README_dict_fr.txt file in this directory for the explanation of + the variants. diff --git a/srcpkgs/hunspell-fr_FR/template b/srcpkgs/hunspell-fr_FR/template index fa74fc8c598..221b53b561e 100644 --- a/srcpkgs/hunspell-fr_FR/template +++ b/srcpkgs/hunspell-fr_FR/template @@ -1,7 +1,7 @@ # Template file for 'hunspell-fr_FR' pkgname=hunspell-fr_FR version=7.0 -revision=1 +revision=2 create_wrksrc=yes hostmakedepends="unzip" short_desc="French dictionary for hunspell" @@ -16,6 +16,7 @@ do_install() { vinstall fr-${_variant}.aff 644 /usr/share/hunspell fr_FR.aff vinstall fr-${_variant}.dic 644 /usr/share/hunspell fr_FR.dic vdoc README_dict_fr.txt + vdoc $FILESDIR/README.voidlinux } hunspell-fr_FR-reforme1990_package() { diff --git a/srcpkgs/hydroxide/template b/srcpkgs/hydroxide/template index bd4dc1b255e..ac417c59ed8 100644 --- a/srcpkgs/hydroxide/template +++ b/srcpkgs/hydroxide/template @@ -1,6 +1,6 @@ # Template file for 'hydroxide' pkgname=hydroxide -version=0.2.17 +version=0.2.18 revision=1 build_style=go go_import_path=github.com/emersion/hydroxide @@ -11,7 +11,7 @@ maintainer="DirectorX " license="MIT" homepage="https://github.com/emersion/hydroxide" distfiles="${homepage}/archive/v${version}.tar.gz" -checksum=d1e24ce95c181fdad8cef78dc93ed6ba259302a21c0b160b7552ffc6b346bde8 +checksum=93865423bad0e37fd231d5ee52f9b98d63b6950cfc664e2d557fc579681a400b post_install() { vlicense LICENSE diff --git a/srcpkgs/hyphen/template b/srcpkgs/hyphen/template index 601c94277c0..3bbc84659c4 100644 --- a/srcpkgs/hyphen/template +++ b/srcpkgs/hyphen/template @@ -1,16 +1,20 @@ -# Template file for 'altlinuxHyph' +# Template file for 'hyphen' pkgname=hyphen version=2.8.8 -revision=2 +revision=3 build_style=gnu-configure -short_desc="ALTLinux hyphenation library" hostmakedepends="perl" +short_desc="ALTLinux hyphenation library" maintainer="Enno Boland " -license="GPL-3" +license="GPL-2.0-or-later, LGPL-2.1-or-later, MPL-1.1" homepage="http://sourceforge.net/projects/hunspell/files/Hyphen" distfiles="${SOURCEFORGE_SITE}/hunspell/$pkgname-$version.tar.gz" checksum=304636d4eccd81a14b6914d07b84c79ebb815288c76fe027b9ebff6ff24d5705 +post_install() { + vlicense COPYING +} + hyphen-tools_package() { depends="hyphen>=${version}_${revision}" short_desc+=" - tools" diff --git a/srcpkgs/jj/template b/srcpkgs/jj/template index 1c2666174ac..2663888781a 100644 --- a/srcpkgs/jj/template +++ b/srcpkgs/jj/template @@ -1,6 +1,6 @@ # Template file for 'jj' pkgname=jj -version=1.7.4 +version=1.7.5 revision=1 build_style=go go_import_path="github.com/tidwall/jj" @@ -10,7 +10,7 @@ maintainer="SolitudeSF " license="MIT" homepage="https://github.com/tidwall/jj" distfiles="${homepage}/archive/v${version}.tar.gz" -checksum=47c51b528754b5e3bea47024ff0b13d1141ee9dab0b8216f6e2472f9c0d83989 +checksum=aa6a0682778601c8d18a8fa334817724be961941213c0379cfca8bda430b3d48 post_install() { vlicense LICENSE diff --git a/srcpkgs/kubernetes-helm/template b/srcpkgs/kubernetes-helm/template index 42f8d1bd443..b5c1b398bf2 100644 --- a/srcpkgs/kubernetes-helm/template +++ b/srcpkgs/kubernetes-helm/template @@ -1,7 +1,7 @@ # Template file for 'kubernetes-helm' pkgname=kubernetes-helm -version=3.3.1 -revision=1 +version=3.5.3 +revision=2 wrksrc="helm-${version}" hostmakedepends="go make git mercurial tar" short_desc="Kubernetes Package Manager" @@ -9,7 +9,7 @@ maintainer="Kyle Nusbaum " license="Apache-2.0" homepage="https://helm.sh/" distfiles="https://github.com/helm/helm/archive/v${version}.tar.gz" -checksum=7a0ca710683d264bfa79eeed61f1dfd90db2cc755cbc1d1e9ccbb43ec55917b6 +checksum=bd3e2488011e0a73650e810cf540fcfcfcb828ff1480cc2c5a1e50934cad9d82 conflicts="helm" nopie=true @@ -35,23 +35,10 @@ do_extract() { helm-${version} } -pre_build() { - export GOPATH="$(pwd)/golib" - - ## The current version of glide in the repository has - ## a bug that prevents building, so pull the current - ## version from git. - CC=/bin/gcc go get github.com/Masterminds/glide - CC=/bin/gcc go get github.com/mitchellh/gox - CC=/bin/gcc go install github.com/Masterminds/glide - CC=/bin/gcc go install github.com/mitchellh/gox - PATH="$PATH:$(pwd)/golib/bin/" - export PATH -} - do_build() { cd golib/src/k8s.io/helm - make build-cross TARGETS="linux/${_go_target_arch} linux/${_go_host_arch}" APP="..." LDFLAGS="-X k8s.io/helm/pkg/version.Version=v${version} -X k8s.io/helm/pkg/version.BuildMetadata=" + go mod tidy # can be removed with 3.6.0; see https://github.com/helm/helm/issues/9479 + make build-cross TARGETS="linux/${_go_target_arch} linux/${_go_host_arch}" APP="..." LDFLAGS="-X helm.sh/helm/v3/internal/version.version=v${version} -X helm.sh/helm/v3/internal/version.metadata=" _dist/linux-${_go_host_arch}/helm completion bash > completion.bash _dist/linux-${_go_host_arch}/helm completion zsh > completion.zsh diff --git a/srcpkgs/kubernetes-kind/template b/srcpkgs/kubernetes-kind/template index 4bc298a4668..018127c7818 100644 --- a/srcpkgs/kubernetes-kind/template +++ b/srcpkgs/kubernetes-kind/template @@ -1,9 +1,10 @@ # Template file for 'kubernetes-kind' pkgname=kubernetes-kind version=0.10.0 -revision=1 +revision=2 wrksrc="kind-${version}" build_style=go +build_helper=qemu go_import_path="sigs.k8s.io/kind" short_desc="Kind is a tool for running local Kubernetes clusters using Docker" maintainer="Andy Cobaugh " @@ -11,3 +12,17 @@ license="Apache-2.0" homepage="https://kind.sigs.k8s.io/" distfiles="https://github.com/kubernetes-sigs/kind/archive/v${version}.tar.gz" checksum=@e5511659e3e1735531d4845405782d869d4fb425b545ea89151fd76208a12a49 +_completions="bash zsh fish" + +post_build() { + local cli=$(find $GOPATH/bin -name kind) + for shell in $_completions; do + vtargetrun $cli completion $shell > "kind.${shell}" + done +} + +post_install() { + for shell in $_completions; do + vcompletion "kind.${shell}" $shell kind + done +} diff --git a/srcpkgs/lets/template b/srcpkgs/lets/template new file mode 100644 index 00000000000..539f644189e --- /dev/null +++ b/srcpkgs/lets/template @@ -0,0 +1,16 @@ +# Template file for 'lets' +pkgname=lets +version=0.0.29 +revision=1 +build_style=go +go_import_path="github.com/lets-cli/lets" +short_desc="CLI task runner for developers - a better alternative to make" +maintainer="juan " +license="MIT" +homepage="https://lets-cli.org/" +distfiles="https://github.com/lets-cli/lets/archive/v$version.tar.gz" +checksum=8dbb82512becd09f12ce347f81132913016cc88007dea4c4d0b4b3eef4e2d264 + +post_install() { + vlicense LICENSE +} diff --git a/srcpkgs/lf/template b/srcpkgs/lf/template index e3a467f9aa9..ad24f6d971f 100644 --- a/srcpkgs/lf/template +++ b/srcpkgs/lf/template @@ -1,6 +1,6 @@ # Template file for 'lf' pkgname=lf -version=r21 +version=r22 revision=1 build_style=go go_import_path="github.com/gokcehan/${pkgname}" @@ -10,7 +10,7 @@ maintainer="Daniel Lewan " license="MIT" homepage="https://github.com/gokcehan/lf" distfiles="https://github.com/gokcehan/lf/archive/${version}.tar.gz" -checksum=088510cc1f86084c02353d55e56a8c44576b5dbfc37327daabaa86ae6b287a20 +checksum=2da82d8c6108b14ce866f49a308d2c7afc0d79bc4254a395e5b4cf07f3fe2c97 post_install() { vlicense LICENSE diff --git a/srcpkgs/libxslt/template b/srcpkgs/libxslt/template index e38b28fff11..42d80f08ac9 100644 --- a/srcpkgs/libxslt/template +++ b/srcpkgs/libxslt/template @@ -1,10 +1,10 @@ # Template file for 'libxslt' pkgname=libxslt version=1.1.34 -revision=3 +revision=4 build_style=gnu-configure configure_args="--disable-static --disable-dependency-tracking" -hostmakedepends="libtool" +hostmakedepends="libtool python-devel libxml2-python pkg-config" makedepends="python-devel libxml2-devel libxml2-python libgcrypt-devel" short_desc="XSLT parser library from the GNOME project" maintainer="Orphaned " @@ -15,33 +15,26 @@ distfiles="http://xmlsoft.org/sources/libxslt-${version}.tar.gz checksum="98b1bd46d6792925ad2dfe9a87452ea2adebf69dcb9919ffd55bf926a7f93f7f 98b1bd46d6792925ad2dfe9a87452ea2adebf69dcb9919ffd55bf926a7f93f7f" -if [ "$CROSS_BUILD" ]; then - hostmakedepends="libtool automake gettext-devel ${makedepends}" - pre_build() { - sed -e "s|/usr/\(include/python2.7\)|$XBPS_CROSS_BASE/\1|g" \ - -e "s|/usr/\(lib/python2.7/site-packages\)|$XBPS_CROSS_BASE/\1|g" \ - -i python/Makefile - } -fi - post_configure() { # Remove missing seperators and errors # on don't know how to make target, needed # by Usage: # Makefile is created after configure so fix here find ${wrksrc} -type f -name Makefile | xargs sed -i '/Usage/,/--version/d' + if [ "$CROSS_BUILD" ]; then + sed -e "s|/usr/include/python2.7|$XBPS_CROSS_BASE/&|g" \ + -e "s|/usr/lib/python2.7/site-packages|$XBPS_CROSS_BASE/&|g" \ + -i python/Makefile + fi } post_install() { - # Remove references to the install(1) wrapper. - vsed -e "s,${XBPS_WRAPPERDIR},/usr/bin,g" -i ${DESTDIR}/usr/bin/xslt-config if [ "$CROSS_BUILD" ]; then # Remove $XBPS_CROSS_BASE in pkg-config + vsed -i -e "s,-I${XBPS_CROSS_BASE}/usr/include,-I\${includedir}," \ + $DESTDIR/usr/bin/xslt-config vsed -i -e "s,$XBPS_CROSS_BASE,,g" \ - $DESTDIR/usr/bin/xslt-config \ - $DESTDIR/usr/lib/pkgconfig/libxslt.pc \ - $DESTDIR/usr/lib/pkgconfig/libexslt.pc \ - $DESTDIR/usr/lib/xsltConf.sh + $DESTDIR/usr/lib/pkgconfig/libexslt.pc fi vlicense COPYING } diff --git a/srcpkgs/linux5.10/template b/srcpkgs/linux5.10/template index 1159ae5b963..3c1bd00d197 100644 --- a/srcpkgs/linux5.10/template +++ b/srcpkgs/linux5.10/template @@ -1,6 +1,6 @@ # Template file for 'linux5.10' pkgname=linux5.10 -version=5.10.29 +version=5.10.30 revision=1 wrksrc="linux-${version}" short_desc="Linux kernel and modules (${version%.*} series)" @@ -8,7 +8,7 @@ maintainer="Leah Neukirchen " license="GPL-2.0-only" homepage="https://www.kernel.org" distfiles="https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-${version}.tar.xz" -checksum=158c6746c11a90645b4d40bdb5c049d9fac7e4c9ed381c9b7aa94db1a8e7e9ec +checksum=d40269b5ac5c8424ec808f4484c7f80947f8f2d549b1ef1a5149aec5b6a20640 python_version=3 patch_args="-Np1" diff --git a/srcpkgs/linux5.11/template b/srcpkgs/linux5.11/template index 61162540a83..d4e86720cad 100644 --- a/srcpkgs/linux5.11/template +++ b/srcpkgs/linux5.11/template @@ -1,6 +1,6 @@ # Template file for 'linux5.11' pkgname=linux5.11 -version=5.11.13 +version=5.11.14 revision=1 wrksrc="linux-${version%.*}" short_desc="Linux kernel and modules (${version%.*} series)" @@ -10,7 +10,7 @@ homepage="https://www.kernel.org" distfiles="https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-${version%.*}.tar.xz https://cdn.kernel.org/pub/linux/kernel/v5.x/patch-${version}.xz" checksum="04f07b54f0d40adfab02ee6cbd2a942c96728d87c1ef9e120d0cb9ba3fe067b4 - d38e0f7f732ec95c247182ad1c97dd433e9fbb1619c99f7a0a8a24fddd001c82" + f4bc3454b5068ac94e5c42bea7e6f37641ec1cea0ff8c438be6bf1317afe32ed" skip_extraction="patch-${version}.xz" python_version=3 patch_args="-Np1" diff --git a/srcpkgs/lmms/template b/srcpkgs/lmms/template index 3ec4eb068c9..15b67a8f222 100644 --- a/srcpkgs/lmms/template +++ b/srcpkgs/lmms/template @@ -1,7 +1,7 @@ # Template file for 'lmms' pkgname=lmms version=1.2.2 -revision=1 +revision=2 archs="~armv6*" wrksrc=${pkgname} build_style=cmake diff --git a/srcpkgs/man-pages/template b/srcpkgs/man-pages/template index f9f7e9a144a..c5cc250ad35 100644 --- a/srcpkgs/man-pages/template +++ b/srcpkgs/man-pages/template @@ -1,7 +1,7 @@ # Template file for 'man-pages' pkgname=man-pages version=5.11 -revision=1 +revision=2 short_desc="Linux Documentation Project (LDP) manual pages" maintainer="Enno Boland " license="GPL-2.0-or-later" @@ -34,9 +34,6 @@ do_install() { # mdocml rm -f man7/man.7 rm -f man7/mdoc.7 - # attr-devel - rm -f man5/attr.5 - rm -f man2/*xattr.2 # openssl-devel mv man3/rand.3 man3/glibc-rand.3 mv man3/err.3 man3/glibc-err.3 diff --git a/srcpkgs/minikube/template b/srcpkgs/minikube/template index 7b35584e34a..eaef07bd086 100644 --- a/srcpkgs/minikube/template +++ b/srcpkgs/minikube/template @@ -1,6 +1,6 @@ # Template file for 'minikube' pkgname=minikube -version=1.18.1 +version=1.19.0 revision=1 build_style=go build_helper=qemu @@ -15,7 +15,7 @@ license="Apache-2.0" homepage="https://github.com/kubernetes/minikube" changelog="https://raw.githubusercontent.com/kubernetes/minikube/master/CHANGELOG.md" distfiles="https://github.com/kubernetes/minikube/archive/v$version.tar.gz" -checksum=4ade34adf8d33ddd141d436b33cb66d4183e059f8a112ea1aeb1edeae9302594 +checksum=89647d2bba64061154ffc15cf393df1834a9f860b618f699e84696992a1654b3 pre_configure() { case "$XBPS_TARGET_MACHINE" in diff --git a/srcpkgs/mkvtoolnix/template b/srcpkgs/mkvtoolnix/template index a6606d0adca..efce272baac 100644 --- a/srcpkgs/mkvtoolnix/template +++ b/srcpkgs/mkvtoolnix/template @@ -1,6 +1,6 @@ # Template file for 'mkvtoolnix' pkgname=mkvtoolnix -version=55.0.0 +version=56.1.0 revision=1 build_style=gnu-configure build_helper=qmake @@ -10,13 +10,14 @@ hostmakedepends="autoconf docbook-xsl gettext libxslt pkg-config qt5-tools-devel makedepends="boost-devel cmark-devel file-devel fmt-devel json-c++ libdvdread-devel libflac-devel libmatroska-devel libvorbis-devel pcre2-devel pugixml-devel qt5-multimedia-devel qt5-tools-devel" +checkdepends="gtest-devel" short_desc="Create, alter and inspect Matroska videos" maintainer="Matthias von Faber " license="GPL-2.0-only" homepage="https://mkvtoolnix.download" changelog="https://mkvtoolnix.download/doc/NEWS.md" distfiles="https://mkvtoolnix.download/sources/${pkgname}-${version}.tar.xz" -checksum=6061639bda18adbf5c49264d5498fd2abab420113ba680d0eb441a9aa02afba6 +checksum=75ff6476e7c4eab10c315af4e2dd78f1399d35da7c4611a8f93f4c3c0b475f72 if [ "$CROSS_BUILD" ]; then configure_args+=" --with-boost=${XBPS_CROSS_BASE}/usr" @@ -28,6 +29,9 @@ pre_configure() { do_build() { rake ${makejobs} } +do_check() { + rake tests:run_unit +} do_install() { rake DESTDIR=${DESTDIR} install } diff --git a/srcpkgs/monero-gui/template b/srcpkgs/monero-gui/template index 6ed3b0f5ce6..16d2926d770 100644 --- a/srcpkgs/monero-gui/template +++ b/srcpkgs/monero-gui/template @@ -1,8 +1,8 @@ # Template file for 'monero-gui' pkgname=monero-gui -version=0.17.1.9 -revision=2 -_monero_version=0.17.1.9 +version=0.17.2.0 +revision=1 +_monero_version=0.17.2.0 _randomx_version="1.1.8" # the revision monero uses as a submodule for the specific version _rapidjson_gitrev="129d19ba7f496df5e33658527a7158c79b99c21c" @@ -26,8 +26,8 @@ distfiles="https://github.com/monero-project/monero-gui/archive/v${version}.tar. https://github.com/Tencent/rapidjson/archive/${_rapidjson_gitrev}.tar.gz https://github.com/monero-project/supercop/archive/${_supercop_gitrev}.tar.gz https://github.com/dlbeer/quirc/archive/${_quirc_gitrev}.tar.gz" -checksum="3a924b4e08b557d93337a0c05826a9fa95e5cf8c503aff0ecb3676be45db1d14 - efedac6d9a64488f57e5237cb6199b56d819c8315f529af5142a9e41fcfcac91 +checksum="00fbadca8090b85781b66b9cf54c36926ba9502ea5ce8e375a4342993b4ce907 + 5e9bd2e565a57b4ae9f0d851704725b2e0b18c4a94051e56d5deae4e74727496 f982a12d18b1d260bef2a1d3c46ae4902975fbf63abb38ca6413c96d1778db3a 44b007d419ac21b6affec58991e865ee572346ead19b73cf1c3e4e11c7a81273 b973b9d8269ec4d97c3c3443f0dad96d09f72b1b30e616e0947557adbdbb03f7 diff --git a/srcpkgs/monero/patches/march_cross.patch b/srcpkgs/monero/patches/march_cross.patch index 1c086feee41..a1276013b00 100644 --- a/srcpkgs/monero/patches/march_cross.patch +++ b/srcpkgs/monero/patches/march_cross.patch @@ -1,11 +1,13 @@ ---- CMakeLists.txt 2017-09-22 19:22:04.735657685 +0200 -+++ CMakeLists.txt 2017-09-22 19:20:08.164169125 +0200 -@@ -388,7 +388,7 @@ - include(TestCXXAcceptsFlag) - set(ARCH native CACHE STRING "CPU to build for: -march value or 'default' to not pass -march at all") +diff --git CMakeLists.txt CMakeLists.txt +index 953707657..394e8cb32 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -581,7 +581,7 @@ else() + set_default_arch() + endif() message(STATUS "Building on ${CMAKE_SYSTEM_PROCESSOR} for ${ARCH}") -+ if(ARCH STREQUAL "default" OR CMAKE_CROSSCOMPILING) - if(ARCH STREQUAL "default") ++ if(ARCH STREQUAL "default" OR CMAKE_CROSSCOMPILING) set(ARCH_FLAG "") elseif(PPC64LE) - set(ARCH_FLAG "-mcpu=${ARCH}") + set(ARCH_FLAG "-mcpu=power8") diff --git a/srcpkgs/monero/patches/system-miniupnpc.patch b/srcpkgs/monero/patches/system-miniupnpc.patch index 79b2e4d842c..607162d8a54 100644 --- a/srcpkgs/monero/patches/system-miniupnpc.patch +++ b/srcpkgs/monero/patches/system-miniupnpc.patch @@ -1,7 +1,6 @@ --- CMakeLists.txt +++ CMakeLists.txt -@@ -430,6 +430,14 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/translations") - +@@ -527,5 +527,13 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/translations") add_subdirectory(external) +# Final setup for miniupnpc @@ -19,9 +18,9 @@ diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 9b21705e..76340a22 100644 --- src/p2p/net_node.inl +++ src/p2p/net_node.inl -@@ -49,9 +49,16 @@ - #include "storages/levin_abstract_invoke2.h" +@@ -61,9 +61,16 @@ #include "storages/levin_abstract_invoke2.h" #include "cryptonote_core/cryptonote_core.h" + #include "net/parse.h" -#include -#include diff --git a/srcpkgs/monero/template b/srcpkgs/monero/template index 45072e81b82..3617a446f09 100644 --- a/srcpkgs/monero/template +++ b/srcpkgs/monero/template @@ -1,7 +1,7 @@ # Template file for 'monero' pkgname=monero -version=0.17.1.9 -revision=2 +version=0.17.2.0 +revision=1 _randomx_version="1.1.8" # the revision monero uses as a submodule for the specific version _rapidjson_gitrev="129d19ba7f496df5e33658527a7158c79b99c21c" @@ -23,7 +23,7 @@ distfiles="https://github.com/monero-project/monero/archive/v${version}.tar.gz https://github.com/tevador/RandomX/archive/v${_randomx_version}.tar.gz https://github.com/Tencent/rapidjson/archive/${_rapidjson_gitrev}.tar.gz https://github.com/monero-project/supercop/archive/${_supercop_gitrev}.tar.gz" -checksum="efedac6d9a64488f57e5237cb6199b56d819c8315f529af5142a9e41fcfcac91 +checksum="5e9bd2e565a57b4ae9f0d851704725b2e0b18c4a94051e56d5deae4e74727496 f982a12d18b1d260bef2a1d3c46ae4902975fbf63abb38ca6413c96d1778db3a 44b007d419ac21b6affec58991e865ee572346ead19b73cf1c3e4e11c7a81273 b973b9d8269ec4d97c3c3443f0dad96d09f72b1b30e616e0947557adbdbb03f7" diff --git a/srcpkgs/musikcube/patches/fix-install-locations.patch b/srcpkgs/musikcube/patches/fix-install-locations.patch index 9693c233b57..aaa0d7c1672 100644 --- a/srcpkgs/musikcube/patches/fix-install-locations.patch +++ b/srcpkgs/musikcube/patches/fix-install-locations.patch @@ -1,18 +1,68 @@ Currently all ELF files (binaries and libraries), get installed to /usr/share/musikcube. This patch moves all those files to their normal locations and fixes the code to expect that -diff --git src/core/support/Common.cpp src/core/support/Common.cpp -index f31cde146f..bad24a40b4 100644 ---- src/core/support/Common.cpp -+++ src/core/support/Common.cpp -@@ -102,65 +102,11 @@ static inline void silentDelete(const std::string fn) { - namespace musik { namespace core { +diff --git CMakeLists.txt CMakeLists.txt +index 7e0ea437..896d45d4 100644 +--- CMakeLists.txt ++++ CMakeLists.txt +@@ -193,7 +193,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin") + install(FILES ${plugins} DESTINATION share/musikcube/plugins) + else () + file(GLOB plugins "bin/plugins/*.so") +- install(FILES ${plugins} DESTINATION share/musikcube/plugins) ++ install(FILES ${plugins} DESTINATION lib/musikcube/plugins) + endif () + + file(GLOB sdk_headers "src/musikcore/sdk/*.h") +@@ -228,20 +228,12 @@ endif() + if (CMAKE_SYSTEM_NAME MATCHES "Darwin") + install(FILES "bin/libmusikcore.dylib" DESTINATION share/musikcube) + else() +- install(FILES "bin/libmusikcore.so" DESTINATION share/musikcube) ++ install(FILES "bin/libmusikcore.so" DESTINATION lib/) + endif() + + # executable and shell script for musikcube + install( + FILES bin/musikcube +- DESTINATION share/musikcube +- PERMISSIONS +- OWNER_EXECUTE OWNER_READ OWNER_WRITE +- GROUP_EXECUTE GROUP_READ GROUP_WRITE +- WORLD_EXECUTE WORLD_READ) +- +-install( +- FILES "${CMAKE_CURRENT_BINARY_DIR}/src/musikcube/musikcube" + DESTINATION bin/ + PERMISSIONS + OWNER_EXECUTE OWNER_READ OWNER_WRITE +@@ -251,14 +243,6 @@ install( + # executable and shell script for daemon + install( + FILES bin/musikcubed +- DESTINATION share/musikcube +- PERMISSIONS +- OWNER_EXECUTE OWNER_READ OWNER_WRITE +- GROUP_EXECUTE GROUP_READ GROUP_WRITE +- WORLD_EXECUTE WORLD_READ) +- +-install( +- FILES "${CMAKE_CURRENT_BINARY_DIR}/src/musikcubed/musikcubed" + DESTINATION bin/ + PERMISSIONS + OWNER_EXECUTE OWNER_READ OWNER_WRITE +diff --git src/musikcore/support/Common.cpp src/musikcore/support/Common.cpp +index 9e327b63..08f49351 100644 +--- src/musikcore/support/Common.cpp ++++ src/musikcore/support/Common.cpp +@@ -86,64 +86,11 @@ namespace musik { namespace core { + } std::string GetPluginDirectory() { - std::string path(GetApplicationDirectory()); - path.append("/plugins/"); - return path; -+ return std::string("/usr/lib/musikcube/plugins"); ++ return std::string("/usr/lib/musikcube/plugins"); } std::string GetApplicationDirectory() { @@ -43,83 +93,32 @@ index f31cde146f..bad24a40b4 100644 - size_t bufsize = sizeof(pathbuf); - sysctl(mib, 4, pathbuf, &bufsize, nullptr, 0); - #elif defined __OpenBSD__ -- int mib[4]; -- char **argv; -- size_t len = ARG_MAX; +- int mib[4]; +- char **argv; +- size_t len = ARG_MAX; - -- mib[0] = CTL_KERN; -- mib[1] = KERN_PROC_ARGS; -- mib[2] = getpid(); -- mib[3] = KERN_PROC_ARGV; +- mib[0] = CTL_KERN; +- mib[1] = KERN_PROC_ARGS; +- mib[2] = getpid(); +- mib[3] = KERN_PROC_ARGV; - -- argv = new char*[len]; -- if (sysctl(mib, 4, argv, &len, nullptr, 0) < 0) abort(); +- argv = new char*[len]; +- if (sysctl(mib, 4, argv, &len, nullptr, 0) < 0) abort(); - -- boost::filesystem::path command = boost::filesystem::system_complete(argv[0]); -- realpath(command.c_str(), pathbuf); -- delete[] argv; +- boost::filesystem::path command = boost::filesystem::system_complete(argv[0]); +- realpath(command.c_str(), pathbuf); +- delete[] argv; - #else - std::string pathToProc = u8fmt("/proc/%d/exe", (int) getpid()); - readlink(pathToProc.c_str(), pathbuf, PATH_MAX); -- #endif -- +- #endif - result.assign(pathbuf); - size_t last = result.find_last_of("/"); - result = result.substr(0, last); /* remove filename component */ - #endif - - return result; -+ return std::string("/usr/share/musikcube"); ++ return std::string("/usr/share/musikcube"); } std::string GetHomeDirectory() { -diff --git CMakeLists.txt CMakeLists.txt -index 3850e4050f..063e09f718 100644 ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -223,7 +223,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - install(FILES ${plugins} DESTINATION share/musikcube/plugins) - else () - file(GLOB plugins "bin/plugins/*.so") -- install(FILES ${plugins} DESTINATION share/musikcube/plugins) -+ install(FILES ${plugins} DESTINATION lib/musikcube/plugins) - endif () - - file(GLOB sdk_headers "src/core/sdk/*.h") -@@ -257,20 +257,12 @@ endif() - if (CMAKE_SYSTEM_NAME MATCHES "Darwin") - install(FILES "bin/libmusikcore.dylib" DESTINATION share/musikcube) - else() -- install(FILES "bin/libmusikcore.so" DESTINATION share/musikcube) -+ install(FILES "bin/libmusikcore.so" DESTINATION lib/) - endif() - - # executable and shell script for musikcube - install( - FILES bin/musikcube -- DESTINATION share/musikcube -- PERMISSIONS -- OWNER_EXECUTE OWNER_READ OWNER_WRITE -- GROUP_EXECUTE GROUP_READ GROUP_WRITE -- WORLD_EXECUTE WORLD_READ) -- --install( -- FILES "${CMAKE_CURRENT_BINARY_DIR}/src/musikcube/musikcube" - DESTINATION bin/ - PERMISSIONS - OWNER_EXECUTE OWNER_READ OWNER_WRITE -@@ -280,14 +272,6 @@ install( - # executable and shell script for daemon - install( - FILES bin/musikcubed -- DESTINATION share/musikcube -- PERMISSIONS -- OWNER_EXECUTE OWNER_READ OWNER_WRITE -- GROUP_EXECUTE GROUP_READ GROUP_WRITE -- WORLD_EXECUTE WORLD_READ) -- --install( -- FILES "${CMAKE_CURRENT_BINARY_DIR}/src/musikcubed/musikcubed" - DESTINATION bin/ - PERMISSIONS - OWNER_EXECUTE OWNER_READ OWNER_WRITE diff --git a/srcpkgs/musikcube/patches/microhttpd.patch b/srcpkgs/musikcube/patches/microhttpd.patch deleted file mode 100644 index dc807dbf6bf..00000000000 --- a/srcpkgs/musikcube/patches/microhttpd.patch +++ /dev/null @@ -1,16 +0,0 @@ -Although musikcube thinks that MHD (microhttpd) version 0.9.70 -defines MHD_Result, the headers installed by our version 0.9.70 -(see PR 247180) don't define that type. So bump the version -check here trivially, to keep using int. - ---- src/plugins/server/HttpServer.h.orig 2020-07-18 17:58:19 UTC -+++ src/plugins/server/HttpServer.h -@@ -43,7 +43,7 @@ extern "C" { - #include - #include - --#if MHD_VERSION < 0x00097000 -+#if MHD_VERSION < 0x00097001 - #define MHD_Result int - #endif - diff --git a/srcpkgs/musikcube/template b/srcpkgs/musikcube/template index bf42f9e53c2..633432afe5a 100644 --- a/srcpkgs/musikcube/template +++ b/srcpkgs/musikcube/template @@ -1,7 +1,7 @@ # Template file for 'musikcube' pkgname=musikcube -version=0.93.1 -revision=3 +version=0.96.4 +revision=1 build_style=cmake make_cmd=make configure_args="-DNO_NCURSESW=1 -DENABLE_SNDIO=true -DDISABLE_STRIP=true" @@ -15,7 +15,7 @@ maintainer="eater <=@eater.me>" license="BSD-3-Clause" homepage="https://musikcube.com/" distfiles="https://github.com/clangen/musikcube/archive/${version}.tar.gz" -checksum=e84e060acaab40266cc3d866f50f727c770c42273a5219fff5d6757186dbad21 +checksum=c184fe12a62da15f6dfabab885a991f5ad49065fcc7e1bef2b2892b15ed7bb99 if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then makedepends+=" libatomic-devel" diff --git a/srcpkgs/nncp/template b/srcpkgs/nncp/template index 85639e333dc..5f934bc6f5b 100644 --- a/srcpkgs/nncp/template +++ b/srcpkgs/nncp/template @@ -1,6 +1,6 @@ # Template file for 'nncp' pkgname=nncp -version=6.2.1 +version=6.3.0 revision=1 build_style=go go_import_path=cypherpunks.ru/nncp @@ -9,7 +9,7 @@ maintainer="Leah Neukirchen " license="GPL-3.0-only" homepage="http://www.nncpgo.org/" distfiles="http://www.nncpgo.org/download/${pkgname}-${version}.tar.xz" -checksum=d9682d954d68025af5b07516258d9ffcda29a4d7e7e1635be0c219a1c5ddb067 +checksum=76c26a11e3423540bb7b8470820176a35fcd0493b21a872ec223eb9443ba466b do_build() { make diff --git a/srcpkgs/notcurses/patches/restore-lost-symbol.patch b/srcpkgs/notcurses/patches/restore-lost-symbol.patch new file mode 100644 index 00000000000..b938a35ed30 --- /dev/null +++ b/srcpkgs/notcurses/patches/restore-lost-symbol.patch @@ -0,0 +1,66 @@ +From da2a897544b9d239515b85ed31c8db4d90d23883 Mon Sep 17 00:00:00 2001 +From: nick black +Date: Wed, 14 Apr 2021 10:04:28 -0400 +Subject: [PATCH] fix unintended cell abi breakage #1532 + +cell_release() and cell_duplicate() were deprecated in 2.2.6, +but replaced with static inlines. this breaks the abi, forcing +recompiles from client programs. restore them as exported +functions. +--- + include/notcurses/notcurses.h | 10 ++-------- + src/lib/render.c | 9 +++++++++ + 2 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/include/notcurses/notcurses.h b/include/notcurses/notcurses.h +index aece8cb6d..9d98ea19f 100644 +--- a/include/notcurses/notcurses.h ++++ b/include/notcurses/notcurses.h +@@ -677,18 +677,12 @@ cell_prime(struct ncplane* n, nccell* c, const char* gcluster, + // failure, and 0 on success. + API int nccell_duplicate(struct ncplane* n, nccell* targ, const nccell* c); + +-__attribute__ ((deprecated)) static inline int +-cell_duplicate(struct ncplane* n, nccell* targ, const nccell* c){ +- return nccell_duplicate(n, targ, c); +-} ++__attribute__ ((deprecated)) API int cell_duplicate(struct ncplane* n, nccell* targ, const nccell* c); + + // Release resources held by the nccell 'c'. + API void nccell_release(struct ncplane* n, nccell* c); + +-__attribute__ ((deprecated)) static inline void +-cell_release(struct ncplane* n, nccell* c){ +- nccell_release(n, c); +-} ++__attribute__ ((deprecated)) API void cell_release(struct ncplane* n, nccell* c); + + #define NCSTYLE_MASK 0x03ffu + #define NCSTYLE_STANDOUT 0x0080u +diff --git a/src/lib/render.c b/src/lib/render.c +index ad95cd878..e1334416f 100644 +--- a/src/lib/render.c ++++ b/src/lib/render.c +@@ -175,6 +175,11 @@ void nccell_release(ncplane* n, nccell* c){ + pool_release(&n->pool, c); + } + ++// FIXME deprecated, goes away in abi3 ++void cell_release(ncplane* n, nccell* c){ ++ nccell_release(n, c); ++} ++ + // Duplicate one cell onto another when they share a plane. Convenience wrapper. + int nccell_duplicate(ncplane* n, nccell* targ, const nccell* c){ + if(cell_duplicate_far(&n->pool, targ, n, c) < 0){ +@@ -184,6 +189,10 @@ int nccell_duplicate(ncplane* n, nccell* targ, const nccell* c){ + return 0; + } + ++int cell_duplicate(struct ncplane* n, nccell* targ, const nccell* c){ ++ return nccell_duplicate(n, targ, c); ++} ++ + // Emit fchannel with RGB changed to contrast effectively against bchannel. + static uint32_t + highcontrast(uint32_t bchannel){ diff --git a/srcpkgs/notcurses/template b/srcpkgs/notcurses/template index 3f6846660b1..f2bc3e9ae1b 100644 --- a/srcpkgs/notcurses/template +++ b/srcpkgs/notcurses/template @@ -1,7 +1,7 @@ # Template file for 'notcurses' pkgname=notcurses -version=2.2.4 -revision=1 +version=2.2.6 +revision=2 build_style=cmake configure_args="-DUSE_STATIC=ON $(vopt_bool man USE_PANDOC)" hostmakedepends="pkg-config $(vopt_if man pandoc)" @@ -14,7 +14,8 @@ license="Apache-2.0" homepage="https://nick-black.com/dankwiki/index.php/Notcurses" changelog="https://raw.githubusercontent.com/dankamongmen/notcurses/master/NEWS.md" distfiles="https://github.com/dankamongmen/notcurses/archive/v${version}.tar.gz" -checksum=f062b4a86ab61e800c8754cd36af557f41ac8a015e3fe3921dab1ed37c665394 +checksum=0507e507f9843a494aa66f31e419add5fbdbceb8fbc9345f3e6d4b55ed8a89d9 +patch_args=-Np1 build_options="man" desc_option_man="Use pandoc for manpages" diff --git a/srcpkgs/ocs-url/template b/srcpkgs/ocs-url/template index 609cf299202..29c0d304f73 100644 --- a/srcpkgs/ocs-url/template +++ b/srcpkgs/ocs-url/template @@ -1,11 +1,12 @@ # Template file for 'ocs-url' pkgname=ocs-url version=3.1.0 -revision=1 +revision=2 wrksrc="ocs-url-release-${version}" build_style="qmake" hostmakedepends="qt5-qmake kdeclarative-devel qt5-svg-devel qt5-declarative-devel" makedepends="qt5-svg-devel kdeclarative-devel qt5-declarative-devel" +depends="qt5-quickcontrols" short_desc="Install helper program for OpenCollaborationServices (ocs://)" maintainer="ThatGeekyWeeb " license="GPL-3.0-or-later" diff --git a/srcpkgs/pahole/template b/srcpkgs/pahole/template index 184b67b9528..d3b720d72f2 100644 --- a/srcpkgs/pahole/template +++ b/srcpkgs/pahole/template @@ -1,7 +1,7 @@ # Template file for 'pahole' pkgname=pahole -version=1.20 -revision=2 +version=1.21 +revision=1 wrksrc="dwarves-${version}" build_style=cmake configure_args="-D__LIB=lib" @@ -11,7 +11,7 @@ maintainer="Andrew Benson " license="GPL-2.0-only" homepage="http://git.kernel.org/?p=devel/pahole/pahole.git;a=summary" distfiles="https://fedorapeople.org/~acme/dwarves/dwarves-${version}.tar.xz" -checksum=a0dbda45ce83c0bf21eba78c44b4fd72560a970285fbb3e4f88375015aab6f06 +checksum=33a8bed6c0e1a5889578e01d1afed3f752353dc087d8bda36d258fe83e42a476 case $XBPS_TARGET_MACHINE in *-musl) makedepends+=" musl-obstack-devel argp-standalone" diff --git a/srcpkgs/perl-PDF-API2/template b/srcpkgs/perl-PDF-API2/template index e3be0d9f166..469ab7ed715 100644 --- a/srcpkgs/perl-PDF-API2/template +++ b/srcpkgs/perl-PDF-API2/template @@ -1,6 +1,6 @@ # Template file for 'perl-PDF-API2' pkgname=perl-PDF-API2 -version=2.039 +version=2.040 revision=1 wrksrc="PDF-API2-${version}" build_style=perl-module @@ -13,4 +13,4 @@ maintainer="Leah Neukirchen " license="LGPL-2.1-or-later" homepage="https://metacpan.org/release/PDF-API2" distfiles="${CPAN_SITE}/PDF/PDF-API2-${version}.tar.gz" -checksum=36a74318847fe92ecec45221bc78f209e194f9f979521710a89ef7baa955a123 +checksum=4925f109f47bb6bdd6deb8cf37db4f2e39aa6cdc51991d1d8008b4312ed1935a diff --git a/srcpkgs/postfix/template b/srcpkgs/postfix/template index ea2df744979..dc76f50f816 100644 --- a/srcpkgs/postfix/template +++ b/srcpkgs/postfix/template @@ -1,7 +1,7 @@ # Template file for 'postfix' pkgname=postfix -version=3.5.9 -revision=3 +version=3.5.10 +revision=1 hostmakedepends="perl m4" makedepends="icu-devel libldap-devel libmariadbclient-devel pcre-devel postgresql-libs-devel sqlite-devel" @@ -10,7 +10,7 @@ maintainer="Benjamín Albiñana " license="IPL-1.0, EPL-2.0" homepage="http://www.postfix.org/" distfiles="http://ftp.porcupine.org/mirrors/postfix-release/official/${pkgname}-${version}.tar.gz" -checksum=51ced5a3165a415beba812b6c9ead0496b7172ac6c3beb654d2ccd9a1b00762b +checksum=5bb4d7d72d7512b58f3a31426dcbd394fd354e0a43de21da89466b057a0228f8 system_accounts="postfix" postfix_homedir="/var/spool/postfix" diff --git a/srcpkgs/prboom-plus/template b/srcpkgs/prboom-plus/template index b492e41874e..cbb15d2f184 100644 --- a/srcpkgs/prboom-plus/template +++ b/srcpkgs/prboom-plus/template @@ -1,7 +1,7 @@ # Template file for 'prboom-plus' pkgname=prboom-plus version=2.5.1.4 -revision=3 +revision=4 build_style=gnu-configure configure_args="--disable-cpu-opt --disable-dogs" hostmakedepends="pcre-devel fluidsynth-devel libmad-devel SDL_mixer-devel SDL_net-devel diff --git a/srcpkgs/python3-PyICU/template b/srcpkgs/python3-PyICU/template index d1e0612a78a..6d2da03b053 100644 --- a/srcpkgs/python3-PyICU/template +++ b/srcpkgs/python3-PyICU/template @@ -1,22 +1,23 @@ # Template file for 'python3-PyICU' pkgname=python3-PyICU -version=2.6 +version=2.7.1 revision=1 -wrksrc="PyICU-${version}" +wrksrc="pyicu-v${version}" build_style=python3-module hostmakedepends="python3-setuptools" makedepends="python3-devel icu-devel" +depends="python3" checkdepends="python3-pytest python3-six" short_desc="Python extension wrapping the ICU C++ API (Python3)" maintainer="Piotr Wójcik " license="MIT" -homepage="https://github.com/ovalhub/pyicu" -changelog="https://raw.githubusercontent.com/ovalhub/pyicu/master/CHANGES" -distfiles="${PYPI_SITE}/P/PyICU/PyICU-${version}.tar.gz" -checksum=a9a5bf6833360f8f69e9375b91c1a7dd6e0c9157a42aee5bb7d6891804d96371 +homepage="https://pypi.org/project/PyICU/" +changelog="https://gitlab.pyicu.org/main/pyicu/-/raw/main/CHANGES" +distfiles="https://gitlab.pyicu.org/main/pyicu/-/archive/v${version}/pyicu-v${version}.tar.bz2" +checksum=c36114e39ab62a7c0fba56e8c5256c1eeae05d5207c766d3dd7ed422a8d877a3 -do_check() { - python3 setup.py test +pre_check() { + export PYTHONPATH=$(cd build/lib* && pwd) } post_install() { diff --git a/srcpkgs/python3-PyICU/update b/srcpkgs/python3-PyICU/update new file mode 100644 index 00000000000..879536c9701 --- /dev/null +++ b/srcpkgs/python3-PyICU/update @@ -0,0 +1 @@ +pkgname=pyicu diff --git a/srcpkgs/python3-adblock/template b/srcpkgs/python3-adblock/template index 9c01559bc98..a5d23c0439f 100644 --- a/srcpkgs/python3-adblock/template +++ b/srcpkgs/python3-adblock/template @@ -1,6 +1,6 @@ # Template file for 'python3-adblock' pkgname=python3-adblock -version=0.4.3 +version=0.4.4 revision=1 wrksrc="${pkgname/python3/python}-${version}" build_style=python3-pep517 @@ -16,7 +16,7 @@ license="Apache-2.0, MIT" homepage="https://github.com/ArniDagur/python-adblock" changelog="https://raw.githubusercontent.com/ArniDagur/python-adblock/master/CHANGELOG.md" distfiles="${homepage}/archive/${version}.tar.gz" -checksum=42f00ff33338eed83c5880ae5f12c70e38154b78fceb19d2f447e86ae34e0f60 +checksum=797cc2bff82e712f867fdb1b7b07ae0dda67020526bddf6413cc97519169d600 case "$XBPS_TARGET_MACHINE" in i686*) broken="compiler throws SIGABRT on the psl crate" ;; diff --git a/srcpkgs/python3-pytest/template b/srcpkgs/python3-pytest/template index 6a38a983b04..64e730d99d1 100644 --- a/srcpkgs/python3-pytest/template +++ b/srcpkgs/python3-pytest/template @@ -1,6 +1,6 @@ # Template file for 'python3-pytest' pkgname=python3-pytest -version=6.2.2 +version=6.2.3 revision=1 wrksrc="pytest-${version}" build_style=python3-module @@ -16,7 +16,7 @@ license="MIT" homepage="https://docs.pytest.org/en/latest/" changelog="https://docs.pytest.org/en/latest/changelog.html" distfiles="${PYPI_SITE}/p/pytest/pytest-${version}.tar.gz" -checksum=9d1edf9e7d0b84d72ea3dbcdfd22b35fb543a5e8f2a60092dd578936bf63d7f9 +checksum=671238a46e4df0f3498d1c3270e5deb9b32d25134c99b7d75370a68cfbe9b634 alternatives=" pytest:pytest:/usr/bin/pytest3 pytest:py.test:/usr/bin/py.test3" diff --git a/srcpkgs/qsynth/template b/srcpkgs/qsynth/template index 8873baf43ce..1b871214846 100644 --- a/srcpkgs/qsynth/template +++ b/srcpkgs/qsynth/template @@ -1,7 +1,7 @@ # Template file for 'qsynth' pkgname=qsynth version=0.9.2 -revision=1 +revision=2 build_style=gnu-configure build_helper=qmake hostmakedepends="pkg-config qt5-tools" diff --git a/srcpkgs/qtractor/template b/srcpkgs/qtractor/template index a8fb195156c..8ea7f5fcd6e 100644 --- a/srcpkgs/qtractor/template +++ b/srcpkgs/qtractor/template @@ -1,11 +1,13 @@ # Template file for 'qtractor' pkgname=qtractor -version=0.9.14 +version=0.9.21 revision=1 wrksrc="qtractor-qtractor_${version//./_}" build_style=gnu-configure -configure_args="--enable-debug" -hostmakedepends="automake pkg-config" +build_helper=qmake +configure_args="--enable-debug ac_cv_qmake=${XBPS_WRAPPERDIR}/qmake + ac_cv_libsuil_gtk2_in_qt5=yes ac_cv_libsuil_x11_in_qt5=yes" +hostmakedepends="automake pkg-config qt5-qmake qt5-host-tools" makedepends="dssi-devel jack-devel ladspa-sdk liblo-devel libmad-devel libsamplerate-devel lilv-devel qt5-tools-devel qt5-x11extras-devel rubberband-devel sratom-devel suil-devel vamp-plugin-sdk-devel" @@ -16,10 +18,7 @@ license="GPL-2.0-or-later" homepage="http://qtractor.org" changelog="https://raw.githubusercontent.com/rncbc/qtractor/master/ChangeLog" distfiles="https://github.com/rncbc/qtractor/archive/qtractor_${version//./_}.tar.gz" -checksum=16795d130ab4e79e76cd535251ff3d5f827731c628b9aee658c2c48e6f326e4d - -# configure fails to find qt5 headers -nocross="https://build.voidlinux.org/builders/armv7l-musl_builder/builds/3458/steps/shell_3/logs/stdio" +checksum=3e8c89d6d6a7a8d84280b5254020515640ef61b8ec356d8aaa3e0da118738daa pre_configure() { autoreconf -if diff --git a/srcpkgs/recoll/patches/musl-pxattr.patch b/srcpkgs/recoll/patches/musl.patch similarity index 52% rename from srcpkgs/recoll/patches/musl-pxattr.patch rename to srcpkgs/recoll/patches/musl.patch index 22cee333130..c57aca4a565 100644 --- a/srcpkgs/recoll/patches/musl-pxattr.patch +++ b/srcpkgs/recoll/patches/musl.patch @@ -1,3 +1,17 @@ +Index: utils/fstreewalk.cpp +=================================================================== +--- utils/fstreewalk.cpp.orig ++++ utils/fstreewalk.cpp +@@ -17,6 +17,7 @@ + + #include "autoconfig.h" + ++#include + #include + + #include +Index: utils/pxattr.cpp +=================================================================== --- utils/pxattr.cpp 2017-07-03 14:14:46.000000000 +0200 +++ utils/pxattr.cpp 2017-12-17 14:34:29.955674837 +0100 @@ -44,7 +44,7 @@ diff --git a/srcpkgs/recoll/template b/srcpkgs/recoll/template index 98fda41bbca..8c5de6966a4 100644 --- a/srcpkgs/recoll/template +++ b/srcpkgs/recoll/template @@ -1,12 +1,13 @@ # Template file for 'recoll' pkgname=recoll -version=1.26.1 -revision=2 +version=1.30.0 +revision=1 build_style=gnu-configure build_helper=qmake configure_args="--disable-python-module --disable-python-chm --enable-recollq --disable-x11mon" -hostmakedepends="automake libtool gettext-devel qt5-qmake" +hostmakedepends="automake libtool gettext-devel qt5-qmake pkg-config + qt5-host-tools" makedepends="xapian-core-devel zlib-devel libuuid-devel qt5-webkit-devel qt5-devel aspell-devel libxslt-devel libxml2-devel" short_desc="Full text search tool based on Xapian backend" @@ -14,16 +15,4 @@ maintainer="Rui Abreu Ferreira " license="GPL-2.0-or-later" homepage="https://www.lesbonscomptes.com/recoll/" distfiles="https://www.lesbonscomptes.com/${pkgname}/${pkgname}-${version}.tar.gz" -checksum=438f251c24baf954020cf3298872c74982f4c4abffd10197d7700db83072e732 - -if [ "$CROSS_BUILD" ]; then - hostmakedepends+=" qt5-host-tools qt5-devel qt5-webkit-devel" - - pre_configure() { - # xslt-config has the libxml2 hardcoded to /usr/include/libxml2 - # use cross path instead. - vsed -e 's;-I/usr/include/libxml2;-I${includedir}/libxml2;' \ - -e 's;libs="-lxslt -L/usr/lib -lxml2";libs="-lxslt -lxml2";g' \ - -i ${XBPS_WRAPPERDIR}/xslt-config - } -fi +checksum=17a8e684a8d5560dc7b44cd4b2962cb46476a75bdc107f622051235076d11885 diff --git a/srcpkgs/residualvm/template b/srcpkgs/residualvm/template index 4a9ed863296..b0abb4052a9 100644 --- a/srcpkgs/residualvm/template +++ b/srcpkgs/residualvm/template @@ -1,7 +1,7 @@ # Template file for 'residualvm' pkgname=residualvm version=0.3.1 -revision=4 +revision=5 build_style=configure configure_args="--prefix=/usr --enable-all-engines --enable-release --enable-flac --enable-faad --enable-fluidsynth $(vopt_enable sndio)" @@ -11,7 +11,7 @@ makedepends="SDL2-devel libvorbis-devel libmad-devel libjpeg-turbo-devel glew-devel libflac-devel fluidsynth-devel faad2-devel $(vopt_if sndio sndio-devel)" short_desc="Cross-platform 3D game interpreter" maintainer="newbluemoon " -license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later, BSD, ISC, MIT, Zlib" +license="GPL-2.0-or-later, GPL-3.0-or-later, LGPL-2.1-or-later, BSD-3-Clause, ISC, MIT, Zlib" homepage="https://www.residualvm.org/" distfiles="https://www.residualvm.org/downloads/release/${version}/residualvm-${version}-sources.tar.bz2" checksum=f50c83bbc55a8121eefc279e83982b6ec590e608e145b7f750006619dd0bf9e9 @@ -41,4 +41,7 @@ post_install() { # move licenses to the right place vmkdir usr/share/licenses/residualvm mv ${DESTDIR}/usr/share/doc/residualvm/COPYING* ${DESTDIR}/usr/share/licenses/residualvm/ + vlicense COPYING.BSD + vlicense COPYING.ISC + vlicense COPYING.MIT } diff --git a/srcpkgs/rssguard/template b/srcpkgs/rssguard/template index df1ccd7ede9..88f7d36d6b3 100644 --- a/srcpkgs/rssguard/template +++ b/srcpkgs/rssguard/template @@ -1,6 +1,6 @@ # Template file for 'rssguard' pkgname=rssguard -version=3.9.1 +version=3.9.2 revision=1 build_style=qmake configure_args="CONFIG+=release LRELEASE_EXECUTABLE=lrelease-qt5 USE_WEBENGINE=false" @@ -12,7 +12,7 @@ maintainer="mobinmob " license="GPL-3.0-only" homepage="https://github.com/martinrotter/rssguard" distfiles="https://github.com/martinrotter/rssguard/archive/${version}.tar.gz" -checksum=312468a21a370159b0e10f6814071f6182314e196f2930402ffc307871e36fbf +checksum=05eb628ff085ff10056289fd83b5e3b0583c19e3711795ade024bdfe71de5d97 post_install() { # Install rssguard icon manually diff --git a/srcpkgs/sabnzbd/template b/srcpkgs/sabnzbd/template index ed3dd23016b..1d3c9f9942b 100644 --- a/srcpkgs/sabnzbd/template +++ b/srcpkgs/sabnzbd/template @@ -1,12 +1,12 @@ # Template file for 'sabnzbd' pkgname=sabnzbd -version=3.0.2 +version=3.2.1 revision=1 wrksrc="SABnzbd-${version}" pycompile_dirs="/usr/share/sabnzbd" hostmakedepends="python3 gettext" depends="par2cmdline python3-sabyenc3 python3-cheetah3 python3-cryptography - python3-feedparser python3-configobj python3-CherryPy + python3-feedparser python3-configobj python3-CherryPy python3-Cheroot python3-portend python3-chardet python3-notify2 unzip" short_desc="Open Source Binary Newsreader written in Python" maintainer="Orphaned " @@ -14,7 +14,7 @@ license="GPL-2.0-or-later, custom:Bundled" homepage="https://sabnzbd.org/" changelog="https://github.com/sabnzbd/sabnzbd/releases" distfiles="https://github.com/sabnzbd/sabnzbd/releases/download/${version}/SABnzbd-${version}-src.tar.gz" -checksum=c93f95d9193061ba653c2ab592704c7a8e9b6146817f80e4e2420b3f74b976b2 +checksum=79c2bb46e41f2316e4c2827b61598157fbc9467ecddaca6fc4f0b2f4e7b8f809 python_version=3 post_extract() { diff --git a/srcpkgs/scummvm/patches/fluidsynth-2.2.0.diff b/srcpkgs/scummvm/patches/fluidsynth-2.2.0.diff new file mode 100644 index 00000000000..c771107514e --- /dev/null +++ b/srcpkgs/scummvm/patches/fluidsynth-2.2.0.diff @@ -0,0 +1,25 @@ +--- audio/softsynth/fluidsynth.cpp ++++ audio/softsynth/fluidsynth.cpp +@@ -144,11 +144,11 @@ + return p; + } + +-static int SoundFontMemLoader_read(void *buf, int count, void *handle) { ++static int SoundFontMemLoader_read(void *buf, fluid_long_long_t count, void *handle) { + return ((Common::SeekableReadStream *) handle)->read(buf, count) == (uint32)count ? FLUID_OK : FLUID_FAILED; + } + +-static int SoundFontMemLoader_seek(void *handle, long offset, int origin) { ++static int SoundFontMemLoader_seek(void *handle, fluid_long_long_t offset, int origin) { + return ((Common::SeekableReadStream *) handle)->seek(offset, origin) ? FLUID_OK : FLUID_FAILED; + } + +@@ -157,7 +157,7 @@ + return FLUID_OK; + } + +-static long SoundFontMemLoader_tell(void *handle) { ++static fluid_long_long_t SoundFontMemLoader_tell(void *handle) { + return ((Common::SeekableReadStream *) handle)->pos(); + } + #endif diff --git a/srcpkgs/scummvm/template b/srcpkgs/scummvm/template index 3256722fd0c..0cec3ab176d 100644 --- a/srcpkgs/scummvm/template +++ b/srcpkgs/scummvm/template @@ -1,7 +1,7 @@ # Template file for 'scummvm' pkgname=scummvm version=2.2.0 -revision=1 +revision=2 build_style=configure configure_args="--prefix=/usr --enable-release-mode --with-sdl-prefix=${XBPS_CROSS_BASE}/usr" @@ -14,7 +14,7 @@ short_desc="Free implementation of LucasArts' SCUMM interpreter" maintainer="John " license="GPL-2.0-or-later" homepage="https://www.scummvm.org/" -distfiles="https://www.scummvm.org/frs/${pkgname}/${version}/${pkgname}-${version}.tar.xz" +distfiles="https://downloads.scummvm.org/frs/${pkgname}/${version}/${pkgname}-${version}.tar.xz" checksum=1469657e593bd8acbcfac0b839b086f640ebf120633e93f116cab652b5b27387 case "$XBPS_TARGET_MACHINE" in diff --git a/srcpkgs/sigil/template b/srcpkgs/sigil/template index 0ee28d56cba..44c96f15b00 100644 --- a/srcpkgs/sigil/template +++ b/srcpkgs/sigil/template @@ -1,6 +1,6 @@ # Template file for 'sigil' pkgname=sigil -version=1.4.3 +version=1.5.1 revision=1 wrksrc="Sigil-${version}" build_style=cmake @@ -19,7 +19,7 @@ maintainer="Orphaned " license="GPL-3.0-or-later" homepage="https://github.com/Sigil-Ebook/Sigil" distfiles="${homepage}/archive/${version}.tar.gz" -checksum=74bd482d3c4fe4b2015ee006a6fa77f1114371bd217e4e7cf1d9a805ea41e719 +checksum=ecdb20c90ca4ca9bd9ebee03734ee8c88ac101b0d32cc7ef25ff70960f4e982c python_version=3 if [ "$CROSS_BUILD" ]; then diff --git a/srcpkgs/sof-firmware/template b/srcpkgs/sof-firmware/template index 544ce9c5893..677fe02c3b7 100644 --- a/srcpkgs/sof-firmware/template +++ b/srcpkgs/sof-firmware/template @@ -1,23 +1,23 @@ # Template file for 'sof-firmware' pkgname=sof-firmware -version=1.6.1 -revision=2 +version=1.7 +revision=1 archs="i686* x86_64*" wrksrc="sof-bin-${version}" +hostmakedepends="rsync" depends="alsa-ucm-conf" short_desc="Sound Open Firmware and topology binaries" maintainer="cinerea0 " license="BSD-3-Clause" homepage="https://thesofproject.github.io/latest/index.html" -distfiles="https://github.com/thesofproject/sof-bin/archive/v${version}.tar.gz" -checksum=587b320030bc84de1aacba5d86d89ba1a4f67201baf8b9b61bb885af60643bfb +distfiles="https://github.com/thesofproject/sof-bin/archive/refs/tags/v${version}.tar.gz" +checksum=895d0199c06fc9b8bd8452fffff4f0d53134af451f63ffd1b78f04b10ef6c251 do_install() { + vmkdir usr/lib/firmware/intel/sof + vmkdir usr/lib/firmware/intel/sof-tplg + rsync -a "sof-v${version}/" "${DESTDIR}/usr/lib/firmware/intel/sof" + rsync -a "sof-tplg-v${version}/" "${DESTDIR}/usr/lib/firmware/intel/sof-tplg" + vlicense LICENCE.NXP - - export ROOT="${DESTDIR}/usr" - export SOF_VERSION="v${version}" - - vmkdir usr/lib/firmware/intel - ./go.sh } diff --git a/srcpkgs/steam/INSTALL.msg b/srcpkgs/steam/INSTALL.msg index 196c392f45b..3f33b10f959 100644 --- a/srcpkgs/steam/INSTALL.msg +++ b/srcpkgs/steam/INSTALL.msg @@ -1,23 +1,2 @@ -Steam on x86_64 requires support for OpenGL/Vulkan in 32bits mode, -the 32bit packages are available in the `multilib` repository. - - # xbps-install -Syv void-repo-multilib{,-nonfree} - # xbps-install -S - -Generic (for all systems): - - - libgcc-32bit libstdc++-32bit libdrm-32bit libglvnd-32bit - -For users of the open source drivers: - - - mesa-dri-32bit - -For users of the proprietary NVIDIA driver: - - - nvidia-libs-32bit (latest nvidia package) - - nvidia390-libs-32bit (latest previous package) - - nvidia340-libs-32bit (latest package for old GPUs) - -For mesa users this would result in: - - # xbps-install -Syv libgcc-32bit libstdc++-32bit libdrm-32bit libglvnd-32bit mesa-dri-32bit +Consult /usr/share/doc/steam/README.voidlinux for further installation +instructions and troubleshooting information. diff --git a/srcpkgs/steam/files/README.voidlinux b/srcpkgs/steam/files/README.voidlinux new file mode 100644 index 00000000000..35d1fe4798d --- /dev/null +++ b/srcpkgs/steam/files/README.voidlinux @@ -0,0 +1,48 @@ +Steam on i686 should work without needing to install any extra packages. +Steam on x86_64 requires support for OpenGL/Vulkan in 32bits mode, +the 32bit packages are available in the multilib repository. + + # xbps-install -S void-repo-multilib{,-nonfree} + # xbps-install -S + +Generic (for all systems): + + - libgcc-32bit libstdc++-32bit libdrm-32bit libglvnd-32bit + +For users of the open source drivers: + + - mesa-dri-32bit + +For users of the proprietary NVIDIA driver: + + - nvidia-libs-32bit (latest nvidia package) + - nvidia390-libs-32bit (latest previous package) + +For mesa users this would result in: + + # xbps-install -S libgcc-32bit libstdc++-32bit libdrm-32bit libglvnd-32bit mesa-dri-32bit + +The dbus service must be enabled, and the mono package will need to be +installed for some games to function. + +If games are running slowly or not at all, or there are issues with network +streaming, verify that your user belongs to the video group. + +If your audio is not working, try installing pulseaudio and +alsa-plugins-pulseaudio. + +If you are encountering runtime errors, the Steam Ubuntu bootstrap tarball might +be using an incompatible libstdc++ library. You can verify this by running the +following command: + + $ LIBGL_DEBUG=verbose steam + +If that is the issue, removing the supplied libstdc++ from +~/.local/share/steam will fix it. Note that this is a temporary solution, as +this file will be restored every time the Steam client is updated. For a more +reliable solution, you can try overriding problematic libraries with +LD_PRELOAD: + + $ LD_PRELOAD='/usr/$LIB/libstdc++.so.6 /usr/$LIB/libgcc_s.so.1 /usr/$LIB/libxcb.so.1' steam + +For convenience, you can put this in a script or an alias. diff --git a/srcpkgs/steam/template b/srcpkgs/steam/template index 972db525e1e..1574edc98dd 100644 --- a/srcpkgs/steam/template +++ b/srcpkgs/steam/template @@ -1,7 +1,7 @@ # Template file for 'steam' pkgname=steam version=1.0.0.70 -revision=1 +revision=2 archs="i686 x86_64" wrksrc=steam-launcher depends="zenity xz curl dbus freetype gdk-pixbuf hicolor-icon-theme desktop-file-utils @@ -30,4 +30,7 @@ do_install() { # Device support for Steam-related hardware (e.g. controllers over Steam Link) vinstall ${FILESDIR}/60-steam-input.rules 644 usr/lib/udev/rules.d vinstall ${FILESDIR}/60-steam-vr.rules 644 usr/lib/udev/rules.d + + # Void-specific documentation. + vdoc "${FILESDIR}/README.voidlinux" } diff --git a/srcpkgs/stunnel/patches/patch-src_ctx_c.patch b/srcpkgs/stunnel/patches/patch-src_ctx_c.patch deleted file mode 100644 index 2fdcdbacca1..00000000000 --- a/srcpkgs/stunnel/patches/patch-src_ctx_c.patch +++ /dev/null @@ -1,41 +0,0 @@ -$OpenBSD: patch-src_ctx_c,v 1.7 2018/02/23 10:26:56 sthen Exp $ -Index: src/ctx.c ---- src/ctx.c.orig -+++ src/ctx.c -@@ -93,7 +93,7 @@ NOEXPORT int ui_retry(); - /* session callbacks */ - NOEXPORT int sess_new_cb(SSL *, SSL_SESSION *); - NOEXPORT SSL_SESSION *sess_get_cb(SSL *, --#if OPENSSL_VERSION_NUMBER>=0x10100000L -+#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) - const - #endif - unsigned char *, int, int *); -@@ -295,7 +295,8 @@ NOEXPORT int matches_wildcard(char *servername, char * - - #ifndef OPENSSL_NO_DH - --#if OPENSSL_VERSION_NUMBER<0x10100000L -+#if OPENSSL_VERSION_NUMBER<0x10100000L || \ -+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL) - NOEXPORT STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx) { - return ctx->cipher_list; - } -@@ -398,7 +399,7 @@ NOEXPORT int ecdh_init(SERVICE_OPTIONS *section) { - /**************************************** initialize OpenSSL CONF */ - - NOEXPORT int conf_init(SERVICE_OPTIONS *section) { --#if OPENSSL_VERSION_NUMBER>=0x10002000L -+#if OPENSSL_VERSION_NUMBER>=0x10002000L && !defined(LIBRESSL_VERSION_NUMBER) - SSL_CONF_CTX *cctx; - NAME_LIST *curr; - char *cmd, *param; -@@ -907,7 +908,7 @@ NOEXPORT int sess_new_cb(SSL *ssl, SSL_SESSION *sess) - } - - NOEXPORT SSL_SESSION *sess_get_cb(SSL *ssl, --#if OPENSSL_VERSION_NUMBER>=0x10100000L -+#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) - const - #endif - unsigned char *key, int key_len, int *do_copy) { diff --git a/srcpkgs/stunnel/patches/patch-src_ssl_c.patch b/srcpkgs/stunnel/patches/patch-src_ssl_c.patch deleted file mode 100644 index a2ca0c16c77..00000000000 --- a/srcpkgs/stunnel/patches/patch-src_ssl_c.patch +++ /dev/null @@ -1,13 +0,0 @@ -$OpenBSD: patch-src_ssl_c,v 1.8 2018/04/14 09:05:14 tb Exp $ -Index: src/ssl.c ---- src/ssl.c.orig -+++ src/ssl.c -@@ -51,7 +51,7 @@ int index_ssl_cli, index_ssl_ctx_opt; - int index_session_authenticated, index_session_connect_address; - - int ssl_init(void) { /* init TLS before parsing configuration file */ --#if OPENSSL_VERSION_NUMBER>=0x10100000L -+#if OPENSSL_VERSION_NUMBER>=0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) - OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS | - OPENSSL_INIT_LOAD_CRYPTO_STRINGS | OPENSSL_INIT_LOAD_CONFIG, NULL); - #else diff --git a/srcpkgs/stunnel/patches/patch-src_verify_c.patch b/srcpkgs/stunnel/patches/patch-src_verify_c.patch deleted file mode 100644 index f4ee8c595dc..00000000000 --- a/srcpkgs/stunnel/patches/patch-src_verify_c.patch +++ /dev/null @@ -1,13 +0,0 @@ -$OpenBSD: patch-src_verify_c,v 1.6 2017/09/12 16:15:24 gsoares Exp $ -Index: src/verify.c ---- src/verify.c.orig -+++ src/verify.c -@@ -353,7 +353,7 @@ NOEXPORT int cert_check_local(X509_STORE_CTX *callback - cert=X509_STORE_CTX_get_current_cert(callback_ctx); - subject=X509_get_subject_name(cert); - --#if OPENSSL_VERSION_NUMBER<0x10100006L -+#if OPENSSL_VERSION_NUMBER<0x10100006L || defined(LIBRESSL_VERSION_NUMBER) - #define X509_STORE_CTX_get1_certs X509_STORE_get1_certs - #endif - /* modern API allows retrieving multiple matching certificates */ diff --git a/srcpkgs/stunnel/template b/srcpkgs/stunnel/template index 54ecff002a0..e5e9636b2e6 100644 --- a/srcpkgs/stunnel/template +++ b/srcpkgs/stunnel/template @@ -1,49 +1,22 @@ # Template file for 'stunnel' pkgname=stunnel -version=5.46 -revision=5 +version=5.59 +revision=1 build_style=gnu-configure configure_args="--enable-ipv6 --with-ssl=${XBPS_CROSS_BASE}/usr" hostmakedepends="perl" makedepends="openssl-devel" -checkdepends="nmap procps-ng" +checkdepends="nmap procps-ng iproute2" short_desc="SSL encryption wrapper" maintainer="Toyam Cox " license="GPL-2.0-or-later" homepage="https://www.stunnel.org/" changelog="https://www.stunnel.org/sdf_ChangeLog.html" -distfiles="https://www.stunnel.org/downloads/archive/5.x/${pkgname}-${version}.tar.gz" -checksum=76aab48c28743d78e4b2f6b2dfe49994b6ca74126046c179444f699fae7a84c7 +distfiles="https://www.stunnel.org/downloads/stunnel-${version}.tar.gz" +checksum=137776df6be8f1701f1cd590b7779932e123479fb91e5192171c16798815ce9f post_install() { rm ${DESTDIR}/usr/share/man/man8/stunnel.??.8 vsconf tools/stunnel.conf-sample rm -r ${DESTDIR}/etc/stunnel ${DESTDIR}/usr/share/doc/stunnel } - -# REMARKS: -# What. A. Pain. What a total pain. -# Using the archive is the only way to get builds to keep working after the -# new version is out. LibreSSL patches for stunnel 5.35 don't yet work. Not -# enough is made conditional. -# -- -# It is important to note that upstream has expressly refused to support -# LibreSSL. -# -- -# Significant thanks to the OpenBSD project for creating patch sets for 5.37 -# One thing OpenBSD does that we don't do here is add a _stunnel user/group and -# modify the configuration samples to chroot and use this by default. -# As of 5.38 the signature expected for the CRYPTO_set_mem_functions seems to -# be out of line with what openssl provides. -# LibreSSL wants 'void (*)(void *)' but argument is of type 'void (*)(void *, const char *, int)' -# This is probably not a security problem. EDIT: Well, it would break. Badly. -# -- -# As of 5.39_2 the code now doesn't use above function call if using LibreSSL, -# and a different call to SSL_CTX_sess_set_get_cb gets a const unsigned char * -# instead of an unsigned char * -# -- -# As of 5.41_1 there are only two sorts of code warnings: -# conversion 'long int' from 'long unsigned int' for what appear to be flags -# and SSL_SESSION* (*)(struct ssl_st *, unsigned char *, int, int*) expected -# got SSL_SESSION* (*)(struct ssl_st *, const unsigned char *, int, int*) -# These are not being considered issues. diff --git a/srcpkgs/tox/update b/srcpkgs/tox/update new file mode 100644 index 00000000000..2c857beffb2 --- /dev/null +++ b/srcpkgs/tox/update @@ -0,0 +1 @@ +ignore="*a*" diff --git a/srcpkgs/tuxguitar/template b/srcpkgs/tuxguitar/template index 19a3420936b..2c9fc380923 100644 --- a/srcpkgs/tuxguitar/template +++ b/srcpkgs/tuxguitar/template @@ -1,7 +1,7 @@ # Template file for 'tuxguitar' pkgname=tuxguitar version=1.5.4 -revision=1 +revision=2 wrksrc="${pkgname}-${version}-src" hostmakedepends="apache-maven openjdk8" makedepends="alsa-lib-devel fluidsynth-devel jack-devel" diff --git a/srcpkgs/unrar/template b/srcpkgs/unrar/template index f3a6ceded88..a4478ba3833 100644 --- a/srcpkgs/unrar/template +++ b/srcpkgs/unrar/template @@ -1,6 +1,6 @@ # Template file for 'unrar' pkgname=unrar -version=6.0.4 +version=6.0.5 revision=1 wrksrc=unrar short_desc="Unarchiver for .rar files (non-free version)" @@ -8,7 +8,7 @@ maintainer="Orphaned " license="custom:freeware" homepage="https://www.rarlab.com/rar_add.htm" distfiles="https://www.rarlab.com/rar/unrarsrc-${version}.tar.gz" -checksum=130197e495d6e2c2ee790a5beee123edeed642508be13f0159672e5397aca6c1 +checksum=7e34064c9e97464462c81aed80c25619149f71d4900995021780787f51dd63f0 repository=nonfree do_build() { diff --git a/srcpkgs/visidata/template b/srcpkgs/visidata/template index 21be128580d..73798ca4586 100644 --- a/srcpkgs/visidata/template +++ b/srcpkgs/visidata/template @@ -1,6 +1,6 @@ # Template file for 'visidata' pkgname=visidata -version=2.3 +version=2.4 revision=1 build_style=python3-module hostmakedepends="python3-setuptools" @@ -12,4 +12,4 @@ license="GPL-3.0-only" homepage="https://visidata.org/" changelog="https://raw.githubusercontent.com/saulpw/visidata/stable/CHANGELOG.md" distfiles="https://github.com/saulpw/visidata/archive/v${version}.tar.gz" -checksum=11a859ef45a7932b10da34bb0978975d052933e747303c055a2d40ccc0472b30 +checksum=9340f84b0c3e1820e2658d7372522b177ca6620fd8a65015391e738338d70838 diff --git a/srcpkgs/volta/template b/srcpkgs/volta/template index d6b4f67774a..7f82c979afa 100644 --- a/srcpkgs/volta/template +++ b/srcpkgs/volta/template @@ -1,6 +1,6 @@ # Template file for 'volta' pkgname=volta -version=1.0.2 +version=1.0.3 revision=2 archs="x86_64" # Due to volta pulling pre-built binaries later. Evil. build_style="cargo" @@ -11,7 +11,7 @@ maintainer="Alex Lohr " license="BSD-2-Clause" homepage="https://volta.sh/" distfiles="https://github.com/volta-cli/volta/archive/v${version}.tar.gz" -checksum=83659888099408dbc44d47a6bba6c3d450ebd11580f74fd3e64ab6c1adbb5724 +checksum=19edec309676d5d345e0686cc3ea2cd0a5815f01a12e88e5b7c63a7ce961c6d1 post_install() { vlicense LICENSE diff --git a/srcpkgs/vscode/template b/srcpkgs/vscode/template index b3d037f6531..16c925c3d90 100644 --- a/srcpkgs/vscode/template +++ b/srcpkgs/vscode/template @@ -1,6 +1,6 @@ # Template file for 'vscode' pkgname=vscode -version=1.55.1 +version=1.55.2 revision=1 _electronver=9.4.1 hostmakedepends="pkg-config python nodejs yarn tar git" @@ -11,7 +11,7 @@ maintainer="shizonic " license="MIT" homepage="https://code.visualstudio.com/" distfiles="https://github.com/Microsoft/vscode/archive/${version}.tar.gz" -checksum=6fe56f9328ded06b38b29de4f545fc82007006cac18bdea8961637e25025d4a2 +checksum=43cb929a0fd3d569ff8a734df7a97a02c3d1107eda4c195d97835e6d08432cbc patch_args="-Np1" if [ "$XBPS_TARGET_WORDSIZE" = "32" ]; then diff --git a/srcpkgs/watchexec/template b/srcpkgs/watchexec/template index 8b62e5ee01d..a9be5777c60 100644 --- a/srcpkgs/watchexec/template +++ b/srcpkgs/watchexec/template @@ -1,14 +1,14 @@ # Template file for 'watchexec' pkgname=watchexec -version=1.14.1 +version=1.15.0 revision=1 build_style=cargo short_desc="Executes commands in response to file modifications" -maintainer="cptpcrd " +maintainer="Orphaned " license="Apache-2.0" homepage="https://github.com/watchexec/watchexec" distfiles="https://github.com/watchexec/watchexec/archive/${version}.tar.gz" -checksum=23ca90f1f070b0d30e821667c8b9deaf174d020373ea032e9e22f1a78adcfa1c +checksum=536366e294047480ebfd440edc473690c226f23d07ea166023d1a7e8953c4f34 post_install() { vdoc README.md diff --git a/srcpkgs/xfce4-settings/template b/srcpkgs/xfce4-settings/template index 90b07210e85..eff27677371 100644 --- a/srcpkgs/xfce4-settings/template +++ b/srcpkgs/xfce4-settings/template @@ -1,7 +1,7 @@ # Template file for 'xfce4-settings' pkgname=xfce4-settings -version=4.16.0 -revision=3 +version=4.16.1 +revision=1 build_style=gnu-configure configure_args="--with-locales-dir=/usr/share/locale --enable-sound-settings --enable-pluggable-dialogs --enable-xrandr" @@ -16,4 +16,4 @@ license="GPL-2.0-only" homepage="https://xfce.org/" changelog="https://raw.githubusercontent.com/xfce-mirror/xfce4-settings/xfce-4.14/NEWS" distfiles="https://archive.xfce.org/src/xfce/${pkgname}/${version%.*}/${pkgname}-${version}.tar.bz2" -checksum=67a1404fc754c675c6431e22a8fe0e5d79644fdfadbfe25a4523d68e1442ddc2 +checksum=bb28e1be7aa34d0edb1cfbaacc509a4267db56828b36cd6be312a202973635c6 diff --git a/srcpkgs/xorg-server/template b/srcpkgs/xorg-server/template index 78073871183..7832f45ff7e 100644 --- a/srcpkgs/xorg-server/template +++ b/srcpkgs/xorg-server/template @@ -1,7 +1,7 @@ # Template file for 'xorg-server' pkgname=xorg-server -version=1.20.10 -revision=4 +version=1.20.11 +revision=1 build_style=meson configure_args="-Dipv6=true -Dxorg=true -Dxnest=true -Dxephyr=true -Dxvfb=true -Dhal=false -Dudev=true -Dxkb_dir=/usr/share/X11/xkb @@ -25,7 +25,7 @@ maintainer="Leah Neukirchen " license="MIT, BSD-3-Clause" homepage="https://xorg.freedesktop.org" distfiles="${XORG_SITE}/xserver/${pkgname}-${version}.tar.bz2" -checksum=977420c082450dc808de301ef56af4856d653eea71519a973c3490a780cb7c99 +checksum=914c796e3ffabe1af48071d40ccc85e92117c97a9082ed1df29e4d64e3c34c49 lib32disabled=yes provides="xserver-abi-extension-10_1 xserver-abi-input-24_1 xserver-abi-video-24_1 xf86-video-modesetting-1_1" diff --git a/srcpkgs/zoom/template b/srcpkgs/zoom/template index 616082b99a6..abb73eabe22 100644 --- a/srcpkgs/zoom/template +++ b/srcpkgs/zoom/template @@ -1,6 +1,6 @@ # Template file for 'zoom' pkgname=zoom -version=5.6.13558.0321 +version=5.6.13632.0328 revision=1 archs="x86_64" wrksrc=zoom @@ -13,7 +13,7 @@ maintainer="Daniel Santana " license="custom:Proprietary" homepage="https://zoom.us/" distfiles="https://cdn.zoom.us/prod/${version}/zoom_x86_64.rpm" -checksum=543a73a7d5a1c4bdf9af9d8af83a03cd3cc2d832315356d51e8861bec1d46f02 +checksum=afad3a1c359d36aa8ac78e44fea46abbd2f4e05dd8f54757b001cc6f3457df2b repository=nonfree noshlibprovides=yes noverifyrdeps=yes diff --git a/xbps-src b/xbps-src index 9d88873ab2c..379bdd36bfd 100755 --- a/xbps-src +++ b/xbps-src @@ -78,6 +78,9 @@ remove remove-autodeps Removes all package dependencies that were installed automatically. +remove-obsoletes + Remove all obsolete packages from default repositories as detected by xbps-rindex. + purge-distfiles Removes all obsolete distfiles in /sources. @@ -799,6 +802,9 @@ case "$XBPS_TARGET" in read_pkg remove_pkg $XBPS_CROSS_BUILD ;; + remove-obsoletes) + remove_obsoletes + ;; list) $XBPS_QUERY_CMD -l ;;