aboutsummaryrefslogtreecommitdiff
path: root/audio/xanalyser
diff options
context:
space:
mode:
authorDiane Bruce <db@FreeBSD.org>2018-01-19 01:22:11 +0000
committerDiane Bruce <db@FreeBSD.org>2018-01-19 01:22:11 +0000
commit546b4fac95f83c0c780be374b151ae121d4d7d98 (patch)
tree5c486920daa65868918c0df3b5ed90293bdb5b5e /audio/xanalyser
parent7e5ac33691463f3053f551088ee6448426e7b9c9 (diff)
downloadports-546b4fac95f83c0c780be374b151ae121d4d7d98.tar.gz
ports-546b4fac95f83c0c780be374b151ae121d4d7d98.zip
- Fix build under clang6
- replace pkg-plist with PLIST_FILES - add LICENSE Reported by: pkg-fallout
Notes
Notes: svn path=/head/; revision=459386
Diffstat (limited to 'audio/xanalyser')
-rw-r--r--audio/xanalyser/Makefile5
-rw-r--r--audio/xanalyser/files/patch-src_Analyser.cc128
-rw-r--r--audio/xanalyser/files/patch-src_Scope.cc29
-rw-r--r--audio/xanalyser/files/patch-src_control.cc29
-rw-r--r--audio/xanalyser/pkg-plist3
5 files changed, 191 insertions, 3 deletions
diff --git a/audio/xanalyser/Makefile b/audio/xanalyser/Makefile
index 3212edd3341b..c4e2c173835c 100644
--- a/audio/xanalyser/Makefile
+++ b/audio/xanalyser/Makefile
@@ -11,9 +11,14 @@ MASTER_SITES= http://arvin.schnell-web.net/xanalyser/ \
MAINTAINER= db@FreeBSD.org
COMMENT= Spectrum analyser
+LICENSE= GPLv2+
+LICENSE_FILE= ${WRKSRC}/COPYING
+
USES= gmake libtool motif tar:bzip2
GNU_CONFIGURE= yes
+PLIST_FILES= bin/xanalyser lib/X11/app-defaults/XAnalyser man/man1/xanalyser.1.gz
+
post-patch:
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
-e 's|%%MOTIFLIB%%|${MOTIFLIB} |g' \
diff --git a/audio/xanalyser/files/patch-src_Analyser.cc b/audio/xanalyser/files/patch-src_Analyser.cc
new file mode 100644
index 000000000000..bc2d119ff92b
--- /dev/null
+++ b/audio/xanalyser/files/patch-src_Analyser.cc
@@ -0,0 +1,128 @@
+--- src/Analyser.cc.orig 2018-01-19 00:36:36 UTC
++++ src/Analyser.cc
+@@ -146,7 +146,7 @@ Analyser::resize (bool redraw)
+ marker[1] = f2sx (f[1]);
+
+ if (redraw) {
+- XRectangle rect = { 0, 0, width, height };
++ XRectangle rect = { 0, 0, static_cast<unsigned short>(width), static_cast<unsigned short>(height) };
+ draw (rect);
+ }
+ }
+@@ -169,7 +169,7 @@ Analyser::clear (bool drawit)
+ calcfoo ();
+
+ if (drawit) {
+- XRectangle rect = { 0, 0, width, height };
++ XRectangle rect = { 0, 0, static_cast<unsigned short>(width), static_cast<unsigned short>(height) };
+ draw (rect);
+ }
+ }
+@@ -188,7 +188,7 @@ Analyser::drawpeaktext (bool showit)
+
+ snprintf (peak_text, 10, "%i", (int) peak_f);
+
+- peak_sx = f2sx (peak_f) - (strlen (peak_text) * font_width) / 2;
++ peak_sx = f2sx (peak_f) - (strlen (peak_text) * font_width) / 2;
+ peak_sy = db2sy (peak_db) - 6;
+
+ XSetForeground (display, gc, xanalyser.markercolor);
+@@ -203,7 +203,7 @@ void
+ Analyser::drawpeakmarker ()
+ {
+ for (int m = 0; m < 2; m++) {
+- XRectangle rect = { marker[m], 0, 1, height };
++ XRectangle rect = { static_cast<short>(marker[m]), 0, 1, static_cast<unsigned short>(height) };
+ draw (rect);
+ }
+ }
+@@ -251,13 +251,13 @@ Analyser::drawgrid (bool withtext)
+ else
+ XSetForeground (display, gc, xanalyser.minorgridcolor);
+
+- XDrawLine (display, window, gc, 0, sy, width - 1, sy);
++ XDrawLine (display, window, gc, 0, sy, static_cast<unsigned short>(width) - 1, sy);
+
+ if (withtext) {
+ const int size = 10;
+ char buffer[size];
+ snprintf (buffer, size, "%+d", db);
+- XDrawString (display, window, gc, width - 2 - font_width *
++ XDrawString (display, window, gc, static_cast<unsigned short>(width) - 2 - font_width *
+ strlen (buffer), sy - 2, buffer, strlen (buffer));
+ }
+ }
+@@ -280,7 +280,7 @@ Analyser::draw (XRectangle rect, bool complete)
+ if (complete) {
+
+ XSetForeground (display, gc, xanalyser.backgroundcolor);
+- XFillRectangle (display, window, gc, 0, 0, width, height);
++ XFillRectangle (display, window, gc, 0, 0, static_cast<unsigned short>(width), height);
+
+ XSetForeground (display, gc, xanalyser.datacolor);
+ for (int sx = first; sx <= last; sx++) {
+@@ -344,7 +344,7 @@ Analyser::realize (Display* display, Window window)
+
+ gc = XCreateGC (display, window, gc_mask, &gc_values);
+
+- // get width and height
++ // get static_cast<unsigned short>(width) and height
+
+ myXGetDrawableSize (display, window, &width, &height);
+
+@@ -382,8 +382,8 @@ Analyser::realize (Display* display, Window window)
+ envelope ();
+
+ marker[0] = 0;
+- // note: it might be that width - 1 != num_fft - 1
+- marker[1] = width - 1;
++ // note: it might be that static_cast<unsigned short>(width) - 1 != num_fft - 1
++ marker[1] = static_cast<unsigned short>(width) - 1;
+
+ return true;
+ }
+@@ -427,7 +427,7 @@ Analyser::shot (const int32_t* buffer, int channel, bo
+ analyse (buffer, channel);
+
+ if (drawit) {
+- XRectangle rect = { 0, 0, width, height };
++ XRectangle rect = { 0, 0, static_cast<unsigned short>(width), static_cast<unsigned short>(height) };
+ draw (rect, false);
+ }
+
+@@ -608,7 +608,7 @@ Analyser::set_search (bool search)
+ drawpeaktext (true);
+
+ for (int m = 0; m < 2; m++) {
+- XRectangle rect = { marker[m], 0, 1, height };
++ XRectangle rect = { static_cast<short>(marker[m]), 0, 1, static_cast<unsigned short>(height) };
+ draw (rect);
+ }
+
+@@ -618,7 +618,7 @@ Analyser::set_search (bool search)
+ drawpeaktext (false);
+
+ for (int m = 0; m < 2; m++) {
+- XRectangle rect = { marker[m], 0, 1, height };
++ XRectangle rect = { static_cast<short>(marker[m]), 0, 1, static_cast<unsigned short>(height) };
+ draw (rect);
+ }
+
+@@ -647,7 +647,7 @@ Analyser::set_marker (short sx)
+
+ // remove old marker and text
+
+- XRectangle rect = { old, 0, 1, height };
++ XRectangle rect = { old, 0, 1, static_cast<unsigned short>(height) };
+ draw (rect);
+
+ XSetClipMask (display, gc, None);
+@@ -662,7 +662,7 @@ Analyser::set_marker (short sx)
+ peaksearch (true);
+
+ for (int m = 0; m < 2; m++) {
+- XRectangle rect = { marker[m], 0, 1, height };
++ XRectangle rect = { static_cast<short>(marker[m]), 0, 1, static_cast<unsigned short>(height) };
+ draw (rect);
+ }
+
diff --git a/audio/xanalyser/files/patch-src_Scope.cc b/audio/xanalyser/files/patch-src_Scope.cc
new file mode 100644
index 000000000000..99f9ed408edc
--- /dev/null
+++ b/audio/xanalyser/files/patch-src_Scope.cc
@@ -0,0 +1,29 @@
+--- src/Scope.cc.orig 2018-01-19 00:47:02 UTC
++++ src/Scope.cc
+@@ -132,7 +132,7 @@ Scope::resize (bool redraw)
+ clearbuffer ();
+
+ if (redraw) {
+- XRectangle rect = { 0, 0, width, height };
++ XRectangle rect = { 0, 0, static_cast<unsigned short>(width), static_cast<unsigned short>(height) };
+ draw (rect);
+ }
+ }
+@@ -193,7 +193,7 @@ Scope::clear (bool drawit)
+ clearbuffer ();
+
+ if (drawit) {
+- XRectangle rect = { 0, 0, width, height };
++ XRectangle rect = { 0, 0, static_cast<unsigned short>(width), static_cast<unsigned short>(height) };
+ draw (rect);
+ }
+ }
+@@ -310,7 +310,7 @@ Scope::shot (const int32_t* buffer, bool drawit)
+ }
+
+ if (drawit && sample.frame_count % num_count == num_count - 1) {
+- XRectangle rect = { 0, 0, width, height };
++ XRectangle rect = { 0, 0, static_cast<unsigned short>(width), static_cast<unsigned short>(height) };
+ draw (rect);
+ }
+
diff --git a/audio/xanalyser/files/patch-src_control.cc b/audio/xanalyser/files/patch-src_control.cc
new file mode 100644
index 000000000000..fdfd997a9909
--- /dev/null
+++ b/audio/xanalyser/files/patch-src_control.cc
@@ -0,0 +1,29 @@
+--- src/control.cc.orig 2018-01-19 00:48:36 UTC
++++ src/control.cc
+@@ -566,7 +566,7 @@ analyser_callback (Widget, XtPointer client_data, XtPo
+ XtWindow (analyser_drawing_w[n]));
+
+ XExposeEvent* e = (XExposeEvent*) c->event;
+- XRectangle rect = { e->x, e->y, e->width, e->height };
++ XRectangle rect = { static_cast<short>(e->x), static_cast<short>(e->y), static_cast<unsigned short>(e->width), static_cast<unsigned short>(e->height) };
+ analyser[n].draw (rect);
+
+ } break;
+@@ -585,7 +585,7 @@ analyser_callback (Widget, XtPointer client_data, XtPo
+ case ButtonPress:
+ case MotionNotify: {
+ XButtonPressedEvent* e = (XButtonPressedEvent*) c->event;
+- XPoint point = { e->x, e->y };
++ XPoint point = { static_cast<short>(e->x),static_cast<short>(e->y) };
+
+ analyser[0].set_marker (point.x);
+ analyser[1].set_marker (point.x);
+@@ -709,7 +709,7 @@ scope_callback (Widget, XtPointer, XtPointer call_data
+ scope.realize (XtDisplay (scope_drawing_w), XtWindow (scope_drawing_w));
+
+ XExposeEvent* e = (XExposeEvent*) c->event;
+- XRectangle rect = { e->x, e->y, e->width, e->height };
++ XRectangle rect = { static_cast<short>(e->x),static_cast<short>(e->y), static_cast<unsigned short>(e->width), static_cast<unsigned short>(e->height) };
+ scope.draw (rect);
+
+ } break;
diff --git a/audio/xanalyser/pkg-plist b/audio/xanalyser/pkg-plist
deleted file mode 100644
index ef7d53553292..000000000000
--- a/audio/xanalyser/pkg-plist
+++ /dev/null
@@ -1,3 +0,0 @@
-bin/xanalyser
-lib/X11/app-defaults/XAnalyser
-man/man1/xanalyser.1.gz