Add various packages and patches for build system improvements
- Introduced valgrind with a patch to respect flags and updated its configuration. - Added Vulkan ICD loader with CMake build configuration. - Implemented Waf build system with a custom build script and configuration. - Included Wayland protocols with Meson build system. - Added xcb-util-keysyms with autotools configuration. - Introduced Yasm with multiple patches for compatibility and improvements. - Added Yelp tools and XSL with Meson build configurations and necessary patches for POSIX compliance.
This commit is contained in:
@@ -30,7 +30,7 @@ description = "source-based package manager designed for Linux, focuses on repro
|
||||
homepage = "https://gitlab.com/sfg-os/depot"
|
||||
license = "MIT"
|
||||
name = "depot"
|
||||
version = "0.29.0"
|
||||
version = "0.31.0"
|
||||
revision = 1
|
||||
|
||||
[[source]]
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
depot_build() {
|
||||
export CFLAGS="${CFLAGS:+$CFLAGS } -D_GNU_SOURCE -Wno-error -Wno-null-dereference -ffat-lto-objects -g"
|
||||
|
||||
mkdir -p build
|
||||
cd build
|
||||
|
||||
../configure \
|
||||
--prefix=/usr \
|
||||
--sysconfdir=/etc \
|
||||
--mandir=/usr/share/man \
|
||||
--localstatedir=/var \
|
||||
--disable-werror \
|
||||
--program-prefix=eu- \
|
||||
--enable-deterministic-archives \
|
||||
--disable-nls \
|
||||
--disable-libdebuginfod \
|
||||
--disable-debuginfod \
|
||||
--with-zstd
|
||||
|
||||
make
|
||||
}
|
||||
|
||||
depot_install_elfutils() {
|
||||
make DESTDIR="$DESTDIR" install
|
||||
haul libelf usr/lib/libelf*
|
||||
haul libelf usr/lib/libdw*
|
||||
haul libelf usr/lib/pkgconfig/libelf.pc
|
||||
haul libelf usr/lib/pkgconfig/libdw.pc
|
||||
haul libelf usr/include/libelf.h
|
||||
haul libelf usr/include/gelf.h
|
||||
haul libelf usr/include/nlist.h
|
||||
haul libelf usr/include/dwarf.h
|
||||
haul libelf usr/include/elfutils
|
||||
}
|
||||
|
||||
depot_install_libelf() {
|
||||
true
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
[package]
|
||||
name = "elfutils"
|
||||
version = "0.194"
|
||||
revision = 1
|
||||
description = "Handle ELF object files and DWARF debugging information"
|
||||
homepage = "https://sourceware.org/elfutils/"
|
||||
license = "GPL-3.0-or-later"
|
||||
|
||||
[[packages]]
|
||||
name = "libelf"
|
||||
version = "0.194"
|
||||
revision = 1
|
||||
description = "Handle ELF object files and DWARF debugging information (libraries)"
|
||||
homepage = "https://sourceware.org/elfutils/"
|
||||
license = [
|
||||
"GPL-2.0-or-later",
|
||||
"LGPL-3.0-or-later",
|
||||
]
|
||||
|
||||
[build]
|
||||
type = "custom"
|
||||
|
||||
[build.flags]
|
||||
skip_tests = false
|
||||
no_delete_static = true
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"bzip2",
|
||||
"curl",
|
||||
"json-c",
|
||||
"libarchive",
|
||||
"libmicrohttpd",
|
||||
"sqlite",
|
||||
"xz",
|
||||
"zlib-ng",
|
||||
"zstd",
|
||||
]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"sh",
|
||||
"libarchive",
|
||||
"libcxx",
|
||||
"libunwind",
|
||||
"libelf"
|
||||
]
|
||||
|
||||
[package_dependencies.elfutils]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"libarchive",
|
||||
"libelf",
|
||||
"sh",
|
||||
]
|
||||
|
||||
[package_dependencies.libelf]
|
||||
runtime = [
|
||||
"bzip2",
|
||||
"curl",
|
||||
"glibc",
|
||||
"json-c",
|
||||
"xz",
|
||||
"zlib-ng",
|
||||
"zstd",
|
||||
]
|
||||
|
||||
[[source]]
|
||||
url = "https://sourceware.org/elfutils/ftp/0.194/elfutils-0.194.tar.bz2"
|
||||
sha256 = "09e2ff033d39baa8b388a2d7fbc5390bfde99ae3b7c67c7daaf7433fbcf0f01e"
|
||||
extract_dir = "elfutils-$version"
|
||||
|
||||
post_extract = [
|
||||
"curl -L 'https://sourceware.org/git/?p=elfutils.git;a=patch;h=4a5cf8be906d5991e7527e69e3f2ceaa74811301' -o fix-c23-const.patch",
|
||||
"patch -Np1 -i fix-c23-const.patch",
|
||||
"sed -i 's/run-backtrace-native.sh//g' tests/Makefile.am",
|
||||
"autoreconf -fiv",
|
||||
]
|
||||
@@ -1,34 +0,0 @@
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[build.flags]
|
||||
configure = [
|
||||
"--disable-debuginfod",
|
||||
"--enable-libdebuginfod=dummy",
|
||||
]
|
||||
make_dirs = [ "lib", "libelf" ]
|
||||
make_install_dirs = [ "libelf" ]
|
||||
post_install = [ "mkdir -p $DESTDIR/usr/lib/pkgconfig", "install -vm644 config/libelf.pc $DESTDIR/usr/lib/pkgconfig", "rm $DESTDIR/usr/lib/libelf.a" ]
|
||||
# the tests fail with glibc 2.43
|
||||
skip_tests = true
|
||||
|
||||
[dependencies]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"xz",
|
||||
"bzip2",
|
||||
"zlib-ng",
|
||||
"zstd"
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Library to read, modify and create ELF files "
|
||||
homepage = "https://sourceware.org/elfutils/"
|
||||
license = "GPL-3.0-or-later AND ( GPL-2.0-or-later OR LGPL-3.0-or-later )"
|
||||
name = "libelf"
|
||||
version = "0.194"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "09e2ff033d39baa8b388a2d7fbc5390bfde99ae3b7c67c7daaf7433fbcf0f01e"
|
||||
url = "https://sourceware.org/elfutils/ftp/$version/elfutils-$version.tar.bz2"
|
||||
@@ -7,18 +7,27 @@ configure = [
|
||||
"-Dhistory=enabled",
|
||||
"-Dicu=enabled",
|
||||
"-Dc_args=-D_GNU_SOURCE",
|
||||
"-Dpython=enabled"
|
||||
]
|
||||
post_install = [
|
||||
'test -f $DESTDIR/usr/bin/xml2-config && sed "s/--static/--shared/" -i $DESTDIR/usr/bin/xml2-config || true',
|
||||
'test -f libxml.m4 && install -Dm644 libxml.m4 -t $DESTDIR/usr/share/aclocal || true',
|
||||
]
|
||||
build_32 = true
|
||||
configure-lib32 = [
|
||||
"-Dhistory=enabled",
|
||||
"-Dicu=enabled",
|
||||
"-Dc_args=-D_GNU_SOURCE",
|
||||
"-Dpython=disabled"
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"python",
|
||||
"meson",
|
||||
"ninja",
|
||||
"docbook-xsl",
|
||||
"doxygen"
|
||||
]
|
||||
runtime = [
|
||||
"sh",
|
||||
@@ -34,6 +43,7 @@ build = [
|
||||
"python",
|
||||
"meson",
|
||||
"ninja",
|
||||
"docbook-xsl",
|
||||
]
|
||||
runtime = [
|
||||
"lib32-glibc",
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
[build]
|
||||
type = "custom"
|
||||
|
||||
[alternatives]
|
||||
provides = [ "cargo" ]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"cmake",
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
type = "meson"
|
||||
|
||||
[alternatives]
|
||||
provides = [ "findutils", "diffutils", "gzip", "grep", "which", "patch" ]
|
||||
provides = [ "findutils", "diffutils", "gzip", "grep", "which", "patch", "pciutils" ]
|
||||
replaces = [ "findutils", "diffutils", "gzip", "grep", "which", "patch" ]
|
||||
|
||||
[build.flags]
|
||||
@@ -25,7 +25,7 @@ license = [
|
||||
"BSD-4-Clause",
|
||||
]
|
||||
name = "vx"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
|
||||
+585
-6
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[build.flags]
|
||||
configure = ["--without-debug"]
|
||||
skip_tests = true
|
||||
use_lto = false
|
||||
|
||||
[dependencies]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"alsa-topology-conf",
|
||||
"alsa-ucm-conf",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "alternative implementation of Linux sound support"
|
||||
homepage = "https://www.alsa-project.org/"
|
||||
license = "LGPL-2.1-or-later"
|
||||
name = "alsa-lib"
|
||||
version = "1.2.15.3"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
post_extract = ["autoreconf -fiv"]
|
||||
sha256 = "7b079d614d582cade7ab8db2364e65271d0877a37df8757ac4ac0c8970be861e"
|
||||
url = "https://www.alsa-project.org/files/pub/lib/$name-$version.tar.bz2"
|
||||
@@ -0,0 +1,14 @@
|
||||
[build]
|
||||
type = "custom"
|
||||
|
||||
[package]
|
||||
description = "ALSA topology configuration files"
|
||||
homepage = "https://alsa-project.org/"
|
||||
license = "BSD-3-Clause"
|
||||
name = "alsa-topology-conf"
|
||||
version = "1.2.5.1"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "f7c5bae1545abcd73824bc97f4e72c340e11abea188ba0f1c06f5e0ad776b179"
|
||||
url = "https://www.alsa-project.org/files/pub/lib/$name-$version.tar.bz2"
|
||||
@@ -0,0 +1,7 @@
|
||||
for dir in ./*; do
|
||||
[ -d "$dir" ] || continue
|
||||
set -- "$dir"/*.conf
|
||||
[ -e "$1" ] || continue
|
||||
install -vdm 755 "$DESTDIR/usr/share/alsa/topology/$(basename "$dir")"
|
||||
install -vm 644 "$@" -t "$DESTDIR/usr/share/alsa/topology/$(basename "$dir")"
|
||||
done
|
||||
@@ -0,0 +1,14 @@
|
||||
[build]
|
||||
type = "custom"
|
||||
|
||||
[package]
|
||||
description = "ALSA Use Case Manager configuration (and topologies)"
|
||||
homepage = "https://alsa-project.org/"
|
||||
license = "BSD-3-Clause"
|
||||
name = "alsa-ucm-conf"
|
||||
version = "1.2.15.3"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "9f79e813c08fc86cfa46dd75c4fcda1a4a51b482db2607e1fcfaafb92f588a31"
|
||||
url = "https://alsa-project.org/files/pub/lib/$name-$version.tar.bz2"
|
||||
@@ -0,0 +1,2 @@
|
||||
install -vdm 755 "$DESTDIR/usr/share/alsa/"
|
||||
cp -av ucm2 "$DESTDIR/usr/share/alsa/"
|
||||
@@ -0,0 +1,36 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-DBUILD_SHARED_LIBS=1",
|
||||
"-DENABLE_TESTS=0",
|
||||
"-G Ninja"
|
||||
]
|
||||
replace_cflags = [ "_FORTIFY_SOURCE=3=_FORTIFY_SOURCE=0" ]
|
||||
replace_cxxflags = [ "_FORTIFY_SOURCE=3=_FORTIFY_SOURCE=0" ]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"cmake",
|
||||
"ninja",
|
||||
"yasm",
|
||||
]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"libunwind",
|
||||
"libcxx",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Alliance for Open Media video codec"
|
||||
homepage = "https://aomedia.org/"
|
||||
license = "BSD-3-Clause"
|
||||
name = "aom"
|
||||
version = "3.13.2"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "634039cc79c3a3307206b6c25ea759abc0e734c6f4ac14f6dbea5694e46af837"
|
||||
url = "https://storage.googleapis.com/aom-releases/libaom-$version.tar.gz"
|
||||
@@ -0,0 +1,35 @@
|
||||
[build]
|
||||
type = "python"
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"python-setuptools",
|
||||
"python-wheel",
|
||||
]
|
||||
optional = [
|
||||
"graphviz",
|
||||
"lilypond",
|
||||
"imagemagick",
|
||||
"source-highlight",
|
||||
"dblatex",
|
||||
"fop",
|
||||
"w3m",
|
||||
"lynx",
|
||||
]
|
||||
runtime = [
|
||||
"libxslt",
|
||||
"docbook-xsl",
|
||||
"python",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Text document format for short documents, articles, books and UNIX man pages"
|
||||
homepage = "https://asciidoc-py.github.io/"
|
||||
license = "GPL-2.0-or-later"
|
||||
name = "asciidoc"
|
||||
version = "10.2.1"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "aa7be8ae894f6cc1e67784d76ffa6c6b9e9f96efdc695db43c6bd63820e5072b"
|
||||
url = "https://github.com/asciidoc-py/asciidoc-py/releases/download/$version/asciidoc-$version.tar.gz"
|
||||
@@ -0,0 +1,29 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = ["-Dselinux=disabled", "-Dbash_completion=disabled", "-Dtests=false"]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"docbook-xsl",
|
||||
"libxslt",
|
||||
"meson",
|
||||
]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"libcap",
|
||||
"libunwind",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Unprivileged sandboxing tool"
|
||||
homepage = "https://github.com/containers/bubblewrap"
|
||||
license = "LGPL-2.0-or-later"
|
||||
name = "bubblewrap"
|
||||
version = "0.11.1"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
url = "https://github.com/containers/bubblewrap.git#v$version"
|
||||
@@ -0,0 +1,48 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-Ddwrite=disabled",
|
||||
"-Dgtk_doc=true",
|
||||
"-Dspectre=disabled",
|
||||
"-Dsymbol-lookup=disabled",
|
||||
"-Dtests=disabled",
|
||||
]
|
||||
split_docs = true
|
||||
doc_dirs = [ "usr/share/gtk-doc" ]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"gtk-doc",
|
||||
"meson",
|
||||
"valgrind",
|
||||
]
|
||||
runtime = [
|
||||
"sh",
|
||||
"fontconfig",
|
||||
"freetype2",
|
||||
"glib2",
|
||||
"glibc",
|
||||
"libpng",
|
||||
"libxcb",
|
||||
"libx11",
|
||||
"libxext",
|
||||
"libxrender",
|
||||
"lzo",
|
||||
"pixman",
|
||||
"zlib-ng",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "2D graphics library with support for multiple output devices"
|
||||
homepage = "https://cairographics.org/"
|
||||
license = "LGPL-2.1-only OR MPL-1.1"
|
||||
name = "cairo"
|
||||
version = "1.18.4"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "445ed8208a6e4823de1226a74ca319d3600e83f6369f99b14265006599c32ccb"
|
||||
url = "https://www.cairographics.org/releases/cairo-$version.tar.xz"
|
||||
@@ -0,0 +1,31 @@
|
||||
[build]
|
||||
type = "rust"
|
||||
|
||||
[build.flags]
|
||||
use_lto = false
|
||||
|
||||
[dependencies]
|
||||
runtime = [
|
||||
"cargo",
|
||||
"curl",
|
||||
"glibc",
|
||||
"libunwind",
|
||||
"openssl",
|
||||
"zlib-ng",
|
||||
]
|
||||
|
||||
[[manual_sources]]
|
||||
url = "https://github.com/lu-zero/cargo-c/releases/download/v$version/Cargo.lock"
|
||||
|
||||
[package]
|
||||
description = "A cargo subcommand to build and install C-ABI compatible dynamic and static libraries"
|
||||
homepage = "https://github.com/lu-zero/cargo-c/"
|
||||
license = "MIT"
|
||||
name = "cargo-c"
|
||||
version = "0.10.21"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
post_extract = ['ln -sf "../.Cargo.lock" "./Cargo.lock"']
|
||||
sha256 = "819b62a61e5271924dffd122b7c713e446e5d65f3e630bbe9b90d4d46513d8fa"
|
||||
url = "https://github.com/lu-zero/cargo-c/archive/v$version/cargo-c-$version.tar.gz"
|
||||
@@ -0,0 +1,23 @@
|
||||
[build]
|
||||
type = "rust"
|
||||
|
||||
[build.flags]
|
||||
use_lto = false
|
||||
|
||||
[dependencies]
|
||||
build = ["cargo"]
|
||||
runtime = [
|
||||
"libcxx",
|
||||
"libunwind",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "tool for generating C bindings to Rust code"
|
||||
homepage = "https://github.com/mozilla/cbindgen"
|
||||
license = "MPL-2.0"
|
||||
name = "cbindgen"
|
||||
version = "0.29.2"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
url = "https://github.com/mozilla/cbindgen.git#v$version"
|
||||
@@ -0,0 +1,31 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-Dtestdata_tests=false",
|
||||
"-Denable_docs=false",
|
||||
]
|
||||
skip_tests = true
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"nasm",
|
||||
"ninja",
|
||||
"xxhash",
|
||||
"meson",
|
||||
]
|
||||
runtime = ["glibc"]
|
||||
|
||||
[package]
|
||||
description = "AV1 cross-platform decoder focused on speed and correctness"
|
||||
homepage = "https://code.videolan.org/videolan/dav1d"
|
||||
license = "BSD-2-Clause"
|
||||
name = "dav1d"
|
||||
version = "1.5.3"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "732010aa5ef461fa93355ed2c6c5fedb48ddc4b74e697eaabe8907eaeb943011"
|
||||
url = "https://downloads.videolan.org/pub/videolan/$name/$version/$name-$version.tar.xz"
|
||||
@@ -0,0 +1,183 @@
|
||||
diff -r -u db-5.3.21_orig/src/mp/mp_stat.c db-5.3.21/src/mp/mp_stat.c
|
||||
--- db-5.3.21_orig/src/mp/mp_stat.c 2012-05-12 01:57:53.000000000 +0800
|
||||
+++ db-5.3.21/src/mp/mp_stat.c 2015-05-19 15:07:09.000000000 +0800
|
||||
@@ -87,6 +87,13 @@
|
||||
u_int32_t i;
|
||||
uintmax_t tmp_wait, tmp_nowait;
|
||||
|
||||
+ /*
|
||||
+ * The array holding the lengths related to the buffer allocated for *fspp.
|
||||
+ * The first element of the array holds the number of entries allocated.
|
||||
+ * The second element of the array holds the total number of bytes allocated.
|
||||
+ */
|
||||
+ u_int32_t fsp_len[2];
|
||||
+
|
||||
dbmp = env->mp_handle;
|
||||
mp = dbmp->reginfo[0].primary;
|
||||
|
||||
@@ -193,32 +200,53 @@
|
||||
if (fspp != NULL) {
|
||||
*fspp = NULL;
|
||||
|
||||
- /* Count the MPOOLFILE structures. */
|
||||
- i = 0;
|
||||
- len = 0;
|
||||
- if ((ret = __memp_walk_files(env,
|
||||
- mp, __memp_count_files, &len, &i, flags)) != 0)
|
||||
- return (ret);
|
||||
+ while (*fspp == NULL) {
|
||||
+ /* Count the MPOOLFILE structures. */
|
||||
+ i = 0;
|
||||
+ /*
|
||||
+ * Allow space for the first __memp_get_files() to align the
|
||||
+ * structure array to uintmax_t, DB_MPOOL_STAT's most
|
||||
+ * restrictive field. [#23150]
|
||||
+ */
|
||||
+ len = sizeof(uintmax_t);
|
||||
+ if ((ret = __memp_walk_files(env,
|
||||
+ mp, __memp_count_files, &len, &i, flags)) != 0)
|
||||
+ return (ret);
|
||||
+
|
||||
+ if (i == 0)
|
||||
+ return (0);
|
||||
+
|
||||
+ /*
|
||||
+ * Copy the number of DB_MPOOL_FSTAT entries and the number of
|
||||
+ * bytes allocated for them into fsp_len. Do not count the space
|
||||
+ * reserved for allignment.
|
||||
+ */
|
||||
+ fsp_len[0] = i;
|
||||
+ fsp_len[1] = len - sizeof(uintmax_t);
|
||||
|
||||
- if (i == 0)
|
||||
- return (0);
|
||||
- len += sizeof(DB_MPOOL_FSTAT *); /* Trailing NULL */
|
||||
+ len += sizeof(DB_MPOOL_FSTAT *); /* Trailing NULL */
|
||||
|
||||
- /* Allocate space */
|
||||
- if ((ret = __os_umalloc(env, len, fspp)) != 0)
|
||||
- return (ret);
|
||||
+ /* Allocate space */
|
||||
+ if ((ret = __os_umalloc(env, len, fspp)) != 0)
|
||||
+ return (ret);
|
||||
|
||||
- tfsp = *fspp;
|
||||
- *tfsp = NULL;
|
||||
-
|
||||
- /*
|
||||
- * Files may have been opened since we counted, don't walk
|
||||
- * off the end of the allocated space.
|
||||
- */
|
||||
- if ((ret = __memp_walk_files(env,
|
||||
- mp, __memp_get_files, &tfsp, &i, flags)) != 0)
|
||||
- return (ret);
|
||||
+ tfsp = *fspp;
|
||||
+ *tfsp = NULL;
|
||||
|
||||
+ /*
|
||||
+ * Files may have been opened since we counted, if we walk off
|
||||
+ * the end of the allocated space specified in fsp_len, retry.
|
||||
+ */
|
||||
+ if ((ret = __memp_walk_files(env,
|
||||
+ mp, __memp_get_files, &tfsp, fsp_len, flags)) != 0) {
|
||||
+ if (ret == DB_BUFFER_SMALL) {
|
||||
+ __os_ufree(env, *fspp);
|
||||
+ *fspp = NULL;
|
||||
+ tfsp = NULL;
|
||||
+ } else
|
||||
+ return (ret);
|
||||
+ }
|
||||
+ }
|
||||
*++tfsp = NULL;
|
||||
}
|
||||
|
||||
@@ -286,28 +314,35 @@
|
||||
* for the text file names.
|
||||
*/
|
||||
static int
|
||||
-__memp_get_files(env, mfp, argp, countp, flags)
|
||||
+__memp_get_files(env, mfp, argp, fsp_len, flags)
|
||||
ENV *env;
|
||||
MPOOLFILE *mfp;
|
||||
void *argp;
|
||||
- u_int32_t *countp;
|
||||
+ u_int32_t fsp_len[];
|
||||
u_int32_t flags;
|
||||
{
|
||||
DB_MPOOL *dbmp;
|
||||
DB_MPOOL_FSTAT **tfsp, *tstruct;
|
||||
char *name, *tname;
|
||||
- size_t nlen;
|
||||
+ size_t nlen, tlen;
|
||||
|
||||
- if (*countp == 0)
|
||||
- return (0);
|
||||
+ /* We walked through more files than argp was allocated for. */
|
||||
+ if (fsp_len[0] == 0)
|
||||
+ return DB_BUFFER_SMALL;
|
||||
|
||||
dbmp = env->mp_handle;
|
||||
tfsp = *(DB_MPOOL_FSTAT ***)argp;
|
||||
|
||||
if (*tfsp == NULL) {
|
||||
- /* Add 1 to count because we need to skip over the NULL. */
|
||||
- tstruct = (DB_MPOOL_FSTAT *)(tfsp + *countp + 1);
|
||||
- tname = (char *)(tstruct + *countp);
|
||||
+ /*
|
||||
+ * Add 1 to count because to skip over the NULL end marker.
|
||||
+ * Align it further for DB_MPOOL_STAT's most restrictive field
|
||||
+ * because uintmax_t might require stricter alignment than
|
||||
+ * pointers; e.g., IP32 LL64 SPARC. [#23150]
|
||||
+ */
|
||||
+ tstruct = (DB_MPOOL_FSTAT *)&tfsp[fsp_len[0] + 1];
|
||||
+ tstruct = ALIGNP_INC(tstruct, sizeof(uintmax_t));
|
||||
+ tname = (char *)&tstruct[fsp_len[0]];
|
||||
*tfsp = tstruct;
|
||||
} else {
|
||||
tstruct = *tfsp + 1;
|
||||
@@ -317,6 +352,15 @@
|
||||
|
||||
name = __memp_fns(dbmp, mfp);
|
||||
nlen = strlen(name) + 1;
|
||||
+
|
||||
+ /* The space required for file names is larger than argp was allocated for. */
|
||||
+ tlen = sizeof(DB_MPOOL_FSTAT *) + sizeof(DB_MPOOL_FSTAT) + nlen;
|
||||
+ if (fsp_len[1] < tlen)
|
||||
+ return DB_BUFFER_SMALL;
|
||||
+ else
|
||||
+ /* Count down the number of bytes left in argp. */
|
||||
+ fsp_len[1] -= tlen;
|
||||
+
|
||||
memcpy(tname, name, nlen);
|
||||
memcpy(tstruct, &mfp->stat, sizeof(mfp->stat));
|
||||
tstruct->file_name = tname;
|
||||
@@ -325,7 +369,9 @@
|
||||
tstruct->st_pagesize = mfp->pagesize;
|
||||
|
||||
*(DB_MPOOL_FSTAT ***)argp = tfsp;
|
||||
- (*countp)--;
|
||||
+
|
||||
+ /* Count down the number of entries left in argp. */
|
||||
+ fsp_len[0]--;
|
||||
|
||||
if (LF_ISSET(DB_STAT_CLEAR))
|
||||
memset(&mfp->stat, 0, sizeof(mfp->stat));
|
||||
diff -r -u db-5.3.21_orig/src/mp/mp_sync.c db-5.3.21/src/mp/mp_sync.c
|
||||
--- db-5.3.21_orig/src/mp/mp_sync.c 2012-05-12 01:57:53.000000000 +0800
|
||||
+++ db-5.3.21/src/mp/mp_sync.c 2015-05-19 15:08:05.000000000 +0800
|
||||
@@ -57,11 +57,13 @@
|
||||
if ((t_ret = func(env,
|
||||
mfp, arg, countp, flags)) != 0 && ret == 0)
|
||||
ret = t_ret;
|
||||
- if (ret != 0 && !LF_ISSET(DB_STAT_MEMP_NOERROR))
|
||||
+ if (ret != 0 &&
|
||||
+ (!LF_ISSET(DB_STAT_MEMP_NOERROR) || ret == DB_BUFFER_SMALL))
|
||||
break;
|
||||
}
|
||||
MUTEX_UNLOCK(env, hp->mtx_hash);
|
||||
- if (ret != 0 && !LF_ISSET(DB_STAT_MEMP_NOERROR))
|
||||
+ if (ret != 0 &&
|
||||
+ (!LF_ISSET(DB_STAT_MEMP_NOERROR) || ret == DB_BUFFER_SMALL))
|
||||
break;
|
||||
}
|
||||
return (ret);
|
||||
@@ -0,0 +1,718 @@
|
||||
diff -U 5 -r db-5.3.21.old/src/dbinc_auto/int_def.in db-5.3.21/src/dbinc_auto/int_def.in
|
||||
--- db-5.3.21.old/src/dbinc_auto/int_def.in 2012-05-12 01:57:53.000000000 +0800
|
||||
+++ db-5.3.21/src/dbinc_auto/int_def.in 2016-10-25 22:40:58.000000000 +0800
|
||||
@@ -1371,10 +1371,11 @@
|
||||
#define __memp_failchk __memp_failchk@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_bhwrite __memp_bhwrite@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_pgread __memp_pgread@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_pg __memp_pg@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_bhfree __memp_bhfree@DB_VERSION_UNIQUE_NAME@
|
||||
+#define __memp_bh_clear_dirty __memp_bh_clear_dirty@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_fget_pp __memp_fget_pp@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_fget __memp_fget@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_fcreate_pp __memp_fcreate_pp@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_fcreate __memp_fcreate@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_set_clear_len __memp_set_clear_len@DB_VERSION_UNIQUE_NAME@
|
||||
@@ -1395,10 +1396,11 @@
|
||||
#define __memp_fopen __memp_fopen@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_fclose_pp __memp_fclose_pp@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_fclose __memp_fclose@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_mf_discard __memp_mf_discard@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_inmemlist __memp_inmemlist@DB_VERSION_UNIQUE_NAME@
|
||||
+#define __memp_mf_mark_dead __memp_mf_mark_dead@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_fput_pp __memp_fput_pp@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_fput __memp_fput@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_unpin_buffers __memp_unpin_buffers@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_dirty __memp_dirty@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_shared __memp_shared@DB_VERSION_UNIQUE_NAME@
|
||||
@@ -1453,10 +1455,11 @@
|
||||
#define __memp_fsync_pp __memp_fsync_pp@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_fsync __memp_fsync@DB_VERSION_UNIQUE_NAME@
|
||||
#define __mp_xxx_fh __mp_xxx_fh@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_sync_int __memp_sync_int@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_mf_sync __memp_mf_sync@DB_VERSION_UNIQUE_NAME@
|
||||
+#define __memp_purge_dead_files __memp_purge_dead_files@DB_VERSION_UNIQUE_NAME@
|
||||
#define __memp_trickle_pp __memp_trickle_pp@DB_VERSION_UNIQUE_NAME@
|
||||
#define __mutex_alloc __mutex_alloc@DB_VERSION_UNIQUE_NAME@
|
||||
#define __mutex_alloc_int __mutex_alloc_int@DB_VERSION_UNIQUE_NAME@
|
||||
#define __mutex_free __mutex_free@DB_VERSION_UNIQUE_NAME@
|
||||
#define __mutex_free_int __mutex_free_int@DB_VERSION_UNIQUE_NAME@
|
||||
diff -U 5 -r db-5.3.21.old/src/dbinc_auto/mp_ext.h db-5.3.21/src/dbinc_auto/mp_ext.h
|
||||
--- db-5.3.21.old/src/dbinc_auto/mp_ext.h 2012-05-12 01:57:53.000000000 +0800
|
||||
+++ db-5.3.21/src/dbinc_auto/mp_ext.h 2016-10-25 22:40:58.000000000 +0800
|
||||
@@ -14,10 +14,11 @@
|
||||
int __memp_failchk __P((ENV *));
|
||||
int __memp_bhwrite __P((DB_MPOOL *, DB_MPOOL_HASH *, MPOOLFILE *, BH *, int));
|
||||
int __memp_pgread __P((DB_MPOOLFILE *, BH *, int));
|
||||
int __memp_pg __P((DB_MPOOLFILE *, db_pgno_t, void *, int));
|
||||
int __memp_bhfree __P((DB_MPOOL *, REGINFO *, MPOOLFILE *, DB_MPOOL_HASH *, BH *, u_int32_t));
|
||||
+void __memp_bh_clear_dirty __P((ENV*, DB_MPOOL_HASH *, BH *));
|
||||
int __memp_fget_pp __P((DB_MPOOLFILE *, db_pgno_t *, DB_TXN *, u_int32_t, void *));
|
||||
int __memp_fget __P((DB_MPOOLFILE *, db_pgno_t *, DB_THREAD_INFO *, DB_TXN *, u_int32_t, void *));
|
||||
int __memp_fcreate_pp __P((DB_ENV *, DB_MPOOLFILE **, u_int32_t));
|
||||
int __memp_fcreate __P((ENV *, DB_MPOOLFILE **));
|
||||
int __memp_set_clear_len __P((DB_MPOOLFILE *, u_int32_t));
|
||||
@@ -38,10 +39,11 @@
|
||||
int __memp_fopen __P((DB_MPOOLFILE *, MPOOLFILE *, const char *, const char **, u_int32_t, int, size_t));
|
||||
int __memp_fclose_pp __P((DB_MPOOLFILE *, u_int32_t));
|
||||
int __memp_fclose __P((DB_MPOOLFILE *, u_int32_t));
|
||||
int __memp_mf_discard __P((DB_MPOOL *, MPOOLFILE *, int));
|
||||
int __memp_inmemlist __P((ENV *, char ***, int *));
|
||||
+void __memp_mf_mark_dead __P((DB_MPOOL *, MPOOLFILE *, int*));
|
||||
int __memp_fput_pp __P((DB_MPOOLFILE *, void *, DB_CACHE_PRIORITY, u_int32_t));
|
||||
int __memp_fput __P((DB_MPOOLFILE *, DB_THREAD_INFO *, void *, DB_CACHE_PRIORITY));
|
||||
int __memp_unpin_buffers __P((ENV *, DB_THREAD_INFO *));
|
||||
int __memp_dirty __P((DB_MPOOLFILE *, void *, DB_THREAD_INFO *, DB_TXN *, DB_CACHE_PRIORITY, u_int32_t));
|
||||
int __memp_shared __P((DB_MPOOLFILE *, void *));
|
||||
@@ -96,10 +98,11 @@
|
||||
int __memp_fsync_pp __P((DB_MPOOLFILE *));
|
||||
int __memp_fsync __P((DB_MPOOLFILE *));
|
||||
int __mp_xxx_fh __P((DB_MPOOLFILE *, DB_FH **));
|
||||
int __memp_sync_int __P((ENV *, DB_MPOOLFILE *, u_int32_t, u_int32_t, u_int32_t *, int *));
|
||||
int __memp_mf_sync __P((DB_MPOOL *, MPOOLFILE *, int));
|
||||
+int __memp_purge_dead_files __P((ENV *));
|
||||
int __memp_trickle_pp __P((DB_ENV *, int, int *));
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
diff -U 5 -r db-5.3.21.old/src/mp/mp_bh.c db-5.3.21/src/mp/mp_bh.c
|
||||
--- db-5.3.21.old/src/mp/mp_bh.c 2012-05-12 01:57:53.000000000 +0800
|
||||
+++ db-5.3.21/src/mp/mp_bh.c 2016-10-25 17:09:35.000000000 +0800
|
||||
@@ -472,15 +472,12 @@
|
||||
* a shared latch.
|
||||
*/
|
||||
if (F_ISSET(bhp, BH_DIRTY | BH_TRASH)) {
|
||||
MUTEX_LOCK(env, hp->mtx_hash);
|
||||
DB_ASSERT(env, !SH_CHAIN_HASNEXT(bhp, vc));
|
||||
- if (ret == 0 && F_ISSET(bhp, BH_DIRTY)) {
|
||||
- F_CLR(bhp, BH_DIRTY | BH_DIRTY_CREATE);
|
||||
- DB_ASSERT(env, atomic_read(&hp->hash_page_dirty) > 0);
|
||||
- atomic_dec(env, &hp->hash_page_dirty);
|
||||
- }
|
||||
+ if (ret == 0)
|
||||
+ __memp_bh_clear_dirty(env, hp, bhp);
|
||||
|
||||
/* put the page back if necessary. */
|
||||
if ((ret != 0 || BH_REFCOUNT(bhp) > 1) &&
|
||||
F_ISSET(bhp, BH_TRASH)) {
|
||||
ret = __memp_pg(dbmfp, bhp->pgno, bhp->buf, 1);
|
||||
@@ -686,5 +683,31 @@
|
||||
} else
|
||||
MUTEX_UNLOCK(env, mfp->mutex);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
+
|
||||
+/*
|
||||
+ * __memp_bh_clear_dirty --
|
||||
+ * Clear the dirty flag of of a buffer. Calls on the same buffer must be
|
||||
+ * serialized to get the accounting correct. This can be achieved by
|
||||
+ * acquiring an exclusive lock on the buffer, a shared lock on the
|
||||
+ * buffer plus an exclusive lock on the hash bucket, or some other
|
||||
+ * mechanism that guarantees single-thread access to the entire region
|
||||
+ * (e.g. during __memp_region_bhfree()).
|
||||
+ *
|
||||
+ * PUBLIC: void __memp_bh_clear_dirty __P((ENV*, DB_MPOOL_HASH *, BH *));
|
||||
+ */
|
||||
+void
|
||||
+__memp_bh_clear_dirty(env, hp, bhp)
|
||||
+ ENV *env;
|
||||
+ DB_MPOOL_HASH *hp;
|
||||
+ BH *bhp;
|
||||
+{
|
||||
+ COMPQUIET(env, env);
|
||||
+ if (F_ISSET(bhp, BH_DIRTY)) {
|
||||
+ F_CLR(bhp, BH_DIRTY | BH_DIRTY_CREATE);
|
||||
+ DB_ASSERT(env, atomic_read(&hp->hash_page_dirty) > 0);
|
||||
+ (void)atomic_dec(env, &hp->hash_page_dirty);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
diff -U 5 -r db-5.3.21.old/src/mp/mp_fget.c db-5.3.21/src/mp/mp_fget.c
|
||||
--- db-5.3.21.old/src/mp/mp_fget.c 2012-05-12 01:57:53.000000000 +0800
|
||||
+++ db-5.3.21/src/mp/mp_fget.c 2016-10-25 17:11:08.000000000 +0800
|
||||
@@ -437,16 +437,11 @@
|
||||
* complain and get out.
|
||||
*/
|
||||
if (flags == DB_MPOOL_FREE) {
|
||||
freebuf: MUTEX_LOCK(env, hp->mtx_hash);
|
||||
h_locked = 1;
|
||||
- if (F_ISSET(bhp, BH_DIRTY)) {
|
||||
- F_CLR(bhp, BH_DIRTY | BH_DIRTY_CREATE);
|
||||
- DB_ASSERT(env,
|
||||
- atomic_read(&hp->hash_page_dirty) > 0);
|
||||
- atomic_dec(env, &hp->hash_page_dirty);
|
||||
- }
|
||||
+ __memp_bh_clear_dirty(env, hp, bhp);
|
||||
|
||||
/*
|
||||
* If the buffer we found is already freed, we're done.
|
||||
* If the ref count is not 1 then someone may be
|
||||
* peeking at the buffer. We cannot free it until they
|
||||
diff -U 5 -r db-5.3.21.old/src/mp/mp_fopen.c db-5.3.21/src/mp/mp_fopen.c
|
||||
--- db-5.3.21.old/src/mp/mp_fopen.c 2012-05-12 01:57:53.000000000 +0800
|
||||
+++ db-5.3.21/src/mp/mp_fopen.c 2016-10-25 22:31:05.000000000 +0800
|
||||
@@ -12,10 +12,11 @@
|
||||
#include "dbinc/log.h"
|
||||
#include "dbinc/mp.h"
|
||||
#include "dbinc/db_page.h"
|
||||
#include "dbinc/hash.h"
|
||||
|
||||
+static int __memp_count_dead_mutex __P((DB_MPOOL *, u_int32_t *));
|
||||
static int __memp_mpf_alloc __P((DB_MPOOL *,
|
||||
DB_MPOOLFILE *, const char *, u_int32_t, u_int32_t, MPOOLFILE **));
|
||||
static int __memp_mpf_find __P((ENV *,
|
||||
DB_MPOOLFILE *, DB_MPOOL_HASH *, const char *, u_int32_t, MPOOLFILE **));
|
||||
|
||||
@@ -709,11 +710,15 @@
|
||||
* We should be able to set mfp to NULL and break out of the
|
||||
* loop, but I like the idea of checking all the entries.
|
||||
*/
|
||||
if (LF_ISSET(DB_TRUNCATE)) {
|
||||
MUTEX_LOCK(env, mfp->mutex);
|
||||
- mfp->deadfile = 1;
|
||||
+ /*
|
||||
+ * We cannot purge dead files here, because the caller
|
||||
+ * is holding the mutex of the hash bucket of mfp.
|
||||
+ */
|
||||
+ __memp_mf_mark_dead(dbmp, mfp, NULL);
|
||||
MUTEX_UNLOCK(env, mfp->mutex);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -907,14 +912,15 @@
|
||||
DB_MPOOL *dbmp;
|
||||
ENV *env;
|
||||
MPOOLFILE *mfp;
|
||||
char *rpath;
|
||||
u_int32_t ref;
|
||||
- int deleted, ret, t_ret;
|
||||
+ int deleted, purge_dead, ret, t_ret;
|
||||
|
||||
env = dbmfp->env;
|
||||
dbmp = env->mp_handle;
|
||||
+ purge_dead = 0;
|
||||
ret = 0;
|
||||
|
||||
/*
|
||||
* Remove the DB_MPOOLFILE from the process' list.
|
||||
*
|
||||
@@ -1004,11 +1010,11 @@
|
||||
}
|
||||
DB_ASSERT(env, mfp->neutral_cnt < mfp->mpf_cnt);
|
||||
if (--mfp->mpf_cnt == 0 || LF_ISSET(DB_MPOOL_DISCARD)) {
|
||||
if (LF_ISSET(DB_MPOOL_DISCARD) ||
|
||||
F_ISSET(mfp, MP_TEMP) || mfp->unlink_on_close) {
|
||||
- mfp->deadfile = 1;
|
||||
+ __memp_mf_mark_dead(dbmp, mfp, &purge_dead);
|
||||
}
|
||||
if (mfp->unlink_on_close) {
|
||||
if ((t_ret = __db_appname(dbmp->env, DB_APP_DATA,
|
||||
R_ADDR(dbmp->reginfo, mfp->path_off), NULL,
|
||||
&rpath)) != 0 && ret == 0)
|
||||
@@ -1037,10 +1043,12 @@
|
||||
deleted = 1;
|
||||
}
|
||||
}
|
||||
if (!deleted && !LF_ISSET(DB_MPOOL_NOLOCK))
|
||||
MUTEX_UNLOCK(env, mfp->mutex);
|
||||
+ if (purge_dead)
|
||||
+ (void)__memp_purge_dead_files(env);
|
||||
|
||||
done: /* Discard the DB_MPOOLFILE structure. */
|
||||
if (dbmfp->pgcookie != NULL) {
|
||||
__os_free(env, dbmfp->pgcookie->data);
|
||||
__os_free(env, dbmfp->pgcookie);
|
||||
@@ -1091,11 +1099,11 @@
|
||||
/*
|
||||
* We have to release the MPOOLFILE mutex before acquiring the region
|
||||
* mutex so we don't deadlock. Make sure nobody ever looks at this
|
||||
* structure again.
|
||||
*/
|
||||
- mfp->deadfile = 1;
|
||||
+ __memp_mf_mark_dead(dbmp, mfp, NULL);
|
||||
|
||||
/* Discard the mutex we're holding and return it too the pool. */
|
||||
MUTEX_UNLOCK(env, mfp->mutex);
|
||||
if ((t_ret = __mutex_free(env, &mfp->mutex)) != 0 && ret == 0)
|
||||
ret = t_ret;
|
||||
@@ -1216,5 +1224,106 @@
|
||||
/* Make sure we don't return any garbage. */
|
||||
*cntp = 0;
|
||||
*namesp = NULL;
|
||||
return (ret);
|
||||
}
|
||||
+
|
||||
+/*
|
||||
+ * __memp_mf_mark_dead --
|
||||
+ * Mark an MPOOLFILE as dead because its contents are no longer necessary.
|
||||
+ * This happens when removing, truncation, or closing an unnamed in-memory
|
||||
+ * database. Return, in the purgep parameter, whether the caller should
|
||||
+ * call __memp_purge_dead_files() after the lock on mfp is released. The
|
||||
+ * caller must hold an exclusive lock on the mfp handle.
|
||||
+ *
|
||||
+ * PUBLIC: void __memp_mf_mark_dead __P((DB_MPOOL *, MPOOLFILE *, int*));
|
||||
+ */
|
||||
+void
|
||||
+__memp_mf_mark_dead(dbmp, mfp, purgep)
|
||||
+ DB_MPOOL *dbmp;
|
||||
+ MPOOLFILE *mfp;
|
||||
+ int *purgep;
|
||||
+{
|
||||
+ ENV *env;
|
||||
+#ifdef HAVE_MUTEX_SUPPORT
|
||||
+ REGINFO *infop;
|
||||
+ DB_MUTEXREGION *mtxregion;
|
||||
+ u_int32_t mutex_max, mutex_inuse, dead_mutex;
|
||||
+#endif
|
||||
+
|
||||
+ if (purgep != NULL)
|
||||
+ *purgep = 0;
|
||||
+
|
||||
+ env = dbmp->env;
|
||||
+
|
||||
+#ifdef HAVE_MUTEX_SUPPORT
|
||||
+ MUTEX_REQUIRED(env, mfp->mutex);
|
||||
+
|
||||
+ if (MUTEX_ON(env) && mfp->deadfile == 0) {
|
||||
+ infop = &env->mutex_handle->reginfo;
|
||||
+ mtxregion = infop->primary;
|
||||
+
|
||||
+ mutex_inuse = mtxregion->stat.st_mutex_inuse;
|
||||
+ if ((mutex_max = env->dbenv->mutex_max) == 0)
|
||||
+ mutex_max = infop->rp->max / mtxregion->mutex_size;
|
||||
+
|
||||
+ /*
|
||||
+ * Purging dead pages requires a full scan of the entire cache
|
||||
+ * buffer, so it is a slow operation. We only want to do it
|
||||
+ * when it is necessary and provides enough benefits. Below is
|
||||
+ * a simple heuristic that determines when to purge all dead
|
||||
+ * pages.
|
||||
+ */
|
||||
+ if (purgep != NULL && mutex_inuse > mutex_max - 200) {
|
||||
+ /*
|
||||
+ * If the mutex region is almost full and there are
|
||||
+ * many mutexes held by dead files, purge dead files.
|
||||
+ */
|
||||
+ (void)__memp_count_dead_mutex(dbmp, &dead_mutex);
|
||||
+ dead_mutex += mfp->block_cnt + 1;
|
||||
+
|
||||
+ if (dead_mutex > mutex_inuse / 20)
|
||||
+ *purgep = 1;
|
||||
+ }
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ mfp->deadfile = 1;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * __memp_count_dead_mutex --
|
||||
+ * Estimate the number of mutexes held by dead files.
|
||||
+ */
|
||||
+static int
|
||||
+__memp_count_dead_mutex(dbmp, dead_mutex)
|
||||
+ DB_MPOOL *dbmp;
|
||||
+ u_int32_t *dead_mutex;
|
||||
+{
|
||||
+ ENV *env;
|
||||
+ DB_MPOOL_HASH *hp;
|
||||
+ MPOOL *mp;
|
||||
+ MPOOLFILE *mfp;
|
||||
+ u_int32_t mutex_per_file;
|
||||
+ int busy, i;
|
||||
+
|
||||
+ env = dbmp->env;
|
||||
+ *dead_mutex = 0;
|
||||
+ mutex_per_file = 1;
|
||||
+#ifndef HAVE_ATOMICFILEREAD
|
||||
+ mutex_per_file = 2;
|
||||
+#endif
|
||||
+ mp = dbmp->reginfo[0].primary;
|
||||
+ hp = R_ADDR(dbmp->reginfo, mp->ftab);
|
||||
+ for (i = 0; i < MPOOL_FILE_BUCKETS; i++, hp++) {
|
||||
+ busy = MUTEX_TRYLOCK(env, hp->mtx_hash);
|
||||
+ if (busy)
|
||||
+ continue;
|
||||
+ SH_TAILQ_FOREACH(mfp, &hp->hash_bucket, q, __mpoolfile) {
|
||||
+ if (mfp->deadfile)
|
||||
+ *dead_mutex += mfp->block_cnt + mutex_per_file;
|
||||
+ }
|
||||
+ MUTEX_UNLOCK(env, hp->mtx_hash);
|
||||
+ }
|
||||
+
|
||||
+ return (0);
|
||||
+}
|
||||
diff -U 5 -r db-5.3.21.old/src/mp/mp_method.c db-5.3.21/src/mp/mp_method.c
|
||||
--- db-5.3.21.old/src/mp/mp_method.c 2012-05-12 01:57:53.000000000 +0800
|
||||
+++ db-5.3.21/src/mp/mp_method.c 2016-10-25 17:22:23.000000000 +0800
|
||||
@@ -638,11 +638,11 @@
|
||||
DB_MPOOL_HASH *hp, *nhp;
|
||||
MPOOL *mp;
|
||||
MPOOLFILE *mfp;
|
||||
roff_t newname_off;
|
||||
u_int32_t bucket;
|
||||
- int locked, ret;
|
||||
+ int locked, purge_dead, ret;
|
||||
size_t nlen;
|
||||
void *p;
|
||||
|
||||
#undef op_is_remove
|
||||
#define op_is_remove (newname == NULL)
|
||||
@@ -655,10 +655,11 @@
|
||||
dbmp = NULL;
|
||||
mfp = NULL;
|
||||
nhp = NULL;
|
||||
p = NULL;
|
||||
locked = ret = 0;
|
||||
+ purge_dead = 0;
|
||||
|
||||
if (!MPOOL_ON(env))
|
||||
goto fsop;
|
||||
|
||||
dbmp = env->mp_handle;
|
||||
@@ -747,11 +748,11 @@
|
||||
* they do not get reclaimed as long as they exist. Since we
|
||||
* are now deleting the database, we need to dec that count.
|
||||
*/
|
||||
if (mfp->no_backing_file)
|
||||
mfp->mpf_cnt--;
|
||||
- mfp->deadfile = 1;
|
||||
+ __memp_mf_mark_dead(dbmp, mfp, &purge_dead);
|
||||
MUTEX_UNLOCK(env, mfp->mutex);
|
||||
} else {
|
||||
/*
|
||||
* Else, it's a rename. We've allocated memory for the new
|
||||
* name. Swap it with the old one. If it's in memory we
|
||||
@@ -806,10 +807,16 @@
|
||||
if (locked == 1) {
|
||||
MUTEX_UNLOCK(env, hp->mtx_hash);
|
||||
if (nhp != NULL && nhp != hp)
|
||||
MUTEX_UNLOCK(env, nhp->mtx_hash);
|
||||
}
|
||||
+ /*
|
||||
+ * __memp_purge_dead_files() must be called when the hash bucket is
|
||||
+ * unlocked.
|
||||
+ */
|
||||
+ if (purge_dead)
|
||||
+ (void)__memp_purge_dead_files(env);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/*
|
||||
* __memp_ftruncate __
|
||||
diff -U 5 -r db-5.3.21.old/src/mp/mp_sync.c db-5.3.21/src/mp/mp_sync.c
|
||||
--- db-5.3.21.old/src/mp/mp_sync.c 2012-05-12 01:57:53.000000000 +0800
|
||||
+++ db-5.3.21/src/mp/mp_sync.c 2016-10-25 17:26:58.000000000 +0800
|
||||
@@ -24,10 +24,11 @@
|
||||
static int __bhcmp __P((const void *, const void *));
|
||||
static int __memp_close_flush_files __P((ENV *, int));
|
||||
static int __memp_sync_files __P((ENV *));
|
||||
static int __memp_sync_file __P((ENV *,
|
||||
MPOOLFILE *, void *, u_int32_t *, u_int32_t));
|
||||
+static inline void __update_err_ret(int, int*);
|
||||
|
||||
/*
|
||||
* __memp_walk_files --
|
||||
* PUBLIC: int __memp_walk_files __P((ENV *, MPOOL *,
|
||||
* PUBLIC: int (*) __P((ENV *, MPOOLFILE *, void *,
|
||||
@@ -961,5 +962,125 @@
|
||||
return (-1);
|
||||
if (bhp1->track_pgno > bhp2->track_pgno)
|
||||
return (1);
|
||||
return (0);
|
||||
}
|
||||
+
|
||||
+/*
|
||||
+ * __memp_purge_dead_files --
|
||||
+ * Remove all dead files and their buffers from the mpool. The caller
|
||||
+ * cannot hold any lock on the dead MPOOLFILE handles, their buffers
|
||||
+ * or their hash buckets.
|
||||
+ *
|
||||
+ * PUBLIC: int __memp_purge_dead_files __P((ENV *));
|
||||
+ */
|
||||
+int
|
||||
+__memp_purge_dead_files(env)
|
||||
+ ENV *env;
|
||||
+{
|
||||
+ BH *bhp;
|
||||
+ DB_MPOOL *dbmp;
|
||||
+ DB_MPOOL_HASH *hp, *hp_end;
|
||||
+ REGINFO *infop;
|
||||
+ MPOOL *c_mp, *mp;
|
||||
+ MPOOLFILE *mfp;
|
||||
+ u_int32_t i_cache;
|
||||
+ int ret, t_ret, h_lock;
|
||||
+
|
||||
+ if (!MPOOL_ON(env))
|
||||
+ return (0);
|
||||
+
|
||||
+ dbmp = env->mp_handle;
|
||||
+ mp = dbmp->reginfo[0].primary;
|
||||
+ ret = t_ret = h_lock = 0;
|
||||
+
|
||||
+ /*
|
||||
+ * Walk each cache's list of buffers and free all buffers whose
|
||||
+ * MPOOLFILE is marked as dead.
|
||||
+ */
|
||||
+ for (i_cache = 0; i_cache < mp->nreg; i_cache++) {
|
||||
+ infop = &dbmp->reginfo[i_cache];
|
||||
+ c_mp = infop->primary;
|
||||
+
|
||||
+ hp = R_ADDR(infop, c_mp->htab);
|
||||
+ hp_end = &hp[c_mp->htab_buckets];
|
||||
+ for (; hp < hp_end; hp++) {
|
||||
+ /* Skip empty buckets. */
|
||||
+ if (SH_TAILQ_FIRST(&hp->hash_bucket, __bh) == NULL)
|
||||
+ continue;
|
||||
+
|
||||
+ /*
|
||||
+ * Search for a dead buffer. Other places that call
|
||||
+ * __memp_bhfree() acquire the buffer lock before the
|
||||
+ * hash bucket lock. Even though we acquire the two
|
||||
+ * locks in reverse order, we cannot deadlock here
|
||||
+ * because we don't block waiting for the locks.
|
||||
+ */
|
||||
+ t_ret = MUTEX_TRYLOCK(env, hp->mtx_hash);
|
||||
+ if (t_ret != 0) {
|
||||
+ __update_err_ret(t_ret, &ret);
|
||||
+ continue;
|
||||
+ }
|
||||
+ h_lock = 1;
|
||||
+ SH_TAILQ_FOREACH(bhp, &hp->hash_bucket, hq, __bh) {
|
||||
+ /* Skip buffers that are being used. */
|
||||
+ if (BH_REFCOUNT(bhp) > 0)
|
||||
+ continue;
|
||||
+
|
||||
+ mfp = R_ADDR(dbmp->reginfo, bhp->mf_offset);
|
||||
+ if (!mfp->deadfile)
|
||||
+ continue;
|
||||
+
|
||||
+ /* Found a dead buffer. Prepare to free it. */
|
||||
+ t_ret = MUTEX_TRYLOCK(env, bhp->mtx_buf);
|
||||
+ if (t_ret != 0) {
|
||||
+ __update_err_ret(t_ret, &ret);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ DB_ASSERT(env, (!F_ISSET(bhp, BH_EXCLUSIVE) &&
|
||||
+ BH_REFCOUNT(bhp) == 0));
|
||||
+ F_SET(bhp, BH_EXCLUSIVE);
|
||||
+ (void)atomic_inc(env, &bhp->ref);
|
||||
+
|
||||
+ __memp_bh_clear_dirty(env, hp, bhp);
|
||||
+
|
||||
+ /*
|
||||
+ * Free the buffer. The buffer and hash bucket
|
||||
+ * are unlocked by __memp_bhfree.
|
||||
+ */
|
||||
+ if ((t_ret = __memp_bhfree(dbmp, infop, mfp,
|
||||
+ hp, bhp, BH_FREE_FREEMEM)) == 0)
|
||||
+ /*
|
||||
+ * Decrement hp, so the next turn will
|
||||
+ * search the same bucket again.
|
||||
+ */
|
||||
+ hp--;
|
||||
+ else
|
||||
+ __update_err_ret(t_ret, &ret);
|
||||
+
|
||||
+ /*
|
||||
+ * The hash bucket is unlocked, we need to
|
||||
+ * start over again.
|
||||
+ */
|
||||
+ h_lock = 0;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (h_lock) {
|
||||
+ MUTEX_UNLOCK(env, hp->mtx_hash);
|
||||
+ h_lock = 0;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return (ret);
|
||||
+}
|
||||
+
|
||||
+static inline void
|
||||
+__update_err_ret(t_ret, retp)
|
||||
+ int t_ret;
|
||||
+ int *retp;
|
||||
+{
|
||||
+ if (t_ret != 0 && t_ret != DB_LOCK_NOTGRANTED && *retp == 0)
|
||||
+ *retp = t_ret;
|
||||
+}
|
||||
diff -U 5 -r db-5.3.21.old/src/mp/mp_trickle.c db-5.3.21/src/mp/mp_trickle.c
|
||||
--- db-5.3.21.old/src/mp/mp_trickle.c 2012-05-12 01:57:53.000000000 +0800
|
||||
+++ db-5.3.21/src/mp/mp_trickle.c 2016-10-25 17:27:57.000000000 +0800
|
||||
@@ -65,10 +65,14 @@
|
||||
"DB_ENV->memp_trickle: %d: percent must be between 1 and 100",
|
||||
"%d"), pct);
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
+ /* First we purge all dead files and their buffers. */
|
||||
+ if ((ret = __memp_purge_dead_files(env)) != 0)
|
||||
+ return (ret);
|
||||
+
|
||||
/*
|
||||
* Loop through the caches counting total/dirty buffers.
|
||||
*
|
||||
* XXX
|
||||
* Using hash_page_dirty is our only choice at the moment, but it's not
|
||||
diff -U 5 -r db-5.3.21.old/src/mutex/mut_region.c db-5.3.21/src/mutex/mut_region.c
|
||||
--- db-5.3.21.old/src/mutex/mut_region.c 2012-05-12 01:57:54.000000000 +0800
|
||||
+++ db-5.3.21/src/mutex/mut_region.c 2016-10-25 17:34:22.000000000 +0800
|
||||
@@ -15,11 +15,11 @@
|
||||
#include "dbinc/txn.h"
|
||||
|
||||
static db_size_t __mutex_align_size __P((ENV *));
|
||||
static int __mutex_region_init __P((ENV *, DB_MUTEXMGR *));
|
||||
static size_t __mutex_region_size __P((ENV *));
|
||||
-static size_t __mutex_region_max __P((ENV *));
|
||||
+static size_t __mutex_region_max __P((ENV *, u_int32_t));
|
||||
|
||||
/*
|
||||
* __mutex_open --
|
||||
* Open a mutex region.
|
||||
*
|
||||
@@ -32,11 +32,11 @@
|
||||
{
|
||||
DB_ENV *dbenv;
|
||||
DB_MUTEXMGR *mtxmgr;
|
||||
DB_MUTEXREGION *mtxregion;
|
||||
size_t size;
|
||||
- u_int32_t cpu_count;
|
||||
+ u_int32_t cpu_count, mutex_needed;
|
||||
int ret;
|
||||
#ifndef HAVE_ATOMIC_SUPPORT
|
||||
u_int i;
|
||||
#endif
|
||||
|
||||
@@ -59,23 +59,24 @@
|
||||
cpu_count : cpu_count * MUTEX_SPINS_PER_PROCESSOR)) != 0)
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/*
|
||||
- * If the user didn't set an absolute value on the number of mutexes
|
||||
- * we'll need, figure it out. We're conservative in our allocation,
|
||||
- * we need mutexes for DB handles, group-commit queues and other things
|
||||
- * applications allocate at run-time. The application may have kicked
|
||||
- * up our count to allocate its own mutexes, add that in.
|
||||
+ * Figure out the number of mutexes we'll need. We're conservative in
|
||||
+ * our allocation, we need mutexes for DB handles, group-commit queues
|
||||
+ * and other things applications allocate at run-time. The application
|
||||
+ * may have kicked up our count to allocate its own mutexes, add that
|
||||
+ * in.
|
||||
*/
|
||||
+ mutex_needed =
|
||||
+ __lock_region_mutex_count(env) +
|
||||
+ __log_region_mutex_count(env) +
|
||||
+ __memp_region_mutex_count(env) +
|
||||
+ __txn_region_mutex_count(env);
|
||||
if (dbenv->mutex_cnt == 0 &&
|
||||
F_ISSET(env, ENV_PRIVATE | ENV_THREAD) != ENV_PRIVATE)
|
||||
- dbenv->mutex_cnt =
|
||||
- __lock_region_mutex_count(env) +
|
||||
- __log_region_mutex_count(env) +
|
||||
- __memp_region_mutex_count(env) +
|
||||
- __txn_region_mutex_count(env);
|
||||
+ dbenv->mutex_cnt = mutex_needed;
|
||||
|
||||
if (dbenv->mutex_max != 0 && dbenv->mutex_cnt > dbenv->mutex_max)
|
||||
dbenv->mutex_cnt = dbenv->mutex_max;
|
||||
|
||||
/* Create/initialize the mutex manager structure. */
|
||||
@@ -88,12 +89,12 @@
|
||||
mtxmgr->reginfo.id = INVALID_REGION_ID;
|
||||
mtxmgr->reginfo.flags = REGION_JOIN_OK;
|
||||
size = __mutex_region_size(env);
|
||||
if (create_ok)
|
||||
F_SET(&mtxmgr->reginfo, REGION_CREATE_OK);
|
||||
- if ((ret = __env_region_attach(env,
|
||||
- &mtxmgr->reginfo, size, size + __mutex_region_max(env))) != 0)
|
||||
+ if ((ret = __env_region_attach(env, &mtxmgr->reginfo,
|
||||
+ size, size + __mutex_region_max(env, mutex_needed))) != 0)
|
||||
goto err;
|
||||
|
||||
/* If we created the region, initialize it. */
|
||||
if (F_ISSET(&mtxmgr->reginfo, REGION_CREATE))
|
||||
if ((ret = __mutex_region_init(env, mtxmgr)) != 0)
|
||||
@@ -350,44 +351,62 @@
|
||||
|
||||
dbenv = env->dbenv;
|
||||
|
||||
s = sizeof(DB_MUTEXMGR) + 1024;
|
||||
|
||||
- /* We discard one mutex for the OOB slot. */
|
||||
+ /*
|
||||
+ * We discard one mutex for the OOB slot. Make sure mutex_cnt doesn't
|
||||
+ * overflow.
|
||||
+ */
|
||||
s += __env_alloc_size(
|
||||
- (dbenv->mutex_cnt + 1) *__mutex_align_size(env));
|
||||
+ (dbenv->mutex_cnt + (dbenv->mutex_cnt == UINT32_MAX ? 0 : 1)) *
|
||||
+ __mutex_align_size(env));
|
||||
|
||||
return (s);
|
||||
}
|
||||
|
||||
/*
|
||||
* __mutex_region_max --
|
||||
* Return the amount of space needed to reach the maximum size.
|
||||
*/
|
||||
static size_t
|
||||
-__mutex_region_max(env)
|
||||
+__mutex_region_max(env, mutex_needed)
|
||||
ENV *env;
|
||||
+ u_int32_t mutex_needed;
|
||||
{
|
||||
DB_ENV *dbenv;
|
||||
- u_int32_t max;
|
||||
+ u_int32_t max, mutex_cnt;
|
||||
|
||||
dbenv = env->dbenv;
|
||||
+ mutex_cnt = dbenv->mutex_cnt;
|
||||
|
||||
- if ((max = dbenv->mutex_max) == 0) {
|
||||
+ /*
|
||||
+ * We want to limit the region size to accommodate at most UINT32_MAX
|
||||
+ * mutexes. If mutex_cnt is UINT32_MAX, no more space is allowed.
|
||||
+ */
|
||||
+ if ((max = dbenv->mutex_max) == 0 && mutex_cnt != UINT32_MAX)
|
||||
if (F_ISSET(env, ENV_PRIVATE | ENV_THREAD) == ENV_PRIVATE)
|
||||
- max = dbenv->mutex_inc + 1;
|
||||
- else
|
||||
+ if (dbenv->mutex_inc + 1 < UINT32_MAX - mutex_cnt)
|
||||
+ max = dbenv->mutex_inc + 1 + mutex_cnt;
|
||||
+ else
|
||||
+ max = UINT32_MAX;
|
||||
+ else {
|
||||
max = __lock_region_mutex_max(env) +
|
||||
__txn_region_mutex_max(env) +
|
||||
__log_region_mutex_max(env) +
|
||||
dbenv->mutex_inc + 100;
|
||||
- } else if (max <= dbenv->mutex_cnt)
|
||||
+ if (max < UINT32_MAX - mutex_needed)
|
||||
+ max += mutex_needed;
|
||||
+ else
|
||||
+ max = UINT32_MAX;
|
||||
+ }
|
||||
+
|
||||
+ if (max <= mutex_cnt)
|
||||
return (0);
|
||||
else
|
||||
- max -= dbenv->mutex_cnt;
|
||||
-
|
||||
- return ( __env_alloc_size(max * __mutex_align_size(env)));
|
||||
+ return (__env_alloc_size(
|
||||
+ (max - mutex_cnt) * __mutex_align_size(env)));
|
||||
}
|
||||
|
||||
#ifdef HAVE_MUTEX_SYSTEM_RESOURCES
|
||||
/*
|
||||
* __mutex_resource_return
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--- db-5.3.28/src/dbinc/atomic.h.old 2018-05-23 09:20:04.216914922 +0200
|
||||
+++ db-5.3.28/src/dbinc/atomic.h 2018-05-23 09:20:49.510057897 +0200
|
||||
@@ -144,7 +144,7 @@
|
||||
#define atomic_inc(env, p) __atomic_inc(p)
|
||||
#define atomic_dec(env, p) __atomic_dec(p)
|
||||
#define atomic_compare_exchange(env, p, o, n) \
|
||||
- __atomic_compare_exchange((p), (o), (n))
|
||||
+ __db_atomic_compare_exchange((p), (o), (n))
|
||||
static inline int __atomic_inc(db_atomic_t *p)
|
||||
{
|
||||
int temp;
|
||||
@@ -176,7 +176,7 @@
|
||||
* http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
|
||||
* which configure could be changed to use.
|
||||
*/
|
||||
-static inline int __atomic_compare_exchange(
|
||||
+static inline int __db_atomic_compare_exchange(
|
||||
db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
|
||||
{
|
||||
atomic_value_t was;
|
||||
@@ -0,0 +1,38 @@
|
||||
--- db5.3-5.3.28+dfsg2.orig/dist/aclocal/mutex.m4
|
||||
+++ db5.3-5.3.28+dfsg2/dist/aclocal/mutex.m4
|
||||
@@ -5,7 +5,7 @@ AC_DEFUN(AM_PTHREADS_SHARED, [
|
||||
AC_TRY_RUN([
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
-main() {
|
||||
+int main() {
|
||||
pthread_cond_t cond;
|
||||
pthread_mutex_t mutex;
|
||||
pthread_condattr_t condattr;
|
||||
@@ -49,7 +49,7 @@ AC_DEFUN(AM_PTHREADS_PRIVATE, [
|
||||
AC_TRY_RUN([
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
-main() {
|
||||
+int main() {
|
||||
pthread_cond_t cond;
|
||||
pthread_mutex_t mutex;
|
||||
pthread_condattr_t condattr;
|
||||
@@ -89,7 +89,7 @@ AC_DEFUN(AM_PTHREADS_CONDVAR_DUPINITCHK,
|
||||
AC_TRY_RUN([
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
-main() {
|
||||
+int main() {
|
||||
pthread_cond_t cond;
|
||||
pthread_condattr_t condattr;
|
||||
exit(pthread_condattr_init(&condattr) ||
|
||||
@@ -110,7 +110,7 @@ AC_DEFUN(AM_PTHREADS_RWLOCKVAR_DUPINITCH
|
||||
AC_TRY_RUN([
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
-main() {
|
||||
+int main() {
|
||||
pthread_rwlock_t rwlock;
|
||||
pthread_rwlockattr_t rwlockattr;
|
||||
exit(pthread_rwlockattr_init(&rwlockattr) ||
|
||||
@@ -0,0 +1,20 @@
|
||||
--- db-5.3.28/lang/sql/sqlite/tool/lemon.c.lemon_hash 2013-09-09 17:35:07.000000000 +0200
|
||||
+++ db-5.3.28/lang/sql/sqlite/tool/lemon.c 2017-02-22 13:12:08.564106051 +0100
|
||||
@@ -3428,7 +3428,7 @@
|
||||
int maxdtlength; /* Maximum length of any ".datatype" field. */
|
||||
char *stddt; /* Standardized name for a datatype */
|
||||
int i,j; /* Loop counters */
|
||||
- int hash; /* For hashing the name of a type */
|
||||
+ unsigned hash; /* For hashing the name of a type */
|
||||
const char *name; /* Name of the parser */
|
||||
|
||||
/* Allocate and initialize types[] and allocate stddt[] */
|
||||
@@ -3491,7 +3491,7 @@
|
||||
break;
|
||||
}
|
||||
hash++;
|
||||
- if( hash>=arraysize ) hash = 0;
|
||||
+ if( hash>=(unsigned)arraysize ) hash = 0;
|
||||
}
|
||||
if( types[hash]==0 ){
|
||||
sp->dtnum = hash + 1;
|
||||
@@ -0,0 +1,105 @@
|
||||
--- a/src/dbinc/db_cxx.in
|
||||
+++ b/src/dbinc/db_cxx.in
|
||||
@@ -50,6 +50,23 @@
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
+/*
|
||||
+ * Berkeley DB's C API exposes atomic_init and store as macros, which
|
||||
+ * collides with libc++ declarations when db.h is already included.
|
||||
+ * Hide the macros while pulling in the C++ standard headers, then
|
||||
+ * restore them for the Berkeley DB interfaces below.
|
||||
+ */
|
||||
+#ifdef atomic_init
|
||||
+#pragma push_macro("atomic_init")
|
||||
+#undef atomic_init
|
||||
+#define DB_CXX_RESTORE_ATOMIC_INIT
|
||||
+#endif
|
||||
+#ifdef store
|
||||
+#pragma push_macro("store")
|
||||
+#undef store
|
||||
+#define DB_CXX_RESTORE_STORE
|
||||
+#endif
|
||||
+
|
||||
@cxx_have_stdheaders@
|
||||
#ifdef HAVE_CXX_STDHEADERS
|
||||
#include <iostream>
|
||||
@@ -61,6 +78,15 @@
|
||||
#define __DB_STD(x) x
|
||||
#endif
|
||||
|
||||
+#ifdef DB_CXX_RESTORE_STORE
|
||||
+#pragma pop_macro("store")
|
||||
+#undef DB_CXX_RESTORE_STORE
|
||||
+#endif
|
||||
+#ifdef DB_CXX_RESTORE_ATOMIC_INIT
|
||||
+#pragma pop_macro("atomic_init")
|
||||
+#undef DB_CXX_RESTORE_ATOMIC_INIT
|
||||
+#endif
|
||||
+
|
||||
#include "db.h"
|
||||
|
||||
class Db; // forward
|
||||
--- a/lang/cxx/stl/dbstl_exception.h
|
||||
+++ b/lang/cxx/stl/dbstl_exception.h
|
||||
@@ -13,9 +13,29 @@
|
||||
#include <cstdlib>
|
||||
#include <cstdio>
|
||||
|
||||
+#ifdef atomic_init
|
||||
+#pragma push_macro("atomic_init")
|
||||
+#undef atomic_init
|
||||
+#define DB_STL_RESTORE_ATOMIC_INIT
|
||||
+#endif
|
||||
+#ifdef store
|
||||
+#pragma push_macro("store")
|
||||
+#undef store
|
||||
+#define DB_STL_RESTORE_STORE
|
||||
+#endif
|
||||
+
|
||||
#include <iostream>
|
||||
#include <exception>
|
||||
|
||||
+#ifdef DB_STL_RESTORE_STORE
|
||||
+#pragma pop_macro("store")
|
||||
+#undef DB_STL_RESTORE_STORE
|
||||
+#endif
|
||||
+#ifdef DB_STL_RESTORE_ATOMIC_INIT
|
||||
+#pragma pop_macro("atomic_init")
|
||||
+#undef DB_STL_RESTORE_ATOMIC_INIT
|
||||
+#endif
|
||||
+
|
||||
#include "dbstl_common.h"
|
||||
|
||||
START_NS(dbstl)
|
||||
--- a/lang/cxx/stl/dbstl_element_ref.h
|
||||
+++ b/lang/cxx/stl/dbstl_element_ref.h
|
||||
@@ -9,8 +9,28 @@
|
||||
#ifndef _DB_STL_KDPAIR_H
|
||||
#define _DB_STL_KDPAIR_H
|
||||
|
||||
+#ifdef atomic_init
|
||||
+#pragma push_macro("atomic_init")
|
||||
+#undef atomic_init
|
||||
+#define DB_STL_RESTORE_ATOMIC_INIT
|
||||
+#endif
|
||||
+#ifdef store
|
||||
+#pragma push_macro("store")
|
||||
+#undef store
|
||||
+#define DB_STL_RESTORE_STORE
|
||||
+#endif
|
||||
+
|
||||
#include <iostream>
|
||||
|
||||
+#ifdef DB_STL_RESTORE_STORE
|
||||
+#pragma pop_macro("store")
|
||||
+#undef DB_STL_RESTORE_STORE
|
||||
+#endif
|
||||
+#ifdef DB_STL_RESTORE_ATOMIC_INIT
|
||||
+#pragma pop_macro("atomic_init")
|
||||
+#undef DB_STL_RESTORE_ATOMIC_INIT
|
||||
+#endif
|
||||
+
|
||||
#include "dbstl_common.h"
|
||||
#include "dbstl_dbt.h"
|
||||
#include "dbstl_exception.h"
|
||||
@@ -0,0 +1,19 @@
|
||||
Author: Filip Januš <fjanus@redhat.com>
|
||||
Date: 6 Sep 2021
|
||||
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1992402
|
||||
Patch was created based on the discussion in the previous link
|
||||
diff -ur db-5.3.28/src/os/os_map.c db_patch/src/os/os_map.c
|
||||
--- db-5.3.28/src/os/os_map.c 2013-09-09 17:35:09.000000000 +0200
|
||||
+++ db_patch/src/os/os_map.c 2021-09-09 07:33:12.027328265 +0200
|
||||
@@ -213,7 +213,10 @@
|
||||
if (rp->max < rp->size)
|
||||
rp->max = rp->size;
|
||||
if (ret == 0 && F_ISSET(infop, REGION_CREATE)) {
|
||||
- if (F_ISSET(dbenv, DB_ENV_REGION_INIT))
|
||||
+
|
||||
+ rp->size = rp->max;
|
||||
+
|
||||
+ if (F_ISSET(dbenv, DB_ENV_REGION_INIT))
|
||||
ret = __db_file_write(env, infop->fhp,
|
||||
rp->size / MEGABYTE, rp->size % MEGABYTE, 0x00);
|
||||
else
|
||||
@@ -0,0 +1,31 @@
|
||||
https://bugs.gentoo.org/898074
|
||||
https://bugs.gentoo.org/918936
|
||||
|
||||
-ignoreme: warning: incompatible pointer to integer conversion passing 'pthread_key_t *' (aka 'unsigned int *') to parameter of type 'pthread_key_t' (aka 'unsigned int'); remove & [-Wint-conversion]
|
||||
+ignoreme: error: incompatible pointer to integer conversion passing 'pthread_key_t *' (aka 'unsigned int *') to parameter of type 'pthread_key_t' (aka 'unsigned int'); remove & [-Wint-conversion]
|
||||
34 | return (void *)pthread_getspecific(&key);
|
||||
| ^~~~
|
||||
/usr/include/pthread.h:1305:49: note: passing argument to parameter '__key' here
|
||||
1305 | extern void *pthread_getspecific (pthread_key_t __key) __THROW;
|
||||
| ^
|
||||
-ignoreme: warning: incompatible pointer to integer conversion passing 'pthread_key_t *' (aka 'unsigned int *') to parameter of type 'pthread_key_t' (aka 'unsigned int'); remove & [-Wint-conversion]
|
||||
+ignoreme: error: incompatible pointer to integer conversion passing 'pthread_key_t *' (aka 'unsigned int *') to parameter of type 'pthread_key_t' (aka 'unsigned int'); remove & [-Wint-conversion]
|
||||
37 | pthread_setspecific(&key, p);
|
||||
| ^~~~
|
||||
/usr/include/pthread.h:1308:47: note: passing argument to parameter '__key' here
|
||||
1308 | extern int pthread_setspecific (pthread_key_t __key,
|
||||
--- a/dist/aclocal/tls.m4
|
||||
+++ b/dist/aclocal/tls.m4
|
||||
@@ -42,10 +42,10 @@ AC_DEFUN([AX_TLS], [
|
||||
pthread_key_create(&key, NULL);
|
||||
}
|
||||
static void *get_tls() {
|
||||
- return (void *)pthread_getspecific(&key);
|
||||
+ return (void *)pthread_getspecific(key);
|
||||
}
|
||||
static void set_tls(void *p) {
|
||||
- pthread_setspecific(&key, p);
|
||||
+ pthread_setspecific(key, p);
|
||||
}], [],
|
||||
[ac_cv_tls=pthread])
|
||||
fi
|
||||
@@ -0,0 +1,694 @@
|
||||
--- db-18.1.32/src/btree/bt_cursor.c 2019-02-20 03:21:20.000000000 +0530
|
||||
+++ db-18.1.40/src/btree/bt_cursor.c 2020-05-29 23:28:22.000000000 +0530
|
||||
@@ -282,6 +282,8 @@
|
||||
*
|
||||
* Recno uses the btree bt_ovflsize value -- it's close enough.
|
||||
*/
|
||||
+ if (t->bt_minkey == 0)
|
||||
+ return (DB_RECOVER);
|
||||
cp->ovflsize = B_MINKEY_TO_OVFLSIZE(
|
||||
dbp, F_ISSET(dbc, DBC_OPD) ? 2 : t->bt_minkey, dbp->pgsize);
|
||||
|
||||
--- db-18.1.32/src/btree/bt_verify.c 2019-02-20 03:21:20.000000000 +0530
|
||||
+++ db-18.1.40/src/btree/bt_verify.c 2020-05-29 23:28:22.000000000 +0530
|
||||
@@ -700,7 +700,11 @@
|
||||
isbad = 1;
|
||||
goto err;
|
||||
default:
|
||||
+ if (ret == 0) {
|
||||
+ isbad = 1;
|
||||
+ ret = DB_VERIFY_FATAL;
|
||||
+ goto err;
|
||||
+ }
|
||||
- DB_ASSERT(env, ret != 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1074,7 +1078,7 @@
|
||||
DBT dbta, dbtb, dup_1, dup_2, *p1, *p2, *tmp;
|
||||
ENV *env;
|
||||
PAGE *child;
|
||||
+ db_pgno_t cpgno, grandparent;
|
||||
- db_pgno_t cpgno;
|
||||
VRFY_PAGEINFO *pip;
|
||||
db_indx_t i, *inp;
|
||||
int adj, cmp, freedup_1, freedup_2, isbad, ret, t_ret;
|
||||
@@ -1106,7 +1110,8 @@
|
||||
|
||||
buf1 = buf2 = NULL;
|
||||
|
||||
+ if (LF_ISSET(DB_NOORDERCHK))
|
||||
+ return (EINVAL);
|
||||
- DB_ASSERT(env, !LF_ISSET(DB_NOORDERCHK));
|
||||
|
||||
dupfunc = (dbp->dup_compare == NULL) ? __bam_defcmp : dbp->dup_compare;
|
||||
if (TYPE(h) == P_LDUP)
|
||||
@@ -1115,6 +1120,7 @@
|
||||
func = __bam_defcmp;
|
||||
if (dbp->bt_internal != NULL) {
|
||||
bt = (BTREE *)dbp->bt_internal;
|
||||
+ grandparent = bt->bt_root;
|
||||
if (TYPE(h) == P_IBTREE && (bt->bt_compare != NULL ||
|
||||
dupfunc != __bam_defcmp)) {
|
||||
/*
|
||||
@@ -974,8 +980,24 @@
|
||||
*/
|
||||
mpf = dbp->mpf;
|
||||
child = h;
|
||||
+ cpgno = pgno;
|
||||
while (TYPE(child) == P_IBTREE) {
|
||||
+ if (NUM_ENT(child) == 0) {
|
||||
+ EPRINT((env, DB_STR_A("1088",
|
||||
+ "Page %lu: internal page is empty and should not be",
|
||||
+ "%lu"), (u_long)cpgno));
|
||||
+ ret = DB_VERIFY_BAD;
|
||||
+ goto err;
|
||||
+ }
|
||||
bi = GET_BINTERNAL(dbp, child, 0);
|
||||
+ if (grandparent == bi->pgno) {
|
||||
+ EPRINT((env, DB_STR_A("5552",
|
||||
+ "Page %lu: found twice in the btree",
|
||||
+ "%lu"), (u_long)grandparent));
|
||||
+ ret = DB_VERIFY_FATAL;
|
||||
+ goto err;
|
||||
+ } else
|
||||
+ grandparent = cpgno;
|
||||
cpgno = bi->pgno;
|
||||
if (child != h &&
|
||||
(ret = __memp_fput(mpf,
|
||||
@@ -1402,7 +1416,10 @@
|
||||
*/
|
||||
if (dup_1.data == NULL ||
|
||||
dup_2.data == NULL) {
|
||||
+ if (ovflok) {
|
||||
+ isbad = 1;
|
||||
+ goto err;
|
||||
+ }
|
||||
- DB_ASSERT(env, !ovflok);
|
||||
if (pip != NULL)
|
||||
F_SET(pip,
|
||||
VRFY_INCOMPLETE);
|
||||
@@ -1747,9 +1764,10 @@
|
||||
(ret = __db_vrfy_ovfl_structure(dbp, vdp,
|
||||
child->pgno, child->tlen,
|
||||
flags | DB_ST_OVFL_LEAF)) != 0) {
|
||||
+ if (ret == DB_VERIFY_BAD) {
|
||||
- if (ret == DB_VERIFY_BAD)
|
||||
isbad = 1;
|
||||
+ break;
|
||||
+ } else
|
||||
- else
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -1823,9 +1841,10 @@
|
||||
stflags | DB_ST_TOPLEVEL,
|
||||
NULL, NULL, NULL)) != 0) {
|
||||
if (ret ==
|
||||
+ DB_VERIFY_BAD) {
|
||||
- DB_VERIFY_BAD)
|
||||
isbad = 1;
|
||||
+ break;
|
||||
+ } else
|
||||
- else
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
@@ -1969,7 +1988,10 @@
|
||||
*/
|
||||
|
||||
/* Otherwise, __db_vrfy_childput would be broken. */
|
||||
+ if (child->refcnt < 1) {
|
||||
+ isbad = 1;
|
||||
+ goto err;
|
||||
+ }
|
||||
- DB_ASSERT(env, child->refcnt >= 1);
|
||||
|
||||
/*
|
||||
* An overflow referenced more than twice here
|
||||
@@ -1986,9 +2008,10 @@
|
||||
if ((ret = __db_vrfy_ovfl_structure(dbp,
|
||||
vdp, child->pgno, child->tlen,
|
||||
flags)) != 0) {
|
||||
+ if (ret == DB_VERIFY_BAD) {
|
||||
- if (ret == DB_VERIFY_BAD)
|
||||
isbad = 1;
|
||||
+ break;
|
||||
+ } else
|
||||
- else
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
@@ -2026,9 +2049,10 @@
|
||||
if ((ret = __bam_vrfy_subtree(dbp, vdp, li->pgno,
|
||||
i == 0 ? NULL : li, ri, flags, &child_level,
|
||||
&child_nrecs, NULL)) != 0) {
|
||||
+ if (ret == DB_VERIFY_BAD) {
|
||||
- if (ret == DB_VERIFY_BAD)
|
||||
isbad = 1;
|
||||
+ break;
|
||||
+ } else
|
||||
- else
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -2929,7 +2953,11 @@
|
||||
db_pgno_t current, p;
|
||||
int err_ret, ret;
|
||||
|
||||
+ if (pgset == NULL) {
|
||||
+ EPRINT((dbp->env, DB_STR("5542",
|
||||
+ "Error, database contains no visible pages.")));
|
||||
+ return (DB_RUNRECOVERY);
|
||||
+ }
|
||||
- DB_ASSERT(dbp->env, pgset != NULL);
|
||||
|
||||
mpf = dbp->mpf;
|
||||
h = NULL;
|
||||
--- db-18.1.32/src/db/db_conv.c 2019-02-20 03:21:20.000000000 +0530
|
||||
+++ db-18.1.40/src/db/db_conv.c 2020-05-29 23:28:22.000000000 +0530
|
||||
@@ -493,8 +493,11 @@
|
||||
db_indx_t i, *inp, len, tmp;
|
||||
u_int8_t *end, *p, *pgend;
|
||||
|
||||
- if (pagesize == 0)
|
||||
- return (0);
|
||||
+ /* This function is also used to byteswap logs, so
|
||||
+ * the pagesize might not be an actual page size.
|
||||
+ */
|
||||
+ if (!(pagesize >= 24 && pagesize <= DB_MAX_PGSIZE))
|
||||
+ return (EINVAL);
|
||||
|
||||
if (pgin) {
|
||||
M_32_SWAP(h->lsn.file);
|
||||
@@ -513,26 +516,41 @@
|
||||
pgend = (u_int8_t *)h + pagesize;
|
||||
|
||||
inp = P_INP(dbp, h);
|
||||
- if ((u_int8_t *)inp >= pgend)
|
||||
- goto out;
|
||||
+ if ((u_int8_t *)inp > pgend)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
|
||||
switch (TYPE(h)) {
|
||||
case P_HASH_UNSORTED:
|
||||
case P_HASH:
|
||||
for (i = 0; i < NUM_ENT(h); i++) {
|
||||
+ if ((u_int8_t*)(inp + i) >= pgend)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
+ if (inp[i] == 0)
|
||||
+ continue;
|
||||
if (pgin)
|
||||
M_16_SWAP(inp[i]);
|
||||
+ if (inp[i] >= pagesize)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
|
||||
- if (P_ENTRY(dbp, h, i) >= pgend)
|
||||
- continue;
|
||||
+ if (P_ENTRY(dbp, h, i) >= pgend)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
|
||||
switch (HPAGE_TYPE(dbp, h, i)) {
|
||||
case H_KEYDATA:
|
||||
break;
|
||||
case H_DUPLICATE:
|
||||
+ if (LEN_HITEM(dbp, h, pagesize, i) <
|
||||
+ HKEYDATA_SIZE(0))
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
+
|
||||
len = LEN_HKEYDATA(dbp, h, pagesize, i);
|
||||
p = HKEYDATA_DATA(P_ENTRY(dbp, h, i));
|
||||
- for (end = p + len; p < end;) {
|
||||
+
|
||||
+ end = p + len;
|
||||
+ if (end > pgend)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
+
|
||||
+ while (p < end) {
|
||||
if (pgin) {
|
||||
P_16_SWAP(p);
|
||||
memcpy(&tmp,
|
||||
@@ -544,14 +562,20 @@
|
||||
SWAP16(p);
|
||||
}
|
||||
p += tmp;
|
||||
+ if (p >= end)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
SWAP16(p);
|
||||
}
|
||||
break;
|
||||
case H_OFFDUP:
|
||||
+ if ((inp[i] + HOFFDUP_SIZE) > pagesize)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
p = HOFFPAGE_PGNO(P_ENTRY(dbp, h, i));
|
||||
SWAP32(p); /* pgno */
|
||||
break;
|
||||
case H_OFFPAGE:
|
||||
+ if ((inp[i] + HOFFPAGE_SIZE) > pagesize)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
p = HOFFPAGE_PGNO(P_ENTRY(dbp, h, i));
|
||||
SWAP32(p); /* pgno */
|
||||
SWAP32(p); /* tlen */
|
||||
@@ -559,7 +583,6 @@
|
||||
default:
|
||||
return (__db_pgfmt(env, pg));
|
||||
}
|
||||
-
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -576,8 +599,12 @@
|
||||
case P_LDUP:
|
||||
case P_LRECNO:
|
||||
for (i = 0; i < NUM_ENT(h); i++) {
|
||||
+ if ((u_int8_t *)(inp + i) >= pgend)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
if (pgin)
|
||||
M_16_SWAP(inp[i]);
|
||||
+ if (inp[i] >= pagesize)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
|
||||
/*
|
||||
* In the case of on-page duplicates, key information
|
||||
@@ -597,7 +624,7 @@
|
||||
|
||||
bk = GET_BKEYDATA(dbp, h, i);
|
||||
if ((u_int8_t *)bk >= pgend)
|
||||
- continue;
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
switch (B_TYPE(bk->type)) {
|
||||
case B_KEYDATA:
|
||||
M_16_SWAP(bk->len);
|
||||
@@ -605,6 +632,8 @@
|
||||
case B_DUPLICATE:
|
||||
case B_OVERFLOW:
|
||||
bo = (BOVERFLOW *)bk;
|
||||
+ if (((u_int8_t *)bo + BOVERFLOW_SIZE) > pgend)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
M_32_SWAP(bo->pgno);
|
||||
M_32_SWAP(bo->tlen);
|
||||
break;
|
||||
@@ -618,12 +647,17 @@
|
||||
break;
|
||||
case P_IBTREE:
|
||||
for (i = 0; i < NUM_ENT(h); i++) {
|
||||
+ if ((u_int8_t *)(inp + i) > pgend)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
if (pgin)
|
||||
M_16_SWAP(inp[i]);
|
||||
+ if ((u_int16_t)(inp[i] +
|
||||
+ BINTERNAL_SIZE(0) - 1) > pagesize)
|
||||
+ break;
|
||||
|
||||
bi = GET_BINTERNAL(dbp, h, i);
|
||||
- if ((u_int8_t *)bi >= pgend)
|
||||
- continue;
|
||||
+ if (((u_int8_t *)bi + BINTERNAL_SIZE(0)) > pgend)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
|
||||
M_16_SWAP(bi->len);
|
||||
M_32_SWAP(bi->pgno);
|
||||
@@ -634,6 +668,10 @@
|
||||
break;
|
||||
case B_DUPLICATE:
|
||||
case B_OVERFLOW:
|
||||
+ if ((u_int16_t)(inp[i] +
|
||||
+ BINTERNAL_SIZE(BOVERFLOW_SIZE) - 1) >
|
||||
+ pagesize)
|
||||
+ goto out;
|
||||
bo = (BOVERFLOW *)bi->data;
|
||||
M_32_SWAP(bo->pgno);
|
||||
M_32_SWAP(bo->tlen);
|
||||
@@ -648,12 +686,16 @@
|
||||
break;
|
||||
case P_IRECNO:
|
||||
for (i = 0; i < NUM_ENT(h); i++) {
|
||||
+ if ((u_int8_t *)(inp + i) >= pgend)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
if (pgin)
|
||||
M_16_SWAP(inp[i]);
|
||||
+ if (inp[i] >= pagesize)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
|
||||
ri = GET_RINTERNAL(dbp, h, i);
|
||||
- if ((u_int8_t *)ri >= pgend)
|
||||
- continue;
|
||||
+ if ((((u_int8_t *)ri) + RINTERNAL_SIZE) > pgend)
|
||||
+ return (__db_pgfmt(env, pg));
|
||||
|
||||
M_32_SWAP(ri->pgno);
|
||||
M_32_SWAP(ri->nrecs);
|
||||
--- db-18.1.32/src/db/db_vrfy.c 2019-02-20 03:21:20.000000000 +0530
|
||||
+++ db-18.1.40/src/db/db_vrfy.c 2020-05-29 23:28:22.000000000 +0530
|
||||
@@ -381,8 +381,10 @@
|
||||
vdp, name, 0, lp, rp, flags)) != 0) {
|
||||
if (t_ret == DB_VERIFY_BAD)
|
||||
isbad = 1;
|
||||
+ else {
|
||||
+ ret = t_ret;
|
||||
+ goto err;
|
||||
+ }
|
||||
- else
|
||||
- goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -771,9 +773,10 @@
|
||||
*/
|
||||
if ((t_ret = __memp_fget(mpf, &i,
|
||||
vdp->thread_info, NULL, 0, &h)) != 0) {
|
||||
+ if ((dbp->type == DB_HASH ||
|
||||
- if (dbp->type == DB_HASH ||
|
||||
(dbp->type == DB_QUEUE &&
|
||||
+ F_ISSET(dbp, DB_AM_INMEM))) &&
|
||||
+ t_ret != DB_RUNRECOVERY) {
|
||||
- F_ISSET(dbp, DB_AM_INMEM))) {
|
||||
if ((t_ret =
|
||||
__db_vrfy_getpageinfo(vdp, i, &pip)) != 0)
|
||||
goto err1;
|
||||
@@ -945,6 +948,8 @@
|
||||
return (ret == 0 ? t_ret : ret);
|
||||
}
|
||||
|
||||
+ if (ret == DB_PAGE_NOTFOUND && isbad == 1)
|
||||
+ ret = 0;
|
||||
return ((isbad == 1 && ret == 0) ? DB_VERIFY_BAD : ret);
|
||||
}
|
||||
|
||||
@@ -1581,7 +1586,7 @@
|
||||
if (pgno == PGNO_BASE_MD &&
|
||||
dbtype != DB_QUEUE && meta->last_pgno != vdp->last_pgno) {
|
||||
#ifdef HAVE_FTRUNCATE
|
||||
+ ret = DB_VERIFY_FATAL;
|
||||
- isbad = 1;
|
||||
EPRINT((env, DB_STR_A("0552",
|
||||
"Page %lu: last_pgno is not correct: %lu != %lu",
|
||||
"%lu %lu %lu"), (u_long)pgno,
|
||||
@@ -1622,7 +1627,11 @@
|
||||
|
||||
env = dbp->env;
|
||||
pgset = vdp->pgset;
|
||||
+ if (pgset == NULL) {
|
||||
+ EPRINT((env, DB_STR("5543",
|
||||
+ "Error, database contains no visible pages.")));
|
||||
+ return (DB_RUNRECOVERY);
|
||||
+ }
|
||||
- DB_ASSERT(env, pgset != NULL);
|
||||
|
||||
if ((ret = __db_vrfy_getpageinfo(vdp, meta, &pip)) != 0)
|
||||
return (ret);
|
||||
@@ -2014,7 +2023,8 @@
|
||||
int keyflag, ret, t_ret;
|
||||
|
||||
env = dbp->env;
|
||||
+ if (!LF_ISSET(DB_SALVAGE))
|
||||
+ return (EINVAL);
|
||||
- DB_ASSERT(env, LF_ISSET(DB_SALVAGE));
|
||||
|
||||
/*
|
||||
* !!!
|
||||
@@ -2126,10 +2136,8 @@
|
||||
int (*callback) __P((void *, const void *));
|
||||
u_int32_t flags;
|
||||
{
|
||||
- ENV *env;
|
||||
-
|
||||
- env = dbp->env;
|
||||
- DB_ASSERT(env, LF_ISSET(DB_SALVAGE));
|
||||
+ if (!LF_ISSET(DB_SALVAGE))
|
||||
+ return (EINVAL);
|
||||
|
||||
/* If we got this page in the subdb pass, we can safely skip it. */
|
||||
if (__db_salvage_isdone(vdp, pgno))
|
||||
@@ -2242,8 +2253,8 @@
|
||||
ret = t_ret;
|
||||
break;
|
||||
case SALVAGE_OVERFLOW:
|
||||
+ EPRINT((env, DB_STR("5544", "Invalid page type to salvage.")));
|
||||
+ return (EINVAL);
|
||||
- DB_ASSERT(env, 0); /* Shouldn't ever happen. */
|
||||
- break;
|
||||
case SALVAGE_HASH:
|
||||
if ((t_ret = __ham_salvage(dbp, vdp,
|
||||
pgno, h, handle, callback, flags)) != 0 && ret == 0)
|
||||
@@ -2256,8 +2267,8 @@
|
||||
* Shouldn't happen, but if it does, just do what the
|
||||
* nice man says.
|
||||
*/
|
||||
+ EPRINT((env, DB_STR("5545", "Invalid page type to salvage.")));
|
||||
+ return (EINVAL);
|
||||
- DB_ASSERT(env, 0);
|
||||
- break;
|
||||
}
|
||||
if ((t_ret = __memp_fput(mpf,
|
||||
vdp->thread_info, h, dbp->priority)) != 0 && ret == 0)
|
||||
@@ -2303,8 +2314,8 @@
|
||||
ret = t_ret;
|
||||
break;
|
||||
default:
|
||||
+ EPRINT((env, DB_STR("5546", "Invalid page type to salvage.")));
|
||||
+ return (EINVAL);
|
||||
- DB_ASSERT(env, 0); /* Shouldn't ever happen. */
|
||||
- break;
|
||||
}
|
||||
if ((t_ret = __memp_fput(mpf,
|
||||
vdp->thread_info, h, dbp->priority)) != 0 && ret == 0)
|
||||
@@ -2361,7 +2372,10 @@
|
||||
|
||||
env = dbp->env;
|
||||
|
||||
+ if (himarkp == NULL) {
|
||||
+ __db_msg(env, "Page %lu index has no end.", (u_long)pgno);
|
||||
+ return (DB_VERIFY_FATAL);
|
||||
+ }
|
||||
- DB_ASSERT(env, himarkp != NULL);
|
||||
inp = P_INP(dbp, h);
|
||||
|
||||
/*
|
||||
@@ -2783,7 +2797,11 @@
|
||||
goto err;
|
||||
ovfl_bufsz = bkkey->len + 1;
|
||||
}
|
||||
+ if (subdbname == NULL) {
|
||||
+ EPRINT((env, DB_STR("5547", "Subdatabase cannot be null.")));
|
||||
+ ret = EINVAL;
|
||||
+ goto err;
|
||||
+ }
|
||||
- DB_ASSERT(env, subdbname != NULL);
|
||||
memcpy(subdbname, bkkey->data, bkkey->len);
|
||||
subdbname[bkkey->len] = '\0';
|
||||
}
|
||||
--- db-18.1.32/src/db/db_vrfyutil.c 2019-02-20 03:21:20.000000000 +0530
|
||||
+++ db-18.1.40/src/db/db_vrfyutil.c 2020-05-29 23:28:22.000000000 +0530
|
||||
@@ -214,7 +214,8 @@
|
||||
if ((ret = __db_get(pgdbp,
|
||||
vdp->thread_info, vdp->txn, &key, &data, 0)) == 0) {
|
||||
/* Found it. */
|
||||
+ if (data.size != sizeof(VRFY_PAGEINFO))
|
||||
+ return (DB_VERIFY_FATAL);
|
||||
- DB_ASSERT(env, data.size == sizeof(VRFY_PAGEINFO));
|
||||
pip = data.data;
|
||||
LIST_INSERT_HEAD(&vdp->activepips, pip, links);
|
||||
goto found;
|
||||
@@ -342,7 +343,8 @@
|
||||
F_SET(&data, DB_DBT_USERMEM);
|
||||
|
||||
if ((ret = __db_get(dbp, ip, txn, &key, &data, 0)) == 0) {
|
||||
+ if (data.size != sizeof(int))
|
||||
+ return (EINVAL);
|
||||
- DB_ASSERT(dbp->env, data.size == sizeof(int));
|
||||
} else if (ret == DB_NOTFOUND)
|
||||
val = 0;
|
||||
else
|
||||
@@ -382,7 +384,8 @@
|
||||
F_SET(&data, DB_DBT_USERMEM);
|
||||
|
||||
if ((ret = __db_get(dbp, ip, txn, &key, &data, 0)) == 0) {
|
||||
+ if (data.size != sizeof(int))
|
||||
+ return (DB_VERIFY_FATAL);
|
||||
- DB_ASSERT(dbp->env, data.size == sizeof(int));
|
||||
} else if (ret != DB_NOTFOUND)
|
||||
return (ret);
|
||||
|
||||
@@ -419,7 +422,8 @@
|
||||
if ((ret = __dbc_get(dbc, &key, &data, DB_NEXT)) != 0)
|
||||
return (ret);
|
||||
|
||||
+ if (key.size != sizeof(db_pgno_t))
|
||||
+ return (DB_VERIFY_FATAL);
|
||||
- DB_ASSERT(dbc->env, key.size == sizeof(db_pgno_t));
|
||||
*pgnop = pgno;
|
||||
|
||||
return (0);
|
||||
@@ -566,7 +570,8 @@
|
||||
if ((ret = __dbc_get(dbc, &key, &data, DB_SET)) != 0)
|
||||
return (ret);
|
||||
|
||||
+ if (data.size != sizeof(VRFY_CHILDINFO))
|
||||
+ return (DB_VERIFY_FATAL);
|
||||
- DB_ASSERT(dbc->env, data.size == sizeof(VRFY_CHILDINFO));
|
||||
*cipp = (VRFY_CHILDINFO *)data.data;
|
||||
|
||||
return (0);
|
||||
@@ -594,7 +599,8 @@
|
||||
if ((ret = __dbc_get(dbc, &key, &data, DB_NEXT_DUP)) != 0)
|
||||
return (ret);
|
||||
|
||||
+ if (data.size != sizeof(VRFY_CHILDINFO))
|
||||
+ return (DB_VERIFY_FATAL);
|
||||
- DB_ASSERT(dbc->env, data.size == sizeof(VRFY_CHILDINFO));
|
||||
*cipp = (VRFY_CHILDINFO *)data.data;
|
||||
|
||||
return (0);
|
||||
@@ -721,7 +727,8 @@
|
||||
return (ret);
|
||||
|
||||
while ((ret = __dbc_get(*dbcp, &key, &data, DB_NEXT)) == 0) {
|
||||
+ if (data.size != sizeof(u_int32_t))
|
||||
+ return (DB_VERIFY_FATAL);
|
||||
- DB_ASSERT(dbp->env, data.size == sizeof(u_int32_t));
|
||||
memcpy(&pgtype, data.data, sizeof(pgtype));
|
||||
|
||||
if (skip_overflow && pgtype == SALVAGE_OVERFLOW)
|
||||
@@ -730,8 +737,9 @@
|
||||
if ((ret = __dbc_del(*dbcp, 0)) != 0)
|
||||
return (ret);
|
||||
if (pgtype != SALVAGE_IGNORE) {
|
||||
+ if (key.size != sizeof(db_pgno_t)
|
||||
+ || data.size != sizeof(u_int32_t))
|
||||
+ return (DB_VERIFY_FATAL);
|
||||
- DB_ASSERT(dbp->env, key.size == sizeof(db_pgno_t));
|
||||
- DB_ASSERT(dbp->env, data.size == sizeof(u_int32_t));
|
||||
|
||||
*pgnop = *(db_pgno_t *)key.data;
|
||||
*pgtypep = *(u_int32_t *)data.data;
|
||||
--- db-18.1.32/src/db/partition.c 2019-02-20 03:21:20.000000000 +0530
|
||||
+++ db-18.1.40/src/db/partition.c 2020-05-29 23:28:22.000000000 +0530
|
||||
@@ -461,9 +461,19 @@
|
||||
} else
|
||||
part->nparts = meta->nparts;
|
||||
} else if (meta->nparts != 0 && part->nparts != meta->nparts) {
|
||||
+ ret = EINVAL;
|
||||
__db_errx(env, DB_STR("0656",
|
||||
"Number of partitions does not match."));
|
||||
- ret = EINVAL;
|
||||
+ goto err;
|
||||
+ }
|
||||
+ /*
|
||||
+ * There is no limit on the number of partitions, but I cannot imagine a real
|
||||
+ * database having more than 10000.
|
||||
+ */
|
||||
+ if (meta->nparts > 10000) {
|
||||
+ ret = EINVAL;
|
||||
+ __db_errx(env, DB_STR_A("5553",
|
||||
+ "Too many partitions %lu", "%lu"), (u_long)(meta->nparts));
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -2106,10 +2116,13 @@
|
||||
memcpy(rp->data, key->data, key->size);
|
||||
B_TSET(rp->type, B_KEYDATA);
|
||||
}
|
||||
+vrfy: if ((t_ret = __db_verify(*pdbp, ip, (*pdbp)->fname,
|
||||
+ NULL, handle, callback,
|
||||
+ lp, rp, flags | DB_VERIFY_PARTITION)) != 0 && ret == 0) {
|
||||
+ ret = t_ret;
|
||||
+ if (ret == ENOENT)
|
||||
+ break;
|
||||
+ }
|
||||
-vrfy: if ((t_ret = __db_verify(*pdbp, ip, (*pdbp)->fname,
|
||||
- NULL, handle, callback,
|
||||
- lp, rp, flags | DB_VERIFY_PARTITION)) != 0 && ret == 0)
|
||||
- ret = t_ret;
|
||||
}
|
||||
|
||||
err: if (lp != NULL)
|
||||
--- db-18.1.32/src/hash/hash_page.c 2019-02-20 03:21:20.000000000 +0530
|
||||
+++ db-18.1.40/src/hash/hash_page.c 2020-05-29 23:28:22.000000000 +0530
|
||||
@@ -869,7 +869,11 @@
|
||||
/* Validate that next, prev pointers are OK */
|
||||
n = NUM_ENT(p);
|
||||
dbp = dbc->dbp;
|
||||
+ if (n % 2 != 0) {
|
||||
+ __db_errx(dbp->env, DB_STR_A("5549",
|
||||
+ "Odd number of entries on page: %lu", "%lu"), (u_long)(p->pgno));
|
||||
+ return (DB_VERIFY_FATAL);
|
||||
+ }
|
||||
- DB_ASSERT(dbp->env, n%2 == 0 );
|
||||
|
||||
env = dbp->env;
|
||||
t = dbp->h_internal;
|
||||
@@ -940,7 +944,12 @@
|
||||
if ((ret = __db_prpage(dbp, p, DB_PR_PAGE)) != 0)
|
||||
return (ret);
|
||||
#endif
|
||||
+ if (res >= 0) {
|
||||
+ __db_errx(env, DB_STR_A("5550",
|
||||
+ "Odd number of entries on page: %lu", "%lu"),
|
||||
+ (u_long)p->pgno);
|
||||
+ return (DB_VERIFY_FATAL);
|
||||
+ }
|
||||
- DB_ASSERT(dbp->env, res < 0);
|
||||
}
|
||||
|
||||
prev = curr;
|
||||
--- db-18.1.32/src/hash/hash_verify.c 2019-02-20 03:21:20.000000000 +0530
|
||||
+++ db-18.1.40/src/hash/hash_verify.c 2020-05-29 23:28:22.000000000 +0530
|
||||
@@ -615,7 +615,7 @@
|
||||
isbad = 1;
|
||||
else
|
||||
goto err;
|
||||
+ }
|
||||
- }
|
||||
|
||||
/*
|
||||
* There may be unused hash pages corresponding to buckets
|
||||
@@ -746,7 +746,7 @@
|
||||
"Page %lu: impossible first page in bucket %lu", "%lu %lu"),
|
||||
(u_long)pgno, (u_long)bucket));
|
||||
/* Unsafe to continue. */
|
||||
+ ret = DB_VERIFY_FATAL;
|
||||
- isbad = 1;
|
||||
goto err;
|
||||
}
|
||||
|
||||
@@ -776,7 +776,7 @@
|
||||
EPRINT((env, DB_STR_A("1116",
|
||||
"Page %lu: hash page referenced twice", "%lu"),
|
||||
(u_long)pgno));
|
||||
+ ret = DB_VERIFY_FATAL;
|
||||
- isbad = 1;
|
||||
/* Unsafe to continue. */
|
||||
goto err;
|
||||
} else if ((ret = __db_vrfy_pgset_inc(vdp->pgset,
|
||||
@@ -1307,7 +1307,11 @@
|
||||
COMPQUIET(flags, 0);
|
||||
ip = vdp->thread_info;
|
||||
|
||||
+ if (pgset == NULL) {
|
||||
+ EPRINT((dbp->env, DB_STR("5548",
|
||||
+ "Error, database contains no visible pages.")));
|
||||
+ return (DB_VERIFY_FATAL);
|
||||
+ }
|
||||
- DB_ASSERT(dbp->env, pgset != NULL);
|
||||
|
||||
mpf = dbp->mpf;
|
||||
totpgs = 0;
|
||||
--- db-18.1.32/src/qam/qam_verify.c 2019-02-20 03:21:20.000000000 +0530
|
||||
+++ db-18.1.40/src/qam/qam_verify.c 2020-05-29 23:28:22.000000000 +0530
|
||||
@@ -465,7 +465,14 @@
|
||||
/* Verify/salvage each page. */
|
||||
if ((ret = __db_cursor(dbp, vdp->thread_info, NULL, &dbc, 0)) != 0)
|
||||
return (ret);
|
||||
-begin: for (; i <= stop; i++) {
|
||||
+begin: if ((stop - i) > 100000) {
|
||||
+ EPRINT((env, DB_STR_A("5551",
|
||||
+"Warning, many possible extends files (%lu), will take a long time to verify",
|
||||
+ "%lu"), (u_long)(stop - i)));
|
||||
+ }
|
||||
+ for (; i <= stop; i++) {
|
||||
+ if (i == UINT32_MAX)
|
||||
+ break;
|
||||
/*
|
||||
* If DB_SALVAGE is set, we inspect our database of completed
|
||||
* pages, and skip any we've already printed in the subdb pass.
|
||||
@@ -0,0 +1,75 @@
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[build.flags]
|
||||
configure = [
|
||||
"--bindir=/usr/bin/db5.3",
|
||||
"--includedir=/usr/include/db5.3",
|
||||
"--enable-compat185",
|
||||
"--enable-shared",
|
||||
"--disable-static",
|
||||
"--enable-cxx",
|
||||
"--enable-dbm",
|
||||
"--enable-stl",
|
||||
]
|
||||
configure_file = "dist/configure"
|
||||
post_install = [
|
||||
"install -d $DESTDIR/usr/lib/db5.3",
|
||||
'rm "$DESTDIR/usr/lib/libdb.so"',
|
||||
'rm "$DESTDIR/usr/lib/libdb_cxx.so"',
|
||||
'rm "$DESTDIR/usr/lib/libdb_stl.so"',
|
||||
'ln -s ../libdb-5.3.so "$DESTDIR/usr/lib/db5.3/libdb.so"',
|
||||
'ln -s ../libdb_cxx-5.3.so "$DESTDIR/usr/lib/db5.3/libdb_cxx.so"',
|
||||
'ln -s ../libdb_stl-5.3.so "$DESTDIR/usr/lib/db5.3/libdb_stl.so"',
|
||||
'rm -r "$DESTDIR/usr/docs"',
|
||||
]
|
||||
skip_tests = true
|
||||
make-build-vars = [ "LIBSO_LIBS=-lpthread" ]
|
||||
|
||||
[dependencies]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"libunwind",
|
||||
"libcxx",
|
||||
"sh",
|
||||
]
|
||||
|
||||
[[manual_sources]]
|
||||
files = [
|
||||
"db-5.3.21-memp_stat-upstream-fix.patch",
|
||||
"db-5.3.21-mutex_leak.patch",
|
||||
"db-5.3.28-lemon_hash.patch",
|
||||
"db-5.3.28_cve-2019-2708.patch",
|
||||
"db-5.3.28-mmap-high-cpu-usage.patch",
|
||||
"db-5.3.28-atomic_compare_exchange.patch",
|
||||
"db-5.3.28-fcntl-mutexes-bdb4.8.patch",
|
||||
"db-5.3.28-tls-configure.patch",
|
||||
"db-5.3.28-libcxx12.patch"
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "The Berkeley DB embedded database system v5.3"
|
||||
homepage = "https://www.oracle.com/technology/software/products/berkeley-db/index.html"
|
||||
license = "Sleepycat"
|
||||
name = "db5.3"
|
||||
version = "5.3.28"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
patches = [
|
||||
"db-5.3.21-memp_stat-upstream-fix.patch",
|
||||
"db-5.3.21-mutex_leak.patch",
|
||||
"db-5.3.28-lemon_hash.patch",
|
||||
"db-5.3.28_cve-2019-2708.patch",
|
||||
"db-5.3.28-mmap-high-cpu-usage.patch",
|
||||
"db-5.3.28-atomic_compare_exchange.patch",
|
||||
"db-5.3.28-fcntl-mutexes-bdb4.8.patch",
|
||||
"db-5.3.28-tls-configure.patch",
|
||||
"db-5.3.28-libcxx12.patch"
|
||||
]
|
||||
post_extract = [
|
||||
"cp /usr/share/autoconf/build-aux/config.* dist/",
|
||||
"cd dist && ./s_config",
|
||||
]
|
||||
sha256 = "e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628"
|
||||
url = "https://download.oracle.com/berkeley-db/db-$version.tar.gz"
|
||||
@@ -0,0 +1,8 @@
|
||||
# This file should _only_ export DBUS_SESSION_BUS_ADDRESS and
|
||||
# shouldn't declare any other variables for now. This allows
|
||||
# us to source this file from (a) other services which need
|
||||
# this env and (b) the user's shell configuration files.
|
||||
#
|
||||
# See: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/80734#note_486342
|
||||
|
||||
export DBUS_SESSION_BUS_ADDRESS="unix:path=$XDG_RUNTIME_DIR/bus"
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="Login Message Bus"
|
||||
description="D-Bus Login Session Message Bus"
|
||||
|
||||
supervisor=supervise-daemon
|
||||
command="/usr/bin/dbus-daemon"
|
||||
command_args="--session --nofork --nopidfile --address=$DBUS_SESSION_BUS_ADDRESS --print-address=3"
|
||||
notify=fd:3
|
||||
@@ -0,0 +1,10 @@
|
||||
# Configuration for /etc/init.d/dbus
|
||||
|
||||
# Additional arguments to pass to dbus-daemon.
|
||||
#command_args=
|
||||
|
||||
# Uncomment to use process supervisor.
|
||||
#supervisor=supervise-daemon
|
||||
|
||||
# Move machine-id generated by dbus-uuidgen
|
||||
#machine_id=/etc/machine-id
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/sbin/openrc-run
|
||||
name="System Message Bus"
|
||||
description="D-Bus System Message Bus"
|
||||
|
||||
extra_started_commands="reload"
|
||||
|
||||
command="/usr/bin/dbus-daemon"
|
||||
command_args="--system --nofork --nopidfile --syslog-only ${command_args:-}"
|
||||
command_background="yes"
|
||||
pidfile="/run/$RC_SVCNAME.pid"
|
||||
|
||||
depend() {
|
||||
need localmount
|
||||
after bootmisc
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath -d -m755 -o "${command_user:-root:messagebus}" /run/dbus || return 1
|
||||
|
||||
/usr/bin/dbus-uuidgen --ensure="${machine_id:-/etc/machine-id}"
|
||||
}
|
||||
|
||||
stop_post() {
|
||||
[ ! -S /run/dbus/system_bus_socket ] || rm -f /run/dbus/system_bus_socket
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "Reloading $name configuration"
|
||||
/usr/bin/dbus-send --print-reply --system --type=method_call \
|
||||
--dest=org.freedesktop.DBus \
|
||||
/ org.freedesktop.DBus.ReloadConfig > /dev/null
|
||||
eend $?
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = ["-Dsystem_pid_file=/run/dbus/dbus.pid"]
|
||||
post_install = [
|
||||
"install -Dm755 $DEPOT_SPECDIR/dbus.initd $DESTDIR/etc/init.d/dbus",
|
||||
"install -Dm644 $DEPOT_SPECDIR/dbus.confd $DESTDIR/etc/conf.d/dbus",
|
||||
"install -Dm755 $DEPOT_SPECDIR/dbus-user.initd $DESTDIR/etc/user/init.d/dbus",
|
||||
"install -Dm644 $DEPOT_SPECDIR/dbus-user.confd $DESTDIR/etc/user/conf.d/dbus",
|
||||
"rm -r $DESTDIR/run",
|
||||
"chmod 4750 $DESTDIR/usr/lib/dbus-daemon-launch-helper",
|
||||
]
|
||||
keep = [ "etc/conf.d/dbus", "etc/user/conf.d/dbus" ]
|
||||
skip_tests = true
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"mallard-ducktype",
|
||||
"doxygen",
|
||||
"docbook-xsl",
|
||||
"meson",
|
||||
"python",
|
||||
"xmlto",
|
||||
"yelp-tools",
|
||||
"glib2"
|
||||
]
|
||||
runtime = [
|
||||
"expat",
|
||||
"glibc",
|
||||
"libcap-ng",
|
||||
]
|
||||
|
||||
[[manual_sources]]
|
||||
files = [
|
||||
"dbus.initd",
|
||||
"dbus.confd",
|
||||
"dbus-user.initd",
|
||||
"dbus-user.confd",
|
||||
"postinstall.sh"
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Freedesktop.org message bus system"
|
||||
homepage = "https://www.freedesktop.org/wiki/Software/dbus/"
|
||||
license = "AFL-2.1 OR GPL-2.0-or-later"
|
||||
name = "dbus"
|
||||
version = "1.16.2"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "0ba2a1a4b16afe7bceb2c07e9ce99a8c2c3508e5dec290dbb643384bd6beb7e2"
|
||||
url = "https://dbus.freedesktop.org/releases/dbus/dbus-$version.tar.xz"
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
chown root:messagebus usr/lib/dbus-daemon-launch-helper
|
||||
exec dbus-uuidgen --ensure=etc/machine-id
|
||||
@@ -0,0 +1,21 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = ["-Dbuild-test=false"]
|
||||
no-delete-static = true
|
||||
|
||||
[dependencies]
|
||||
build = ["meson"]
|
||||
|
||||
[package]
|
||||
description = "DirectX headers for using D3D12"
|
||||
homepage = "https://github.com/microsoft/DirectX-Headers"
|
||||
license = "MIT"
|
||||
name = "directx-headers"
|
||||
version = "1.619.1"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
url = "https://github.com/microsoft/DirectX-Headers.git#v$version"
|
||||
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd .
|
||||
|
||||
DTDDIR="usr/share/sgml/docbook-sgml-4.5"
|
||||
|
||||
sed -i \
|
||||
-e '/ISO 8879/d' \
|
||||
-e '/gml/d' \
|
||||
docbook.cat
|
||||
|
||||
cat >> docbook.cat <<'EOF'
|
||||
|
||||
-- Begin Single Major Version catalog changes --
|
||||
|
||||
PUBLIC "-//OASIS//DTD DocBook V4.4//EN" "docbook.dtd"
|
||||
PUBLIC "-//OASIS//DTD DocBook V4.3//EN" "docbook.dtd"
|
||||
PUBLIC "-//OASIS//DTD DocBook V4.2//EN" "docbook.dtd"
|
||||
PUBLIC "-//OASIS//DTD DocBook V4.1//EN" "docbook.dtd"
|
||||
PUBLIC "-//OASIS//DTD DocBook V4.0//EN" "docbook.dtd"
|
||||
|
||||
-- End Single Major Version catalog changes --
|
||||
|
||||
EOF
|
||||
|
||||
install -dm755 "$DESTDIR/$DTDDIR"
|
||||
install -m644 docbook.cat "$DESTDIR/$DTDDIR/catalog"
|
||||
install -m644 ./*.dtd ./*.mod ./*.dcl "$DESTDIR/$DTDDIR"
|
||||
@@ -0,0 +1,24 @@
|
||||
[build]
|
||||
type = "custom"
|
||||
|
||||
[dependencies]
|
||||
runtime = ["sgml-common"]
|
||||
|
||||
[package]
|
||||
description = "Document type definitions for verification of SGML data files against the DocBook rule set."
|
||||
homepage = "https://www.docbook.org/sgml/"
|
||||
license = "LicenseRef-docbook-sgml"
|
||||
name = "docbook-sgml"
|
||||
version = "4.5"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "8043e514e80c6c19cb146b5d37937d1305bf3abf9b0097c36df7f70f611cdf43"
|
||||
url = "https://archive.docbook.org/sgml/$version/docbook-$version.zip"
|
||||
|
||||
[[manual_sources]]
|
||||
files = [
|
||||
"postinstall.sh",
|
||||
"postupdate.sh",
|
||||
"preremove.sh",
|
||||
]
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
install-catalog --add /etc/sgml/sgml-docbook-dtd-4.5.cat \
|
||||
/usr/share/sgml/docbook-sgml-4.5/catalog >/dev/null 2>&1
|
||||
|
||||
install-catalog --add /etc/sgml/sgml-docbook-dtd-4.5.cat \
|
||||
/etc/sgml/sgml-docbook.cat >/dev/null 2>&1
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
install-catalog --add /etc/sgml/sgml-docbook-dtd-4.5.cat \
|
||||
/usr/share/sgml/docbook-sgml-4.5/catalog >/dev/null 2>&1
|
||||
|
||||
install-catalog --add /etc/sgml/sgml-docbook-dtd-4.5.cat \
|
||||
/etc/sgml/sgml-docbook.cat >/dev/null 2>&1
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
install-catalog --remove /etc/sgml/sgml-docbook-dtd-4.5.cat \
|
||||
/usr/share/sgml/docbook-sgml-4.5/catalog >/dev/null 2>&1
|
||||
|
||||
install-catalog --remove /etc/sgml/sgml-docbook-dtd-4.5.cat \
|
||||
/etc/sgml/sgml-docbook.cat >/dev/null 2>&1
|
||||
@@ -0,0 +1,14 @@
|
||||
diff --git a/testing/009/bug.xml b/testing/009/bug.xml
|
||||
index e7aff1d..a8200ff 100644
|
||||
--- a/testing/009/bug.xml
|
||||
+++ b/testing/009/bug.xml
|
||||
@@ -18,7 +18,8 @@
|
||||
<term>Member <ref refid="class_bug_1a1f720954dd97cd1203e80501a6eae74c" kindref="member">Bug::foo</ref> ()</term>
|
||||
</varlistentry>
|
||||
<listitem>
|
||||
- <para><anchor id="bug_1_bug000002"/>Function bug<itemizedlist><listitem><para>list item 1 in bug</para></listitem><listitem><para>list item 2 in bug</para></listitem></itemizedlist></para>
|
||||
+ <para><anchor id="bug_1_bug000002"/>Function bug<itemizedlist><listitem><para>list item 1 in bug</para></listitem><listitem><para>list item 2 in bug</para></listitem></itemizedlist>
|
||||
+</para>
|
||||
</listitem>
|
||||
</variablelist>
|
||||
</para>
|
||||
@@ -0,0 +1,50 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-W no-dev",
|
||||
"-Duse_sys_spdlog:BOOL=ON",
|
||||
"-Duse_sys_sqlite3:BOOL=ON",
|
||||
"-Duse_sys_fmt:BOOL=ON",
|
||||
"-Duse_libclang:BOOL=ON",
|
||||
"-Dbuild_doc:BOOL=OFF",
|
||||
"-G Ninja",
|
||||
]
|
||||
skip_tests = true
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"cmake",
|
||||
"clang",
|
||||
"flex",
|
||||
"python",
|
||||
"ninja"
|
||||
]
|
||||
runtime = [
|
||||
"clang",
|
||||
"fmt",
|
||||
"glibc",
|
||||
"libunwind",
|
||||
"libcxx",
|
||||
"llvm-libs",
|
||||
"spdlog",
|
||||
"sqlite",
|
||||
]
|
||||
|
||||
[[manual_sources]]
|
||||
file = "0001-test-009-bug.patch"
|
||||
|
||||
[package]
|
||||
description = "Documentation system for C++, C, Java, IDL and PHP"
|
||||
homepage = "http://www.doxygen.nl/"
|
||||
license = "GPL-2.0-or-later"
|
||||
name = "doxygen"
|
||||
version = "1.16.1"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
patches = ["0001-test-009-bug.patch"]
|
||||
sha256 = "201ce33b514ea87cc1697c0dcf829692c2695c1812683a9cc622194b05e263a8"
|
||||
url = "https://www.doxygen.nl/files/doxygen-$version.src.tar.gz"
|
||||
@@ -0,0 +1,43 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-DBUILD_SHARED_LIBS=ON",
|
||||
"-DNDEBUG=ON",
|
||||
"-DWITH_FORTIFY_SOURCE=OFF",
|
||||
"-DWITH_STACK_PROTECTOR=OFF",
|
||||
"-G Ninja",
|
||||
]
|
||||
make-test-vars = [ "-j1" ]
|
||||
post_install = [ 'install -Dm 644 src/*/*.m4 -t "$DESTDIR/usr/share/aclocal"' ]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"cmake",
|
||||
"nasm",
|
||||
"ninja",
|
||||
"pandoc",
|
||||
]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"libunwind",
|
||||
"libcxx",
|
||||
"libogg",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Free Lossless Audio Codec"
|
||||
homepage = "https://xiph.org/flac/"
|
||||
license = [
|
||||
"BSD-3-Clause",
|
||||
"GPL-2.0-or-later",
|
||||
]
|
||||
name = "flac"
|
||||
version = "1.5.0"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
post_extract = ["sed -i 's/FLAC__TEST_LEVEL=1/FLAC__TEST_LEVEL=0/' test/CMakeLists.txt"]
|
||||
url = "https://github.com/xiph/flac.git#$version"
|
||||
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
while IFS= read -r f; do
|
||||
link=${1:?}/${f##*/}
|
||||
if [ -e "$f" ] && [ ! -e "$link" ]; then
|
||||
ln -s "/$f" "$link"
|
||||
elif [ ! -e "$f" ] && [ -L "$link" ]; then
|
||||
rm -f "$link"
|
||||
fi
|
||||
done
|
||||
@@ -0,0 +1,12 @@
|
||||
[hook]
|
||||
name = "fontconfig-config"
|
||||
description = "Updating fontconfig configuration..."
|
||||
|
||||
[when]
|
||||
phase = "post"
|
||||
operation = ["install", "remove"]
|
||||
paths = ["usr/share/fontconfig/conf.default/*"]
|
||||
|
||||
[exec]
|
||||
command = "/usr/share/depot.d/scripts/fontconfig/40-fontconfig-config /etc/fonts/conf.d"
|
||||
needs_paths = true
|
||||
@@ -0,0 +1,84 @@
|
||||
diff --git a/test/run-test.sh b/test/run-test.sh
|
||||
index 9b3c91c..73c0d3e 100644
|
||||
--- a/test/run-test.sh
|
||||
+++ b/test/run-test.sh
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/bash
|
||||
+#!/bin/sh
|
||||
# fontconfig/test/run-test.sh
|
||||
#
|
||||
# Copyright © 2000 Keith Packard
|
||||
@@ -84,11 +84,11 @@ fstat() {
|
||||
ret=$(stat -c "$fmt" "$fn")
|
||||
else
|
||||
# BSD
|
||||
- if [ "x$fmt" == "x%Y" ]; then
|
||||
+ if [ "x$fmt" = "x%Y" ]; then
|
||||
ret=$(stat -f "%m" "$fn")
|
||||
- elif [ "x$fmt" == "x%y" ]; then
|
||||
+ elif [ "x$fmt" = "x%y" ]; then
|
||||
ret=$(stat -f "%Sm" -t "%F %T %z" "$fn")
|
||||
- elif [ "x$fmt" == "x%n %s %y %z" ]; then
|
||||
+ elif [ "x$fmt" = "x%n %s %y %z" ]; then
|
||||
ret=$(stat -f "%SN %z %Sm %Sc" -t "%F %T %z" "$fn")
|
||||
else
|
||||
echo "E: Unknown format"
|
||||
diff --git a/test/run-test-map.sh b/test/run-test-map.sh
|
||||
index 869d7b2..c634bb8 100755
|
||||
--- a/test/run-test-map.sh
|
||||
+++ b/test/run-test-map.sh
|
||||
@@ -1,4 +1,4 @@
|
||||
-#!/bin/bash
|
||||
+#!/bin/sh
|
||||
# fontconfig/test/run-test-cache-map.sh
|
||||
#
|
||||
# Copyright © 2018 Keith Packard
|
||||
@@ -41,9 +41,8 @@ EXPECTED="out-map.expected"
|
||||
FCLIST=../fc-list/fc-list$EXEEXT
|
||||
FCCACHE=../fc-cache/fc-cache$EXEEXT
|
||||
|
||||
-which bwrap > /dev/null 2>&1
|
||||
-if [ $? -eq 0 ]; then
|
||||
- BWRAP=`which bwrap`
|
||||
+if command -v bwrap > /dev/null 2>&1; then
|
||||
+ BWRAP=$(command -v bwrap)
|
||||
fi
|
||||
|
||||
FONT1=$TESTDIR/4x6.pcf
|
||||
diff --git a/test/wrapper-script.sh b/test/wrapper-script.sh
|
||||
index 94dcb85..ae68c6d 100755
|
||||
--- a/test/wrapper-script.sh
|
||||
+++ b/test/wrapper-script.sh
|
||||
@@ -1,20 +1,24 @@
|
||||
-#! /bin/bash
|
||||
+#! /bin/sh
|
||||
|
||||
CC=${CC:-gcc}
|
||||
|
||||
case "$1" in
|
||||
*.exe)
|
||||
export WINEPATH=$(${CC} -print-sysroot)/mingw/bin
|
||||
- fccwd=`pwd`
|
||||
- cd $(IFS=:;for i in $PATH; do echo $i|grep mingw> /dev/null; [ $? -eq 0 ] && echo $i; done)
|
||||
- if [ "x$(dirname $@)" = "x." ]; then
|
||||
- /usr/bin/env wine $fccwd/$@
|
||||
+ fccwd=$(pwd)
|
||||
+ mingw_path=$(IFS=:; for i in $PATH; do
|
||||
+ case "$i" in
|
||||
+ *mingw*) printf '%s\n' "$i"; break ;;
|
||||
+ esac
|
||||
+ done)
|
||||
+ cd "$mingw_path" || exit 1
|
||||
+ if [ "$(dirname -- "$1")" = "." ]; then
|
||||
+ /usr/bin/env wine "$fccwd/$1"
|
||||
else
|
||||
- /usr/bin/env wine $@
|
||||
+ /usr/bin/env wine "$@"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
- $@
|
||||
+ "$@"
|
||||
;;
|
||||
esac
|
||||
-
|
||||
@@ -0,0 +1,16 @@
|
||||
[hook]
|
||||
name = "fontconfig-cache"
|
||||
description = "Updating fontconfig cache..."
|
||||
|
||||
[when]
|
||||
phase = "post"
|
||||
operation = ["install", "upgrade", "remove"]
|
||||
paths = [
|
||||
"etc/fonts/conf.d/*",
|
||||
"usr/share/fonts/*",
|
||||
"usr/share/fontconfig/conf.avail/*",
|
||||
"usr/share/fontconfig/conf.default/*",
|
||||
]
|
||||
|
||||
[exec]
|
||||
command = "/usr/bin/fc-cache -s"
|
||||
@@ -0,0 +1,57 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"--wrap-mode=nofallback",
|
||||
"-Dbitmap-conf=noinstall",
|
||||
"-Ddefault-sub-pixel-rendering=noinstall",
|
||||
"-Ddoc-html=disabled",
|
||||
"-Ddoc-pdf=disabled",
|
||||
"-Ddoc-txt=disabled",
|
||||
]
|
||||
post_install = [
|
||||
'mkdir -p "$DESTDIR/usr/share/fontconfig/conf.default"',
|
||||
'for _f in "$DESTDIR"/etc/fonts/conf.d/*.conf; do [ -e "$_f" ] || continue; ln -sf "../conf.avail/${_f##*/}" "$DESTDIR/usr/share/fontconfig/conf.default/${_f##*/}"; rm -f "$_f"; done',
|
||||
'install -Dm644 "$DEPOT_SPECDIR/40-fontconfig-config.toml" -t "$DESTDIR/usr/share/depot.d/hooks"',
|
||||
'install -Dm644 "$DEPOT_SPECDIR/fontconfig-hook.toml" -t "$DESTDIR/usr/share/depot.d/hooks"',
|
||||
'install -D "$DEPOT_SPECDIR/40-fontconfig-config.script" "$DESTDIR/usr/share/depot.d/scripts/fontconfig/40-fontconfig-config"',
|
||||
]
|
||||
keep = [ "etc/fonts/fonts.conf" ]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"docbook-sgml",
|
||||
"gperf",
|
||||
"meson",
|
||||
"perl-sgmls",
|
||||
]
|
||||
runtime = [
|
||||
"sh",
|
||||
"expat",
|
||||
"freetype2",
|
||||
"glibc",
|
||||
]
|
||||
|
||||
[[manual_sources]]
|
||||
files = [
|
||||
"40-fontconfig-config.script",
|
||||
"40-fontconfig-config.toml",
|
||||
"fontconfig-hook.toml",
|
||||
"postinstall.sh",
|
||||
"postupdate.sh",
|
||||
"fontconfig-2.17.1-posixify.patch"
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Library for configuring and customizing font access"
|
||||
homepage = "https://www.freedesktop.org/wiki/Software/fontconfig/"
|
||||
license = "HPND AND Unicode-DFS-2016"
|
||||
name = "fontconfig"
|
||||
version = "2.17.1"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
url = "https://gitlab.freedesktop.org/api/v4/projects/890/packages/generic/fontconfig/$version/fontconfig-$version.tar.xz"
|
||||
patches = [ "fontconfig-2.17.1-posixify.patch" ]
|
||||
@@ -0,0 +1 @@
|
||||
/usr/bin/fc-cache -rs
|
||||
@@ -0,0 +1 @@
|
||||
/usr/bin/fc-cache -rs
|
||||
@@ -0,0 +1,33 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [ "-DFREEGLUT_BUILD_STATIC_LIBS=OFF", "-G Ninja" ]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"cmake",
|
||||
"ninja",
|
||||
"mesa",
|
||||
]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"glu",
|
||||
"libxxf86vm",
|
||||
"libxi",
|
||||
"libx11",
|
||||
"libxrandr",
|
||||
"libgl",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Free OpenGL Utility Toolkit"
|
||||
homepage = "https://freeglut.sourceforge.net/"
|
||||
license = "X11"
|
||||
name = "freeglut"
|
||||
version = "3.8.0"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
url = "https://github.com/FreeGLUTProject/freeglut#v$version"
|
||||
@@ -0,0 +1,42 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
|
||||
Date: Tue, 23 Jun 2015 08:40:29 +0200
|
||||
Subject: [PATCH] Enable table validation modules
|
||||
|
||||
---
|
||||
modules.cfg | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/modules.cfg b/modules.cfg
|
||||
index fa8592b15171..cc97ec1af50a 100644
|
||||
--- a/modules.cfg
|
||||
+++ b/modules.cfg
|
||||
@@ -117,26 +117,26 @@ AUX_MODULES += cache
|
||||
|
||||
# TrueType GX/AAT table validation. Needs `ftgxval.c' below.
|
||||
#
|
||||
-# AUX_MODULES += gxvalid
|
||||
+AUX_MODULES += gxvalid
|
||||
|
||||
# Support for streams compressed with gzip (files with suffix .gz).
|
||||
#
|
||||
# See include/freetype/ftgzip.h for the API.
|
||||
AUX_MODULES += gzip
|
||||
|
||||
# Support for streams compressed with LZW (files with suffix .Z).
|
||||
#
|
||||
# See include/freetype/ftlzw.h for the API.
|
||||
AUX_MODULES += lzw
|
||||
|
||||
# Support for streams compressed with bzip2 (files with suffix .bz2).
|
||||
#
|
||||
# See include/freetype/ftbzip2.h for the API.
|
||||
AUX_MODULES += bzip2
|
||||
|
||||
# OpenType table validation. Needs `ftotval.c' below.
|
||||
#
|
||||
-# AUX_MODULES += otvalid
|
||||
+AUX_MODULES += otvalid
|
||||
|
||||
# Auxiliary PostScript driver component to share common code.
|
||||
#
|
||||
@@ -0,0 +1,22 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
|
||||
Date: Tue, 23 Jun 2015 08:43:07 +0200
|
||||
Subject: [PATCH] Enable subpixel rendering
|
||||
|
||||
---
|
||||
include/freetype/config/ftoption.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
|
||||
index fadfb918742e..6a1f8125dafb 100644
|
||||
--- a/include/freetype/config/ftoption.h
|
||||
+++ b/include/freetype/config/ftoption.h
|
||||
@@ -123,7 +123,7 @@ FT_BEGIN_HEADER
|
||||
* When this macro is not defined, FreeType offers alternative LCD
|
||||
* rendering technology that produces excellent output.
|
||||
*/
|
||||
-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
|
||||
+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
@@ -0,0 +1,22 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
|
||||
Date: Sun, 14 May 2017 18:09:31 +0200
|
||||
Subject: [PATCH] Enable long PCF family names
|
||||
|
||||
---
|
||||
include/freetype/config/ftoption.h | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
|
||||
index 6a1f8125dafb..9e52bad707ed 100644
|
||||
--- a/include/freetype/config/ftoption.h
|
||||
+++ b/include/freetype/config/ftoption.h
|
||||
@@ -934,7 +934,7 @@ FT_BEGIN_HEADER
|
||||
* If this option is activated, it can be controlled with the
|
||||
* `no-long-family-names` property of the 'pcf' driver module.
|
||||
*/
|
||||
-/* #define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES */
|
||||
+#define PCF_CONFIG_OPTION_LONG_FAMILY_NAMES
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
@@ -0,0 +1,11 @@
|
||||
# Subpixel hinting mode can be chosen by setting the right TrueType interpreter
|
||||
# version. The available settings are:
|
||||
#
|
||||
# truetype:interpreter-version=35 # Classic mode (default in 2.6)
|
||||
# truetype:interpreter-version=40 # Minimal mode (default in 2.7)
|
||||
#
|
||||
# There are more properties that can be set, separated by whitespace. Please
|
||||
# refer to the FreeType documentation for details.
|
||||
|
||||
# Uncomment and configure below
|
||||
#export FREETYPE_PROPERTIES="truetype:interpreter-version=40"
|
||||
@@ -0,0 +1,55 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-Dfreetype2:default_library=shared",
|
||||
"-Dfreetype2:error_strings=true",
|
||||
"-Dfreetype2:harfbuzz=dynamic",
|
||||
]
|
||||
post_install = ['install -Dm644 $DEPOT_SPECDIR/freetype2.sh -t "$DESTDIR/etc/profile.d"']
|
||||
keep = [ "etc/profile.d/freetype2.sh" ]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"glib2",
|
||||
"libunwind",
|
||||
"libcxx",
|
||||
"libx11",
|
||||
"meson",
|
||||
"harfbuzz",
|
||||
"cairo"
|
||||
]
|
||||
runtime = [
|
||||
"brotli",
|
||||
"bzip2",
|
||||
"glibc",
|
||||
"libpng",
|
||||
"zlib-ng",
|
||||
"harfbuzz"
|
||||
]
|
||||
|
||||
[[manual_sources]]
|
||||
files = [
|
||||
"0001-Enable-table-validation-modules.patch",
|
||||
"0002-Enable-subpixel-rendering.patch",
|
||||
"0003-Enable-long-PCF-family-names.patch",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Font rasterization library"
|
||||
homepage = "https://www.freetype.org/"
|
||||
license = "FTL OR GPL-2.0-or-later"
|
||||
name = "freetype2"
|
||||
version = "2.14.2"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
patches = [
|
||||
"0001-Enable-table-validation-modules.patch",
|
||||
"0002-Enable-subpixel-rendering.patch",
|
||||
"0003-Enable-long-PCF-family-names.patch",
|
||||
]
|
||||
sha256 = "4b62dcab4c920a1a860369933221814362e699e26f55792516d671e6ff55b5e1"
|
||||
url = "https://download-mirror.savannah.gnu.org/releases/freetype/freetype-$version.tar.xz"
|
||||
@@ -0,0 +1,40 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
|
||||
Date: Fri, 7 Jan 2022 18:59:10 +0000
|
||||
Subject: [PATCH] glib-compile-schemas: Remove noisy deprecation warnings
|
||||
|
||||
While the warnings are useful for developers, Arch Linux users also see
|
||||
them when glib-compile-schemas gets run after upgrades, where they just
|
||||
add noise.
|
||||
|
||||
The alternative to this patch would be redirecting the compiler's stderr
|
||||
to /dev/null, but that might also suppress more useful errors or
|
||||
warnings we want users to see.
|
||||
---
|
||||
gio/glib-compile-schemas.c | 13 -------------
|
||||
1 file changed, 13 deletions(-)
|
||||
|
||||
diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
|
||||
index 81e675f53e8b..1a10a8d098c5 100644
|
||||
--- a/gio/glib-compile-schemas.c
|
||||
+++ b/gio/glib-compile-schemas.c
|
||||
@@ -1232,19 +1232,6 @@ parse_state_start_schema (ParseState *state,
|
||||
return;
|
||||
}
|
||||
|
||||
- if (path && (g_str_has_prefix (path, "/apps/") ||
|
||||
- g_str_has_prefix (path, "/desktop/") ||
|
||||
- g_str_has_prefix (path, "/system/")))
|
||||
- {
|
||||
- gchar *message = NULL;
|
||||
- message = g_strdup_printf (_("Warning: Schema “%s” has path “%s”. "
|
||||
- "Paths starting with "
|
||||
- "“/apps/”, “/desktop/” or “/system/” are deprecated."),
|
||||
- id, path);
|
||||
- g_printerr ("%s\n", message);
|
||||
- g_free (message);
|
||||
- }
|
||||
-
|
||||
state->schema_state = schema_state_new (path, gettext_domain,
|
||||
extends, extends_name, list_of);
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Fabian Bornschein <fabiscafe@mailbox.org>
|
||||
Date: Wed, 19 Feb 2025 09:05:01 +0100
|
||||
Subject: [PATCH] gdesktopappinfo: Add more known terminals
|
||||
|
||||
---
|
||||
gio/gdesktopappinfo.c | 3 +++
|
||||
gio/tests/desktop-app-info.c | 9 +++++++++
|
||||
2 files changed, 12 insertions(+)
|
||||
|
||||
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
|
||||
index 1e5a752ac6d9..4569e272b1cc 100644
|
||||
--- a/gio/gdesktopappinfo.c
|
||||
+++ b/gio/gdesktopappinfo.c
|
||||
@@ -2720,6 +2720,9 @@ prepend_terminal_to_vector (int *argc,
|
||||
const char *exec_arg;
|
||||
} known_terminals[] = {
|
||||
{ "xdg-terminal-exec", NULL },
|
||||
+ { "ghostty", "-e" },
|
||||
+ { "ptyxis", "--" },
|
||||
+ { "app.devsuite.Ptyxis", "--" },
|
||||
{ "kgx", "-e" },
|
||||
{ "gnome-terminal", "--" },
|
||||
{ "mate-terminal", "-x" },
|
||||
diff --git a/gio/tests/desktop-app-info.c b/gio/tests/desktop-app-info.c
|
||||
index aa705f9a4c0e..ae3272c56040 100644
|
||||
--- a/gio/tests/desktop-app-info.c
|
||||
+++ b/gio/tests/desktop-app-info.c
|
||||
@@ -1418,6 +1418,12 @@ get_terminal_divider (const char *terminal_name)
|
||||
{
|
||||
if (g_str_equal (terminal_name, "xdg-terminal-exec"))
|
||||
return NULL;
|
||||
+ if (g_str_equal (terminal_name, "ghostty"))
|
||||
+ return "-e";
|
||||
+ if (g_str_equal (terminal_name, "ptyxis"))
|
||||
+ return "--";
|
||||
+ if (g_str_equal (terminal_name, "app.devsuite.Ptyxis"))
|
||||
+ return "--";
|
||||
if (g_str_equal (terminal_name, "kgx"))
|
||||
return "-e";
|
||||
if (g_str_equal (terminal_name, "gnome-terminal"))
|
||||
@@ -1940,6 +1946,9 @@ main (int argc,
|
||||
guint i;
|
||||
const gchar *supported_terminals[] = {
|
||||
"xdg-terminal-exec",
|
||||
+ "ghostty",
|
||||
+ "ptyxis",
|
||||
+ "app.devsuite.Ptyxis",
|
||||
"kgx",
|
||||
"gnome-terminal",
|
||||
"mate-terminal",
|
||||
@@ -0,0 +1,11 @@
|
||||
[hook]
|
||||
name = "gio-querymodules"
|
||||
description = "Update the GIO module cache"
|
||||
|
||||
[when]
|
||||
phase = "post"
|
||||
operation = ["install", "update", "remove"]
|
||||
paths = ["usr/lib/gio/modules/*.so"]
|
||||
|
||||
[exec]
|
||||
command = "gio-querymodules /usr/lib/gio/modules"
|
||||
@@ -0,0 +1,14 @@
|
||||
[hook]
|
||||
name = "glib-compile-schemas"
|
||||
description = "Compile GSettings XML schema files"
|
||||
|
||||
[when]
|
||||
phase = "post"
|
||||
operation = ["install", "update", "remove"]
|
||||
paths = [
|
||||
"usr/share/glib-2.0/schemas/*.xml",
|
||||
"usr/share/glib-2.0/schemas/*.override",
|
||||
]
|
||||
|
||||
[exec]
|
||||
command = "glib-compile-schemas /usr/share/glib-2.0/schemas"
|
||||
@@ -0,0 +1,68 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-Ddtrace=disabled",
|
||||
"-Dglib_debug=disabled",
|
||||
"-Dintrospection=enabled",
|
||||
"-Dman-pages=enabled",
|
||||
"-Dselinux=disabled",
|
||||
"-Dsysprof=disabled",
|
||||
"-Dsystemtap=disabled",
|
||||
]
|
||||
post_install = [
|
||||
'install -Dt "$DESTDIR/usr/share/depot.d/hooks" -m644 $DEPOT_SPECDIR/gio-querymodules.toml',
|
||||
"""install -Dt "$DESTDIR/usr/share/depot.d/hooks" -m644 $DEPOT_SPECDIR/glib-compile-schemas.toml""",
|
||||
'touch "$DESTDIR/usr/lib/gio/modules/.keep"',
|
||||
'python -m compileall -d /usr/share/glib-2.0/codegen "$DESTDIR/usr/share/glib-2.0/codegen"',
|
||||
'python -O -m compileall -d /usr/share/glib-2.0/codegen "$DESTDIR/usr/share/glib-2.0/codegen"',
|
||||
]
|
||||
skip_tests = true
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"gettext",
|
||||
"meson",
|
||||
"libelf",
|
||||
"shared-mime-info",
|
||||
"python",
|
||||
"python-docutils",
|
||||
"python-packaging",
|
||||
"util-linux",
|
||||
"gobject-introspection",
|
||||
]
|
||||
runtime = [
|
||||
"sh",
|
||||
"glibc",
|
||||
"libffi",
|
||||
"pcre2",
|
||||
"util-linux",
|
||||
"zlib-ng",
|
||||
]
|
||||
|
||||
[[manual_sources]]
|
||||
files = [
|
||||
"0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch",
|
||||
"0002-gdesktopappinfo-Add-more-known-terminals.patch",
|
||||
"gio-querymodules.toml",
|
||||
"glib-compile-schemas.toml"
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Low-level core library that forms the basis for projects such as GTK and GNOME."
|
||||
homepage = "https://gitlab.gnome.org/GNOME/glib"
|
||||
license = "LGPL-2.1-or-later"
|
||||
name = "glib2"
|
||||
version = "2.86.4"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
patches = [
|
||||
"0001-glib-compile-schemas-Remove-noisy-deprecation-warnin.patch",
|
||||
"0002-gdesktopappinfo-Add-more-known-terminals.patch",
|
||||
]
|
||||
url = "https://download.gnome.org/sources/glib/2.86/glib-$version.tar.xz"
|
||||
sha256 = "md5:f2233a826c952aaae42b4a61611a06a4"
|
||||
post_extract = [ "
|
||||
@@ -0,0 +1,28 @@
|
||||
cmake \
|
||||
-Bbuild-static \
|
||||
-GNinja \
|
||||
-DCMAKE_INSTALL_PREFIX='/usr' \
|
||||
-DCMAKE_BUILD_TYPE='None' \
|
||||
-DALLOW_EXTERNAL_SPIRV_TOOLS='ON' \
|
||||
-DBUILD_SHARED_LIBS='OFF'
|
||||
cmake --build build-static
|
||||
|
||||
cmake \
|
||||
-Bbuild-shared \
|
||||
-GNinja \
|
||||
-DCMAKE_INSTALL_PREFIX='/usr' \
|
||||
-DCMAKE_BUILD_TYPE='None' \
|
||||
-DALLOW_EXTERNAL_SPIRV_TOOLS='ON' \
|
||||
-DBUILD_SHARED_LIBS='ON' \
|
||||
-DGLSLANG_TESTS='ON'
|
||||
cmake --build build-shared
|
||||
|
||||
DESTDIR="$DESTDIR" cmake --install build-static
|
||||
DESTDIR="$DESTDIR" cmake --install build-shared
|
||||
|
||||
|
||||
cd "$DESTDIR/usr/lib" || exit 1
|
||||
for lib in *.so; do
|
||||
[ -e "$lib" ] || continue
|
||||
ln -sf "$lib" "$lib.0"
|
||||
done
|
||||
@@ -0,0 +1,30 @@
|
||||
[build]
|
||||
type = "custom"
|
||||
|
||||
[build.flags]
|
||||
no-delete-static = true
|
||||
CXXFLAGS += [ "-ffat-lto-objects" ]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"cmake",
|
||||
"ninja",
|
||||
"spirv-headers",
|
||||
"python",
|
||||
]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"libcxx",
|
||||
"spirv-tools",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "OpenGL and OpenGL ES shader front end and validator"
|
||||
homepage = "https://github.com/KhronosGroup/glslang"
|
||||
license = "BSD-3-Clause"
|
||||
name = "glslang"
|
||||
version = "1.4.341.0"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
url = "https://github.com/KhronosGroup/glslang#vulkan-sdk-$version"
|
||||
@@ -0,0 +1,31 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = ["-Ddefault_library=shared"]
|
||||
|
||||
[dependencies]
|
||||
build = ["meson"]
|
||||
runtime = [
|
||||
"libgl",
|
||||
"glibc",
|
||||
"libcxx",
|
||||
"libunwind",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Mesa OpenGL utility library"
|
||||
homepage = "https://gitlab.freedesktop.org/mesa/glu"
|
||||
license = [
|
||||
"MIT",
|
||||
"SGI-B-2.0",
|
||||
]
|
||||
name = "glu"
|
||||
version = "9.0.3"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "bd43fe12f374b1192eb15fe20e45ff456b9bc26ab57f0eee919f96ca0f8a330f"
|
||||
url = "https://mesa.freedesktop.org/archive/glu/glu-$version.tar.xz"
|
||||
post_extract = [ "echo 'SGI-B-2.0 and MIT' > ./LICENSE" ]
|
||||
@@ -0,0 +1,39 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
post_install = [
|
||||
"python -m compileall -d /usr/lib/gobject-introspection usr/lib/gobject-introspection",
|
||||
"python -O -m compileall -d /usr/lib/gobject-introspection usr/lib/gobject-introspection",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"meson",
|
||||
"python-sphinx",
|
||||
]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"glib2",
|
||||
"libffi",
|
||||
"python",
|
||||
"python-mako",
|
||||
"python-markdown",
|
||||
"python-setuptools",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Introspection system for GObject-based libraries"
|
||||
homepage = "https://wiki.gnome.org/Projects/GObjectIntrospection"
|
||||
license = [
|
||||
"GPL-2.0-or-later",
|
||||
"LGPL-2.0-or-later",
|
||||
]
|
||||
name = "gobject-introspection"
|
||||
version = "1.86.0"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "920d1a3fcedeadc32acff95c2e203b319039dd4b4a08dd1a2dfd283d19c0b9ae"
|
||||
url = "https://download.gnome.org/sources/gobject-introspection/1.86/gobject-introspection-$version.tar.xz"
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
patch -Np1 -i ../3c0ba3b5687632dfc66526544a4e811fe0ec0cd9.patch
|
||||
|
||||
install -vDm 644 fonts/*.otf -t "$DESTDIR/usr/share/fonts/gsfonts/"
|
||||
install -vDm 644 appstream/*.xml -t "$DESTDIR/usr/share/metainfo/"
|
||||
|
||||
install -vdm 755 "$DESTDIR/usr/share/fontconfig/conf.default/"
|
||||
for _config in fontconfig/*.conf; do
|
||||
_config_path="$DESTDIR/usr/share/fontconfig/conf.avail/69-${_config##*/}"
|
||||
install -vDm 644 "$_config" "$_config_path"
|
||||
ln -srf "$_config_path" "$DESTDIR/usr/share/fontconfig/conf.default/"
|
||||
done
|
||||
@@ -0,0 +1,17 @@
|
||||
[build]
|
||||
type = "custom"
|
||||
|
||||
[[manual_sources]]
|
||||
url = "https://github.com/ArtifexSoftware/urw-base35-fonts/commit/3c0ba3b5687632dfc66526544a4e811fe0ec0cd9.patch"
|
||||
|
||||
[package]
|
||||
description = "(URW)++ base 35 font set"
|
||||
homepage = "https://github.com/ArtifexSoftware/urw-base35-fonts"
|
||||
license = "AGPL-3.0-only WITH PS-or-PDF-font-exception-20170817"
|
||||
name = "gsfonts"
|
||||
version = "20200910"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "e0d9b7f11885fdfdc4987f06b2aa0565ad2a4af52b22e5ebf79e1a98abd0ae2f"
|
||||
url = "https://github.com/ArtifexSoftware/urw-base35-fonts/archive/$version/urw-base35-fonts-$version.tar.gz"
|
||||
@@ -0,0 +1,36 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
skip_tests = true
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"yelp-tools",
|
||||
"meson",
|
||||
]
|
||||
runtime = [
|
||||
"docbook-xml",
|
||||
"sh",
|
||||
"docbook-xsl",
|
||||
"glib2",
|
||||
"python",
|
||||
"python-lxml",
|
||||
"python-pygments",
|
||||
"python-parameterized"
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Documentation tool for public library API"
|
||||
homepage = "https://gitlab.gnome.org/GNOME/gtk-doc"
|
||||
license = [
|
||||
"GFDL-1.1-or-later",
|
||||
"GPL-2.0-or-later",
|
||||
]
|
||||
name = "gtk-doc"
|
||||
version = "1.36.0"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
url = "https://gitlab.gnome.org/GNOME/gtk-doc.git#$version"
|
||||
@@ -0,0 +1,47 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = ["-Dcpp_std=c++17"]
|
||||
replace_cflags = [ "-fexceptions=" ]
|
||||
replace_cxxflags = [ "-fexceptions=" ]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"freetype2",
|
||||
"gobject-introspection",
|
||||
"gtk-doc",
|
||||
"help2man",
|
||||
"icu78",
|
||||
"libpng",
|
||||
"libcxx",
|
||||
"meson",
|
||||
"python",
|
||||
"ragel",
|
||||
"cairo"
|
||||
]
|
||||
runtime = [
|
||||
"freetype2",
|
||||
"glib2",
|
||||
"glibc",
|
||||
"libpng",
|
||||
"zlib-ng",
|
||||
"graphite"
|
||||
]
|
||||
test = [
|
||||
"python-setuptools",
|
||||
"python-fonttools",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "OpenType text shaping engine"
|
||||
homepage = "https://harfbuzz.github.io/"
|
||||
license = "MIT"
|
||||
name = "harfbuzz"
|
||||
version = "13.2.1"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "6695da3eb7e1be0aa3092fe4d81433a33b47f4519259c759d729e3a9a55c1429"
|
||||
url = "https://github.com/harfbuzz/harfbuzz/releases/download/$version/harfbuzz-$version.tar.xz"
|
||||
@@ -0,0 +1,28 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
configure = [ "-DHIDAPI_WITH_HIDRAW=OFF", "-DHIDAPI_WITH_LIBUSB=ON" ]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"cmake",
|
||||
"libusb",
|
||||
]
|
||||
runtime = ["glibc"]
|
||||
|
||||
[package]
|
||||
description = "Simple library for communicating with USB and Bluetooth HID devices"
|
||||
homepage = "https://github.com/libusb/hidapi"
|
||||
license = [
|
||||
"BSD-3-Clause",
|
||||
"GPL-3.0-or-Later",
|
||||
"HIDAPI",
|
||||
]
|
||||
name = "hidapi"
|
||||
version = "0.15.0"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "5d84dec684c27b97b921d2f3b73218cb773cf4ea915caee317ac8fc73cef8136"
|
||||
url = "https://github.com/libusb/hidapi/archive/hidapi-$version.tar.gz"
|
||||
@@ -0,0 +1,17 @@
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[build.flags]
|
||||
configure = ["--disable-blacklist"]
|
||||
skip_tests = true
|
||||
|
||||
[package]
|
||||
description = "hardware identification databases"
|
||||
homepage = "https://github.com/vcrhonek/hwdata"
|
||||
license = "GPL-2.0-or-later"
|
||||
name = "hwdata"
|
||||
version = "0.405"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
url = "https://github.com/vcrhonek/hwdata.git#v$version"
|
||||
@@ -0,0 +1,33 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-G Ninja",
|
||||
"-DRUN_TEST_SUITE=ON",
|
||||
"-Wno-dev",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"cmake",
|
||||
"ninja",
|
||||
]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"libcxx",
|
||||
"libunwind",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Intel Graphics Memory Management Library"
|
||||
homepage = "https://github.com/intel/gmmlib/"
|
||||
license = "MIT"
|
||||
name = "intel-gmmlib"
|
||||
version = "22.9.0"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "6ae262b95540681ad5478c63affb880135f772c95410b092009a6f7dfc04a5ba"
|
||||
url = "https://github.com/intel/gmmlib/archive/intel-gmmlib-$version/$name-$version.tar.gz"
|
||||
@@ -0,0 +1,37 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-DINSTALL_DRIVER_SYSCONF=OFF",
|
||||
"-DMEDIA_BUILD_FATAL_WARNINGS=OFF",
|
||||
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5.0",
|
||||
"-G Ninja",
|
||||
"-Wno-dev",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
build = [ "cmake", "ninja" ]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"intel-gmmlib",
|
||||
"libunwind",
|
||||
"libcxx",
|
||||
"libva",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Intel Media Driver for VAAPI Broadwell+ iGPUs"
|
||||
homepage = "https://github.com/intel/media-driver/"
|
||||
license = [
|
||||
"BSD-3-Clause",
|
||||
"MIT",
|
||||
]
|
||||
name = "intel-media-driver"
|
||||
version = "25.4.6"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "e5cf57c66e22359d1ec07d766b04e5da43677b9330999ce0dbf686aac60cf6bb"
|
||||
url = "https://github.com/intel/media-driver/archive/intel-media-$version/$name-$version.tar.gz"
|
||||
@@ -0,0 +1,90 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Tanguy Ortolo <tanguy+debian@ortolo.eu>
|
||||
Date: Fri, 7 Dec 2018 00:00:00 +0000
|
||||
Subject: [PATCH] Fix the crash from #912099
|
||||
|
||||
ITS Tool 2.0.4 crashes when building some documentation, as reported in #912099.
|
||||
This comes from translations with invalid XML markup, which ITS Tool fails to
|
||||
merge (which is not abnormal), and to report these issues, needlessly encodes
|
||||
the original msgstr from unicode to bytes, causing it to be recoded using the
|
||||
default ascii codec, which fails when the msgstr contains anything out of ascii.
|
||||
|
||||
This patch removes the useless decoding, avoiding the failing subsequent
|
||||
recoding. It also explicitly encodes the output strings to be able to print them
|
||||
in all cases, even when the output encoding cannot be detected.
|
||||
|
||||
Bug: https://github.com/itstool/itstool/issues/25
|
||||
Bug-Debian: https://bugs.debian.org/912099
|
||||
Forwarded: https://github.com/itstool/itstool/issues/25
|
||||
---
|
||||
itstool.in | 21 +++++++++++++++++----
|
||||
1 file changed, 17 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/itstool.in b/itstool.in
|
||||
index c21ad4bfeb86..f34673581c88 100755
|
||||
--- a/itstool.in
|
||||
+++ b/itstool.in
|
||||
@@ -44,9 +44,22 @@ if PY3:
|
||||
else:
|
||||
return str(s)
|
||||
ustr_type = str
|
||||
+ def pr_str(s):
|
||||
+ """Return a string that can be safely print()ed"""
|
||||
+ # Since print works on both bytes and unicode, just return the argument
|
||||
+ return s
|
||||
else:
|
||||
string_types = basestring,
|
||||
ustr = ustr_type = unicode
|
||||
+ def pr_str(s):
|
||||
+ """Return a string that can be safely print()ed"""
|
||||
+ if isinstance(s, str):
|
||||
+ # Since print works on str, just return the argument
|
||||
+ return s
|
||||
+ else:
|
||||
+ # print may not work on unicode if the output encoding cannot be
|
||||
+ # detected, so just encode with UTF-8
|
||||
+ return unicode.encode(s, 'utf-8')
|
||||
|
||||
NS_ITS = 'http://www.w3.org/2005/11/its'
|
||||
NS_ITST = 'http://itstool.org/extensions/'
|
||||
@@ -1077,36 +1090,36 @@ class Document (object):
|
||||
if strict:
|
||||
raise
|
||||
else:
|
||||
- sys.stderr.write('Warning: Could not merge %stranslation for msgid:\n%s\n' % (
|
||||
+ sys.stderr.write(pr_str('Warning: Could not merge %stranslation for msgid:\n%s\n' % (
|
||||
(lang + ' ') if lang is not None else '',
|
||||
- msgstr.encode('utf-8')))
|
||||
+ msgstr)))
|
||||
self._xml_err = ''
|
||||
return node
|
||||
def scan_node(node):
|
||||
children = [child for child in xml_child_iter(node)]
|
||||
for child in children:
|
||||
if child.type != 'element':
|
||||
continue
|
||||
if child.ns() is not None and child.ns().content == NS_BLANK:
|
||||
ph_node = msg.get_placeholder(child.name).node
|
||||
if self.has_child_elements(ph_node):
|
||||
self.merge_translations(translations, None, ph_node, strict=strict)
|
||||
newnode = ph_node.copyNode(1)
|
||||
newnode.setTreeDoc(self._doc)
|
||||
child.replaceNode(newnode)
|
||||
else:
|
||||
repl = self.get_translated(ph_node, translations, strict=strict, lang=lang)
|
||||
child.replaceNode(repl)
|
||||
scan_node(child)
|
||||
try:
|
||||
scan_node(trnode)
|
||||
except:
|
||||
if strict:
|
||||
raise
|
||||
else:
|
||||
- sys.stderr.write('Warning: Could not merge %stranslation for msgid:\n%s\n' % (
|
||||
+ sys.stderr.write(pr_str('Warning: Could not merge %stranslation for msgid:\n%s\n' % (
|
||||
(lang + ' ') if lang is not None else '',
|
||||
- msgstr.encode('utf-8')))
|
||||
+ msgstr)))
|
||||
self._xml_err = ''
|
||||
ctxt.doc().freeDoc()
|
||||
return node
|
||||
@@ -0,0 +1,73 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Nils Philippsen <nils@tiptoe.de>
|
||||
Date: Mon, 9 Oct 2023 14:26:43 +0200
|
||||
Subject: [PATCH] Fix insufficiently quoted regular expressions
|
||||
|
||||
These went under the radar until Python 3.12 started warning about them.
|
||||
|
||||
Signed-off-by: Nils Philippsen <nils@tiptoe.de>
|
||||
---
|
||||
itstool.in | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/itstool.in b/itstool.in
|
||||
index f34673581c88..8e8c657aa352 100755
|
||||
--- a/itstool.in
|
||||
+++ b/itstool.in
|
||||
@@ -233,7 +233,7 @@ class Message (object):
|
||||
if not isinstance(text, ustr_type):
|
||||
text = ustr(text, 'utf-8')
|
||||
self._message[-1] += text.replace('&', '&').replace('<', '<').replace('>', '>')
|
||||
- if re.sub('\s+', ' ', text).strip() != '':
|
||||
+ if re.sub(r'\s+', ' ', text).strip() != '':
|
||||
self._empty = False
|
||||
|
||||
def add_entity_ref (self, name):
|
||||
@@ -331,7 +331,7 @@ class Message (object):
|
||||
message += '<_:%s-%i/>' % (msg.name, placeholder)
|
||||
placeholder += 1
|
||||
if not self._preserve:
|
||||
- message = re.sub('\s+', ' ', message).strip()
|
||||
+ message = re.sub(r'\s+', ' ', message).strip()
|
||||
return message
|
||||
|
||||
def get_preserve_space (self):
|
||||
@@ -469,9 +469,9 @@ class LocNote (object):
|
||||
if self._preserve_space:
|
||||
return self.locnote
|
||||
else:
|
||||
- return re.sub('\s+', ' ', self.locnote).strip()
|
||||
+ return re.sub(r'\s+', ' ', self.locnote).strip()
|
||||
elif self.locnoteref is not None:
|
||||
- return '(itstool) link: ' + re.sub('\s+', ' ', self.locnoteref).strip()
|
||||
+ return '(itstool) link: ' + re.sub(r'\s+', ' ', self.locnoteref).strip()
|
||||
return ''
|
||||
|
||||
|
||||
@@ -902,7 +902,7 @@ class Document (object):
|
||||
trans = translations.ugettext('_\x04translator-credits')
|
||||
if trans is None or trans == 'translator-credits':
|
||||
return
|
||||
- regex = re.compile('(.*) \<(.*)\>, (.*)')
|
||||
+ regex = re.compile(r'(.*) \<(.*)\>, (.*)')
|
||||
for credit in trans.split('\n'):
|
||||
match = regex.match(credit)
|
||||
if not match:
|
||||
@@ -937,7 +937,7 @@ class Document (object):
|
||||
prevnode = None
|
||||
if node.prev is not None and node.prev.type == 'text':
|
||||
prevtext = node.prev.content
|
||||
- if re.sub('\s+', '', prevtext) == '':
|
||||
+ if re.sub(r'\s+', '', prevtext) == '':
|
||||
prevnode = node.prev
|
||||
for lang in sorted(list(translations.keys()), reverse=True):
|
||||
locale = self.get_its_locale_filter(node)
|
||||
@@ -1481,7 +1481,7 @@ def match_locale(extrange, locale):
|
||||
localei += 1
|
||||
return True
|
||||
|
||||
-_locale_pattern = re.compile('([a-zA-Z0-9-]+)(_[A-Za-z0-9]+)?(@[A-Za-z0-9]+)?(\.[A-Za-z0-9]+)?')
|
||||
+_locale_pattern = re.compile(r'([a-zA-Z0-9-]+)(_[A-Za-z0-9]+)?(@[A-Za-z0-9]+)?(\.[A-Za-z0-9]+)?')
|
||||
def convert_locale (locale):
|
||||
# Automatically convert POSIX-style locales to BCP47
|
||||
match = _locale_pattern.match(locale)
|
||||
@@ -0,0 +1,31 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Harald van Dijk <harald@gigawatt.nl>
|
||||
Date: Thu, 15 Jun 2023 23:18:11 +0100
|
||||
Subject: [PATCH] Fix handling of untranslated nodes
|
||||
|
||||
If a translation is missing, get_translated returns the node it was
|
||||
called with. But ph_node when passed to get_translated is part of
|
||||
another document and cannot just be reparented, it needs to be cloned.
|
||||
The reparenting leaves things in an inconsistent state where references
|
||||
intended to refer to nodes in the original document no longer do so, and
|
||||
they may then be accessed from those references after the new document
|
||||
has already been freed.
|
||||
|
||||
Fixes bug #36.
|
||||
---
|
||||
itstool.in | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/itstool.in b/itstool.in
|
||||
index 8e8c657aa352..0e273b4c5bfa 100755
|
||||
--- a/itstool.in
|
||||
+++ b/itstool.in
|
||||
@@ -1109,6 +1109,8 @@ class Document (object):
|
||||
child.replaceNode(newnode)
|
||||
else:
|
||||
repl = self.get_translated(ph_node, translations, strict=strict, lang=lang)
|
||||
+ if repl == ph_node:
|
||||
+ repl = repl.copyNode(1)
|
||||
child.replaceNode(repl)
|
||||
scan_node(child)
|
||||
try:
|
||||
@@ -0,0 +1,33 @@
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[dependencies]
|
||||
runtime = [
|
||||
"docbook-xml",
|
||||
"libxml215",
|
||||
"python",
|
||||
]
|
||||
|
||||
[[manual_sources]]
|
||||
files = [
|
||||
"0001-Fix-the-crash-from-912099.patch",
|
||||
"0002-Fix-insufficiently-quoted-regular-expressions.patch",
|
||||
"0003-Fix-handling-of-untranslated-nodes.patch",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Translate XML with PO files using W3C Internationalization Tag Set rules"
|
||||
homepage = "https://itstool.org/"
|
||||
license = "GPL-3.0-only"
|
||||
name = "itstool"
|
||||
version = "2.0.7"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
patches = [
|
||||
"0001-Fix-the-crash-from-912099.patch",
|
||||
"0002-Fix-insufficiently-quoted-regular-expressions.patch",
|
||||
"0003-Fix-handling-of-untranslated-nodes.patch",
|
||||
]
|
||||
post_extract = ["autoreconf -fiv"]
|
||||
url = "https://github.com/itstool/itstool.git#$version"
|
||||
@@ -0,0 +1,19 @@
|
||||
Description: CBR: High quality settings (e.g, -q 0) degrade quality over -q 4
|
||||
Origin: https://sourceforge.net/p/lame/bugs/516/#a26d
|
||||
Forwarded: https://sourceforge.net/p/lame/bugs/516/
|
||||
|
||||
--- a/libmp3lame/lame.c
|
||||
+++ b/libmp3lame/lame.c
|
||||
@@ -1050,6 +1050,11 @@ lame_init_params(lame_global_flags * gfp
|
||||
if (gfp->quality < 0)
|
||||
gfp->quality = LAME_DEFAULT_QUALITY;
|
||||
|
||||
+ /* VBR and ABR don't give good results with noise shaping
|
||||
+ * settings used in quality levels below 4.
|
||||
+ */
|
||||
+ if (gfp->quality < 4)
|
||||
+ gfp->quality = 4;
|
||||
|
||||
if (cfg->vbr == vbr_off)
|
||||
(void) lame_set_VBR_mean_bitrate_kbps(gfp, gfp->brate);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
Description: Add missing symbol(s) to library symbol file
|
||||
Author: Fabian Greffrath <fabian@debian.org>
|
||||
Forwarded: https://sourceforge.net/p/lame/bugs/515/
|
||||
|
||||
--- a/include/libmp3lame.sym
|
||||
+++ b/include/libmp3lame.sym
|
||||
@@ -193,6 +193,7 @@ hip_decode_headers
|
||||
hip_decode1
|
||||
hip_decode1_headers
|
||||
hip_decode1_headersB
|
||||
+hip_finish_pinfo
|
||||
lame_decode_init
|
||||
lame_decode
|
||||
lame_decode_headers
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[build.flags]
|
||||
configure = [
|
||||
"--enable-nasm",
|
||||
"--enable-shared",
|
||||
"--disable-mp3rtp",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
build = ["nasm"]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"ncurses",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "high quality MPEG Audio Layer III (MP3) encoder"
|
||||
homepage = "http://lame.sourceforge.net/"
|
||||
license = "LGPL-2.0-only"
|
||||
name = "lame"
|
||||
version = "3.100"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "b2:6954d30cfd3951ea07762ba5dd7ff27038b78455f423099a225ebf748abddf9970e444456ca5a6179bd381e2205b32293392cb757c203901674860710fe2c183"
|
||||
url = "https://sourceforge.net/projects/lame/files/lame/$version/lame-$version.tar.gz"
|
||||
patches = [ "lame-symbols.patch", "lame-cbr-abr-quality-settings-clamp.patch" ]
|
||||
post_extract = [
|
||||
"sed -i -e '/^lame_init_old$/d' -e '/^hip_finish_pinfo$/d' include/libmp3lame.sym"
|
||||
]
|
||||
|
||||
[[manual_sources]]
|
||||
files = [ "lame-symbols.patch", "lame-cbr-abr-quality-settings-clamp.patch" ]
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[build.flags]
|
||||
configure = [
|
||||
"--with-python3",
|
||||
"--without-python",
|
||||
"--enable-static=no",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"python",
|
||||
"swig",
|
||||
]
|
||||
runtime = ["glibc"]
|
||||
optional = [ "python" ]
|
||||
|
||||
[package]
|
||||
description = "A library for Linux that makes using posix capabilities easy"
|
||||
homepage = "https://people.redhat.com/sgrubb/libcap-ng/"
|
||||
license = [
|
||||
"GPL-2.0-or-later",
|
||||
"LGPL-2.1-or-later",
|
||||
]
|
||||
name = "libcap-ng"
|
||||
version = "0.9.1"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "52418b8940f83dcc00dcd01d187e67c3399ff65f3fa558442e3a21b415cc46c0"
|
||||
url = "https://github.com/stevegrubb/libcap-ng/archive/v$version/libcap-ng-$version.tar.gz"
|
||||
post_extract = [ "touch NEWS", "autoreconf -fiv" ]
|
||||
@@ -0,0 +1,27 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = ["-G Ninja"]
|
||||
source_subdir = "libclc"
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"cmake",
|
||||
"spirv-llvm-translator",
|
||||
"python",
|
||||
"ninja"
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Library requirements of the OpenCL C programming language"
|
||||
homepage = "https://libclc.llvm.org/"
|
||||
license = "Apache-2.0 WITH LLVM-exception"
|
||||
name = "libclc"
|
||||
version = "22.1.1"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "9c6f37f6f5f68d38f435d25f770fc48c62d92b2412205767a16dac2c942f0c95"
|
||||
url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-$version/llvm-project-$version.src.tar.xz"
|
||||
@@ -0,0 +1,26 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"hwdata",
|
||||
"meson",
|
||||
"python",
|
||||
"ninja",
|
||||
]
|
||||
runtime = ["glibc"]
|
||||
|
||||
[package]
|
||||
description = "EDID and DisplayID library"
|
||||
homepage = "https://gitlab.freedesktop.org/emersion/libdisplay-info"
|
||||
license = "MIT"
|
||||
name = "libdisplay-info"
|
||||
version = "0.3.0"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "6ae77cd937f9cf7d1321d35c116062c4911e8447010a6a713ac4286f7a9d5987"
|
||||
url = "https://gitlab.freedesktop.org/emersion/libdisplay-info/-/releases/$version/downloads/libdisplay-info-$version.tar.xz"
|
||||
@@ -0,0 +1,36 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[alternatives]
|
||||
provides = [ "libgl", "libegl", "libgles" ]
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = ["-Dgles1=false"]
|
||||
skip_tests = true
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"libxext",
|
||||
"libx11",
|
||||
"xorgproto",
|
||||
"python",
|
||||
"meson",
|
||||
]
|
||||
runtime = [ "libxext", "mesa", "opengl-driver" ]
|
||||
|
||||
[package]
|
||||
description = "The GL Vendor-Neutral Dispatch library"
|
||||
homepage = "https://gitlab.freedesktop.org/glvnd/libglvnd"
|
||||
license = [
|
||||
"MIT",
|
||||
"BSD-1-Clause",
|
||||
"BSD-3-Clause",
|
||||
]
|
||||
name = "libglvnd"
|
||||
version = "1.7.0"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "2b6e15b06aafb4c0b6e2348124808cbd9b291c647299eaaba2e3202f51ff2f3d"
|
||||
url = "https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v$version/libglvnd-v$version.tar.gz"
|
||||
@@ -0,0 +1,37 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-DENABLE_STATIC=OFF",
|
||||
"-DWITH_JAVA=OFF",
|
||||
"-DWITH_JPEG8=ON",
|
||||
"-G Ninja",
|
||||
"-Wno-dev",
|
||||
]
|
||||
post_install = ['install -vDm 644 src/jpegint.h "$DESTDIR/usr/include"']
|
||||
skip_tests = true
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"cmake",
|
||||
"ninja",
|
||||
"nasm",
|
||||
]
|
||||
runtime = ["glibc"]
|
||||
|
||||
[package]
|
||||
description = "JPEG image codec with accelerated baseline compression and decompression"
|
||||
homepage = "https://libjpeg-turbo.org/"
|
||||
license = [
|
||||
"BSD-3-Clause",
|
||||
"IJG",
|
||||
]
|
||||
name = "libjpeg-turbo"
|
||||
version = "3.1.3"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "075920b826834ac4ddf97661cc73491047855859affd671d52079c6867c1c6c0"
|
||||
url = "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/$version/libjpeg-turbo-$version.tar.gz"
|
||||
@@ -0,0 +1,29 @@
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[build.flags]
|
||||
configure = [
|
||||
"--disable-dependency-tracking",
|
||||
"--disable-examples",
|
||||
"--enable-curl",
|
||||
"--enable-https",
|
||||
"--enable-largefile",
|
||||
"--enable-messages",
|
||||
"--with-pic",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
runtime = ["gnutls"]
|
||||
test = ["curl"]
|
||||
|
||||
[package]
|
||||
description = "small C library that is supposed to make it easy to run an HTTP server as part of another application"
|
||||
homepage = "https://www.gnu.org/software/libmicrohttpd/"
|
||||
license = "LGPL-2.1-or-Later"
|
||||
name = "libmicrohttpd"
|
||||
version = "1.0.2"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "df324fcd0834175dab07483133902d9774a605bfa298025f69883288fd20a8c7"
|
||||
url = "https://mirrors.kernel.org/gnu/libmicrohttpd/libmicrohttpd-$version.tar.gz"
|
||||
@@ -0,0 +1,37 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-G Ninja",
|
||||
"-DBUILD_SHARED_LIBS=ON",
|
||||
]
|
||||
post_install = [ 'install -Dm 644 ogg.m4 -t $DESTDIR/usr/share/aclocal/' ]
|
||||
build_32 = true
|
||||
post_install-lib32 = [ 'true' ]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"cmake",
|
||||
"ninja",
|
||||
]
|
||||
runtime = ["glibc"]
|
||||
|
||||
[dependencies.lib32]
|
||||
build = [
|
||||
"cmake",
|
||||
"ninja",
|
||||
]
|
||||
runtime = ["lib32-glibc"]
|
||||
|
||||
[package]
|
||||
description = "Ogg bitstream and framing library"
|
||||
homepage = "https://www.xiph.org/ogg/"
|
||||
license = "BSD-3-Clause"
|
||||
name = "libogg"
|
||||
version = "1.3.6"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
url = "https://github.com/xiph/ogg.git#v$version"
|
||||
@@ -0,0 +1,35 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-DBUILD_SHARED_LIBS=ON",
|
||||
"-G Ninja",
|
||||
"-Wno-dev",
|
||||
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5"
|
||||
]
|
||||
skip_tests = true
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"alsa-lib",
|
||||
"cmake",
|
||||
"ninja",
|
||||
"libsndfile",
|
||||
"opus",
|
||||
]
|
||||
runtime = ["glibc"]
|
||||
test = ["fftw"]
|
||||
|
||||
[package]
|
||||
description = "An audio sample rate conversion library"
|
||||
homepage = "https://libsndfile.github.io/libsamplerate/"
|
||||
license = "BSD-2-Clause"
|
||||
name = "libsamplerate"
|
||||
version = "0.2.2"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "3258da280511d24b49d6b08615bbe824d0cacc9842b0e4caf11c52cf2b043893"
|
||||
url = "https://github.com/libsndfile/libsamplerate/releases/download/$version/libsamplerate-$version.tar.xz"
|
||||
@@ -0,0 +1,40 @@
|
||||
From 0754562e13d2e63a248a1c82f90b30bc0ffe307c Mon Sep 17 00:00:00 2001
|
||||
From: Alex Stewart <alex.stewart@ni.com>
|
||||
Date: Tue, 10 Oct 2023 16:10:34 -0400
|
||||
Subject: [PATCH] mat4/mat5: fix int overflow in dataend calculation
|
||||
|
||||
The clang sanitizer warns of a possible signed integer overflow when
|
||||
calculating the `dataend` value in `mat4_read_header()`.
|
||||
|
||||
```
|
||||
src/mat4.c:323:41: runtime error: signed integer overflow: 205 * -100663296 cannot be represented in type 'int'
|
||||
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/mat4.c:323:41 in
|
||||
src/mat4.c:323:48: runtime error: signed integer overflow: 838860800 * 4 cannot be represented in type 'int'
|
||||
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior src/mat4.c:323:48 in
|
||||
```
|
||||
|
||||
Cast the offending `rows` and `cols` ints to `sf_count_t` (the type of
|
||||
`dataend` before performing the calculation, to avoid the issue.
|
||||
|
||||
CVE: CVE-2022-33065
|
||||
Fixes: https://github.com/libsndfile/libsndfile/issues/789
|
||||
Fixes: https://github.com/libsndfile/libsndfile/issues/833
|
||||
|
||||
Signed-off-by: Alex Stewart <alex.stewart@ni.com>
|
||||
---
|
||||
src/mat4.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/mat4.c b/src/mat4.c
|
||||
index 0b1b414b4..575683ba1 100644
|
||||
--- a/src/mat4.c
|
||||
+++ b/src/mat4.c
|
||||
@@ -320,7 +320,7 @@ mat4_read_header (SF_PRIVATE *psf)
|
||||
psf->filelength - psf->dataoffset, psf->sf.channels * psf->sf.frames * psf->bytewidth) ;
|
||||
}
|
||||
else if ((psf->filelength - psf->dataoffset) > psf->sf.channels * psf->sf.frames * psf->bytewidth)
|
||||
- psf->dataend = psf->dataoffset + rows * cols * psf->bytewidth ;
|
||||
+ psf->dataend = psf->dataoffset + (sf_count_t) rows * (sf_count_t) cols * psf->bytewidth ;
|
||||
|
||||
psf->datalength = psf->filelength - psf->dataoffset - psf->dataend ;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-DBUILD_SHARED_LIBS=ON",
|
||||
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
|
||||
"-DENABLE_EXTERNAL_LIBS=ON",
|
||||
"-DENABLE_MPEG=OFF",
|
||||
"-Wno-dev",
|
||||
"-G Ninja",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"alsa-lib",
|
||||
"cmake",
|
||||
"ninja",
|
||||
"python",
|
||||
"sqlite",
|
||||
]
|
||||
optional = ["alsa-lib"]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"flac",
|
||||
"lame",
|
||||
"libogg",
|
||||
"libvorbis",
|
||||
"opus",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "C library for reading and writing files containing sampled audio data"
|
||||
homepage = "https://libsndfile.github.io/libsndfile/"
|
||||
license = "LGPL-2.1-or-later"
|
||||
name = "libsndfile"
|
||||
version = "1.2.2"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
patches = ["libsndfile-1.2.2-CVE-2022-33065.patch"]
|
||||
sha256 = "3799ca9924d3125038880367bf1468e53a1b7e3686a934f098b7e1d286cdb80e"
|
||||
url = "https://github.com/libsndfile/libsndfile/releases/download/$version/libsndfile-$version.tar.xz"
|
||||
@@ -0,0 +1,38 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = ["-DCMAKE_POLICY_VERSION_MINIMUM=3.5"]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"cmake",
|
||||
"freeglut",
|
||||
"glu",
|
||||
"mesa",
|
||||
]
|
||||
optional = ["freeglut"]
|
||||
runtime = [
|
||||
"libcxx",
|
||||
"libunwind",
|
||||
"glibc",
|
||||
"jbigkit",
|
||||
"libdeflate",
|
||||
"libjpeg-turbo",
|
||||
"libwebp",
|
||||
"xz",
|
||||
"zlib-ng",
|
||||
"zstd",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Library for manipulation of TIFF images"
|
||||
homepage = "http://www.simplesystems.org/libtiff/"
|
||||
license = "libtiff"
|
||||
name = "libtiff"
|
||||
version = "4.7"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
url = "https://gitlab.com/libtiff/libtiff.git#v$version"
|
||||
@@ -0,0 +1,20 @@
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[build.flags]
|
||||
configure = [ "--disable-udev" ]
|
||||
|
||||
[dependencies]
|
||||
runtime = ["glibc"]
|
||||
|
||||
[package]
|
||||
description = "Library that provides generic access to USB devices"
|
||||
homepage = "https://libusb.info/"
|
||||
license = "LGPL-2.1-or-later"
|
||||
name = "libusb"
|
||||
version = "1.0.29"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
url = "https://github.com/libusb/libusb.git#v$version"
|
||||
post_extract = [ "autoreconf -fiv" ]
|
||||
@@ -0,0 +1,46 @@
|
||||
From 4206d0e15363d188f30f2f3dbcc212fef206fc1d Mon Sep 17 00:00:00 2001
|
||||
From: Simon Ser <contact@emersion.fr>
|
||||
Date: Mon, 11 Mar 2024 23:48:17 +0100
|
||||
Subject: [PATCH] Make wl_drm optional
|
||||
|
||||
Don't error out when vtable->wl_interface is NULL.
|
||||
|
||||
Fetching wl_drm_interface from libEGL used to work but doesn't
|
||||
anymore: it's now a private symbol (wayland-scanner private-code).
|
||||
---
|
||||
src/i965_output_wayland.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/i965_output_wayland.c b/src/i965_output_wayland.c
|
||||
index a6120b7b2..a002cae5b 100644
|
||||
--- a/src/i965_output_wayland.c
|
||||
+++ b/src/i965_output_wayland.c
|
||||
@@ -154,7 +154,7 @@ registry_handle_global(
|
||||
struct va_wl_output * const wl_output = i965->wl_output;
|
||||
struct wl_vtable * const wl_vtable = &wl_output->vtable;
|
||||
|
||||
- if (strcmp(interface, "wl_drm") == 0) {
|
||||
+ if (strcmp(interface, "wl_drm") == 0 && wl_vtable->drm_interface) {
|
||||
wl_output->wl_drm_name = name;
|
||||
wl_output->wl_drm = registry_bind(wl_vtable, wl_output->wl_registry,
|
||||
name, wl_vtable->drm_interface,
|
||||
@@ -472,6 +472,7 @@ i965_output_wayland_init(VADriverContextP ctx)
|
||||
|
||||
wl_vtable = &i965->wl_output->vtable;
|
||||
|
||||
+ /* drm_interface is optional */
|
||||
if (vtable->wl_interface)
|
||||
wl_vtable->drm_interface = vtable->wl_interface;
|
||||
else {
|
||||
@@ -483,9 +484,8 @@ i965_output_wayland_init(VADriverContextP ctx)
|
||||
}
|
||||
|
||||
dso_handle = i965->wl_output->libegl_handle;
|
||||
- if (!dso_get_symbols(dso_handle, wl_vtable, sizeof(*wl_vtable),
|
||||
- libegl_symbols))
|
||||
- goto error;
|
||||
+ dso_get_symbols(dso_handle, wl_vtable, sizeof(*wl_vtable),
|
||||
+ libegl_symbols);
|
||||
}
|
||||
|
||||
i965->wl_output->libwl_client_handle = dso_open(LIBWAYLAND_CLIENT_NAME);
|
||||
@@ -0,0 +1,29 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
|
||||
[dependencies]
|
||||
build = ["meson"]
|
||||
runtime = [
|
||||
"libva",
|
||||
"libdrm",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "VA-API implementation for Intel G45 and HD Graphics family"
|
||||
homepage = "https://01.org/linuxmedia/vaapi"
|
||||
license = "MIT"
|
||||
name = "libva-intel-driver"
|
||||
version = "2.4.1"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
url = "https://github.com/intel/intel-vaapi-driver/releases/download/$version/intel-vaapi-driver-$version.tar.bz2"
|
||||
post_extract = [ '''sed -i '1s/python$/&2/' src/shaders/gpp.py''' ]
|
||||
sha256 = "b2:25888ac7a1a42233c4b0269bd910c5161f99bf22c932b46e20c8c77ed0404bf99702dd9f11b73bc0fd76a3b012ffa1de6c6133cbd7be880428235de9cfcc6ad8"
|
||||
patches = [ "4206d0e15363d188f30f2f3dbcc212fef206fc1d.patch" ]
|
||||
|
||||
[[manual_sources]]
|
||||
file = "4206d0e15363d188f30f2f3dbcc212fef206fc1d.patch"
|
||||
@@ -0,0 +1,39 @@
|
||||
[build]
|
||||
type = "meson"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
keep = [ "etc/libva.conf" ]
|
||||
CFLAGS += [ "-DENABLE_VA_MESSAGING" ]
|
||||
post_install = [ "mkdir -pv $DESTDIR/etc", "echo 'LIBVA_MESSAGING_LEVEL=1' > $DESTDIR/etc/libva.conf" ]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"libglvnd",
|
||||
"meson",
|
||||
"mesa"
|
||||
]
|
||||
optional = [
|
||||
"intel-media-driver",
|
||||
"libva-intel-driver",
|
||||
"libva-mesa-driver",
|
||||
]
|
||||
runtime = [
|
||||
"libdrm",
|
||||
"libgl",
|
||||
"libx11",
|
||||
"libxext",
|
||||
"libxfixes",
|
||||
"wayland",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Video Acceleration (VA) API for Linux"
|
||||
homepage = "https://01.org/linuxmedia/vaapi"
|
||||
license = "MIT"
|
||||
name = "libva"
|
||||
version = "2.23.0"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
url = "https://github.com/intel/libva.git#dbf83dc3b1ce6bad46e1628aaf2da5ef731157b8"
|
||||
@@ -0,0 +1,27 @@
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[build.flags]
|
||||
configure = [
|
||||
"--disable-static",
|
||||
"--enable-shared",
|
||||
]
|
||||
skip_tests = true
|
||||
|
||||
[dependencies]
|
||||
runtime = [
|
||||
"glibc",
|
||||
"libogg",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "Reference implementation of the Ogg Vorbis audio format"
|
||||
homepage = "https://www.xiph.org/vorbis/"
|
||||
license = "BSD-3-Clause"
|
||||
name = "libvorbis"
|
||||
version = "1.3.7"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
post_extract = ["./autogen.sh"]
|
||||
url = "https://github.com/xiph/vorbis.git#0c55fa38933fd4bdb7db7c298b27e7bf2f2c5e98"
|
||||
@@ -0,0 +1,37 @@
|
||||
[build]
|
||||
type = "cmake"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
configure = [
|
||||
"-DWEBP_BUILD_CWEBP=ON",
|
||||
"-DWEBP_BUILD_DWEBP=ON",
|
||||
"-DCMAKE_SKIP_INSTALL_RPATH=ON",
|
||||
"-DWEBP_BUILD_EXTRAS=OFF",
|
||||
"-DWEBP_BUILD_GIF2WEBP=ON",
|
||||
"-DWEBP_BUILD_IMG2WEBP=ON",
|
||||
"-DWEBP_BUILD_VWEBP=OFF",
|
||||
"-G Ninja",
|
||||
]
|
||||
|
||||
[dependencies]
|
||||
build = [
|
||||
"cmake",
|
||||
"ninja",
|
||||
"giflib",
|
||||
"libjpeg-turbo",
|
||||
"libpng",
|
||||
]
|
||||
runtime = ["glibc"]
|
||||
|
||||
[package]
|
||||
description = "WebP image codec library"
|
||||
homepage = "https://developers.google.com/speed/webp/"
|
||||
license = "BSD-3-Clause"
|
||||
name = "libwebp"
|
||||
version = "1.6.0"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "e4ab7009bf0629fd11982d4c2aa83964cf244cffba7347ecd39019a9e38c4564"
|
||||
url = "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-$version.tar.gz"
|
||||
@@ -0,0 +1,31 @@
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[build.flags]
|
||||
configure = ["--disable-static"]
|
||||
|
||||
[dependencies]
|
||||
build = ["xorg-util-macros"]
|
||||
runtime = [
|
||||
"libxext",
|
||||
"libxfixes",
|
||||
"libx11",
|
||||
"glibc",
|
||||
"xorgproto",
|
||||
]
|
||||
|
||||
[package]
|
||||
description = "X11 Input extension library"
|
||||
homepage = "https://xorg.freedesktop.org/"
|
||||
license = [
|
||||
"MIT",
|
||||
"MIT-open-group",
|
||||
"SMLNJ",
|
||||
]
|
||||
name = "libxi"
|
||||
version = "1.8.2"
|
||||
|
||||
[[source]]
|
||||
extract_dir = "$name-$version"
|
||||
sha256 = "d0e0555e53d6e2114eabfa44226ba162d2708501a25e18d99cfb35c094c6c104"
|
||||
url = "https://xorg.freedesktop.org/releases/individual/lib/libXi-$version.tar.xz"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user