~ruther/guix-local

b4e655e5f1ce3064c805f1ff4c0b6693d52814e0 — Eric Bavier 10 years ago 0573a92
gnu: Add doc++.

* gnu/packages/documentation.scm (doc++): New variable.
* gnu/packages/patches/doc++-include-directives.patch,
  gnu/packages/patches/doc++-segfault-fix.patch: New files.
* gnu-system.am (dist_patch_DATA): Add them.
M gnu/local.mk => gnu/local.mk +2 -0
@@ 458,6 458,8 @@ dist_patch_DATA =						\
  gnu/packages/patches/dico-libtool-deterministic.patch		\
  gnu/packages/patches/diffutils-gets-undeclared.patch		\
  gnu/packages/patches/dfu-programmer-fix-libusb.patch		\
  gnu/packages/patches/doc++-include-directives.patch		\
  gnu/packages/patches/doc++-segfault-fix.patch			\
  gnu/packages/patches/doxygen-test.patch			\
  gnu/packages/patches/duplicity-piped-password.patch		\
  gnu/packages/patches/duplicity-test_selection-tmp.patch	\

M gnu/packages/documentation.scm => gnu/packages/documentation.scm +28 -0
@@ 1,6 1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014, 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
;;;
;;; This file is part of GNU Guix.
;;;


@@ 28,6 29,7 @@
  #:use-module (gnu packages bison)
  #:use-module (gnu packages flex)
  #:use-module (gnu packages graphviz)
  #:use-module (gnu packages gettext)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages xml)
  #:autoload   (gnu packages zip) (unzip))


@@ 87,3 89,29 @@ programming languages such as C, Objective-C, C#, PHP, Java, Python,
IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl,
and to some extent D.")
    (license gpl3+)))

