termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.28k stars 3.06k forks source link

[Package]: shntool for wav splitting #8343

Closed KhaeWa closed 2 years ago

KhaeWa commented 2 years ago

Package description

A multi-purpose WAVE data processing and reporting utility.

Home page URL

No response

Source code URL

http://shnutils.freeshell.org/shntool/

Packaging policy acknowledgement

Additional information

No response

tathastu871 commented 2 years ago

Minimal install without any helper programs mentioned in TERMUX_PKG_SUGGESTS. Since they are not in repo need to be compiled seperately.

If the helper programs/codec packs are added to termux repo then replace them from SUGGESTS TO DEPENDS.

TERMUX_PKG_HOMEPAGE=http://shnutils.freeshell.org/shntool/
TERMUX_PKG_DESCRIPTION="shntool is a multi-purpose WAVE data processing and reporting utility"
TERMUX_PKG_LICENSE=GPL-2.0
TERMUX_PKG_LICENSE_FILE=COPYING
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=3.0.10
TERMUX_PKG_SRCURL=http://shnutils.freeshell.org/shntool/dist/src/shntool-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=74302eac477ca08fb2b42b9f154cc870593aec8beab308676e4373a5e4ca2102
TERMUX_PKG_DEPENDS="flac, sox"
TERMUX_PKG_SUGGESTS="wavpack, shorten, mac, ofr, lpac, alac, la ttaenc, mp4als, mkwcon, takc, bonk, kexis"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--build=aarch64-unknown-linux-gnu"
tathastu871 commented 2 years ago

build.sh for helper codec programs that enhances shntool

1) bonk

TERMUX_PKG_HOMEPAGE=http://www.logarithmic.net/pfh/bonk
TERMUX_PKG_DESCRIPTION="Bonk is a an audio compression program that operates in both lossy and lossless modes"
TERMUX_PKG_LICENSE=GPL-2.0
TERMUX_PKG_LICENSE_FILE=COPYING
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.6
TERMUX_PKG_SRCURL=https://logarithmic.net/pfh-files/bonk/bonk-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=754a2cad4d6529227f1b44210d4da0c14564a16ff65c8de50be123af5a33ce81
termux_step_configure() {
    cd ${TERMUX_PKG_SRCDIR}
    sed "/^PREFIX/ s/\/usr/\/data\/data\/com.termux\/files\/usr/" Makefile -i
}
termux_step_make() {
    cd ${TERMUX_PKG_SRCDIR} && make
}
termux_step_make_install() {
    cd ${TERMUX_PKG_SRCDIR} && make install
}

2) wavpack

TERMUX_PKG_HOMEPAGE=https://www.wavpack.com/
TERMUX_PKG_DESCRIPTION="WavPack encode/decode library, command-line programs, and several plugins"
TERMUX_PKG_LICENSE="BSD 3-Clause"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=5.4.0
TERMUX_PKG_SRCURL=https://github.com/dbry/WavPack/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=abbe5ca3fc918fdd64ef216200a5c896243ea803a059a0662cd362d0fa827cd2
TERMUX_PKG_DEPENDS="iconv, openssl, libandroid-glob"
TERMUX_PKG_FORCE_CMAKE=true
termux_step_pre_configure() {
    export LDFLAGS=" -landroid-glob"
}

3) kexis

TERMUX_PKG_HOMEPAGE=https://sourceforge.net/projects/kexis/
TERMUX_PKG_DESCRIPTION="Kexis - A lossless WAV file compressor"
TERMUX_PKG_LICENSE=GPL-2.0
TERMUX_PKG_LICENSE_FILE=GPL.txt
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.2.2
TERMUX_PKG_SRCURL=https://sourceforge.net/projects/kexis/files/Kexis/${TERMUX_PKG_VERSION}/kexis-${TERMUX_PKG_VERSION}.tgz/download
TERMUX_PKG_SHA256=059d77fc009fae9c2f3ece906f0f4c8de792a5071d7b7c958e2b434c7d54b353
termux_step_make_install() {
    cd ${TERMUX_PKG_SRCDIR} && make && make  install
}

Makefile.patch

diff -uNr kexis/Makefile kexis.mod/Makefile
--- kexis/Makefile  2000-09-23 01:42:48.000000000 +0530
+++ kexis.mod/Makefile  2021-12-27 00:12:57.461508487 +0530
@@ -1,3 +1,5 @@
+includedir=$(PREFIX)/include/kexis
+include_HEADERS=bits.h decode.h encode.h header.h kexis.h predictor.h rice.h types.h
 DESTDIR =
 SOURCE=encode.c decode.c header.c predictor.c bits.c rice.c kexis.c
 OBJ = $(SOURCE:.c=.o)
@@ -21,3 +23,9 @@

 clean:
    @rm -f *.o $(TARGETS)
+
+install:
+   install -d $(PREFIX)/include/kexis
+   cp $(include_HEADERS) $(includedir)
+   install -m 755 kexis $(PREFIX)/bin
+

4) La (lossless audio) http://www.lossless-audio.com/la04.tar.bz2 Source code not released

5) shorten

TERMUX_PKG_HOMEPAGE=http://shnutils.freeshell.org/shorten/
TERMUX_PKG_DESCRIPTION="shorten is a fast, low complexity waveform coder"
TERMUX_PKG_LICENSE=custom
TERMUX_PKG_LICENSE_FILE=COPYING
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=3.6.1
TERMUX_PKG_SRCURL=http://shnutils.freeshell.org/shorten/dist/src/shorten-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=ce22e0676c93494ee7d094aed9b27ad018eae5f2478e8862ae1e962346405b66
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--build=aarch64-unknown-linux-gnu"

6) Libalac

TERMUX_PKG_HOMEPAGE=https://github.com/macosforge/alac
TERMUX_PKG_DESCRIPTION="Apple alac codec"
TERMUX_PKG_LICENSE="Apache-2.0"
TERMUX_PKG_LICENSE_FILE="@termux"
TERMUX_PKG_VERSION=1.0.1.72e79c774b2157a822223e57d7a85b69c79ff57c-1
TERMUX_PKG_SRCURL=https://github.com/sidneys/libalac/archive/72e79c774b2157a822223e57d7a85b69c79ff57c.tar.gz
TERMUX_PKG_SHA256=1fd9518dc097c3ac7125f44d271f395e62bf969f482d5f0c9257923317971332
termux_step_pre_configure() {
    cd ${TERMUX_PKG_SRCDIR} &&
        autoreconf -vfi
}
termux_step_configure() {
    cd ${TERMUX_PKG_SRCDIR} && ./configure --prefix=$PREFIX
}
termux_step_make() {
    cd ${TERMUX_PKG_SRCDIR} && make
}
termux_step_make_install() {
    cd ${TERMUX_PKG_SRCDIR} && make install
}

7) mac (monkey audio codec)

TERMUX_PKG_HOMEPAGE=https://monkeysaudio.com/
TERMUX_PKG_DESCRIPTION="Lossless Monkey audio codec"
TERMUX_PKG_LICENSE=custom
TERMUX_PKG_LICENSE_FILE=LICENSE
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=3.99.6
TERMUX_PKG_SRCURL=https://github.com/fernandotcl/monkeys-audio/archive/refs/tags/release-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=0d279bf2042ac5a8fc57674de0f20a4c78f8f33926346d98949bc312c76860f1
TERMUX_PKG_DEPENDS="yasm"
TERMUX_PKG_FORCE_CMAKE=true