initial import
This commit is contained in:
2
jack1/40-audio-privileges.rules
Normal file
2
jack1/40-audio-privileges.rules
Normal file
@@ -0,0 +1,2 @@
|
||||
# rw access to /dev/cpu_dma_latency to prevent CPUs from going into idle state
|
||||
KERNEL=="cpu_dma_latency", GROUP="audio"
|
||||
187
jack1/PKGBUILD
Normal file
187
jack1/PKGBUILD
Normal file
@@ -0,0 +1,187 @@
|
||||
# Maintainer: Jesus E. <heckyel@riseup.net>
|
||||
|
||||
pkgbase=jack
|
||||
_pkgbase=jackd1
|
||||
pkgname=('jack1' 'libjack1')
|
||||
pkgver=0.125.0
|
||||
pkgrel=2
|
||||
_debname=jack-audio-connection-kit
|
||||
_debver=$pkgver
|
||||
_debrel=3
|
||||
arch=('i686' 'x86_64')
|
||||
url='https://jackaudio.org/'
|
||||
makedepends=('celt' 'db' 'doxygen' 'libsamplerate' 'libsndfile'
|
||||
'readline' 'quilt')
|
||||
if [ "$(uname -o)" = 'GNU/Linux' ]; then
|
||||
makedepends+=('zita-alsa-pcmi' 'zita-resampler')
|
||||
fi
|
||||
_url=("https://deb.debian.org/debian/pool/main/${_debname::1}/${_debname}")
|
||||
source=("${_url[0]}/${_debname}_${_debver}.orig.tar.xz"
|
||||
"${_url[0]}/${_debname}_${_debver}-${_debrel}.debian.tar.xz"
|
||||
'40-audio-privileges.rules'
|
||||
'jack1.conf'
|
||||
'jackd.sh'
|
||||
'jackd.confd'
|
||||
'jackd.initd'
|
||||
'remove-system_has_rtprio_limits_conf-function.patch')
|
||||
sha512sums=('31eb6974213ab6692cf8ffead59c9a4e57fcbc4d45766b0905adf92d20c203564064fddf7340ba6344767e8692eccf0304cf330986cad10e9f664e2b107dff62'
|
||||
'f9720ba081c90f224474eb23324c879402867c5b526cff10e7855475e159b604ac4edca03613a1abd033be2fcc79f5616b64113a56d4b1773d324f8915213aea'
|
||||
'7a8383fe2820b89159c4532a11eca6103a9d3001f20bb73d84f56512a885ac756deeca918627d88902f864ac96abeb2843b6bc9692b4d94150c08b1ebfa6cffe'
|
||||
'db133c903754a6eb90031bc195b9af0da329594ab49ef770d4340f82179c84909f19833c7d0bc762533aa2db5b90b6f8c8911177dc0cff8ac4032db8e522b32a'
|
||||
'00350094e1be304d6ebf9c850a942d84a94a06040c0f892caebeb604e426000e77ba8a566ce5f06156b5b3589cef3c761a8aca294f95b687cd968bdc41126c14'
|
||||
'0478d821a280a74c2e7f58147cbe981201e7d06ae19e24c8cebacc43e802c0e3ba0330589b8a2a399269e6392188beec542da519be8b96a48105c5303057e77a'
|
||||
'7761988c17e61cc485bbe0e720836ddeefe14dc7e8d473d44db165e9fb6d7be3aca152171f11baa8f1294d01f76e79abd164aa5b1c9107c4edd878ace81be6c2'
|
||||
'7a462bff22da14f21a2514e28a32f5c1e731588270a4b81f4e1cf8242b0f151d805707df55ea4ae21ceef80f01c6873e8427c1b65ff460d0c926f4cf6cc94bc1')
|
||||
|
||||
prepare() {
|
||||
cd "${srcdir}/${_pkgbase}-${pkgver}"
|
||||
|
||||
if [ "${pkgver%.*}" = "${_debver%.*}" ]; then
|
||||
# Debian patches
|
||||
export QUILT_PATCHES='debian/patches'
|
||||
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
||||
export QUILT_DIFF_ARGS='--no-timestamps'
|
||||
|
||||
mv "${srcdir}/debian" '.'
|
||||
|
||||
# Doesn't apply
|
||||
rm -v 'debian/patches/2001_debian_lib64.patch' || true
|
||||
|
||||
quilt 'push' -av
|
||||
fi
|
||||
unset QUILT_PATCHES QUILT_REFRESH_ARGS QUILT_DIFF_ARGS
|
||||
|
||||
# remove system_has_rtprio_limits_conf() from pam configuration
|
||||
patch -p '1' -i "${srcdir}/remove-system_has_rtprio_limits_conf-function.patch"
|
||||
|
||||
# fix zalsa support
|
||||
ln -s ../../jack tools/zalsa
|
||||
|
||||
autoreconf -fiv
|
||||
|
||||
# use sun in HyperbolaBSD and alsa in Hyperbola GNU/Linux
|
||||
cp "${srcdir}/jackd.confd" "${srcdir}/_jackd.confd"
|
||||
if [ "$(uname -s)" = 'HyperbolaBSD' ]; then
|
||||
sed -i 's|%SYSAUDIO%|-d sun -C /dev/audio0 -P /dev/audio0|' \
|
||||
"${srcdir}/_jackd.confd"
|
||||
elif [ "$(uname -o)" = 'GNU/Linux' ]; then
|
||||
sed -i 's|%SYSAUDIO%|-d alsa -d hw:0|' \
|
||||
"${srcdir}/_jackd.confd"
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "${srcdir}/${_pkgbase}-${pkgver}"
|
||||
|
||||
mkdir "${srcdir}/build"
|
||||
cd "${srcdir}/build"
|
||||
"${srcdir}/${_pkgbase}-${pkgver}/configure" \
|
||||
--prefix='/usr' \
|
||||
--includedir='/usr/include/jack1' \
|
||||
--libdir='/usr/lib/jack1'
|
||||
cd "${OLDPWD}"
|
||||
make -C "${srcdir}/build" V='1'
|
||||
}
|
||||
|
||||
package_jack1() {
|
||||
license=('GPL-2')
|
||||
pkgdesc="A low-latency audio server (legacy version)"
|
||||
backup=('etc/conf.d/jackd')
|
||||
depends=('celt' 'libjack1' 'libsndfile' 'readline')
|
||||
if [ "$(uname -o)" = 'GNU/Linux' ]; then
|
||||
depends+=('zita-alsa-pcmi' 'zita-resampler')
|
||||
fi
|
||||
provides=('jack')
|
||||
conflicts=('jack')
|
||||
|
||||
make -C "${srcdir}/build" DESTDIR="${pkgdir}" 'install'
|
||||
|
||||
# move jackd binary file to correct directory and
|
||||
# fix RT priority in GNU/Linux
|
||||
if [ "$(uname -s)" = 'HyperbolaBSD' ]; then
|
||||
install -dm '750' -g '4' "${pkgdir}/usr/sbin"
|
||||
mv "${pkgdir}/usr/bin/jackd" "${pkgdir}/usr/sbin"
|
||||
elif [ "$(uname -o)" = 'GNU/Linux' ]; then
|
||||
install -dm '755' "${pkgdir}/usr/libexec/jack"
|
||||
mv "${pkgdir}/usr/bin/jackd" "${pkgdir}/usr/libexec/jack"
|
||||
install -dm '750' -g '4' "${pkgdir}/usr/sbin"
|
||||
install -Dm '755' "${srcdir}/jackd.sh" "${pkgdir}/usr/sbin/jackd"
|
||||
fi
|
||||
ln -s 'jackd' "${pkgdir}/usr/sbin/jackstart"
|
||||
|
||||
# move jackd manual file to correct directory
|
||||
install -dm '750' -g '4' "${pkgdir}/usr/share/man/man8"
|
||||
for i in 'jackd' 'jackstart'; do
|
||||
mv "${pkgdir}/usr/share/man/man1/${i}.1" \
|
||||
"${pkgdir}/usr/share/man/man8/${i}.8"
|
||||
done
|
||||
unset i
|
||||
rmdir "${pkgdir}/usr/share/man/man1"
|
||||
|
||||
# move jack1 library modules to correct directory
|
||||
mv "${pkgdir}/usr/lib/jack1/jack" "${pkgdir}/usr/lib"
|
||||
|
||||
# remove files, because these are files from libjack1 package
|
||||
rm -r "${pkgdir}/usr/lib/jack1"
|
||||
|
||||
# remove header files, because these are files from libjack1 package
|
||||
for i in 'intclient' 'jack' 'jslist' 'metadata' 'midiport' \
|
||||
'ringbuffer' 'session' 'statistics' 'thread' 'transport' \
|
||||
'types' 'uuid' 'weakjack' 'weakmacros'; do
|
||||
rm "${pkgdir}/usr/include/jack1/jack/${i}.h"
|
||||
done
|
||||
unset i
|
||||
|
||||
# move documents files to correct directory
|
||||
install -dm '755' "${pkgdir}/usr/share/doc"
|
||||
mv "${pkgdir}/usr/share/${_debname}/reference" "${pkgdir}/usr/share/doc/jack"
|
||||
rmdir "${pkgdir}/usr/share/${_debname}"
|
||||
|
||||
# install udev rules
|
||||
install -Dm '644' "${srcdir}/40-audio-privileges.rules" \
|
||||
-t "${pkgdir}/lib/udev/rules.d"
|
||||
|
||||
# install OpenRC
|
||||
install -Dm '644' "${srcdir}/_jackd.confd" "${pkgdir}/etc/conf.d/jackd"
|
||||
install -Dm '755' "${srcdir}/jackd.initd" "${pkgdir}/etc/init.d/jackd"
|
||||
|
||||
# install licenses
|
||||
for i in 'COPYING' 'COPYING.GPL'; do
|
||||
install -Dm '644' "${srcdir}/${_pkgbase}-${pkgver}/${i}" \
|
||||
-t "${pkgdir}/usr/share/licenses/${pkgname}"
|
||||
done
|
||||
unset i
|
||||
}
|
||||
|
||||
package_libjack1() {
|
||||
license=('LGPL-2.1')
|
||||
pkgdesc="A low-latency audio server libraries (legacy version)"
|
||||
depends=('db')
|
||||
makedepends=('quilt')
|
||||
|
||||
make -C "${srcdir}/build" DESTDIR="${pkgdir}" 'install'
|
||||
|
||||
# remove files, because these are files from jack1 package
|
||||
for i in 'usr/bin' 'usr/lib/jack1/jack' 'usr/share'; do
|
||||
rm -r "${pkgdir}/${i}"
|
||||
done
|
||||
unset i
|
||||
|
||||
# remove header file, because these are files from jack1 package
|
||||
rm "${pkgdir}/usr/include/jack1/jack/control.h"
|
||||
|
||||
# rename jack pkgconfig file
|
||||
mv "${pkgdir}/usr/lib/jack1/pkgconfig" "${pkgdir}/usr/lib"
|
||||
mv "${pkgdir}/usr/lib/pkgconfig/jack.pc" \
|
||||
"${pkgdir}/usr/lib/pkgconfig/jack1.pc"
|
||||
|
||||
# install ld.so.conf file
|
||||
install -Dm '644' "${srcdir}/jack1.conf" -t "${pkgdir}/etc/ld.so.conf.d"
|
||||
|
||||
# install licenses
|
||||
for i in 'COPYING' 'COPYING.LGPL'; do
|
||||
install -Dm '644' "${srcdir}/${_pkgbase}-${pkgver}/${i}" \
|
||||
-t "${pkgdir}/usr/share/licenses/${pkgname}"
|
||||
done
|
||||
unset i
|
||||
}
|
||||
1
jack1/jack1.conf
Normal file
1
jack1/jack1.conf
Normal file
@@ -0,0 +1 @@
|
||||
/usr/lib/jack1
|
||||
7
jack1/jackd.confd
Normal file
7
jack1/jackd.confd
Normal file
@@ -0,0 +1,7 @@
|
||||
# /etc/conf.d/jackd: config file for /etc/init.d/jackd
|
||||
|
||||
# Options to pass to the jackd service.
|
||||
# See the jackd(1) man page for more info.
|
||||
|
||||
ARGS='%SYSAUDIO%'
|
||||
#ARGS='-d sndio -d snd/0'
|
||||
20
jack1/jackd.initd
Normal file
20
jack1/jackd.initd
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/sbin/openrc-run
|
||||
# Copyright 2019-2021 Hyperbola Project
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
description='A low-latency audio service'
|
||||
|
||||
command='/usr/sbin/jackd'
|
||||
command_args="${ARGS}"
|
||||
command_background='yes'
|
||||
pidfile='/run/jackd/jackd.pid'
|
||||
retry='TERM/10/KILL/5'
|
||||
|
||||
depend() {
|
||||
need 'localmount'
|
||||
after 'bootmisc' 'modules' 'isapnp' 'coldplug' 'hotplug' 'alsasound' 'sndiod'
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath --directory --owner ':audio' --mode '750' '/run/jackd'
|
||||
}
|
||||
3
jack1/jackd.sh
Normal file
3
jack1/jackd.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
prlimit --rtprio='99' '/usr/libexec/jack/jackd' "${@}"
|
||||
prlimit --memlock='unlimited' --pid "${?}"
|
||||
71
jack1/remove-system_has_rtprio_limits_conf-function.patch
Normal file
71
jack1/remove-system_has_rtprio_limits_conf-function.patch
Normal file
@@ -0,0 +1,71 @@
|
||||
diff --git a/config/os/gnu-linux/sanitycheck.c b/config/os/gnu-linux/sanitycheck.c
|
||||
index f8449f20..ab0fa8bd 100644
|
||||
--- a/config/os/gnu-linux/sanitycheck.c
|
||||
+++ b/config/os/gnu-linux/sanitycheck.c
|
||||
@@ -33,14 +33,10 @@ int sanitycheck (int care_about_realtime,
|
||||
errors++;
|
||||
relogin++;
|
||||
fprintf (stderr, "\nJACK is running in realtime mode, but you are not allowed to use realtime scheduling.\n");
|
||||
+ fprintf (stderr, "Please use the prlimit command like: \n");
|
||||
+ fprintf (stderr, " prlimit --rtprio=99 jackd [options] \n");
|
||||
|
||||
- if (!system_has_rtprio_limits_conf ()) {
|
||||
- errors++;
|
||||
- relogin++;
|
||||
- fprintf (stderr, "Please check your /etc/security/limits.conf for the following line\n");
|
||||
- fprintf (stderr, "and correct/add it if necessary:\n\n");
|
||||
- fprintf (stderr, " @audio - rtprio 99\n");
|
||||
- } else if (!system_has_audiogroup ()) {
|
||||
+ if (!system_has_audiogroup ()) {
|
||||
errors++;
|
||||
relogin++;
|
||||
fprintf (stderr, "\nYour system has no audio group. Please add it by executing (as root):\n");
|
||||
diff --git a/config/os/gnu-linux/systemtest.c b/config/os/gnu-linux/systemtest.c
|
||||
index 957abe8a..9e77f378 100644
|
||||
--- a/config/os/gnu-linux/systemtest.c
|
||||
+++ b/config/os/gnu-linux/systemtest.c
|
||||
@@ -156,25 +156,6 @@ static gid_t get_group_by_name (const char* name)
|
||||
return res;
|
||||
}
|
||||
|
||||
-/***
|
||||
- * Checks for a definition in /etc/security/limits.conf that looks
|
||||
- * as if it allows RT scheduling priority.
|
||||
- *
|
||||
- * @returns 1 if there appears to be such a line
|
||||
- **/
|
||||
-int system_has_rtprio_limits_conf ()
|
||||
-{
|
||||
- const char* limits = "/etc/security/limits.conf";
|
||||
- char cmd[100];
|
||||
-
|
||||
- snprintf (cmd, sizeof(cmd), "grep -q 'rtprio *[0-9][0-9]*' %s", limits);
|
||||
- if (system (cmd) == 0) {
|
||||
- return 1;
|
||||
- }
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
-
|
||||
/**
|
||||
* Checks for the existence of the 'audio' group on this system
|
||||
*
|
||||
diff --git a/include/systemtest.h b/include/systemtest.h
|
||||
index 9445372a..969ee545 100644
|
||||
--- a/include/systemtest.h
|
||||
+++ b/include/systemtest.h
|
||||
@@ -32,14 +32,6 @@ int system_has_frequencyscaling();
|
||||
int system_uses_frequencyscaling();
|
||||
|
||||
|
||||
-/***
|
||||
- * Checks for a definition in /etc/security/limits.conf that looks
|
||||
- * as if it allows RT scheduling priority.
|
||||
- *
|
||||
- * @returns 1 if there appears to be such a line
|
||||
- **/
|
||||
-int system_has_rtprio_limits_conf();
|
||||
-
|
||||
/**
|
||||
* Checks for the existence of the 'audio' group on this system
|
||||
*
|
||||
Reference in New Issue
Block a user