summaryrefslogtreecommitdiff
path: root/media-sound/freebirth
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 /media-sound/freebirth
reinit the tree, so we can have metadata
Diffstat (limited to 'media-sound/freebirth')
-rw-r--r--media-sound/freebirth/Manifest7
-rw-r--r--media-sound/freebirth/files/freebirth-0.3.2-gentoo-2.patch214
-rw-r--r--media-sound/freebirth/files/freebirth-0.3.2-segfault.patch17
-rw-r--r--media-sound/freebirth/freebirth-0.3.2-r1.ebuild40
-rw-r--r--media-sound/freebirth/metadata.xml11
5 files changed, 289 insertions, 0 deletions
diff --git a/media-sound/freebirth/Manifest b/media-sound/freebirth/Manifest
new file mode 100644
index 000000000000..3d7d48fc5034
--- /dev/null
+++ b/media-sound/freebirth/Manifest
@@ -0,0 +1,7 @@
+AUX freebirth-0.3.2-gentoo-2.patch 6589 SHA256 121c85263df31ce7b276b17ad8b0cdd1bef9c2b4cbd51d5ea440234d8f093c3f SHA512 9ce3c911276b5f732c478b64e343b73aa3d0f0f805a594ba4c26e6d93eda2db2b056261a50fedbce6e27ccd3dd8889c384176c02fb78b70cc90d983696766cc4 WHIRLPOOL 32ccfe0550b9ec8ed8bdbf29ffd0e0834a56db53337d33c29f4ea635da155d349d914a28126ae1e140d1187b1159119565ac09e06ce5eb0e1304c570f48f36a2
+AUX freebirth-0.3.2-segfault.patch 519 SHA256 fb2364ac5d3bb8f642ba76790451c1efcd4b265c88d4fc86a48e2a007cd6652b SHA512 61bacbeaa5599a88f3f7a446ab2300f3a611c86e8e728b9d847322e9d8cc4b54a6580428342025322e01e0b4a1cf8a3547ce873842704a98f9167f5a3e67d0c2 WHIRLPOOL c00e2450b85d17dbcba58871e1e03a18c10cb0be17209a96b3998a712bdf702cb8158f9bc2d02c2a71421280f557cc8381b9a88c97c544c8ea89a475c20945e4
+DIST freebirth-0.3.2.tar.gz 2456900 SHA256 8cdee757be747eae337826ec9ca9244798c36f75c82f10dfd2c09facfc623f96 SHA512 a532905e687d8ebc415dea3794a4dfc4c55037123c79cc0dd2111fc74e6db1ba367e8210da75e3586c5ee4d2521a21b5cd03a5a0afcfd3a04e678834f140590a WHIRLPOOL 27272c947760559c46c30456dcec1b05fdb3e10a561c3da2542ce8f6115976deeed2a3b4a1f55e734dec134308b028900dcf3812b6176b1a56a9f3342ed3766a
+EBUILD freebirth-0.3.2-r1.ebuild 763 SHA256 749c037c07a356e8b505ec6f13599d2056b650396fd10db26cce4b4af117e220 SHA512 0f6175f17f99eb7392f99428395fd8231ef428e4e7c36dcdfbc4c59708b148798f85ae1e7e2bd4f9c7dab6a1cc28cb19bbc9d7deaf13850f214f1ad0e66e23b9 WHIRLPOOL cee5fb1dc7e2d8e14d1cc0e43d114131464f1c7aec1fc0776c1d93761087fa783ba736d8740c839cd009b7449f5d9057dd83065f13c89e0ec98a810f504abae2
+MISC ChangeLog 3193 SHA256 e0858c0bbea2cfd3e1ac30cec9df9fa2ead5f837b72562e1b83ddbc7b93d4e14 SHA512 f4dced7ad3ea8ed0a1d4115e74bb89e487f606fa4c5b17096b2c9a727feb1f6190ebeab666967021ce587da941533435f305e7eac6c3af6b41a60e0f5b6581da WHIRLPOOL 52575d9e8ce75a30037e176ac835fcdbc04f1cbc9225660fdc8264a43b8eb51232d80c1038e1d6629d66b87a7cbb4642a3916fb9d31173bfd488dd67100c2c1c
+MISC ChangeLog-2015 2417 SHA256 5b7be6938fca18cf0972bf35f43c86a7387375034572a24396693536487adeba SHA512 f16599be8e2758dd70a6155ce3112237ecf40c71e0cbf299c653f58501ee4abbf28dda2197d13a6b30961f335470e81d4d39aa5015204900d059577b711f7d6a WHIRLPOOL d77c914c4ac0c56f275c5829eecbed49b79f61cdaafb07d1fcb65b2e5e87d572ece0e172d238b064065316912aafcc07607111f798b4231921c022f604dc70bc
+MISC metadata.xml 325 SHA256 969977181bcc7f0f73dc713e28973ee638abba9c960f8f47b720c07453b85696 SHA512 633be59eb61315afe57a92345666505b9428cbb0b910ffc550803bbebed0258fd838197b69349e998ba346a1e4703b99f474db977eeef690633956176231b4a2 WHIRLPOOL 1a92fd48cb8c13b76a91824dd2ac3fd7f91b01efbefb62019699aa5c1ab5e63ae4a20f224e5274a97d72dd219cf82589ef478b09bbcc906a3b25f53183364c2b
diff --git a/media-sound/freebirth/files/freebirth-0.3.2-gentoo-2.patch b/media-sound/freebirth/files/freebirth-0.3.2-gentoo-2.patch
new file mode 100644
index 000000000000..52b184b04b2f
--- /dev/null
+++ b/media-sound/freebirth/files/freebirth-0.3.2-gentoo-2.patch
@@ -0,0 +1,214 @@
+--- freebirth.c
++++ freebirth.c
+@@ -248,15 +248,15 @@
+ //bass_e = env_new(1025,10000,(sample_producer *)osc_blender);
+ sl = g_slist_append(sl, bass_e);
+
+- kick = raw_wave_new("raw/kick.raw");
++ kick = raw_wave_new("/usr/share/freebirth/raw/kick.raw");
+ sl = g_slist_append(sl, kick);
+- snare = raw_wave_new("raw/snare.raw");
++ snare = raw_wave_new("/usr/share/freebirth/raw/snare.raw");
+ sl = g_slist_append(sl, snare);
+- cl_hat = raw_wave_new("raw/cl_hat.raw");
++ cl_hat = raw_wave_new("/usr/share/freebirth/raw/cl_hat.raw");
+ sl = g_slist_append(sl, cl_hat);
+- op_hat = raw_wave_new("raw/op_hat.raw");
++ op_hat = raw_wave_new("/usr/share/freebirth/raw/op_hat.raw");
+ sl = g_slist_append(sl, op_hat);
+- samp_1 = raw_wave_new("raw/samp_1.raw");
++ samp_1 = raw_wave_new("/usr/share/freebirth/raw/samp_1.raw");
+ sl = g_slist_append(sl, samp_1);
+
+ sources = (sample_producer**)
+@@ -1087,7 +1087,7 @@
+
+
+ /*effect window */
+- effect_window = gtk_window_new (GTK_WINDOW_DIALOG);
++ effect_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_title(GTK_WINDOW (effect_window), "Effects");
+ gtk_widget_set_style(effect_window,window_style);
+ effect_box = gtk_vbox_new(FALSE,10);
+@@ -1109,7 +1109,7 @@
+
+
+ /* sample freq window */
+- sample_freq_window = gtk_window_new (GTK_WINDOW_DIALOG);
++ sample_freq_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_title(GTK_WINDOW (sample_freq_window), "Sample Pitch");
+ sample_freq_box = gtk_vbox_new(TRUE,10);
+ gtk_widget_set_style(sample_freq_window,window_style);
+--- fuse_loops.c
++++ fuse_loops.c
+@@ -122,7 +122,18 @@
+ fprintf(file, "/* generated file -- don't edit */\n");
+ fprintf(file, "#include <unistd.h>\n");
+ fprintf(file, "#include <math.h>\n");
++ fprintf(file, "#include <endian.h>\n");
+ fprintf(file, "#include \"freebirth.h\"\n");
++ fprintf(file, "/* borrowed from glib2 */\n");
++ fprintf(file, "#define SHORT_SWAP_LE_BE(val) ((short) ( \\\n");
++ fprintf(file, " (short) ((short) (val) >> 8) | \\\n");
++ fprintf(file, " (short) ((short) (val) << 8)))\n");
++ fprintf(file, "static void swap_endian(short *data, int length)\n");
++ fprintf(file, "{\n");
++ fprintf(file, " int i;\n");
++ fprintf(file, " for (i = 0; i < length; i += 1, data++)\n");
++ fprintf(file, " *data = SHORT_SWAP_LE_BE(*data);\n");
++ fprintf(file, "}\n");
+ fprintf(file, "\n");
+
+ fprintf(file, "sample_producer *sp[%d];\n", g_list_length(order));
+@@ -172,6 +183,9 @@
+ fprintf(file, " }\n");
+ fprintf(file, "\n");
+
++ fprintf(file, "#if __BYTE_ORDER == __BIG_ENDIAN\n");
++ fprintf(file, " swap_endian(buffer, 2 * TBASS_BUFF_SIZE);\n");
++ fprintf(file, "#endif\n");
+ fprintf(file, " write(fd, buffer, 2 * TBASS_BUFF_SIZE * sizeof(short));\n");
+ fprintf(file, "\n");
+
+--- gtkdial.c
++++ gtkdial.c
+@@ -75,8 +75,6 @@
+ sizeof (GtkDialClass),
+ (GtkClassInitFunc) gtk_dial_class_init,
+ (GtkObjectInitFunc) gtk_dial_init,
+- (GtkArgSetFunc) NULL,
+- (GtkArgGetFunc) NULL,
+ };
+
+ dial_type = gtk_type_unique (gtk_widget_get_type (), &dial_info);
+--- Makefile
++++ Makefile
+@@ -1,10 +1,9 @@
+ # Makefile for Freebirth
+ #
+
+-CC=gcc
+-LOADLIBES=-lm $(shell gtk-config --libs)
+-CFLAGS=-g -O6 -Wall $(shell gtk-config --cflags)
+-LDFLAGS=
++CC?=gcc
++CFLAGS+=-Wall $(shell pkg-config --cflags gtk+-2.0)
++LIBS=-lm $(shell pkg-config --libs gtk+-2.0)
+
+ OFILES=\
+ oscillator.o sequencer.o envelope.o filter.o gtkdial.o mixer.o \
+@@ -22,16 +21,18 @@
+ -rm -f *.o freebirth fusebirth fused_loop.c Makefile.deps *~
+
+ freebirth: $(OFILES) fused_loop.o freebirth.o
++ $(CC) $(LDFLAGS) $(CFLAGS) -o freebirth $(OFILES) fused_loop.o freebirth.o $(LIBS)
+
+ fused_loop.c: fusebirth
+ ./fusebirth > fused_loop.c 2>/dev/null
+
+ fusebirth: $(OFILES) fuse_loops.o fusebirth.o
++ $(CC) $(LDFLAGS) $(CFLAGS) -o fusebirth $(OFILES) fuse_loops.o fusebirth.o $(LIBS)
+
+ fusebirth.o: freebirth.c
+ $(CC) -c $(CFLAGS) -DFUSE_LOOPS -o fusebirth.o freebirth.c
+
+ Makefile.deps:
+- gcc -MM $(CFLAGS) $(CFILES) > Makefile.deps
++ $(CC) -MM $(CFLAGS) $(CFILES) > Makefile.deps
+
+ include Makefile.deps
+--- raw_wave.c
++++ raw_wave.c
+@@ -21,18 +21,36 @@
+ #include "raw_wave.h"
+ #include <stdio.h>
+ #include <stdlib.h>
++#include <string.h>
+ #include <math.h>
++#include <endian.h>
++
++/* borrowed from glib2 */
++#define SHORT_SWAP_LE_BE(val) ((short) ( \
++ (short) ((short) (val) >> 8) | \
++ (short) ((short) (val) << 8)))
++static void swap_endian(short *data, int length)
++{
++ int i;
++ for (i = 0; i < length; i += 1, data++)
++ *data = SHORT_SWAP_LE_BE(*data);
++}
+
+ static char *get_full_path(char *fn)
+ {
+ char *full_fn;
+ char *fb_samples;
+
+- if (fn == NULL || fn[0] == '/') return fn;
+ fb_samples = getenv("FB_SAMPLES");
+ if (fb_samples == NULL) fb_samples = FB_SAMPLES;
+- sprintf(full_fn = (char *)malloc(strlen(fb_samples) + 1 + strlen(fn) + 1),
+- "%s/%s", fb_samples, fn);
++ full_fn = (char *)malloc(strlen(fb_samples) + 1 + strlen(fn) + 1);
++
++ if (fn == NULL || fn[0] == '/') { /* path is valid already */
++ sprintf(full_fn, "%s", fn);
++ } else {
++ sprintf(full_fn, "%s/%s", fb_samples, fn); /* add path */
++ }
++
+ return full_fn;
+ }
+
+@@ -76,10 +94,13 @@
+
+ }
+ this->length += count;
++#if __BYTE_ORDER == __BIG_ENDIAN
++ swap_endian(tmp, this->length);
++#endif
+ this->table = (sample *)malloc(sizeof(sample) * this->length);
+- for(i = 0; i < this->length;i++)
++ for(i = 0; i < this->length;i++) {
+ this->table[i] = (sample)tmp[i];
+-
++ }
+ fclose(in);
+ free(tmp);
+ }
+@@ -126,6 +147,7 @@
+
+ }
+ }
++
+ return this->buffer;
+ }
+
+@@ -145,7 +167,7 @@
+ void raw_wave_set_sample_file(raw_wave* this, char *filename)
+ {
+ FILE *in;
+- if (this->filename != 0) free(this->filename);
++ if (this->filename != NULL) free(this->filename);
+ this->filename = get_full_path(filename);
+ in = fopen(this->filename,"r");
+ if( in==NULL )
+@@ -243,7 +265,7 @@
+ /* set table to zero here check if it is zero in */
+ /* _fill_table */
+ out->table = 0;
+- out->filename = 0;
++ out->filename = NULL;
+ raw_wave_set_sample_file(out, filename);
+
+ out->buffer = (sample *)malloc(sizeof(sample) * TBASS_BUFF_SIZE);
+--- raw_wave.h
++++ raw_wave.h
+@@ -62,7 +62,7 @@
+ event *event_pitch_change_new(int seq_handle, double pitch);
+
+ // #define FB_SAMPLES "/usr/local/lib/freebirth"
+-#define FB_SAMPLES "."
++#define FB_SAMPLES "/usr/share/freebirth"
+
+ /*
+ Local Variables:
diff --git a/media-sound/freebirth/files/freebirth-0.3.2-segfault.patch b/media-sound/freebirth/files/freebirth-0.3.2-segfault.patch
new file mode 100644
index 000000000000..2a3a40711f1c
--- /dev/null
+++ b/media-sound/freebirth/files/freebirth-0.3.2-segfault.patch
@@ -0,0 +1,17 @@
+https://bugs.gentoo.org/show_bug.cgi?id=320123
+
+Index: freebirth-0.3.2/oscillator.c
+===================================================================
+--- freebirth-0.3.2.orig/oscillator.c
++++ freebirth-0.3.2/oscillator.c
+@@ -237,8 +237,8 @@ event *event_freq_change_new(int seq_han
+
+ static sample_producer **get_children(osc *this)
+ {
+- static sample_producer *no_kids[] = { NULL };
+- return no_kids;
++ static sample_producer no_kids[] = {{ NULL }};
++ return &no_kids;
+ }
+
+ static char **get_header(osc *this)
diff --git a/media-sound/freebirth/freebirth-0.3.2-r1.ebuild b/media-sound/freebirth/freebirth-0.3.2-r1.ebuild
new file mode 100644
index 000000000000..271853ab4567
--- /dev/null
+++ b/media-sound/freebirth/freebirth-0.3.2-r1.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Free software bass synthesizer step sequencer"
+HOMEPAGE="http://freshmeat.net/releases/8834"
+SRC_URI="http://www.bitmechanic.com/projects/freebirth/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~ppc sparc x86"
+IUSE=""
+
+RDEPEND="x11-libs/gtk+:2"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-gentoo-2.patch \
+ "${FILESDIR}"/${P}-segfault.patch
+}
+
+src_compile() {
+ tc-export CC
+ emake
+}
+
+src_install() {
+ dobin ${PN}
+
+ insinto /usr/share/${PN}/raw
+ doins raw/*.raw
+
+ dodoc CHANGES NEXT_VERSION README
+
+ doicon xpm/${PN}.xpm
+ make_desktop_entry ${PN} ${PN}
+}
diff --git a/media-sound/freebirth/metadata.xml b/media-sound/freebirth/metadata.xml
new file mode 100644
index 000000000000..a38ef435258d
--- /dev/null
+++ b/media-sound/freebirth/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sound@gentoo.org</email>
+ <name>Gentoo Sound project</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="freshmeat">8834</remote-id>
+ </upstream>
+</pkgmetadata>