[35964] trunk/dports/multimedia

milosh at macports.org milosh at macports.org
Fri Apr 11 05:53:05 PDT 2008


Revision: 35964
          http://trac.macosforge.org/projects/macports/changeset/35964
Author:   milosh at macports.org
Date:     2008-04-11 05:53:03 -0700 (Fri, 11 Apr 2008)

Log Message:
-----------
New port: moc (thanks to martinvazquez)

Added Paths:
-----------
    trunk/dports/multimedia/moc/
    trunk/dports/multimedia/moc/Portfile
    trunk/dports/multimedia/moc/files/
    trunk/dports/multimedia/moc/files/patch-autojack.diff
    trunk/dports/multimedia/moc/files/patch-configure.diff
    trunk/dports/multimedia/moc/files/patch-options.c.diff

Added: trunk/dports/multimedia/moc/Portfile
===================================================================
--- trunk/dports/multimedia/moc/Portfile	                        (rev 0)
+++ trunk/dports/multimedia/moc/Portfile	2008-04-11 12:53:03 UTC (rev 35964)
@@ -0,0 +1,56 @@
+# $Id$
+
+PortSystem          1.0
+
+name                moc
+version             2.4.3
+categories          multimedia
+maintainers         martinvazquez.net:eu
+description         MOC (music on console) is a console audio player for LINUX/UNIX
+long_description    MOC (music on console) is a console audio player for LINUX/UNIX \
+                    designed to be powerful and easy to use. \
+                    Internet stream (Icecast, Shoutcast) are supported, \
+                    key mapping can be fully customized. \
+                    Supported file formats are: mp3, Ogg Vorbis, FLAC, Musepack, Speex, WAVE, \
+                    AIFF, AU (and other less popular formats supported by libsndfile. New formats \
+                    support is under development.
+
+homepage            http://moc.daper.net
+platforms           darwin
+master_sites        ftp://ftp.daper.net/pub/soft/moc/stable/
+
+checksums           md5 8808082848e90eeec5415baaec7e98ad \
+                    sha1 d9b54636f51f5366e94b684ddff3e869b1c634ac \
+                    rmd160 34470535b16ab329a9055b05550028ceb0a860f7
+
+use_bzip2           yes
+
+depends_lib         port:libiconv \
+                    port:ncurses \
+                    port:ffmpeg \
+                    port:libmad \
+                    port:mpc \
+                    port:libid3tag \
+                    port:libsamplerate \
+                    port:jack \
+                    port:curl
+
+patchfiles          patch-configure.diff \
+                    patch-options.c.diff
+
+configure.args      --with-jack --without-vorbis
+
+default_variants    +autojack
+
+variant autojack description {Autostart jack on mocp init and close it on server stop} {
+        patchfiles-append       patch-autojack.diff
+}
+
+variant vorbis description {Add support for ogg files} {
+        depends_lib-append      port:libvorbis
+        configure.args-delete   --without-vorbis
+}
+
+variant without_ffmpeg description {Disable some decoders provided by ffmpeg} {
+        depends_lib-delete      port:ffmpeg
+}

Added: trunk/dports/multimedia/moc/files/patch-autojack.diff
===================================================================
--- trunk/dports/multimedia/moc/files/patch-autojack.diff	                        (rev 0)
+++ trunk/dports/multimedia/moc/files/patch-autojack.diff	2008-04-11 12:53:03 UTC (rev 35964)
@@ -0,0 +1,175 @@
+diff -ur ../moc-2.4.3.orig/main.c ./main.c
+--- ../moc-2.4.3.orig/main.c	2006-02-12 12:55:10.000000000 +0100
++++ ./main.c	2008-03-26 22:48:14.000000000 +0100
+@@ -264,38 +264,40 @@
+ 	printf (PACKAGE_STRING"\n"
+ "Usage:\n"
+ "%s [OPTIONS]... [FILE]...\n"
+-"-V --version           Print program version and exit.\n"
+-"-h --help              Print usage and exit.\n"
++"-V --version                 Print program version and exit.\n"
++"-h --help                    Print usage and exit.\n"
+ #ifndef NDEBUG
+-"-D --debug             Turn on logging to a file.\n"
++"-D --debug                   Turn on logging to a file.\n"
+ #endif
+-"-S --server            Run only the server.\n"
+-"-F --foreground        Run server in foreground, log to stdout.\n"
+-"-R --sound-driver NAME Use the specified sound driver (oss, alsa, jack, null).\n"
+-"-m --music-dir         Start in MusicDir.\n"
+-"-a --append            Append the files/directories/playlists passed in\n"
+-"                       the command line to playlist and exit.\n"
+-"-c --clear             Clear the playlist and exit.\n"
+-"-p --play              Start playing from the first item on the playlist.\n"
+-"-l --playit            Play files given on command line without modifing the\n"
+-"                       playlist.\n"
+-"-s --stop              Stop playing.\n"
+-"-f --next              Play next song.\n"
+-"-r --previous          Play previous song.\n"
+-"-x --exit              Shutdown the server.\n"
+-"-T --theme theme       Use selected theme file (read from ~/.moc/themes if\n"
+-"                       the path is not absolute.\n"
+-"-C --config FILE       Use the specified config file instead of the default.\n"
+-"-M --moc-dir DIR       Use the specified MOC directory instead of the default.\n"
+-"-P --pause             Pause.\n"
+-"-U --unpause           Unpause.\n"
+-"-G --toggle-pause      Toggle between play/pause.\n"
+-"-y --sync              Synchronize the playlist with other clients.\n"
+-"-n --nosync            Don't synchronize the playlist with other clients.\n"
+-"-A --ascii             Use ASCII characters to draw lines.\n"
+-"-i --info              Print the information about the currently played file.\n"
+-"-e --recursively       Alias for -a.\n"
+-"-k --seek N            Seek by N seconds (can be negative).\n"
++"-S --server                  Run only the server.\n"
++"-F --foreground              Run server in foreground, log to stdout.\n"
++"-R --sound-driver NAME       Use the specified sound driver (oss, alsa, jack, null).\n"
++"-j --autostart-jackd         Start jackd on server init, and close it on server exit.\n"
++"-J --no-autostart-jackd      Do not start jackd on server init, and not close it on server exit.\n"
++"-m --music-dir               Start in MusicDir.\n"
++"-a --append                  Append the files/directories/playlists passed in\n"
++"                             the command line to playlist and exit.\n"
++"-c --clear                   Clear the playlist and exit.\n"
++"-p --play                    Start playing from the first item on the playlist.\n"
++"-l --playit                  Play files given on command line without modifing the\n"
++"                             playlist.\n"
++"-s --stop                    Stop playing.\n"
++"-f --next                    Play next song.\n"
++"-r --previous                Play previous song.\n"
++"-x --exit                    Shutdown the server.\n"
++"-T --theme theme             Use selected theme file (read from ~/.moc/themes if\n"
++"                             the path is not absolute.\n"
++"-C --config FILE             Use the specified config file instead of the default.\n"
++"-M --moc-dir DIR             Use the specified MOC directory instead of the default.\n"
++"-P --pause                   Pause.\n"
++"-U --unpause                 Unpause.\n"
++"-G --toggle-pause            Toggle between play/pause.\n"
++"-y --sync                    Synchronize the playlist with other clients.\n"
++"-n --nosync                  Don't synchronize the playlist with other clients.\n"
++"-A --ascii                   Use ASCII characters to draw lines.\n"
++"-i --info                    Print the information about the currently played file.\n"
++"-e --recursively             Alias for -a.\n"
++"-k --seek N                  Seek by N seconds (can be negative).\n"
+ , prg_name);
+ }
+ 
+@@ -410,6 +412,8 @@
+ 		{ "info",		0, NULL, 'i' },
+ 		{ "recursively",	0, NULL, 'e' },
+ 		{ "seek",		1, NULL, 'k' },
++		{ "autostart-jackd",		0, NULL, 'j' },
++		{ "no-autostart-jackd",		0, NULL, 'J' },
+ 		{ 0, 0, 0, 0 }
+ 	};
+ 	int ret, opt_index = 0;
+@@ -420,7 +424,7 @@
+ 	options_init ();
+ 
+ 	while ((ret = getopt_long(argc, argv,
+-					"VhDSFR:macpsxT:C:M:PUynArfiGelk:",
++					"VhDSFR:macpsxT:C:M:PUynArfiGelk:jJ",
+ 					long_options, &opt_index)) != -1) {
+ 		switch (ret) {
+ 			case 'V':
+@@ -446,6 +450,14 @@
+ 				option_set_str ("SoundDriver", optarg);
+ 				option_ignore_config ("SoundDriver");
+ 				break;
++			case 'j':
++				option_set_int ("AutoStartJackd", 1);
++				option_ignore_config ("AutoStartJackd");
++				break;
++			case 'J':
++				option_set_int ("AutoStartJackd", 0);
++				option_ignore_config ("AutoStartJackd");
++				break;
+ 			case 'm':
+ 				option_set_int ("StartInMusicDir", 1);
+ 				option_ignore_config ("StartInMusicDir");
+diff -ur ../moc-2.4.3.orig/options.c ./options.c
+--- ../moc-2.4.3.orig/options.c	2007-05-22 20:24:34.000000000 +0200
++++ ./options.c	2008-03-26 20:02:14.000000000 +0100
+@@ -217,6 +217,10 @@
+ 	option_add_int ("SetXtermTitle", 1);
+ 	option_add_int ("PlaylistFullPaths", 1);
+ 	option_add_int ("Allow24bitOutput", 0);
++	
++	// Option to start Jackd on server init
++	option_add_int ("AutoStartJackd", 1);
++	
+ }
+ 
+ /* Return 1 if a parameter to an integer option is valid. */
+@@ -243,6 +247,7 @@
+ 			|| !strcasecmp(name, "SetXtermTitle")
+ 			|| !strcasecmp(name, "PlaylistFullPaths")
+ 			|| !strcasecmp(name, "Allow24bitOutput")
++			|| !strcasecmp(name, "AutoStartJackd")
+ 			) {
+ 		if (!(val == 1 || val == 0))
+ 			return 0;
+diff -ur ../moc-2.4.3.orig/server.c ./server.c
+--- ../moc-2.4.3.orig/server.c	2006-02-12 12:55:10.000000000 +0100
++++ server.c	2008-03-26 23:48:34.000000000 +0100
+@@ -48,6 +48,7 @@
+ 
+ #define SERVER_LOG	"mocp_server_log"
+ #define PID_FILE	"pid"
++#define JACKD_PATH "/opt/local/bin/jackd"
+ 
+ struct client
+ {
+@@ -324,6 +325,34 @@
+ 	if (listen(server_sock, 1) == -1)
+ 		fatal ("listen() failed: %s", strerror(errno));
+ 
++
++	/******* JACKd init ********/
++	if(options_get_int ("AutoStartJackd")){
++		int res;
++		pid_t pid;
++
++	        pid = fork();
++	        if (pid == (pid_t)-1) {
++	                perror("I can't start JACK\n");
++					res=1;
++	        }
++	        if (pid == 0) {
++	                printf("Starting JACKd");
++	                execl(JACKD_PATH,JACKD_PATH,"-R","-T","--silent","-d", "coreaudio",0);
++
++					_exit(1);
++	        }
++			else{
++				res=0;
++			}
++
++			if(!res){
++				sleep(1);
++			}
++	}
++	/***************************************/
++
++
+ 	audio_initialize ();
+ 	tags_cache_init (&tags_cache, options_get_int("TagsCacheSize") * 1024);
+ 	tags_cache_load (&tags_cache, create_file_name("tags_cache"));

Added: trunk/dports/multimedia/moc/files/patch-configure.diff
===================================================================
--- trunk/dports/multimedia/moc/files/patch-configure.diff	                        (rev 0)
+++ trunk/dports/multimedia/moc/files/patch-configure.diff	2008-04-11 12:53:03 UTC (rev 35964)
@@ -0,0 +1,12 @@
+diff -ur ../moc-2.4.3.orig/configure ./configure
+--- ../moc-2.4.3.orig/configure	2007-07-30 17:49:11.000000000 +0200
++++ ./configure	2008-03-26 19:32:00.000000000 +0100
+@@ -21998,7 +21998,7 @@
+ 		;;
+ esac
+ 
+-LDFLAGS="$LDFLAGS -export-dynamic"
++LDFLAGS="$LDFLAGS ${export_dynamic_flag}"
+ 
+ { echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+ echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }

Added: trunk/dports/multimedia/moc/files/patch-options.c.diff
===================================================================
--- trunk/dports/multimedia/moc/files/patch-options.c.diff	                        (rev 0)
+++ trunk/dports/multimedia/moc/files/patch-options.c.diff	2008-04-11 12:53:03 UTC (rev 35964)
@@ -0,0 +1,14 @@
+diff -ur ../moc-2.4.3.orig/options.c ./options.c
+--- ../moc-2.4.3.orig/options.c	2007-05-22 20:24:34.000000000 +0200
++++ ./options.c	2008-03-26 20:02:14.000000000 +0100
+@@ -172,8 +172,8 @@
+ 	option_add_int ("SyncPlaylist", 1);
+ 	option_add_int ("InputBuffer", 512);
+ 	option_add_int ("Prebuffering", 64);
+-	option_add_str ("JackOutLeft", "alsa_pcm:playback_1");
+-	option_add_str ("JackOutRight", "alsa_pcm:playback_2");
++	option_add_str ("JackOutLeft", "system:playback_1");
++	option_add_str ("JackOutRight", "system:playback_2");
+ 	option_add_int ("ASCIILines", 0);
+ 	option_add_str ("FastDir1", NULL);
+ 	option_add_str ("FastDir2", NULL);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080411/ccc34b9f/attachment-0001.html


More information about the macports-changes mailing list