summaryrefslogtreecommitdiff
path: root/sci-visualization/spectromatic
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sci-visualization/spectromatic
reinit the tree, so we can have metadata
Diffstat (limited to 'sci-visualization/spectromatic')
-rw-r--r--sci-visualization/spectromatic/Manifest8
-rw-r--r--sci-visualization/spectromatic/files/spectromatic-1.0-makefile.patch49
-rw-r--r--sci-visualization/spectromatic/files/spectromatic-1.0-stringliteral.patch78
-rw-r--r--sci-visualization/spectromatic/files/spectromatic-1.0-waveheaderstruct-amd64.patch103
-rw-r--r--sci-visualization/spectromatic/metadata.xml19
-rw-r--r--sci-visualization/spectromatic/spectromatic-1.0-r3.ebuild34
6 files changed, 291 insertions, 0 deletions
diff --git a/sci-visualization/spectromatic/Manifest b/sci-visualization/spectromatic/Manifest
new file mode 100644
index 000000000000..b52023caecd4
--- /dev/null
+++ b/sci-visualization/spectromatic/Manifest
@@ -0,0 +1,8 @@
+AUX spectromatic-1.0-makefile.patch 1155 SHA256 bd39ec352e6420899f165896fff1989e8fa713e8da4d2026c09c4b7158e08ae5 SHA512 695eba1642daa8a1f5379e1272731000e9de73a3152d9af923ed64331a4a249c17ea1e2adbb1c90b388c667730a88fb8cf529f2dfdfbf1812a1ab7191331f6d3 WHIRLPOOL 0c03cd5be5e3fc079ac39d3d57f498b8c1a0ef24fae5b07629f5fb5ba3d94d7c6f98473e9210e303f97c9ec61ed1bd7596bda8c1c853b21dc7288b9f38049c96
+AUX spectromatic-1.0-stringliteral.patch 2111 SHA256 1860af1eb5029f1fdd4eb078ebac42bc8adf03ace629bc40d55525e2ff1ee6ed SHA512 a15ca056d2d9ff31223e17e4a95120e842850626f1cbff350091449d5e5929cdac731c67d58f1039fab848e3aeda1851cec6b2cb8d1b4ffd906660d264f29a71 WHIRLPOOL dcee9107e3dd13b410df7d64138a379c31d0df1ebe2ee862bb8c66b2b1c5fcb860b919b7ac205a30ba0806eb9d17f61de64ed12c57b1e160bc9efbefe275465c
+AUX spectromatic-1.0-waveheaderstruct-amd64.patch 3821 SHA256 d82ada202841cfa4c7bea26837d0a2b495f196cd1dc1bba5dfb0b699c1773b38 SHA512 45f861395dbe03bfc61120388d833e9997afd14888d4ef3583660676384eacb53755bcd95e4b39150cce6df1f11952260e4460bc15862249af928784e4ddf115 WHIRLPOOL 81e671e0f7b902c52937f7ab864628e5e6f131278cb4f79d9ca71d627236cede721950fb0744853d9fecd62abb6ca0c16d73d132e1d525d5e39e28f23e005aa8
+DIST spectromatic_1.0-1.tar.gz 13724 SHA256 5ed057c6c37cc7c5a6a1c8975cb0a74085baa8b18467f4643d40c0986fc45fd4 SHA512 b83acaacd21f7eb12ee3fd955073e8f95c02649de833a6087cf62786b20d8d1bf9a5b62920c17435510237797c6bc3a378921c4c1c2c4e4f74acbca49becfd6c WHIRLPOOL e724a8159624979980241f14bd72010431ad3c51382b9f29a2b5676b3e0585db2dbcb5341fb1fe599706024ece95d290a6aabd6aa5ac64e837640cdaf52a90fe
+EBUILD spectromatic-1.0-r3.ebuild 765 SHA256 3c54b42ecbbca4a183e236f51f8cb3b3c5936f7227cfc87bebcbee5519498c98 SHA512 565a8b9e535bd9bdb2c657b40144bfe381dbc8389a605831890ff15c7cb2d997665ba74e561e361743ec0f5682cd9063dc6838eb48e069c6939667773555577b WHIRLPOOL 7f14f62fc72adced517eeee810598ed47cc1e0464d89f62d51cfd4c56280041d5d743eb187f1c2025e23f8ca2466e7150aa360b321d8eb66b9ab408889b6025b
+MISC ChangeLog 2598 SHA256 4eb60ddea2aaf0739bbc28e458cef42037e7979f279758754496b5bf8b5e6ed1 SHA512 88639ec38dee3112283b77da0e7a00782ffd6c4b413292c15d94fbe864174703f79d6a386e4f8df030508d24d17dd57fc5dd005bfbe5dd45776625fb35342af0 WHIRLPOOL 0c02f653f289c17dd741713cffc6345e2430e69990a2248deaf1e277a9e1f63986af71c2caa260be4cccaa634ef7ffc15fdfed3d1586fa7a896233fa5f088fd9
+MISC ChangeLog-2015 3225 SHA256 4e06250f17b07acf8df8a18c49cacf2a6b44267d0e56cc0a44974135dce467c5 SHA512 c5321472eeefb218550d4ca3dcb094a760bf2d1d54e0dce508907ed1bb3b9a3ecbbfc841337959afd0c6ff226441f80011d3e321eacf1091488bd377dc16ee2e WHIRLPOOL d6d13fde3af77c9db5bbedb5bd5269baaf8e4bd655cdd201d924e43e04d9722a3b025ecb600a238703d633f881f5db9b68686dd279d8aed3c8701ac83e0a8f88
+MISC metadata.xml 887 SHA256 bfb0364806964e3a5a9b2e1a0bda309de05cac690e42cae4c2a29d1c269a7877 SHA512 1271a92e21dbb7ee8915dd989eb82a2b04d82fd6c791f73a625d34e6192c0d9bc571ae64fd4158d9d9edd7c40d8c8deac988c2f6d682c051cbb1c5376468e715 WHIRLPOOL 8c94c99ccfca612b0b7f12eb82fb7489d83dc93e886bcd732ecfe0a4d4d0186cefe6d9622ac5fa6b866303973e2ea33ae5c2fef80478b68363ec2271d4ef721d
diff --git a/sci-visualization/spectromatic/files/spectromatic-1.0-makefile.patch b/sci-visualization/spectromatic/files/spectromatic-1.0-makefile.patch
new file mode 100644
index 000000000000..619aaecf7a89
--- /dev/null
+++ b/sci-visualization/spectromatic/files/spectromatic-1.0-makefile.patch
@@ -0,0 +1,49 @@
+Respect LDFLAGS, CFLAGS, CC #334715
+Fix install paths
+
+--- a/Makefile
++++ b/Makefile
+@@ -1,33 +1,29 @@
+ # Makefile for spectromatic
+
+-CFLAGS = -O2 -Wall
+-LIBS = -lgsl -lgslcblas -lpng -lm
++LIBS = -lpng `pkg-config --libs gsl`
+ DESTDIR =
+-TOPLEVEL_HOME = /usr
++TOPLEVEL_HOME ?= /usr
+
+-CC = gcc -I.
+-
+ SRC = spectromatic.c wave.c
+
+ OBJ = $(SRC:.c=.o)
+
+ TARGET = spectromatic
+
+-install: all
+- mkdir -p $(DESTDIR)$(TOPLEVEL_HOME)/bin
+- mkdir -p $(DESTDIR)$(TOPLEVEL_HOME)/man/man1
+- install -o root -g root -m 0755 spectromatic $(DESTDIR)$(TOPLEVEL_HOME)/bin
+- install -o root -g root -m 0644 man/spectromatic.1 $(DESTDIR)$(TOPLEVEL_HOME)/man/man1
+-
+ all: $(OBJ)
+- $(CC) -o $(TARGET) $(OBJ) $(LIBS)
+- strip $(TARGET)
++ $(CC) $(LDFLAGS) $(OBJ) $(LIBS) -o $(TARGET)
++
++install: $(TARGET)
++ mkdir -p $(DESTDIR)$(TOPLEVEL_HOME)/bin
++ mkdir -p $(DESTDIR)$(TOPLEVEL_HOME)/share/man/man1
++ install -m 0755 spectromatic $(DESTDIR)$(TOPLEVEL_HOME)/bin
++ install -m 0644 man/spectromatic.1 $(DESTDIR)$(TOPLEVEL_HOME)/share/man/man1
+
+ clean:
+ $(RM) $(TARGET) $(OBJ)
+
+ .c.o:
+- $(CC) $(CFLAGS) -c $<
++ $(CC) $(CFLAGS) -I. -c $<
+
+ .o:
+ $(CC) $< $(LIBS) -o $@
diff --git a/sci-visualization/spectromatic/files/spectromatic-1.0-stringliteral.patch b/sci-visualization/spectromatic/files/spectromatic-1.0-stringliteral.patch
new file mode 100644
index 000000000000..d7233c1aab81
--- /dev/null
+++ b/sci-visualization/spectromatic/files/spectromatic-1.0-stringliteral.patch
@@ -0,0 +1,78 @@
+diff -ru spectromatic-1.0/spectromatic.c spectromatic-1.0-new/spectromatic.c
+--- a/spectromatic.c
++++ b/spectromatic.c
+@@ -21,6 +21,7 @@
+ ****************************************************************************/
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <malloc.h>
+ #include <png.h>
+ #include <string.h>
+@@ -37,36 +38,36 @@
+ void usage (char *pname)
+ {
+ fprintf (stderr,
+-"
+-Usage: %s [options] file.wav
+-
+-Options:
+- --window <size> FFT window size (default: 2048)
+-
+- --step <size> Slide the window by <size> samples each time
+- (default: 200)
+-
+- --inverse White/Colour-on-black
+-
+- --logarithmic Intensity is calculated by
+- log10 (1 + 9 * (amplitude / max_amp)) -
+- better for visualising weaker signals
+-
+- --combine XYZ Determines how a stereo signal is
+- represented as an RGB image. The argument is
+- a 3-character block, each character
+- corresponding to R, G and B components. It
+- may take values of L, R, A, D, X or Z,
+- meaning Left, Right, Average, Difference,
+- Cross-Correlation or Zero respectively.
+-
+- --verbose Slightly less quiet
+-
+- --version Print out the version
+-
+- --help You're in it.
+-
+-", pname);
++"\n"
++"Usage: %s [options] file.wav\n"
++"\n"
++"Options:\n"
++" --window <size> FFT window size (default: 2048)\n"
++"\n"
++" --step <size> Slide the window by <size> samples each time \n"
++" (default: 200)\n"
++"\n"
++" --inverse White/Colour-on-black\n"
++"\n"
++" --logarithmic Intensity is calculated by\n"
++" log10 (1 + 9 * (amplitude / max_amp)) -\n"
++" better for visualising weaker signals\n"
++"\n"
++" --combine XYZ Determines how a stereo signal is\n"
++" represented as an RGB image. The argument is\n"
++" a 3-character block, each character\n"
++" corresponding to R, G and B components. It\n"
++" may take values of L, R, A, D, X or Z,\n"
++" meaning Left, Right, Average, Difference,\n"
++" Cross-Correlation or Zero respectively.\n"
++"\n"
++" --verbose Slightly less quiet\n"
++"\n"
++" --version Print out the version\n"
++"\n"
++" --help You're in it.\n"
++"\n"
++, pname);
+
+
+ exit (-1);
diff --git a/sci-visualization/spectromatic/files/spectromatic-1.0-waveheaderstruct-amd64.patch b/sci-visualization/spectromatic/files/spectromatic-1.0-waveheaderstruct-amd64.patch
new file mode 100644
index 000000000000..0c4253e7e765
--- /dev/null
+++ b/sci-visualization/spectromatic/files/spectromatic-1.0-waveheaderstruct-amd64.patch
@@ -0,0 +1,103 @@
+--- a/wave.c
++++ b/wave.c
+@@ -1,11 +1,26 @@
+ #include <stdio.h>
+ #include <string.h>
++#include <endian.h>
+ #include "wave.h"
+
+ int read_header (FILE *f, waveheaderstruct *header)
+ {
++ waveheaderstruct h;
+ fseek (f, 0, SEEK_SET);
+- return fread (header, 1, sizeof (waveheaderstruct), f);
++ size_t red = fread (&h, 1, sizeof (waveheaderstruct), f);
++
++ h.length = le32toh(h.length);
++ h.length_chunk = le32toh(h.length_chunk);
++ h.format = le16toh(h.format);
++ h.modus = le16toh(h.modus);
++ h.sample_fq = le32toh(h.sample_fq);
++ h.byte_p_sec = le32toh(h.byte_p_sec);
++ h.byte_p_spl = le16toh(h.byte_p_spl);
++ h.bit_p_spl = le16toh(h.bit_p_spl);
++ h.data_length = le32toh(h.data_length);
++
++ *header = h;
++ return red;
+ }
+
+ int read_frames (FILE *f, int start, int length, char *data)
+@@ -52,12 +67,12 @@
+
+ read_header (f, &header);
+
+- printf ("Length: %lu\n", header.length);
+- printf ("Length Chunk: %lu\n", header.length_chunk);
++ printf ("Length: %lu\n", (unsigned long)header.length);
++ printf ("Length Chunk: %lu\n", (unsigned long)header.length_chunk);
+ printf ("Format: %u\n", header.format);
+ printf ("Modus: %u\n", header.modus);
+- printf ("Sample Frequency: %lu\n", header.sample_fq);
+- printf ("Bytes per Second: %lu\n", header.byte_p_sec);
++ printf ("Sample Frequency: %lu\n", (unsigned long)header.sample_fq);
++ printf ("Bytes per Second: %lu\n", (unsigned long)header.byte_p_sec);
+ printf ("Bytes per Sample: %u\n", header.byte_p_spl);
+- printf ("Data Length: %lu\n", header.data_length);
++ printf ("Data Length: %lu\n", (unsigned long)header.data_length);
+ }
+--- a/wave.h
++++ b/wave.h
+@@ -22,24 +22,25 @@
+ #ifndef WAVE_H
+ #define WAVE_H
+
+-typedef unsigned long ulongT;
+-typedef unsigned short ushortT;
++#include <stdint.h>
+
++#pragma pack(push,1)
+ typedef struct { /* header for WAV-Files */
+- char main_chunk[4]; /* 'RIFF' */
+- unsigned long length; /* length of file */
+- char chunk_type[4]; /* 'WAVE' */
+- char sub_chunk[4]; /* 'fmt' */
+- unsigned long length_chunk; /* length sub_chunk, always 16 bytes */
+- unsigned short format; /* always 1 = PCM-Code */
+- unsigned short modus; /* 1 = Mono, 2 = Stereo */
+- unsigned long sample_fq; /* Sample Freq */
+- unsigned long byte_p_sec; /* Data per sec */
+- unsigned short byte_p_spl; /* Bytes per sample */
+- unsigned short bit_p_spl; /* bits per sample, 8, 12, 16 */
+- char data_chunk[4]; /* 'data' */
+- unsigned long data_length; /* length of data */
+-} waveheaderstruct;
++ uint8_t main_chunk[4]; /* 'RIFF' */
++ uint32_t length; /* length of file */
++ uint8_t chunk_type[4]; /* 'WAVE' */
++ uint8_t sub_chunk[4]; /* 'fmt' */
++ uint32_t length_chunk; /* length sub_chunk, always 16 bytes */
++ uint16_t format; /* always 1 = PCM-Code */
++ uint16_t modus; /* 1 = Mono, 2 = Stereo */
++ uint32_t sample_fq; /* Sample Freq */
++ uint32_t byte_p_sec; /* Data per sec */
++ uint16_t byte_p_spl; /* Bytes per sample */
++ uint16_t bit_p_spl; /* bits per sample, 8, 12, 16 */
++ uint8_t data_chunk[4]; /* 'data' */
++ uint32_t data_length; /* length of data */
++} __attribute__ ((__packed__)) waveheaderstruct;
++#pragma pack(pop)
+
+ int read_header (FILE *f, waveheaderstruct *header);
+ int read_frames (FILE *f, int start, int length, char *data);
+--- a/spectromatic.c
++++ b/spectromatic.c
+@@ -217,7 +217,7 @@
+ if (header.modus == 2)
+ ch2 = (double*) malloc (window_size * sizeof (double));
+
+- fprintf (stderr, "samples = %li, step_size = %i, window_size = %i\n", header.data_length / header.byte_p_spl, step_size, window_size);
++ fprintf (stderr, "samples = %lu, step_size = %i, window_size = %i\n", (unsigned long)header.data_length / header.byte_p_spl, step_size, window_size);
+
+ for (i = -window_size; i < window_size + (int)(header.data_length / header.byte_p_spl); i += step_size) {
+ read_frames (f, i, window_size, data);
diff --git a/sci-visualization/spectromatic/metadata.xml b/sci-visualization/spectromatic/metadata.xml
new file mode 100644
index 000000000000..abcd7bb71213
--- /dev/null
+++ b/sci-visualization/spectromatic/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ <name>Gentoo Science Project</name>
+ </maintainer>
+ <longdescription lang="en">
+ Spectromatic is a program for generating spectrograms from audio
+ files. Spectrograms are a form of simple time-frequency analysis which
+ lets you see how the distribution of energy at different frequencies
+ in an audio stream change over time. For example, if you play a scale
+ on a musical instrument, you will see a climbing and/or descending
+ pattern of blobs as you move from left to right.
+ Spectromatic reads its input as mono or stereo 16-bit wave files, and
+ writes the output image to an elongated PNG image (colour for stereo,
+ grayscale for mono audio).
+</longdescription>
+</pkgmetadata>
diff --git a/sci-visualization/spectromatic/spectromatic-1.0-r3.ebuild b/sci-visualization/spectromatic/spectromatic-1.0-r3.ebuild
new file mode 100644
index 000000000000..d7bd8aaf7c93
--- /dev/null
+++ b/sci-visualization/spectromatic/spectromatic-1.0-r3.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+MY_P=${PN}_${PV}-1
+
+DESCRIPTION="Generates time-frequency analysis images from wav files"
+HOMEPAGE="http://ieee.uow.edu.au/~daniel/software/spectromatic/"
+SRC_URI="http://ieee.uow.edu.au/~daniel/software/spectromatic/dist/${MY_P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux"
+IUSE=""
+
+RDEPEND="
+ media-libs/libpng:0=
+ sci-libs/gsl:="
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-makefile.patch
+ "${FILESDIR}"/${P}-stringliteral.patch
+ "${FILESDIR}"/${P}-waveheaderstruct-amd64.patch
+)
+
+src_configure() {
+ tc-export CC
+ export TOPLEVEL_HOME="${EPREFIX}/usr"
+}