(define-public doc++
  (package
    (name "doc++")
    (version "3.4.10")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://sourceforge.net/projects/docpp/"
                                  "files/doc++-" version ".tar.gz"))
              (sha256
               (base32
                "0i37zlxl8g352s4hzpdx0657k5x3czh3xcsfr27irc708gb277pn"))
              (patches (search-patches "doc++-include-directives.patch"
                                       "doc++-segfault-fix.patch"))))
    (build-system gnu-build-system)
    (native-inputs
     `(("flex" ,flex)
       ("gettext" ,gnu-gettext)))
    (home-page "http://docpp.sourceforge.net/")
    (synopsis "Documentation system for C, C++, IDL, and Java")
    (description
     "DOC++ is a documentation system for C, C++, IDL, and Java.  It can
generate both TeX output for high-quality hardcopies or HTML output for online
brwosing.  The documentation is extracted directly from the C/C++/IDL source
or Java class files.")
    (license gpl2+)))

A gnu/packages/patches/doc++-include-directives.patch => gnu/packages/patches/doc++-include-directives.patch +224 -0
@@ 0,0 1,224 @@
Adapted from https://sourceforge.net/p/docpp/patches/1/

--- doc++-3.4.10/src/comment.ll	2000-06-24 18:50:23.000000000 +0200
+++ doc++-3.4.10/src/comment.ll	2012-09-17 11:14:50.744922841 +0200
@@ -24,7 +24,7 @@
 
 #include <assert.h>
 #include <ctype.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdarg.h>
 #include <stdio.h>
 
--- doc++-3.4.10/src/cpp.ll	2002-05-09 08:11:14.000000000 +0200
+++ doc++-3.4.10/src/cpp.ll	2012-09-17 11:15:21.184333236 +0200
@@ -26,7 +26,7 @@
 
 #include <assert.h>
 #include <ctype.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdarg.h>
 #include <stdio.h>
 
--- doc++-3.4.10/src/datahashtable.h	2000-08-27 21:44:34.000000000 +0200
+++ doc++-3.4.10/src/datahashtable.h	2012-09-17 11:22:59.442589960 +0200
@@ -26,11 +26,13 @@
 #define _DATAHASHTABLE_H
 
 #include <assert.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdlib.h>
 
 #include "McDArray.h"
 
+using namespace std;
+
 /* This should be a private subclass of #DataHashTable#. However, since cfront
    is not able to compile this constrution, we had move the class to global
    scope.
--- doc++-3.4.10/src/doc2dbsgml.ll	2002-05-09 08:11:14.000000000 +0200
+++ doc++-3.4.10/src/doc2dbsgml.ll	2012-09-17 11:20:49.077259414 +0200
@@ -22,8 +22,8 @@
 
 %{
 #include <assert.h>
-#include <fstream.h>
-#include <iostream.h>
+#include <fstream>
+#include <iostream>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -36,6 +36,8 @@
 #undef	YY_INPUT
 #define	YY_INPUT(buf, result, max_size) result = yyread(buf, max_size);
 
+using namespace std;
+
 static Entry*	current;
 static int	inPos;
 static int	lastContext;
--- doc++-3.4.10/src/doc2dbxml.ll	2002-05-09 08:11:14.000000000 +0200
+++ doc++-3.4.10/src/doc2dbxml.ll	2012-09-17 11:20:22.264831159 +0200
@@ -25,8 +25,8 @@
 
 %{
 #include <assert.h>
-#include <fstream.h>
-#include <iostream.h>
+#include <fstream>
+#include <iostream>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -39,6 +39,8 @@
 #undef	YY_INPUT
 #define	YY_INPUT(buf, result, max_size) result = yyread(buf, max_size);
 
+using namespace std;
+
 static Entry*	current;
 static int	inPos;
 static int	lastContext;
--- doc++-3.4.10/src/doc2html.ll	2000-07-17 23:17:24.000000000 +0200
+++ doc++-3.4.10/src/doc2html.ll	2012-09-17 11:22:40.354469631 +0200
@@ -29,6 +29,8 @@
 #include "doc.h"
 #include "nametable.h"
 
+using namespace std;
+
 extern NameTable	gifs;
 
 #define YY_DECL int yylex()
--- doc++-3.4.10/src/doc2tex.ll	2000-11-05 17:21:16.000000000 +0100
+++ doc++-3.4.10/src/doc2tex.ll	2012-09-17 11:23:22.210701715 +0200
@@ -23,8 +23,8 @@
 
 %{
 #include <assert.h>
-#include <fstream.h>
-#include <iostream.h>
+#include <fstream>
+#include <iostream>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -38,6 +38,8 @@
 #undef	YY_INPUT
 #define	YY_INPUT(buf, result, max_size) result = yyread(buf, max_size);
 
+using namespace std;
+
 static Entry*	current;
 static int	inPos;
 static int	lastContext;
--- doc++-3.4.10/src/doc.ll	2000-09-17 21:41:17.000000000 +0200
+++ doc++-3.4.10/src/doc.ll	2012-09-17 11:15:37.068009454 +0200
@@ -23,8 +23,8 @@
 
 %{
 #include <assert.h>
-#include <fstream.h>
-#include <iostream.h>
+#include <fstream>
+#include <iostream>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
--- doc++-3.4.10/src/equate.cc	2002-05-02 21:13:10.000000000 +0200
+++ doc++-3.4.10/src/equate.cc	2012-09-17 11:25:42.850669366 +0200
@@ -23,9 +23,9 @@
 
 #include "config.h"
 
-#include <fstream.h>
+#include <fstream>
 #include <getopt.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdio.h>
 #include <string.h>
 
--- doc++-3.4.10/src/html.cc	2001-02-17 07:34:49.000000000 +0100
+++ doc++-3.4.10/src/html.cc	2012-09-17 11:24:07.978824681 +0200
@@ -31,7 +31,7 @@
 #include <direct.h>
 #endif
 #include <errno.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
--- doc++-3.4.10/src/java.ll	2001-11-25 18:04:12.000000000 +0100
+++ doc++-3.4.10/src/java.ll	2012-09-17 11:24:19.138834603 +0200
@@ -26,7 +26,7 @@
 
 #include <assert.h>
 #include <ctype.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdio.h>
 
 #include "doc.h"
--- doc++-3.4.10/src/main.cc	2002-05-09 08:11:14.000000000 +0200
+++ doc++-3.4.10/src/main.cc	2012-09-17 11:25:30.650719070 +0200
@@ -25,7 +25,7 @@
 #include "config.h"
 
 #include <assert.h>
-#include <fstream.h>
+#include <fstream>
 #include <getopt.h>
 #include <locale.h>
 #include <stdio.h>
--- doc++-3.4.10/src/nametable.cc	2000-04-08 23:11:54.000000000 +0200
+++ doc++-3.4.10/src/nametable.cc	2012-09-17 11:25:58.894591128 +0200
@@ -22,7 +22,7 @@
 */
 
 #include <assert.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdlib.h>
 #include <string.h>
 
--- doc++-3.4.10/src/nametable.h	2000-04-08 23:11:56.000000000 +0200
+++ doc++-3.4.10/src/nametable.h	2012-09-17 11:22:07.826207198 +0200
@@ -25,7 +25,7 @@
 #define	_NAME_TABLE_H
 
 #include <assert.h>
-#include <iostream.h>
+#include <iostream>
 
 #include "datahashtable.h"
 
--- doc++-3.4.10/src/php.ll	2001-02-16 23:34:47.000000000 +0100
+++ doc++-3.4.10/src/php.ll	2012-09-17 11:25:18.582759801 +0200
@@ -23,7 +23,7 @@
 %{
 #include <assert.h>
 #include <ctype.h>
-#include <iostream.h>
+#include <iostream>
 #include <stdio.h>
 
 #include "doc.h"
--- doc++-3.4.10/src/tex2gif.cc	2001-08-07 20:55:40.000000000 +0200
+++ doc++-3.4.10/src/tex2gif.cc	2012-09-17 11:26:06.698547836 +0200
@@ -21,8 +21,8 @@
   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
 
-#include <iostream.h>
-#include <fstream.h>
+#include <iostream>
+#include <fstream>
 #include <stdio.h>
 #include <string.h>
 

A gnu/packages/patches/doc++-segfault-fix.patch => gnu/packages/patches/doc++-segfault-fix.patch +169 -0
@@ 0,0 1,169 @@
Adapted from https://sources.debian.net/data/main/d/doc%2B%2B/3.4.10-3.4/debian/patches/segfault_fix.patch

--- doc++-3.4.10/src/McDArray.h	2000-07-30 12:40:48.000000000 +0200
+++ doc++-3.4.10/src/McDArray.h	2005-05-10 15:02:06.000000000 +0200
@@ -80,9 +80,14 @@
     McDArray(const McDArray& old) : memFactor(old.memFactor),
 	thesize(old.thesize), themax(old.themax)
 	{
-	data = (T*)malloc(themax * sizeof(T));
-	if(thesize)
-	    memcpy(data, old.data, thesize * sizeof(T));
+	if (themax)
+	    {
+	    data = (T*)malloc(themax * sizeof(T));
+	    if(thesize)
+		memcpy(data, old.data, thesize * sizeof(T));
+	    }
+	else
+	    data = 0;
 	assert(isConsistent());
 	}
 
--- doc++-3.4.10/src/McDirectory.cc	2000-03-14 22:17:36.000000000 +0100
+++ doc++-3.4.10/src/McDirectory.cc	2005-05-10 15:02:18.000000000 +0200
@@ -23,12 +23,13 @@
 */
 
 #include "McDirectory.h"
-#include "McSorter.h"
 #include "McString.h"
 #include "doc.h"
 
 #include <stdio.h>
 
+#include <algorithm>
+
 #ifdef WIN32
 #include <windows.h>
 #ifdef __BORLANDC__
@@ -62,7 +63,7 @@
     FindClose(searchHandle);
     StringCompare comp;
     if(list.size())
-	sort((char **)list, list.size(), comp, 0);
+	std::sort((char **)list, (char **)list + list.size(), comp);
     return 0;
 }
 
@@ -107,7 +108,7 @@
     closedir(dir);
     StringCompare comp;
     if(list.size())
-	sort((char **)list, list.size(), comp, 0);
+	std::sort((char **)list, (char **)list + list.size(), comp);
     return list.size();
 }
 
--- doc++-3.4.10/src/McDirectory.h	2000-06-28 21:54:58.000000000 +0200
+++ doc++-3.4.10/src/McDirectory.h	2005-05-10 15:02:18.000000000 +0200
@@ -59,9 +59,9 @@
     class StringCompare
 	{
 	public:
-	    int operator()(const char *t1, const char *t2)
+	    bool operator()(const char *t1, const char *t2)
 		{
-		return strcmp(t1, t2);
+		return strcmp(t1, t2) < 0;
 		}
 	};
 };
--- doc++-3.4.10/src/html.cc	2001-02-17 07:34:49.000000000 +0100
+++ doc++-3.4.10/src/html.cc	2005-05-10 15:02:18.000000000 +0200
@@ -38,9 +38,10 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#include <algorithm>
+
 #include "McDirectory.h"
 #include "McHashTable.h"
-#include "McSorter.h"
 #include "classgraph.h"
 #include "doc.h"
 #include "gifs.h"
@@ -314,9 +315,11 @@
 	virtual void writeMember(Entry *e, bool links, bool withSub = true);
 	class EntryCompare {
 	    public:
-		int operator()(const MemberWriterListEntry& l1, const MemberWriterListEntry& l2)
+		bool operator()(const MemberWriterListEntry& l1, const MemberWriterListEntry& l2)
 		    {
-		    return strcmp(l1.entry->fullName.c_str(), l2.entry->fullName.c_str());
+		    const char *s1 = l1.entry->fullName.c_str();
+		    const char *s2 = l2.entry->fullName.c_str();
+		    return strcmp(s1, s2) < 0;
 		    }
 	};
     public:
@@ -324,7 +327,7 @@
 	    {
 	    EntryCompare comp;
 	    if(list.size())
-		::sort((MemberWriterListEntry *)list, list.size(), comp, 0);
+		std::sort((MemberWriterListEntry *)list, (MemberWriterListEntry *)list + list.size(), comp);
 	    }
 	virtual void startList(FILE *f, char *heading, bool withLinks);
 	virtual void addMember(Entry *e, bool links, bool withSub = true)
@@ -376,7 +379,7 @@
 	    int lp;
 
 	    if(list.size() > 1)
-		::sort((TOCListEntry *)list, list.size(), comp, 0);
+		std::sort((TOCListEntry *)list, (TOCListEntry *)list + list.size(), comp);
 
 	    // Sort subsections
 	    for(lp = 0; lp < list.size(); lp++)
@@ -385,9 +388,9 @@
 	    }
 	class EntryCompare {
 	    public:
-		int operator()(TOCListEntry& l1, TOCListEntry& l2)
+		bool operator()(const TOCListEntry& l1, const TOCListEntry& l2)
 		    {
-		    return strcmp(l1.name, l2.name);
+		    return strcmp(l1.name, l2.name) < 0;
 		    }
 	};
 	void addEntry(Entry *entry, TOClist *tl);
@@ -487,7 +490,7 @@
 
     for(i = 0; i < list.size(); i++)
 	if(list[i].tl)
-	    free(list[i].tl);
+	    delete list[i].tl;
 }
 
 class HIERlist;
@@ -509,7 +512,7 @@
 	    int i;
 
 	    if(list.size() > 1)
-		::sort((HIERListEntry *)list, list.size(), comp, 0);
+		std::sort((HIERListEntry *)list, (HIERListEntry *)list + list.size(), comp);
 
 	    // Sort subentries
 	    for(i = 0; i < list.size(); i++)
@@ -519,9 +522,9 @@
 	class EntryCompare
 	    {
 	    public:
-		int operator()(HIERListEntry& l1, HIERListEntry& l2)
+		bool operator()(const HIERListEntry& l1, const HIERListEntry& l2)
 		    {
-		    return strcmp(l1.name, l2.name);
+		    return strcmp(l1.name, l2.name) < 0;
 		    }
 	    };
 	void addEntry(Entry *entry, HIERlist *hl);
--- doc++-3.4.10/src/readfiles.ll	2001-11-25 18:04:48.000000000 +0100
+++ doc++-3.4.10/src/readfiles.ll	2005-05-10 15:02:18.000000000 +0200
@@ -28,7 +28,6 @@
 #include <sys/types.h>
 
 #include "McDirectory.h"
-#include "McSorter.h"
 #include "McString.h"
 #include "doc.h"
 #include "nametable.h"