diff options
author | davidovski <david@davidovski.xyz> | 2022-05-18 23:40:38 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-05-18 23:40:38 +0100 |
commit | 0b977787374349328a21af0deade30d534cf3978 (patch) | |
tree | 3c2be28ef9a6f74a36f21cd48a34cb06b3080960 /repo/util | |
parent | dccab9b94dcfc5e040647210ba22b9cc4bddc742 (diff) |
fixed gcc loader/linker errors
Diffstat (limited to 'repo/util')
-rw-r--r-- | repo/util/flite/flite.xibuild | 29 | ||||
-rw-r--r-- | repo/util/llvm2/device-mapper.xibuild | 11 | ||||
-rw-r--r-- | repo/util/llvm2/dmeventd.initd | 26 | ||||
-rw-r--r-- | repo/util/llvm2/fix-stdio-usage.patch | 49 | ||||
-rw-r--r-- | repo/util/llvm2/llvm2.xibuild | 47 | ||||
-rw-r--r-- | repo/util/llvm2/lvm.confd | 5 | ||||
-rw-r--r-- | repo/util/llvm2/lvm.initd | 38 | ||||
-rw-r--r-- | repo/util/llvm2/mallinfo.patch | 11 | ||||
-rw-r--r-- | repo/util/llvm2/mlockall-default-config.patch | 22 | ||||
-rw-r--r-- | repo/util/mpdscribble/mpdscribble.xibuild | 22 | ||||
-rw-r--r-- | repo/util/stty/stty.xibuild | 16 |
11 files changed, 276 insertions, 0 deletions
diff --git a/repo/util/flite/flite.xibuild b/repo/util/flite/flite.xibuild new file mode 100644 index 0000000..3fff5dd --- /dev/null +++ b/repo/util/flite/flite.xibuild @@ -0,0 +1,29 @@ +#!/bin/sh + +NAME="flite" +DESC="Open source text to speach engine" + +MAKEDEPS="make " +DEPS="musl alsa-lib" + +PKG_VER=2.2 +SOURCE="https://github.com/festvox/flite/archive/refs/tags/v$PKG_VER.tar.gz" + +prepare () { + sed -i "s/-pd/-p/g" main/Makefile +} + +build () { + ./configure \ + --prefix=/usr \ + --enable-shared \ + --localstatedir=/var \ + --with-audio=linux + make +} + +package () { + make install INSTALLBINDIR="$PKG_DEST"/usr/bin \ + INSTALLLIBDIR="$PKG_DEST"/usr/lib \ + INSTALLINCDIR="$PKG_DEST"/usr/include/flite +} diff --git a/repo/util/llvm2/device-mapper.xibuild b/repo/util/llvm2/device-mapper.xibuild new file mode 100644 index 0000000..8db667b --- /dev/null +++ b/repo/util/llvm2/device-mapper.xibuild @@ -0,0 +1,11 @@ +#!/bin/sh +DESC="Device-mapper event daemon" + +package() { + install -Dm755 dmeventd.initd "$PKG_DEST"/etc/init.d/dmeventd + + add_from_main sbin/dmeventd + add_from_main usr/lib/libdevmapper.a "sbin/dm*" + add_from_main lib/libdevmapper* +} + diff --git a/repo/util/llvm2/dmeventd.initd b/repo/util/llvm2/dmeventd.initd new file mode 100644 index 0000000..c46f8ba --- /dev/null +++ b/repo/util/llvm2/dmeventd.initd @@ -0,0 +1,26 @@ +#!/sbin/openrc-run +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-fs/lvm2/files/dmeventd.initd-2.02.67-r1,v 1.3 2014/02/08 21:17:46 robbat2 Exp $ + +PIDFILE=/run/dmeventd.pid +BIN=/sbin/dmeventd + +depend() { + # As of .67-r1, we call ALL lvm start/stop scripts with --sysinit, that + # means dmeventd is NOT notified, as it cannot be safely running + after lvm device-mapper +} + +start() { + ebegin "Starting dmeventd" + start-stop-daemon --start --exec $BIN --pidfile $PIDFILE + eend $? +} + +stop() { + ebegin "Stopping dmeventd" + start-stop-daemon --stop --exec $BIN --pidfile $PIDFILE + eend $? +} + diff --git a/repo/util/llvm2/fix-stdio-usage.patch b/repo/util/llvm2/fix-stdio-usage.patch new file mode 100644 index 0000000..5ac99fd --- /dev/null +++ b/repo/util/llvm2/fix-stdio-usage.patch @@ -0,0 +1,49 @@ +--- ./tools/lvmcmdline.c ++++ ./tools/lvmcmdline.c +@@ -1252,7 +1252,7 @@ + int err = is_valid_fd(STDERR_FILENO); + + if (!is_valid_fd(STDIN_FILENO) && +- !(stdin = fopen(_PATH_DEVNULL, "r"))) { ++ !freopen(_PATH_DEVNULL, "r", stdin)) { + if (err) + perror("stdin stream open"); + else +@@ -1262,7 +1262,7 @@ + } + + if (!is_valid_fd(STDOUT_FILENO) && +- !(stdout = fopen(_PATH_DEVNULL, "w"))) { ++ !freopen(_PATH_DEVNULL, "w", stdout)) { + if (err) + perror("stdout stream open"); + /* else no stdout */ +@@ -1270,7 +1270,7 @@ + } + + if (!is_valid_fd(STDERR_FILENO) && +- !(stderr = fopen(_PATH_DEVNULL, "w"))) { ++ !freopen(_PATH_DEVNULL, "w", stderr)) { + printf("stderr stream open: %s\n", + strerror(errno)); + return 0; +--- ./lib/commands/toolcontext.c ++++ ./lib/commands/toolcontext.c +@@ -1869,7 +1869,7 @@ + /* FIXME Make this configurable? */ + reset_lvm_errno(1); + +-#ifndef VALGRIND_POOL ++#if !defined(VALGRIND_POOL) && defined(__GLIBC__) + /* Set in/out stream buffering before glibc */ + if (set_buffering + #ifdef SYS_gettid +@@ -2274,7 +2274,7 @@ + + if (cmd->pending_delete_mem) + dm_pool_destroy(cmd->pending_delete_mem); +-#ifndef VALGRIND_POOL ++#if !defined(VALGRIND_POOL) && defined(__GLIBC__) + if (cmd->linebuffer) { + /* Reset stream buffering to defaults */ + if (is_valid_fd(STDIN_FILENO) && diff --git a/repo/util/llvm2/llvm2.xibuild b/repo/util/llvm2/llvm2.xibuild new file mode 100644 index 0000000..cb364ec --- /dev/null +++ b/repo/util/llvm2/llvm2.xibuild @@ -0,0 +1,47 @@ +#!/bin/sh + +NAME="llvm2" +DESC="Logical Volume Manager 2 utilities" + +MAKEDEPS="make " +DEPS="libaio util-linux musl device-mapper" + +PKG_VER=2.02.187 +SOURCE="https://mirrors.kernel.org/sourceware/lvm2/LVM2.$PKG_VER.tgz" +ADDITIONAL="mlockall-default-config.patch mallinfo.patch lvm.initd lvm.confd fix-stdio-usage.patch dmeventd.initd " + +prepare () { + apply_patches +} + +build () { + ./configure \ + --prefix=/usr \ + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static \ + --enable-static_link \ + --disable-nls \ + --disable-readline \ + --enable-pkgconfig \ + --enable-applib \ + --with-thin=internal \ + --enable-dmeventd \ + --enable-cmdlib \ + --with-thin-check=/sbin/thin_check \ + --with-thin-dump=/sbin/thin_dump \ + --with-thin-repair=/sbin/thin_repair \ + --with-dmeventd-path=/sbin/dmeventd \ + --enable-udev_rules + + make +} + +package () { + make DESTDIR="$PKG_DEST" install + install -d "$PKG_DEST"/etc/lvm/archive "$PKG_DEST"/etc/lvm/backup + install -Dm755 lvm.initd "$PKG_DEST"/etc/init.d/lvm + install -Dm644 lvm.confd "$PKG_DEST"/etc/conf.d/lvm + ln -s libdevmapper.so.1.02 "$PKG_DEST"/lib/libdevmapper.so + +} diff --git a/repo/util/llvm2/lvm.confd b/repo/util/llvm2/lvm.confd new file mode 100644 index 0000000..9d150f6 --- /dev/null +++ b/repo/util/llvm2/lvm.confd @@ -0,0 +1,5 @@ +# LVM should normally only be started after mdadm-raid is available +# this is because LVM physical volumes are very often MD devices. + +rc_after="mdadm-raid" + diff --git a/repo/util/llvm2/lvm.initd b/repo/util/llvm2/lvm.initd new file mode 100644 index 0000000..db6adbe --- /dev/null +++ b/repo/util/llvm2/lvm.initd @@ -0,0 +1,38 @@ +#!/sbin/openrc-run + +depend() { + before checkfs fsck swap + after hwdrivers modules device-mapper +} + +dm_in_proc() { + local rc=0 i= + for i in devices misc; do + grep -qs 'device-mapper' /proc/$i + rc=$(($rc + $?)) + done + return $rc +} + +start() { + local rc=0 msg= + ebegin "Setting up the Logical Volume Manager" + if [ -e /proc/modules ] && ! dm_in_proc; then + modprobe dm-mod 2>/dev/null + fi + if [ -d /proc/lvm ] || dm_in_proc; then + vgscan --mknodes --ignorelockingfailure >/dev/null 2>&1 + vgchange --sysinit --activate y >/dev/null 2>&1 + rc=$? + else + rc=1 + fi + eend $rc +} + +stop() { + ebegin "Shutting down the Logical Volume Manager" + vgchange --ignorelockingfailure -a n >/dev/null 2>&1 + eend $? +} + diff --git a/repo/util/llvm2/mallinfo.patch b/repo/util/llvm2/mallinfo.patch new file mode 100644 index 0000000..471a6b2 --- /dev/null +++ b/repo/util/llvm2/mallinfo.patch @@ -0,0 +1,11 @@ +--- ./lib/mm/memlock.c.orig 2015-03-09 11:18:41.560028850 -0100 ++++ ./lib/mm/memlock.c 2015-03-09 11:19:54.504373309 -0100 +@@ -137,7 +137,7 @@ + + static void _allocate_memory(void) + { +-#ifndef VALGRIND_POOL ++#if !defined(VALGRIND_POOL) && defined(__GLIBC__) + void *stack_mem; + struct rlimit limit; + int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks; diff --git a/repo/util/llvm2/mlockall-default-config.patch b/repo/util/llvm2/mlockall-default-config.patch new file mode 100644 index 0000000..305ddee --- /dev/null +++ b/repo/util/llvm2/mlockall-default-config.patch @@ -0,0 +1,22 @@ +--- ./conf/example.conf.in.orig ++++ ./conf/example.conf.in +@@ -1352,7 +1352,7 @@ + # Use the old behavior of mlockall to pin all memory. + # Prior to version 2.02.62, LVM used mlockall() to pin the whole + # process's memory while activating devices. +- use_mlockall = 0 ++ use_mlockall = 1 + + # Configuration option activation/monitoring. + # Monitor LVs that are activated. +--- ./lib/config/defaults.h.orig ++++ ./lib/config/defaults.h +@@ -55,7 +55,7 @@ + #define DEFAULT_LVMLOCKD_LOCK_RETRIES 3 + #define DEFAULT_LVMETAD_UPDATE_WAIT_TIME 10 + #define DEFAULT_PRIORITISE_WRITE_LOCKS 1 +-#define DEFAULT_USE_MLOCKALL 0 ++#define DEFAULT_USE_MLOCKALL 1 + #define DEFAULT_METADATA_READ_ONLY 0 + #define DEFAULT_LVDISPLAY_SHOWS_FULL_DEVICE_PATH 0 + #define DEFAULT_UNKNOWN_DEVICE_NAME "[unknown]" diff --git a/repo/util/mpdscribble/mpdscribble.xibuild b/repo/util/mpdscribble/mpdscribble.xibuild new file mode 100644 index 0000000..a153361 --- /dev/null +++ b/repo/util/mpdscribble/mpdscribble.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +NAME="mpdscribble" +DESC="MPD client which submits information about tracks being played to a scrobbler" + +MAKEDEPS="meson ninja " +DEPS="libmpdclient curl libgcrypt " + +PKG_VER=0.24 +SOURCE="https://github.com/MusicPlayerDaemon/mpdscribble/archive/refs/tags/v$PKG_VER.tar.gz" + +build () { + mkdir build && + cd build && + meson --prefix=/usr \ + .. && + ninja +} + +package () { + DESTDIR=$PKG_DEST ninja install +} diff --git a/repo/util/stty/stty.xibuild b/repo/util/stty/stty.xibuild new file mode 100644 index 0000000..8fd431d --- /dev/null +++ b/repo/util/stty/stty.xibuild @@ -0,0 +1,16 @@ +#!/bin/sh + +MAKEDEPS="make sort" +DEPS="musl sh" + +SOURCE=https://xi.davidovski.xyz/git/other/stty.git +DESC="Stty forked" + +build () { + meson --prefix=/usr build + ninja -C build +} + +package () { + DESTDIR=$PKG_DEST ninja -C build install +} |