[med-svn] [SCM] praat branch, master, updated. debian/5.3.14-1-45-geb6df89

Rafael Laboissiere rafael at laboissiere.net
Mon Apr 22 20:29:26 UTC 2013


The following commit has been merged in the master branch:
commit 0ea73638b7fe548bc64fac5f66fbdb1a3fbf1cc4
Author: Rafael Laboissiere <rafael at laboissiere.net>
Date:   Mon Apr 22 15:36:36 2013 +0200

    Build and install the sendpraat program
    
    - debian/rules: Adjust the building and cleaning this new program and its
      man page
    - debian/install.in: Install it
    - debian/patches/{allow-stand-alone-sendpraat,sendpraat-getenv-display,
      sendpraat-help-string}.patch: New patches needed for building the
      standalone version of the program and fixing minor bugs
    - debian/sendpraat.dbk: New man page source
    
    Git-Dch: Full

diff --git a/.gitignore b/.gitignore
index 3d28a8d..ca779bf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 *.a
 /makefile.defs
 /praat
+/sendpraat
 /*.1
 /debian/files
 /debian/praat.dirs
diff --git a/debian/install.in b/debian/install.in
index 55439b1..90ade97 100644
--- a/debian/install.in
+++ b/debian/install.in
@@ -1,4 +1,5 @@
 praat			@BINDIR@
+sendpraat		@BINDIR@
 debian/praat.xpm	@PIXDIR@
 debian/praat.svg	@SVGDIR@
 debian/praat.desktop    @APPDIR@
diff --git a/debian/patches/allow-stand-alone-sendpraat.patch b/debian/patches/allow-stand-alone-sendpraat.patch
new file mode 100644
index 0000000..de6f188
--- /dev/null
+++ b/debian/patches/allow-stand-alone-sendpraat.patch
@@ -0,0 +1,22 @@
+Description: Allow compilation of stand alone sendpraat program
+ Replace the "#if 0" in the source file sys/sendpraat.c by "#if
+ STAND_ALONE", such it is easier to generate the sendpraat program for
+ the Debian package.
+Author: Rafael Laboissiere <rafael at laboissiere.net>
+Forwarded: not-needed
+Last-Update: 2013-04-22
+
+--- praat-5.3.46.orig/sys/sendpraat.c
++++ praat-5.3.46/sys/sendpraat.c
+@@ -533,9 +533,9 @@ wchar_t *sendpraatW (void *display, cons
+ 
+ /*
+  * To compile sendpraat as a stand-alone program:
+- * temporarily change the following line to "#if 1" instead of "#if 0":
++ * Use the -DSTAND_ALONE option to the C compiler
+  */
+-#if 0
++#if STAND_ALONE
+ /*
+  * To compile on MacOS X:
+ cc -o sendpraat -framework CoreServices -I/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/Headers -I/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers sendpraat.c -Dmacintosh -DuseCarbon=1
diff --git a/debian/patches/sendpraat-getenv-display.patch b/debian/patches/sendpraat-getenv-display.patch
new file mode 100644
index 0000000..a065282
--- /dev/null
+++ b/debian/patches/sendpraat-getenv-display.patch
@@ -0,0 +1,24 @@
+Description: Get DISPLAY from the environment
+ The current code in sys/sendpraat.c hardcodes the value of the DISPLAY
+ (":0.0").  This is inappropriate when PRaat is run trhough, say, SSH,
+ in which case the DISPLAY would be something like "localhost:10.0".
+ In order to avoid this problem, the value of DISPLAY is obtained
+ using getenv() in this patch.
+Author: Rafael Laboissiere <rafael at laboissiere.net>
+Forwarded: no
+Last-Update: 2013-04-22
+
+--- praat-5.3.46.orig/sys/sendpraat.c
++++ praat-5.3.46/sys/sendpraat.c
+@@ -233,9 +233,9 @@ char *sendpraat (void *display, const ch
+ 			g_type_init ();
+ 			int displaySupplied = display != NULL;
+ 			if (! displaySupplied) {
+-				display = gdk_display_open (":0.0");   /* GdkDisplay* */
++				display = gdk_display_open (getenv ("DISPLAY"));   /* GdkDisplay* */
+ 				if (display == NULL) {
+-					sprintf (errorMessage, "Cannot open display :0.0.");
++					sprintf (errorMessage, "Cannot open display %s", getenv ("DISPLAY"));
+ 					return errorMessage;
+ 				}
+ 			}
diff --git a/debian/patches/sendpraat-help-string.patch b/debian/patches/sendpraat-help-string.patch
new file mode 100644
index 0000000..e6b58ef
--- /dev/null
+++ b/debian/patches/sendpraat-help-string.patch
@@ -0,0 +1,16 @@
+Description: Fix the help string of the sendpraat command
+Author: Rafael Laboissiere <rafael at laboissiere.net>
+Forwarded: no
+Last-Update: 2013-04-22
+
+--- praat-5.3.46.orig/sys/sendpraat.c
++++ praat-5.3.46/sys/sendpraat.c
+@@ -597,7 +597,7 @@ int main (int argc, char **argv) {
+ 		printf ("\n");
+ 		#if win
+ 			printf ("   sendpraat praat \"execute C:\\MyDocuments\\MyScript.praat\"\n");
+-		#elif mac
++		#else
+ 			printf ("   sendpraat praat \"execute ~/MyResearch/MyProject/MyScript.praat\"\n");
+ 		#endif
+ 		printf ("      Causes the program \"praat\" to execute a script.\n");
diff --git a/debian/patches/series b/debian/patches/series
index 5458732..49af79c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,4 @@
 use-ldflags.patch
+allow-stand-alone-sendpraat.patch
+sendpraat-getenv-display.patch
+sendpraat-help-string.patch
diff --git a/debian/praat.manpages b/debian/praat.manpages
index b1f73bc..67b1ffa 100644
--- a/debian/praat.manpages
+++ b/debian/praat.manpages
@@ -1 +1,2 @@
 praat.1
+sendpraat.1
diff --git a/debian/rules b/debian/rules
index 98d337b..2516a6d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -28,7 +28,8 @@ clean:
 	# Fix the lacking cleaning command for the main/ directory
 	[ ! -f makefile.defs ] || make -C main clean
 	rm -f makefile.defs $(DEBDIR)/praat.dirs		\
-		 $(DEBDIR)/praat.install $(DEBDIR)/praat.menu praat.1
+		 $(DEBDIR)/praat.install $(DEBDIR)/praat.menu	\
+		 sendpraat praat.1 sendpraat.1
 
 override_dh_auto_configure:
 	# Generate the debhelper files
@@ -45,7 +46,16 @@ override_dh_auto_configure:
 	# Generate the man page from the DocBook source
 	xmlto -m $(DEBDIR)/manpage.xsl man $<
 
-override_dh_auto_build: praat.1
+sendpraat: sys/sendpraat.c
+	# Build the sendpraat program
+	$(CC) $(shell dpkg-buildflags --get CPPFLAGS)		\
+		$(shell dpkg-buildflags --get CFLAGS)		\
+		$(shell dpkg-buildflags --get LDFLAGS)		\
+		$(shell pkg-config --cflags --libs gtk+-2.0)	\
+		-Wl,--as-needed -std=gnu99 -DSTAND_ALONE -DUNIX	\
+		-o sendpraat sys/sendpraat.c
+
+override_dh_auto_build: sendpraat praat.1 sendpraat.1
 	dh_auto_build
 
 override_dh_auto_install::
diff --git a/debian/sendpraat.dbk b/debian/sendpraat.dbk
new file mode 100644
index 0000000..8c5ea87
--- /dev/null
+++ b/debian/sendpraat.dbk
@@ -0,0 +1,196 @@
+<?xml version='1.0' encoding='ISO-8859-1'?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
+"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
+
+<!--
+
+Process this file with an XSLT processor: `xsltproc \
+-''-nonet /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\
+manpages/docbook.xsl manpage.dbk'.  A manual page
+<package>.<section> will be generated.  You may view the
+manual page with: nroff -man <package>.<section> | less'.  A
+typical entry in a Makefile or Makefile.am is:
+
+DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\
+manpages/docbook.xsl
+XP=xsltproc -''-nonet
+
+manpage.1: manpage.dbk
+        $(XP) $(DB2MAN) $<
+
+The xsltproc binary is found in the xsltproc package.  The
+XSL files are in docbook-xsl.  Please remember that if you
+create the nroff version in one of the debian/rules file
+targets (such as build), you will need to include xsltproc
+and docbook-xsl in your Build-Depends control field.
+
+-->
+
+  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
+  <!ENTITY dhfirstname "<firstname>Rafael</firstname>">
+  <!ENTITY dhsurname   "<surname>Laboissiere</surname>">
+  <!-- Please adjust the date whenever revising the manpage. -->
+  <!ENTITY dhdate      "<date>April 22, 2013</date>">
+  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
+       allowed: see man(7), man(1). -->
+  <!ENTITY dhsection   "<manvolnum>1</manvolnum>">
+  <!ENTITY dhemail     "<email>rafael at laboissiere.net</email>">
+  <!ENTITY dhusername  "Rafael Laboissiere">
+  <!ENTITY dhucpackage "<refentrytitle>SENDPRAAT</refentrytitle>">
+  <!ENTITY dhpackage   "sendpraat">
+
+  <!ENTITY debian      "Debian">
+  <!ENTITY gnu         "<acronym>GNU</acronym>">
+  <!ENTITY gpl         "&gnu; <acronym>GPL</acronym>">
+]>
+
+<refentry>
+  <refentryinfo>
+    <address>
+      &dhemail;
+    </address>
+    <author>
+      &dhfirstname;
+      &dhsurname;
+    </author>
+    <copyright>
+      <year>2003</year>
+      <holder>&dhusername;</holder>
+    </copyright>
+    &dhdate;
+  </refentryinfo>
+  <refmeta>
+    &dhucpackage;
+    &dhsection;
+    <refmiscinfo class="manual">User Commands</refmiscinfo>
+    <refmiscinfo class="source">Praat</refmiscinfo>
+  </refmeta>
+  <refnamediv>
+    <refname>&dhpackage;</refname>
+
+    <refpurpose>doing phonetics by computer</refpurpose>
+  </refnamediv>
+  <refsynopsisdiv>
+    <cmdsynopsis>
+      <command>&dhpackage;</command>
+      <arg choice="opt">
+        <replaceable class="parameter">timeOut</replaceable>
+      </arg>
+      <arg choice="req">
+         <replaceable class="parameter">program</replaceable>
+      </arg>
+      <arg choice="req" rep="repeat">
+        <replaceable class="parameter">message</replaceable>
+      </arg>
+    </cmdsynopsis>
+  </refsynopsisdiv>
+
+  <refsect1>
+    <title>DESCRIPTION</title>
+
+    <para>This manual page documents the <command>&dhpackage;</command>
+    command. It was written for the &debian; distribution because the
+    original program does not have a manual page.</para>
+
+    <para><command>&dhpackage;</command> is a program for sendings messages
+    to a running program that uses the Praat shell, like
+    <citerefentry><refentrytitle>praat</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
+    </para>
+
+  </refsect1>
+
+  <refsect1>
+    <title>ARGUMENTS</title>
+
+    <variablelist>
+      <varlistentry>
+        <term><replaceable class="parameter">program</replaceable></term>
+        <listitem>
+          <para>
+            the name of a running program that uses the Praat shell.
+          </para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><replaceable class="parameter">message ...</replaceable></term>
+        <listitem>
+          <para>
+            a sequence of Praat shell lines (commands and directives).
+            Each line is a separate argument.  Lines that contain spaces
+            should be put inside double quotes.
+          </para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
+        <term><replaceable class="parameter">timeOut</replaceable></term>
+        <listitem>
+          <para>
+            the number of seconds that sendpraat will wait for an answer
+            before writing an error message. A <replaceable
+            class="parameter">timeOut</replaceable> of 0 means that the
+            message will be sent asynchronously, i.e., that sendpraat will
+            return immediately without issuing any error message.
+          </para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+
+  </refsect1>
+
+  <refsect1>
+    <title>EXAMPLES</title>
+
+    <programlisting>sendpraat 0 praat Quit</programlisting>
+    
+    <para>Causes the program <command>praat</command> to quit
+    (gracefully).  This works because "Quit" is a fixed command in
+    Praat's Control menu.  Sendpraat will return immediately.</para>    
+    
+    <programlisting>sendpraat 1000 praat "Play reverse"</programlisting>
+    
+    <para>Causes the program <command>praat</command>, which can play
+    sounds, to play the selected Sound objects backwards.  This works
+    because "Play reverse" is an action command that becomes available in
+    Praat's dynamic menu when Sounds are selected.  Sendpraat will allow
+    "praat" at most 1000 seconds to perform this.</para>
+    
+    <programlisting>sendpraat praat "execute ~/MyResearch/MyProject/MyScript.praat"</programlisting>
+    
+    <para>Causes the program "praat" to execute a script.  Sendpraat will
+    allow <command>praat</command> at most 10 seconds (the default time
+    out).</para>
+    
+    <programlisting>sendpraat als "for i from 1 to 5" "Draw circle... 0.5 0.5 0.1*i" "endfor"</programlisting>
+    
+    <para>Causes the program <command>als</command> to draw five concentric
+    circles into its Picture window.</para>
+    
+  </refsect1>
+
+  <refsect1>
+    <title>AUTHOR</title>
+
+    <para>This manual page was written by &dhusername; <&dhemail;> for
+    the &debian; system (but may be used by others).  It was based on
+    the information provided by the help message of the
+    <command>&dhpackage;</command> program itself. Permission is
+    granted to copy, distribute and/or modify this document under the
+    terms of the &gnu; General Public License, Version 3 any later
+    version published by the Free Software Foundation.</para>
+    
+    <para>On Debian systems, the complete text of the GNU General Public
+    License can be found in /usr/share/common-licenses/GPL-3.</para>
+
+  </refsect1>
+
+  <refsect1>
+
+    <title>SEE ALSO</title>
+
+    <para>For further information, see the Praat website
+    (http://www.praat.org).</para>
+
+  </refsect1>
+
+</refentry>
+

-- 
Debian packaging for Praat



More information about the debian-med-commit mailing list