diff --git a/bootstrap.d/app-arch.yml b/bootstrap.d/app-arch.yml index 830f863f5..5132e759c 100644 --- a/bootstrap.d/app-arch.yml +++ b/bootstrap.d/app-arch.yml @@ -227,6 +227,46 @@ packages: environ: DESTDIR: '@THIS_COLLECT_DIR@' + - name: snappy + architecture: '@OPTION:arch@' + metadata: + summary: A high-speed compression/decompression library by Google + description: This package contains a compressor and decompressor for the snappy compression format. + spdx: 'BSD-3-Clause' + website: 'https://github.com/google/snappy' + maintainer: "Dennis Bonke " + categories: ['app-arch'] + source: + subdir: 'ports' + git: 'https://github.com/google/snappy.git' + tag: '1.1.9' + version: '1.1.9' + tools_required: + - system-gcc + - host-cmake + pkgs_required: + - mlibc + configure: + - args: + - 'cmake' + - '-GNinja' + - '-DCMAKE_TOOLCHAIN_FILE=@SOURCE_ROOT@/scripts/CMakeToolchain-@OPTION:arch-triple@.txt' + - '-DCMAKE_INSTALL_PREFIX=/usr' + - '-DCMAKE_BUILD_TYPE=Release' + - '-DSNAPPY_BUILD_TESTS=OFF' + - '-DSNAPPY_BUILD_BENCHMARKS=OFF' + - '-DBUILD_SHARED_LIBS=ON' + # Options below are related to benchmarking, that we disable. + - '-DHAVE_LIBZ=NO' + - '-DHAVE_LIBLZO2=NO' + - '-DHAVE_LIBLZ4=NO' + - '@THIS_SOURCE_DIR@' + build: + - args: ['ninja'] + - args: ['ninja', 'install'] + environ: + DESTDIR: '@THIS_COLLECT_DIR@' + - name: tar labels: [aarch64] architecture: '@OPTION:arch@' diff --git a/bootstrap.d/dev-libs.yml b/bootstrap.d/dev-libs.yml index 790ab5edd..d7126f309 100644 --- a/bootstrap.d/dev-libs.yml +++ b/bootstrap.d/dev-libs.yml @@ -1436,6 +1436,38 @@ packages: environ: DESTDIR: '@THIS_COLLECT_DIR@' + - name: re2 + architecture: '@OPTION:arch@' + metadata: + summary: An efficient, principled regular expression library + description: RE2 is a fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python. + spdx: 'BSD-3-Clause' + website: 'https://github.com/google/re2' + maintainer: "Dennis Bonke " + categories: ['dev-libs'] + source: + subdir: ports + git: 'https://github.com/google/re2.git' + tag: '2022-04-01' + version: '2022.04.01' + tools_required: + - host-cmake + - system-gcc + pkgs_required: + - mlibc + configure: + - args: + - 'cmake' + - '-DCMAKE_TOOLCHAIN_FILE=@SOURCE_ROOT@/scripts/CMakeToolchain-@OPTION:arch-triple@.txt' + - '-DCMAKE_INSTALL_PREFIX=/usr' + - '-DBUILD_SHARED_LIBS=ON' + - '@THIS_SOURCE_DIR@' + build: + - args: ['make', '-j@PARALLELISM@'] + - args: ['make', 'install'] + environ: + DESTDIR: '@THIS_COLLECT_DIR@' + - name: wayland-protocols labels: [aarch64] architecture: '@OPTION:arch@' diff --git a/bootstrap.d/media-libs.yml b/bootstrap.d/media-libs.yml index 2f5f9857e..b141527df 100644 --- a/bootstrap.d/media-libs.yml +++ b/bootstrap.d/media-libs.yml @@ -368,6 +368,55 @@ packages: environ: DESTDIR: '@THIS_COLLECT_DIR@' + - name: lcms + architecture: '@OPTION:arch@' + metadata: + summary: A lightweight, speed optimized color management engine + description: The Little Color Management System is a small-footprint color management engine, with special focus on accuracy and performance. It uses the International Color Consortium standard (ICC), which is the modern standard for color management. + spdx: 'MIT' + website: 'http://www.littlecms.com/' + maintainer: "Dennis Bonke " + categories: ['media-libs'] + source: + subdir: 'ports' + git: 'https://github.com/mm2/Little-CMS.git' + tag: 'lcms2.13.1' + version: '2.13.1' + tools_required: + - host-autoconf-v2.69 + - host-automake-v1.15 + - host-libtool + - host-pkg-config + regenerate: + - args: ['./autogen.sh'] + environ: + NOCONFIGURE: '1' + - args: ['cp', + '@BUILD_ROOT@/tools/host-automake-v1.15/share/automake-1.15/config.sub', + '@THIS_SOURCE_DIR@/'] + tools_required: + - system-gcc + pkgs_required: + - mlibc + - zlib + - libjpeg-turbo + - libtiff + configure: + - args: + - '@THIS_SOURCE_DIR@/configure' + - '--host=@OPTION:arch-triple@' + - '--prefix=/usr' + - '--disable-static' + - '--with-zlib' + - '--with-jpeg' + - '--with-tiff' + - '--with-threads' + build: + - args: ['make', '-j@PARALLELISM@'] + - args: ['make', 'install'] + environ: + DESTDIR: '@THIS_COLLECT_DIR@' + - name: libepoxy labels: [aarch64] architecture: '@OPTION:arch@' @@ -697,6 +746,48 @@ packages: environ: DESTDIR: '@THIS_COLLECT_DIR@' + - name: libvpx + architecture: '@OPTION:arch@' + metadata: + summary: Open codec for interactive speech and music transmission over the Internet + description: This package provides the reference implementations of the VP8 Codec, used in most current html5 video, and of the next-generation VP9 Codec. + spdx: 'BSD-3-Clause' + website: 'https://www.webmproject.org/' + maintainer: "Dennis Bonke " + categories: ['media-libs'] + source: + subdir: 'ports' + git: 'https://chromium.googlesource.com/webm/libvpx.git' + tag: 'v1.11.0' + version: '1.11.0' + tools_required: + - system-gcc + pkgs_required: + - mlibc + configure: + # Fix ownership and permission of installed files. + - args: ['sed', '-i', 's/cp -p/cp/', '@THIS_SOURCE_DIR@/build/make/Makefile'] + - args: + - '@THIS_SOURCE_DIR@/configure' + - '--prefix=/usr' + - '--disable-static' + - '--enable-shared' + # Generic GNU target to disable optimizations + - '--force-target=generic-gnu' + - '--enable-pic' + - '--enable-vp8' + - '--enable-vp9' + - '--enable-multithread' + - '--enable-vp9-highbitdepth' + - '--disable-examples' + - '--disable-install-docs' + - '--disable-docs' + build: + - args: ['make', 'HAVE_GNU_STRIP=no', 'CC=x86_64-managarm-gcc', 'LD=x86_64-managarm-gcc', 'CXX=x86_64-managarm-g++', 'AR=x86_64-managarm-ar', 'NM=x86_64-managarm-nm', '-j@PARALLELISM@'] + - args: ['make', 'install'] + environ: + DESTDIR: '@THIS_COLLECT_DIR@' + - name: libwebp architecture: '@OPTION:arch@' metadata: @@ -744,6 +835,57 @@ packages: environ: DESTDIR: '@THIS_COLLECT_DIR@' + - name: libx264 + architecture: '@OPTION:arch@' + metadata: + summary: A free library for encoding X264/AVC streams + description: This package contains an encoder for X264/AVC streams. + spdx: 'GPL-2.0-only' + website: 'https://www.videolan.org/developers/x264.html' + maintainer: "Dennis Bonke " + categories: ['media-libs'] + source: + subdir: 'ports' + git: 'https://code.videolan.org/videolan/x264.git' + # Check out current master, x264 doesn't do git tags + branch: 'master' + commit: 'bfc87b7a330f75f5c9a21e56081e4b20344f139e' + version: '20220305' + tools_required: + - host-autoconf-v2.69 + - host-automake-v1.15 + - host-libtool + - host-pkg-config + regenerate: + - args: ['cp', + '@BUILD_ROOT@/tools/host-automake-v1.15/share/automake-1.15/config.sub', + '@THIS_SOURCE_DIR@/'] + tools_required: + - system-gcc + pkgs_required: + - mlibc + - nasm + configure: + - args: + - '@THIS_SOURCE_DIR@/configure' + - '--host=x86_64-managarm' + - '--prefix=/usr' + - '--enable-shared' + - '--disable-cli' + - '--disable-avs' + - '--disable-lavf' + - '--disable-swscale' + - '--disable-ffms' + - '--disable-gpac' + - '--disable-opencl' + - '--enable-pic' + - '--cross-prefix=@OPTION:arch-triple@-' + build: + - args: ['make', '-j@PARALLELISM@'] + - args: ['make', 'install'] + environ: + DESTDIR: '@THIS_COLLECT_DIR@' + - name: mesa labels: [aarch64] architecture: '@OPTION:arch@' @@ -814,6 +956,50 @@ packages: DESTDIR: '@THIS_COLLECT_DIR@' quiet: true + - name: opus + architecture: '@OPTION:arch@' + metadata: + summary: Open codec for interactive speech and music transmission over the Internet + description: Opus is a lossy audio compression format developed by the Internet Engineering Task Force (IETF) that is particularly suitable for interactive speech and audio transmission over the Internet. This package provides the Opus development library and headers. + spdx: 'BSD-3-Clause' + website: 'https://opus-codec.org/' + maintainer: "Dennis Bonke " + categories: ['media-libs'] + source: + subdir: 'ports' + git: 'https://gitlab.xiph.org/xiph/opus.git' + tag: 'v1.3.1' + version: '1.3.1' + tools_required: + - host-autoconf-v2.69 + - host-automake-v1.15 + - host-libtool + - host-pkg-config + regenerate: + - args: ['./autogen.sh'] + tools_required: + - system-gcc + - host-autoconf-v2.69 + - host-automake-v1.15 + - host-libtool + - host-pkg-config + pkgs_required: + - mlibc + configure: + - args: + - '@THIS_SOURCE_DIR@/configure' + - '--host=@OPTION:arch-triple@' + - '--prefix=/usr' + - '--docdir=/usr/share/doc/opus-1.3.1' + - '--disable-static' + - '--disable-intrinsics' + - '--disable-doc' + build: + - args: ['make', '-j@PARALLELISM@'] + - args: ['make', 'install'] + environ: + DESTDIR: '@THIS_COLLECT_DIR@' + - name: sdl2 architecture: '@OPTION:arch@' metadata: diff --git a/bootstrap.d/media-video.yml b/bootstrap.d/media-video.yml new file mode 100644 index 000000000..1aa8aa8bc --- /dev/null +++ b/bootstrap.d/media-video.yml @@ -0,0 +1,107 @@ +packages: + - name: ffmpeg + architecture: '@OPTION:arch@' + metadata: + summary: Complete solution to record/convert/stream audio and video. Includes libavcodec + description: FFmpeg is a solution to record, convert and stream audio and video. It is a very fast video and audio converter and it can also acquire from a live audio/video source.FFmpeg is a solution to record, convert and stream audio and video. It is a very fast video and audio converter and it can also acquire from a live audio/video source. + spdx: 'GPL-2.0-only' + website: 'https://ffmpeg.org/' + maintainer: "Dennis Bonke " + categories: ['media-video'] + source: + subdir: ports + git: 'https://git.ffmpeg.org/ffmpeg.git' + tag: 'n4.4.1' + version: '4.4.1' + pkgs_required: + - mlibc + - libiconv + - libxcb + - bzip2 + - xz-utils + - libxml + - openssl + - sdl2 + - mesa + - zlib + - libx11 + - fontconfig + - freetype + - fribidi + - libmodplug + - libvorbis + - libtheora + - libwebp + - libdrm + - libx264 + tools_required: + - system-gcc + - host-pkg-config + - virtual: pkgconfig-for-target + triple: x86_64-managarm + configure: + # Object files are placed where configure is launched + - args: ['cp', '-r', '@THIS_SOURCE_DIR@/.', '@THIS_BUILD_DIR@'] + - args: + - './configure' + - '--prefix=/usr' + - '--enable-gpl' # Enable more plugins + - '--enable-version3' # Enable more plugins + - '--enable-nonfree' # Enable more plugins (may mean unredistributable) + - '--disable-static' + - '--enable-shared' + - '--disable-stripping' + - '--docdir=/usr/share/doc/ffmpeg-4.4.1' + - '--enable-avresample' + - '--enable-ffplay' + - '--disable-alsa' + - '--enable-openssl' + - '--enable-sdl2' + - '--enable-libxml2' + - '--enable-opengl' + - '--disable-securetransport' + - '--disable-frei0r' + - '--disable-libass' + - '--disable-sndio' + - '--disable-securetransport' + - '--disable-amf' + - '--disable-audiotoolbox' + - '--disable-cuda-llvm' + - '--disable-cuvid' + - '--disable-d3d11va' + - '--disable-dxva2' + - '--disable-ffnvcodec' + - '--disable-nvdec' + - '--disable-nvenc' + - '--disable-v4l2-m2m' + - '--disable-vaapi' + - '--disable-vdpau' + - '--disable-videotoolbox' + # Start cross compilation config + - '--enable-cross-compile' + - '--arch=@OPTION:arch@' + - '--cross-prefix=@OPTION:arch-triple@' + - '--host-cc=gcc' + - '--target-os=linux' # Fun times ahead + - '--cc=@OPTION:arch-triple@-gcc' + - '--cxx=@OPTION:arch-triple@-g++' + - '--ar=@OPTION:arch-triple@-ar' + - '--nm=@OPTION:arch-triple@-nm' + - '--strip=@OPTION:arch-triple@-strip' + - '--ranlib=@OPTION:arch-triple@-ranlib' + - '--pkg-config=@OPTION:arch-triple@-pkg-config' + # End cross compilation config + - '--enable-libfontconfig' + - '--enable-libfreetype' + - '--enable-libfribidi' + - '--enable-libmodplug' + - '--enable-libvorbis' + - '--enable-libtheora' + - '--enable-libwebp' + - '--enable-libdrm' + - '--enable-libx264' + build: + - args: ['make', '-j@PARALLELISM@'] + - args: ['make', 'install'] + environ: + DESTDIR: '@THIS_COLLECT_DIR@' diff --git a/bootstrap.yml b/bootstrap.yml index 752a7855a..090f7c65c 100644 --- a/bootstrap.yml +++ b/bootstrap.yml @@ -18,6 +18,7 @@ imports: - file: bootstrap.d/media-fonts.yml - file: bootstrap.d/media-gfx.yml - file: bootstrap.d/media-libs.yml + - file: bootstrap.d/media-video.yml - file: bootstrap.d/meta-pkgs.yml - file: bootstrap.d/net-dns.yml - file: bootstrap.d/net-libs.yml diff --git a/patches/ffmpeg/0001-Add-initial-Managarm-support.patch b/patches/ffmpeg/0001-Add-initial-Managarm-support.patch new file mode 100644 index 000000000..274edcfe2 --- /dev/null +++ b/patches/ffmpeg/0001-Add-initial-Managarm-support.patch @@ -0,0 +1,26 @@ +From c606b2718f2c419f580f884a97e59b62feda5e39 Mon Sep 17 00:00:00 2001 +From: Dennis Bonke +Date: Wed, 27 Apr 2022 23:14:43 +0200 +Subject: [PATCH] Add initial Managarm support + +Signed-off-by: Dennis Bonke +--- + libavutil/cpu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libavutil/cpu.c b/libavutil/cpu.c +index 6bd0f07..4d692e4 100644 +--- a/libavutil/cpu.c ++++ b/libavutil/cpu.c +@@ -280,7 +280,7 @@ int av_cpu_count(void) + #if HAVE_WINRT + SYSTEM_INFO sysinfo; + #endif +-#if HAVE_SCHED_GETAFFINITY && defined(CPU_COUNT) ++#if HAVE_SCHED_GETAFFINITY && defined(CPU_COUNT) && !defined(__managarm__) + cpu_set_t cpuset; + + CPU_ZERO(&cpuset); +-- +2.36.0 + diff --git a/patches/libx264/0001-Add-Managarm-support.patch b/patches/libx264/0001-Add-Managarm-support.patch new file mode 100644 index 000000000..ad2a2dcd7 --- /dev/null +++ b/patches/libx264/0001-Add-Managarm-support.patch @@ -0,0 +1,29 @@ +From cf4be60057bd66032fa97815197ca7e04d503879 Mon Sep 17 00:00:00 2001 +From: Dennis Bonke +Date: Thu, 28 Apr 2022 08:55:10 +0200 +Subject: [PATCH] Add Managarm support + +Signed-off-by: Dennis Bonke +--- + configure | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/configure b/configure +index e242e73c..48abab52 100755 +--- a/configure ++++ b/configure +@@ -682,6 +682,11 @@ case $host_os in + define HAVE_MALLOC_H + libm="-lm" + ;; ++ managarm*) ++ SYS="MANAGARM" ++ define HAVE_MALLOC_H ++ libm="-lm" ++ ;; + gnu*) + SYS="HURD" + define HAVE_MALLOC_H +-- +2.36.0 + diff --git a/patches/snappy/0001-snappy-1.1.9_gcc_inline.patch b/patches/snappy/0001-snappy-1.1.9_gcc_inline.patch new file mode 100644 index 000000000..04d35f56e --- /dev/null +++ b/patches/snappy/0001-snappy-1.1.9_gcc_inline.patch @@ -0,0 +1,67 @@ +From 0c716d435abe65250100c2caea0e5126ac4e14bd Mon Sep 17 00:00:00 2001 +From: "Georgi D. Sotirov" +Date: Wed, 5 May 2021 14:16:46 +0300 +Subject: [PATCH] Add inline with SNAPPY_ATTRIBUTE_ALWAYS_INLINE + +Add inline with SNAPPY_ATTRIBUTE_ALWAYS_INLINE on AdvanceToNextTag to +fix the following compilation errors and a warning with GCC: + +[ 2%] Building CXX object CMakeFiles/snappy.dir/snappy.cc.o +/usr/bin/c++ -DHAVE_CONFIG_H -Dsnappy_EXPORTS +-I/tmp/snappy-1.1.9/build -I/tmp/snappy-1.1.9 -O3 +-march=i586 -mtune=i686 -Wall -Wextra -fno-exceptions -fno-rtti -O3 +-DNDEBUG -fPIC -std=c++11 -o CMakeFiles/snappy.dir/snappy.cc.o -c +/tmp/snappy-1.1.9/snappy.cc +/tmp/snappy-1.1.9/snappy.cc:1017:8: warning: always_inline +function might not be inlinable [-Wattributes] + size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { + ^ +/tmp/snappy-1.1.9/snappy.cc: In function 'std::pair snappy::DecompressBranchless(const uint8_t*, const +uint8_t*, ptrdiff_t, T, ptrdiff_t) [with T = char*; uint8_t = unsigned +char; ptrdiff_t = int]': +/tmp/snappy-1.1.9/snappy.cc:1017:8: error: inlining failed in +call to always_inline 'size_t snappy::AdvanceToNextTag(const uint8_t**, +size_t*)': function body can be overwritten at link time +/tmp/snappy-1.1.9/snappy.cc:1097:53: error: called from here + size_t tag_type = AdvanceToNextTag(&ip, &tag); + ^ +/tmp/snappy-1.1.9/snappy.cc:1017:8: error: inlining failed in +call to always_inline 'size_t snappy::AdvanceToNextTag(const uint8_t**, +size_t*)': function body can be overwritten at link time + size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { + ^ +/tmp/snappy-1.1.9/snappy.cc:1097:53: error: called from here + size_t tag_type = AdvanceToNextTag(&ip, &tag); + ^ +/tmp/snappy-1.1.9/snappy.cc:1017:8: error: inlining failed in +call to always_inline 'size_t snappy::AdvanceToNextTag(const uint8_t**, +size_t*)': function body can be overwritten at link time + size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { + ^ +/tmp/snappy-1.1.9/snappy.cc:1097:53: error: called from here + size_t tag_type = AdvanceToNextTag(&ip, &tag); + ^ +CMakeFiles/snappy.dir/build.make:137: recipe for target +'CMakeFiles/snappy.dir/snappy.cc.o' failed + +Just like with other functions using SNAPPY_ATTRIBUTE_ALWAYS_INLINE +macro (i.e. __attribute__((always_inline)) ) it is necessary to use C++ +inline specifier. +--- + snappy.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/snappy.cc b/snappy.cc +index 79dc0e8..51157be 100644 +--- a/snappy.cc ++++ b/snappy.cc +@@ -1014,7 +1014,7 @@ void MemMove(ptrdiff_t dst, const void* src, size_t size) { + } + + SNAPPY_ATTRIBUTE_ALWAYS_INLINE +-size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { ++inline size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { + const uint8_t*& ip = *ip_p; + // This section is crucial for the throughput of the decompression loop. + // The latency of an iteration is fundamentally constrained by the diff --git a/patches/snappy/0002-snappy-1.1.9_remove-no-rtti.patch b/patches/snappy/0002-snappy-1.1.9_remove-no-rtti.patch new file mode 100644 index 000000000..16528b594 --- /dev/null +++ b/patches/snappy/0002-snappy-1.1.9_remove-no-rtti.patch @@ -0,0 +1,35 @@ +From 516fdcca6606502e2d562d20c01b225c8d066739 Mon Sep 17 00:00:00 2001 +From: holmes1412 +Date: Fri, 28 May 2021 21:46:53 +0800 +Subject: [PATCH] remove Disable-RTTI flags for the convenient of derivation + +--- + CMakeLists.txt | 8 -------- + 1 file changed, 8 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 672561e..31afaa0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,10 +51,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c-") + add_definitions(-D_HAS_EXCEPTIONS=0) +- +- # Disable RTTI. +- string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") + else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Use -Wall for clang and gcc. + if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") +@@ -76,10 +72,6 @@ else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Disable C++ exceptions. + string(REGEX REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") +- +- # Disable RTTI. +- string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") + endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + + # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make