void-linux / void-packages

The Void source packages collection
https://voidlinux.org
Other
2.46k stars 2.09k forks source link

Package request: tcl-snack #49825

Open Eloitor opened 2 months ago

Eloitor commented 2 months ago

Package name

tcl-snack

Package homepage

http://www.speech.kth.se/snack/

Description

Sound toolkit for scripting languages (tcl).

scid_vs_pc uses it for sound:

Initializing Sound... Snack sound package not found.

Does the requested package meet the package requirements?

System, Compiled, Required

Is the requested package released?

Yes

Eloitor commented 2 months ago

Maybe https://github.com/scottypitcher/tcl-snack instead

MechDR commented 2 months ago

I could probably give what @Eloitor suggested a shot... if you'd like.

Eloitor commented 2 months ago

It would be great, thanks!

MechDR commented 2 months ago

OK, I'll try.

MechDR commented 2 months ago

A little help, I did get to building, but it suddenly exits xbps-src, haven't checked why.

# Template file for 'tcl-snack
pkgname=tcl-snack
version=2.2.10
revision=1
build_style=gnu-makefile
hostmakedepends=""
makedepends="tcl-devel tk-devel vorbis-tools libvorbis-devel alsa-lib-devel"
short_desc="Snack is a powerfull multi-platform library for audio playback, recording, etc. using Tcl/Tk or Python."
maintainer="someone <someone@some.one>"
license="GPL-2.0-only"
homepage="https://www.speech.kth.se/snack/"
distfiles="https://web.archive.org/web/20230819212652/https://www.speech.kth.se/snack/dist/snack${version}.tar.gz"
checksum="4bfe764547ab92ba58f43b77366dbb7c7b3512d65a27cdbf9e585a9cb64ce81e"

post_extract () {
    # Minor code corrections, missing include.
    sed -i '/#include <stdlib.h>/a #include <math.h>' ${wrksrc}/generic/jkFormatMP3.c
}

do_configure () {
    cd ${wrksrc}/unix
    ./configure \
        --enable-alsa \
        --with-tcl=/usr/lib/ \
        --with-tk=/usr/lib \
        --with-ogg-include=/usr/lib \
        --with-ogg-lib=/usr/lib

}

do_build () {
    cd ${wrksrc}/unix
    make
}
Eloitor commented 2 months ago

I think you can use the cmake_builddir variable

and configure_args

MechDR commented 2 months ago

I don't think the builddir is the problem, though it is preferable to have one. The makefile runs an if statement and the if statement ends, and then it just exits (xbps, like quits entirely). I still haven't tried echoing to see at which point it does that, but could you take a look at the makefile and see if anything strikes you as odd?

Eloitor commented 2 months ago

I think it is fine. It just ends building. after that I get

=> tcl-snack-2.2.10_1: skipping check (XBPS_CHECK_PKGS is disabled) ... => tcl-snack-2.2.10_1: running pre-install hook: 00-libdir ... => tcl-snack-2.2.10_1: running pre-install hook: 02-script-wrapper ... => tcl-snack-2.2.10_1: running pre-install hook: 98-fixup-gir-path ... => tcl-snack-2.2.10_1: running do_install ... make: *** No rule to make target 'install'. Stop.

Eloitor commented 2 months ago
# Template file for 'tcl-snack
pkgname=tcl-snack
version=2.2.10
revision=1
build_style=gnu-makefile
build_wrksrc=unix
hostmakedepends=""
makedepends="tcl-devel tk-devel vorbis-tools libvorbis-devel alsa-lib-devel"
short_desc="Snack is a powerfull multi-platform library for audio playback, recording, etc. using Tcl/Tk or Python."
maintainer="someone <someone@some.one>"
license="GPL-2.0-only"
homepage="https://www.speech.kth.se/snack/"
distfiles="https://web.archive.org/web/20230819212652/https://www.speech.kth.se/snack/dist/snack${version}.tar.gz"
checksum="4bfe764547ab92ba58f43b77366dbb7c7b3512d65a27cdbf9e585a9cb64ce81e"

post_extract () {
    # Minor code corrections, missing include.
    sed -i '/#include <stdlib.h>/a #include <math.h>' ${wrksrc}/generic/jkFormatMP3.c
}

do_configure () {
    ./configure \
        --enable-alsa \
        --with-tcl=/usr/lib/ \
        --with-tk=/usr/lib \
        --with-ogg-include=/usr/lib \
        --with-ogg-lib=/usr/lib
}
Eloitor commented 2 months ago
# Template file for 'tcl-snack
pkgname=tcl-snack
version=2.2.10
revision=1
build_style=gnu-makefile
build_wrksrc=unix
hostmakedepends=""
makedepends="tcl-devel tk-devel vorbis-tools libvorbis-devel alsa-lib-devel"
short_desc="Snack is a powerfull multi-platform library for audio playback, recording, etc. using Tcl/Tk or Python."
maintainer="someone <someone@some.one>"
license="GPL-2.0-only"
homepage="https://www.speech.kth.se/snack/"
distfiles="https://web.archive.org/web/20230819212652/https://www.speech.kth.se/snack/dist/snack${version}.tar.gz"
checksum="4bfe764547ab92ba58f43b77366dbb7c7b3512d65a27cdbf9e585a9cb64ce81e"

