mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 04:07:46 +00:00
Ports: Add TiMidity++
Also add it as a dependency for the `SDL_mixer` and `SDL2_mixer` ports. Eawpats GUS patches are installed as part of the port, because without patches TiMidity++ is not able to generate any sound. The license for these is "fameware", credit to Andrew Suffield: https://lists.debian.org/debian-legal/2002/09/msg00137.html
This commit is contained in:
parent
8ab410a536
commit
808e0c9b17
6 changed files with 103 additions and 2 deletions
30
Ports/timidity/package.sh
Executable file
30
Ports/timidity/package.sh
Executable file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env -S bash ../.port_include.sh
|
||||
port='timidity'
|
||||
useconfigure='true'
|
||||
version='2.15.0'
|
||||
files="https://netcologne.dl.sourceforge.net/project/timidity/TiMidity%2B%2B/TiMidity%2B%2B-${version}/TiMidity%2B%2B-${version}.tar.xz timidity-${version}.tar.xz 9eaf4fadb0e19eb8e35cd4ac16142d604c589e43d0e8798237333697e6381d39
|
||||
https://www.quaddicted.com/files/idgames/sounds/eawpats.zip eawpats.zip.no_extract 19087fa4a40e25ec39a09cffcc9f775fc22d88bc971a7a9831e075cdae2ee1e3"
|
||||
auth_type='sha256'
|
||||
workdir="TiMidity++-${version}"
|
||||
use_fresh_config_sub='true'
|
||||
config_sub_paths=('autoconf/config.sub')
|
||||
depends=()
|
||||
configopts=(
|
||||
'lib_cv___va_copy=no'
|
||||
'lib_cv_va_copy=no'
|
||||
'lib_cv_va_val_copy=no'
|
||||
)
|
||||
|
||||
post_install() {
|
||||
# Unpack Eawpats
|
||||
eaw_pats_dir='/usr/local/share/eawpats'
|
||||
eaw_pats_host_dir="${SERENITY_INSTALL_ROOT}${eaw_pats_dir}"
|
||||
mkdir -p "${eaw_pats_host_dir}"
|
||||
run unzip -qo -d "${eaw_pats_host_dir}" '../eawpats.zip.no_extract'
|
||||
|
||||
# Set up timidity.cfg
|
||||
timidity_cfg_path="${SERENITY_INSTALL_ROOT}/etc/timidity.cfg"
|
||||
mkdir -p "$(dirname ${timidity_cfg_path})"
|
||||
cp "${eaw_pats_host_dir}/timidity.cfg" "${timidity_cfg_path}"
|
||||
sed -i "s#^dir .*#dir ${eaw_pats_dir}#g" "${timidity_cfg_path}"
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Jelle Raaijmakers <jelle@gmta.nl>
|
||||
Date: Thu, 1 Sep 2022 13:47:34 +0200
|
||||
Subject: [PATCH] Calculate Newton coefficients on the fly
|
||||
|
||||
Since we are cross-compiling, we do not get a binary we can run on the
|
||||
host that is able to generate `newton_table.c`, so fall back to the old
|
||||
way of generating the table.
|
||||
---
|
||||
timidity/Makefile.in | 2 --
|
||||
timidity/resample.c | 5 +----
|
||||
2 files changed, 1 insertion(+), 6 deletions(-)
|
||||
|
||||
diff --git a/timidity/Makefile.in b/timidity/Makefile.in
|
||||
index e4ee43c..a93105e 100644
|
||||
--- a/timidity/Makefile.in
|
||||
+++ b/timidity/Makefile.in
|
||||
@@ -1956,8 +1956,6 @@ uninstall-am: uninstall-binPROGRAMS uninstall-info-am
|
||||
version.$(OBJEXT): version.c ../configure
|
||||
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(CFLAGS) -c $(srcdir)/version.c
|
||||
|
||||
-resample.c: newton_table.c
|
||||
-
|
||||
@VCPP_TRUE@newton_table.c: calcnewt$(EXEEXT)
|
||||
@VCPP_TRUE@ ./calcnewt $@
|
||||
|
||||
diff --git a/timidity/resample.c b/timidity/resample.c
|
||||
index cd6b8e6..a878526 100644
|
||||
--- a/timidity/resample.c
|
||||
+++ b/timidity/resample.c
|
||||
@@ -46,7 +46,6 @@
|
||||
|
||||
/* for start/end of samples */
|
||||
static float newt_coeffs[58][58] = {
|
||||
-#include "newton_table.c"
|
||||
};
|
||||
|
||||
int sample_bounds_min, sample_bounds_max; /* min/max bounds for sample data */
|
||||
@@ -468,7 +467,6 @@ void free_gauss_table(void)
|
||||
gauss_table[0] = NULL;
|
||||
}
|
||||
|
||||
-#if 0 /* NOT USED */
|
||||
/* the was calculated statically in newton_table.c */
|
||||
static void initialize_newton_coeffs(void)
|
||||
{
|
||||
@@ -499,12 +497,11 @@ static void initialize_newton_coeffs(void)
|
||||
for (j = 0, sign = pow(-1, i); j <= i; j++, sign *= -1)
|
||||
newt_coeffs[i][j] *= sign;
|
||||
}
|
||||
-#endif /* NOT USED */
|
||||
|
||||
/* initialize the coefficients of the current resampling algorithm */
|
||||
void initialize_resampler_coeffs(void)
|
||||
{
|
||||
- /* initialize_newton_coeffs(); */
|
||||
+ initialize_newton_coeffs();
|
||||
initialize_gauss_table(gauss_n);
|
||||
/* we don't have to initialize newton table any more */
|
||||
|
10
Ports/timidity/patches/ReadMe.md
Normal file
10
Ports/timidity/patches/ReadMe.md
Normal file
|
@ -0,0 +1,10 @@
|
|||
# Patches for timidity on SerenityOS
|
||||
|
||||
## `0001-Calculate-Newton-coefficients-on-the-fly.patch`
|
||||
|
||||
Calculate Newton coefficients on the fly
|
||||
|
||||
Since we are cross-compiling, we do not get a binary we can run on the
|
||||
host that is able to generate `newton_table.c`, so fall back to the old
|
||||
way of generating the table.
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue