Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 May 2017 16:48:19 +0000 (UTC)
From:      Emanuel Haupt <ehaupt@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r440505 - in head/audio/aylet: . files
Message-ID:  <201705091648.v49GmJs8040739@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ehaupt
Date: Tue May  9 16:48:19 2017
New Revision: 440505
URL: https://svnweb.freebsd.org/changeset/ports/440505

Log:
  Update GTK interface from GTK 1.2 to GTK 2.0
  
  Obtained from:	gentoo portage

Added:
  head/audio/aylet/files/patch-ui.c   (contents, props changed)
  head/audio/aylet/files/patch-uigtk.c   (contents, props changed)
Modified:
  head/audio/aylet/Makefile
  head/audio/aylet/files/patch-Makefile

Modified: head/audio/aylet/Makefile
==============================================================================
--- head/audio/aylet/Makefile	Tue May  9 15:34:01 2017	(r440504)
+++ head/audio/aylet/Makefile	Tue May  9 16:48:19 2017	(r440505)
@@ -3,7 +3,7 @@
 
 PORTNAME=	aylet
 PORTVERSION=	0.5
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	audio
 MASTER_SITES=	http://www.worldofspectrum.org/pub/sinclair/music/players-unix/ \
 		LOCAL/ehaupt
@@ -14,13 +14,16 @@ COMMENT=	Aylet plays music files in the 
 LICENSE=	GPLv2
 LICENSE_FILE=	${WRKSRC}/COPYING
 
+LIB_DEPENDS=	libfontconfig.so:x11-fonts/fontconfig \
+		libfreetype.so:print/freetype2
+
 USES=		gettext-runtime pkgconfig
 
 OPTIONS_DEFINE=	GUI
 OPTIONS_DEFAULT=GUI
 OPTIONS_SUB=	yes
 
-GUI_USE=	XORG=x11,xext,xi GNOME=gtk12
+GUI_USE=	XORG=x11,xext,xi GNOME=cairo,gdkpixbuf2,gtk20
 
 ALL_TARGET=	aylet
 GUI_ALL_TARGET=	xaylet

Modified: head/audio/aylet/files/patch-Makefile
==============================================================================
--- head/audio/aylet/files/patch-Makefile	Tue May  9 15:34:01 2017	(r440504)
+++ head/audio/aylet/files/patch-Makefile	Tue May  9 16:48:19 2017	(r440505)
@@ -1,6 +1,6 @@
 --- Makefile.orig	2005-12-18 03:05:08 UTC
 +++ Makefile
-@@ -2,7 +2,7 @@
+@@ -2,12 +2,12 @@
  
  # You need an ANSI C compiler. gcc is probably best.
  #
@@ -9,6 +9,12 @@
  
  # Compiler options (and sound driver) to use. This one is for Linux,
  # and other OSS-using systems.
+ #
+-CFLAGS=-O -Wall -DDRIVER_OSS
++CFLAGS+=-Wall -DDRIVER_OSS
+ 
+ # for OpenBSD, uncomment this:
+ #CFLAGS=-O -Wall -DDRIVER_OPENBSD
 @@ -19,10 +19,10 @@ CURSES_LIB=-lncurses
  
  # dest for make install
@@ -23,7 +29,28 @@
  
  # if you want the X version to be installed in the usual X executables
  # directory, uncomment this (altering if necessary):
-@@ -52,10 +52,9 @@ installdirs:
+@@ -37,25 +37,27 @@ MANDIR=$(PREFIX)/man/man1
+ OBJS=main.o sound.o ui.o z80.o drv-oss.o drv-obsd.o
+ XOBJS=main.o sound.o uigtk.o z80.o drv-oss.o drv-obsd.o
+ 
++GTK_CFLAGS+=        `pkg-config --cflags gtk+-2.0` -DGTK2
++GTK_LDFLAGS+=       `pkg-config --libs gtk+-2.0` -DGTK2
++
+ all: aylet xaylet
+ 
+ aylet: $(OBJS)
+-	$(CC) -o aylet $(OBJS) $(CURSES_LIB)
++	$(CC) $(LDFLAGS) $(CFLAGS) -o aylet $(OBJS) $(CURSES_LIB)
+ 
+ xaylet: $(XOBJS)
+-	$(CC) -o xaylet $(XOBJS) `gtk-config --libs`
++	$(CC) $(GTK_CFLAGS) $(GTK_LDFLAGS) $(LDFLAGS) $(CFLAGS) -o xaylet $(XOBJS)
+ 
+ uigtk.o: uigtk.c
+-	$(CC) $(CFLAGS) `gtk-config --cflags` -c uigtk.c -o uigtk.o
++	$(CC) $(GTK_CFLAGS) $(CFLAGS) $(LDFLAGS) -c uigtk.c -o uigtk.o
+ 
+ installdirs:
  	/bin/sh ./mkinstalldirs $(BINDIR) $(XBINDIR) $(MANDIR)
  
  install: installdirs

Added: head/audio/aylet/files/patch-ui.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/aylet/files/patch-ui.c	Tue May  9 16:48:19 2017	(r440505)
@@ -0,0 +1,23 @@
+--- ui.c.orig	2003-11-27 19:42:47 UTC
++++ ui.c
+@@ -5,7 +5,9 @@
+  */
+ 
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <signal.h>
+ #include <curses.h>
+@@ -188,8 +190,8 @@ if(need_update)
+   {
+   need_update=0;
+   draw_frame();
+-  draw_status(ay_filenames[ay_file],aydata.miscstr,aydata.authorstr,
+-              ay_track+1,aydata.tracks[ay_track].namestr);
++  draw_status(ay_filenames[ay_file],(char *)aydata.miscstr, (char *)aydata.authorstr,
++              ay_track+1, (char *)aydata.tracks[ay_track].namestr);
+   }
+ 
+ /* update time display */

Added: head/audio/aylet/files/patch-uigtk.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/aylet/files/patch-uigtk.c	Tue May  9 16:48:19 2017	(r440505)
@@ -0,0 +1,177 @@
+--- uigtk.c.orig	2002-09-14 15:45:45 UTC
++++ uigtk.c
+@@ -14,11 +14,13 @@
+ #include "ui.h"
+ 
+ /* button pixmaps */
++#ifndef GTK2_6
+ #include "button1.xpm"
+ #include "button2.xpm"
+ #include "button3.xpm"
+ #include "button4.xpm"
+ #include "button5.xpm"
++#endif
+ 
+ 
+ static GtkWidget *window,*vbox,*detailstbl,*detaillabel[5];
+@@ -107,6 +109,11 @@ GtkWidget *pixmap;
+ GdkBitmap *bitmap,*mask;
+ int tbl_row,width;
+ 
++#ifdef GTK2
++#define gtk_accel_group_get_default() accel
++  GtkAccelGroup *accel;
++#endif
++
+ window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ gtk_signal_connect(GTK_OBJECT(window),"destroy",
+                    GTK_SIGNAL_FUNC(cb_doquit),NULL);
+@@ -116,6 +123,11 @@ gtk_widget_set_events(window,GDK_KEY_PRE
+ gtk_window_set_title(GTK_WINDOW(window),"xaylet");
+ gtk_window_set_policy(GTK_WINDOW(window),FALSE,TRUE,FALSE);	/* XXX? */
+ 
++#ifdef GTK2
++  accel = gtk_accel_group_new ();
++  gtk_window_add_accel_group (GTK_WINDOW (window), accel);
++#endif
++
+ /* main vbox */
+ vbox=gtk_vbox_new(FALSE,0);
+ gtk_container_add(GTK_CONTAINER(window),vbox);
+@@ -194,7 +206,11 @@ DO_TBL_LEFT(statustbl,1, 0,"Time:");
+ DO_TBL_RIGHT(statustbl,1, 1,2,"");
+ label_for_time=label;
+ 
++#ifdef GTK2
++  highspeed_widget = gtk_check_button_new_with_mnemonic ("_High speed");
++#else
+ highspeed_widget=gtk_check_button_new_with_label("High-speed");
++#endif
+ /* don't allow focus, looks too weird and we have shortcut */
+ GTK_WIDGET_UNSET_FLAGS(highspeed_widget,GTK_CAN_FOCUS);
+ gtk_table_attach_defaults(GTK_TABLE(statustbl),highspeed_widget, 2,4, 0,2);
+@@ -227,6 +243,21 @@ gtk_table_set_row_spacings(GTK_TABLE(but
+ gtk_container_set_border_width(GTK_CONTAINER(buttontbl),5);
+ gtk_widget_show(buttontbl);
+ 
++#ifdef GTK2_6 /* >= GTK+ 2.6 */
++#define ADD_PIXMAP_TO_BUTTON(button,xpm,stock) \
++  pixmap = gtk_image_new_from_stock (GTK_STOCK_MEDIA_##stock, \
++				     GTK_ICON_SIZE_BUTTON); \
++  gtk_container_add (GTK_CONTAINER ((button)), pixmap); \
++  gtk_widget_show (pixmap)
++#else /* < GTK+ 2.6 */
++#define ADD_PIXMAP_TO_BUTTON(button,xpm,stock) \
++  bitmap=gdk_pixmap_create_from_xpm_d(window->window,&mask,	\
++                                      &(window->style->black),	\
++                                      (xpm));			\
++  pixmap=gtk_pixmap_new(bitmap,mask);				\
++  gtk_container_add(GTK_CONTAINER(button),pixmap);		\
++  gtk_widget_show(pixmap)
++#endif
+ 
+ hbox=gtk_hbox_new(TRUE,5);
+ gtk_table_attach_defaults(GTK_TABLE(buttontbl),hbox, 0,4, 0,1);
+@@ -236,16 +267,8 @@ gtk_widget_show(hbox);
+ /* XXX this seems to be needed here, but is it ok? */
+ gtk_widget_realize(window);
+ 
+-#define ADD_PIXMAP_TO_BUTTON(button,xpm) \
+-  bitmap=gdk_pixmap_create_from_xpm_d(window->window,&mask,	\
+-                                      &(window->style->black),	\
+-                                      (xpm));			\
+-  pixmap=gtk_pixmap_new(bitmap,mask);				\
+-  gtk_container_add(GTK_CONTAINER(button),pixmap);		\
+-  gtk_widget_show(pixmap)
+-
+ button=gtk_button_new();
+-ADD_PIXMAP_TO_BUTTON(button,button1);
++ADD_PIXMAP_TO_BUTTON(button,button1,PREVIOUS);
+ gtk_box_pack_start(GTK_BOX(hbox),button,TRUE,TRUE,0);
+ gtk_signal_connect(GTK_OBJECT(button),"clicked",
+                    GTK_SIGNAL_FUNC(cb_button_prev_track),NULL);
+@@ -256,7 +279,7 @@ GTK_WIDGET_UNSET_FLAGS(button,GTK_CAN_FO
+ gtk_widget_show(button);
+ 
+ button=gtk_button_new();
+-ADD_PIXMAP_TO_BUTTON(button,button2);
++ADD_PIXMAP_TO_BUTTON(button,button2,PLAY);
+ gtk_box_pack_start(GTK_BOX(hbox),button,TRUE,TRUE,0);
+ gtk_signal_connect(GTK_OBJECT(button),"clicked",
+                    GTK_SIGNAL_FUNC(cb_button_play),NULL);
+@@ -266,7 +289,7 @@ GTK_WIDGET_UNSET_FLAGS(button,GTK_CAN_FO
+ gtk_widget_show(button);
+ 
+ button=gtk_button_new();
+-ADD_PIXMAP_TO_BUTTON(button,button3);
++ADD_PIXMAP_TO_BUTTON(button,button3,PAUSE);
+ gtk_box_pack_start(GTK_BOX(hbox),button,TRUE,TRUE,0);
+ gtk_signal_connect(GTK_OBJECT(button),"clicked",
+                    GTK_SIGNAL_FUNC(cb_button_pause),NULL);
+@@ -276,7 +299,7 @@ GTK_WIDGET_UNSET_FLAGS(button,GTK_CAN_FO
+ gtk_widget_show(button);
+ 
+ button=gtk_button_new();
+-ADD_PIXMAP_TO_BUTTON(button,button4);
++ADD_PIXMAP_TO_BUTTON(button,button4,STOP);
+ gtk_box_pack_start(GTK_BOX(hbox),button,TRUE,TRUE,0);
+ gtk_signal_connect(GTK_OBJECT(button),"clicked",
+                    GTK_SIGNAL_FUNC(cb_button_stop),NULL);
+@@ -286,7 +309,7 @@ GTK_WIDGET_UNSET_FLAGS(button,GTK_CAN_FO
+ gtk_widget_show(button);
+ 
+ button=gtk_button_new();
+-ADD_PIXMAP_TO_BUTTON(button,button5);
++ADD_PIXMAP_TO_BUTTON(button,button5,NEXT);
+ gtk_box_pack_start(GTK_BOX(hbox),button,TRUE,TRUE,0);
+ gtk_signal_connect(GTK_OBJECT(button),"clicked",
+                    GTK_SIGNAL_FUNC(cb_button_next_track),NULL);
+@@ -295,7 +318,11 @@ gtk_widget_add_accelerator(button,"click
+ GTK_WIDGET_UNSET_FLAGS(button,GTK_CAN_FOCUS);
+ gtk_widget_show(button);
+ 
++#ifdef GTK2
++  button = gtk_button_new_with_mnemonic ("_Restart");
++#else
+ button=gtk_button_new_with_label("Restart");
++#endif
+ gtk_box_pack_start(GTK_BOX(hbox),button,TRUE,TRUE,0);
+ gtk_signal_connect(GTK_OBJECT(button),"clicked",
+                    GTK_SIGNAL_FUNC(cb_button_restart),NULL);
+@@ -304,17 +331,24 @@ gtk_widget_add_accelerator(button,"click
+ GTK_WIDGET_UNSET_FLAGS(button,GTK_CAN_FOCUS);
+ gtk_widget_show(button);
+ 
+-
+ /* second row, these go straight on the table */
+ /* backspace/delete/space are dealt with by keypress() */
++#ifdef GTK2
++  button = gtk_button_new_with_mnemonic ("_Previous file");
++#else
+ button=gtk_button_new_with_label("Prev File");
++#endif
+ gtk_table_attach_defaults(GTK_TABLE(buttontbl),button, 1,2, 1,2);
+ gtk_signal_connect(GTK_OBJECT(button),"clicked",
+                    GTK_SIGNAL_FUNC(cb_button_prev_file),NULL);
+ GTK_WIDGET_UNSET_FLAGS(button,GTK_CAN_FOCUS);
+ gtk_widget_show(button);
+ 
++#ifdef GTK2
++  button = gtk_button_new_with_mnemonic("_Next file");
++#else
+ button=gtk_button_new_with_label("Next File");
++#endif
+ gtk_table_attach_defaults(GTK_TABLE(buttontbl),button, 2,3, 1,2);
+ gtk_signal_connect(GTK_OBJECT(button),"clicked",
+                    GTK_SIGNAL_FUNC(cb_button_next_file),NULL);
+@@ -386,8 +420,8 @@ retval=1;
+ if(need_update)
+   {
+   need_update=0;
+-  ui_draw_status(ay_filenames[ay_file],aydata.miscstr,aydata.authorstr,
+-                 ay_track+1,aydata.tracks[ay_track].namestr);
++  ui_draw_status(ay_filenames[ay_file], (char *)aydata.miscstr, (char *)aydata.authorstr,
++                 ay_track+1, (char *)aydata.tracks[ay_track].namestr);
+   }
+ 
+ /* update time display */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201705091648.v49GmJs8040739>