post_extract () {
    # Minor code corrections, missing include.
    sed -i '/#include <stdlib.h>/a #include <math.h>' ${wrksrc}/generic/jkFormatMP3.c
    sed -i '/#include "snack.h"/a #include <stdint.h>' ${wrksrc}/generic/jkSoundFile.c
}

do_configure () {
    ./configure \
        --enable-alsa \
        --with-tcl=/usr/lib/ \
        --with-tk=/usr/lib \
        --with-ogg-include=/usr/lib \
        --with-ogg-lib=/usr/lib
}

Now I'm getting the error:

./../unix/jkAudIO_alsa.c:23:10: fatal error: jkAudIO.h: No such file or directory 23 | #include "jkAudIO.h" | ^~~ compilation terminated.

Eloitor commented 2 months ago

using build-styl=gnu-configure solved the issue

MechDR commented 2 months ago

I think it is fine. It just ends building.

Not for me... I will try on a clean git clone.

Now I'm getting the error...

That's because the makefile needs to exit the unix dir and enter the generic dir, but with build_wrksrc=unix, we're limiting xbps-src to build in that dir and not exit it. I tried copying a few files "missing" from the unix dir and it does get past the files I copied, but of course gets stuck on other missing files.

There are 2 options. We either copy everything from generic to unix, which might overwrite something that doesn't need to be overwritten, or two, we don't define build_wrksrc at all and just do do_build manually, like in my original script.

make: *** No rule to make target 'install'. Stop.

I think that is because it actually builds in the same dir as the source, there is no separate dir... don't know how xbps-src solves this regarding what files it should take from the build... my guess is, it has to have a separate build dir, so it will just copy everything to destdir.

MechDR commented 2 months ago

using build-styl=gnu-configure solved the issue

Just that change in your last template? OK, will try.

Eloitor commented 2 months ago
# Template file for 'tcl-snack
pkgname=tcl-snack
version=2.2.10
revision=1
build_style=gnu-configure
build_wrksrc=unix
configure_args="--enable-alsa --with-tcl=/usr/lib/ --with-tk=/usr/lib --with-ogg-include=/usr/lib --with-ogg-lib=/usr/lib"
hostmakedepends=""
makedepends="tcl-devel tk-devel vorbis-tools libvorbis-devel alsa-lib-devel"
short_desc="Snack is a powerfull multi-platform library for audio playback, recording, etc. using Tcl/Tk or Python."
maintainer="someone <someone@some.one>"
license="GPL-2.0-only"
homepage="https://www.speech.kth.se/snack/"
distfiles="https://web.archive.org/web/20230819212652/https://www.speech.kth.se/snack/dist/snack${version}.tar.gz"
checksum="4bfe764547ab92ba58f43b77366dbb7c7b3512d65a27cdbf9e585a9cb64ce81e"

post_extract () {
    # Minor code corrections, missing include.
    sed -i '/#include <stdlib.h>/a #include <math.h>' ${wrksrc}/generic/jkFormatMP3.c
}

=> tcl-snack-2.2.10_1: running post-install hook: 99-pkglint-warn-cross-cruft ... => tcl-snack-2.2.10_1: running pre-pkg hook: 03-rewrite-python-shebang ... => tcl-snack-2.2.10_1: running pre-pkg hook: 04-generate-runtime-deps ... SONAME: libc.so.6 <-> glibc>=2.39_1 SONAME: libasound.so.2 <-> alsa-lib>=1.0.20_1 SONAME: libvorbisenc.so.2 <-> libvorbis>=1.2.1rc1_1 SONAME: libvorbis.so.0 <-> libvorbis>=1.2.1rc1_1 SONAME: libogg.so.0 <-> libogg>=1.3.0_1 SONAME: libX11.so.6 <-> libX11>=1.2_1 SONAME: libtcl8.6.so <-> tcl>=8.6.0_1 SONAME: libm.so.6 <-> glibc>=2.39_1 => tcl-snack-2.2.10_1: running pre-pkg hook: 05-generate-32bit-runtime-deps ... => tcl-snack-2.2.10_1: running pre-pkg hook: 90-set-timestamps ... => tcl-snack-2.2.10_1: setting mtimes to Fri Apr 26 07:56:09 AM UTC 2024 => tcl-snack-2.2.10_1: running pre-pkg hook: 99-pkglint-subpkgs ... => tcl-snack-2.2.10_1: running pre-pkg hook: 99-pkglint ... => ERROR: tcl-snack-2.2.10_1: /lib64 must not exist. => ERROR: tcl-snack-2.2.10_1: cannot continue with installation!

The problem now it is that it install things in the wrong place...

Eloitor commented 2 months ago

Also, I think that snack can be used from other scripting languages. Maybe we should call it just "snack".

MechDR commented 2 months ago

Yeah, there is no other package called "snack". OK, go for it.