Hi,

the attached patch updates the DICT.org software, with some resistance,
to the current upstream releases. The current nixpkgs version of dictfmt
tends to SEGV on big complicated dictionaries.

Petr

Index: pkgs/servers/dict/libmaa.nix
===================================================================
--- pkgs/servers/dict/libmaa.nix	(revision 0)
+++ pkgs/servers/dict/libmaa.nix	(working copy)
@@ -0,0 +1,16 @@
+{ stdenv, fetchurl, libtool }:
+
+stdenv.mkDerivation rec {
+  name = "libmaa-1.3.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/dict/${name}.tar.gz";
+    sha256 = "0xzhypadhh2nc266gilmddd47vibnvyb4s86znwsi89y6dvi0h2k";
+  };
+
+  buildInputs = [ libtool ];
+
+  meta = {
+    description = "libmaa from dict.org";
+  };
+}
Index: pkgs/servers/dict/default.nix
===================================================================
--- pkgs/servers/dict/default.nix	(revision 31261)
+++ pkgs/servers/dict/default.nix	(working copy)
@@ -1,16 +1,20 @@
-{ stdenv, fetchurl, which, bison, flex }:
+{ stdenv, fetchurl, which, bison, flex, makeWrapper, libmaa, zlib, libtool }:
 
-stdenv.mkDerivation {
-  name = "dictd-1.9.15";
+stdenv.mkDerivation rec {
+  name = "dictd-1.12.0";
 
   src = fetchurl {
-    url = mirror://sourceforge/dict/dictd-1.9.15.tar.gz;
-    sha256 = "0p41yf72l0igmshz6vxy3hm51z25600vrnb9j2jpgws4c03fqnac";
+    url = "mirror://sourceforge/dict/${name}.tar.gz";
+    sha256 = "18m4yhz5mdbpyjvl5cb6iz270zsdlzz8dshp6v7qiq26kk927i2y";
   };
 
-  buildInputs = [ flex bison which ];
+  buildInputs = [ flex bison which makeWrapper libmaa zlib libtool ];
+  patches = [ ./buildfixes.diff ];
   
-  configureFlags = "--datadir=/var/run/current-system/share/dictd";
+  configureFlags = "--datadir=/var/run/current-system/share/dictd --with-system-utf8";
+  postInstall = ''
+    wrapProgram $out/bin/dict --add-flags -c --add-flags /etc/dict.conf
+  '';
 
   meta = {
     description = "Dict protocol server and client";
Index: pkgs/servers/dict/buildfixes.diff
===================================================================
--- pkgs/servers/dict/buildfixes.diff	(revision 0)
+++ pkgs/servers/dict/buildfixes.diff	(working copy)
@@ -0,0 +1,146 @@
+diff -ru dictd-1.12.0/dictfmt.c dictd-1.12.0.my/dictfmt.c
+--- dictd-1.12.0/dictfmt.c	2011-01-08 16:43:30.000000000 +0100
++++ dictd-1.12.0.my/dictfmt.c	2012-01-03 22:13:55.000000000 +0100
+@@ -123,7 +123,7 @@
+ 	 return -1;
+ 
+       default:
+-	 width = wcwidth__ (wchar);
++	 width = wcwidth (wchar);
+ 	 if (-1 == width)
+ 	    width = 1; /* we also count non-printable characters */
+ 
+diff -ru dictd-1.12.0/Makefile.in dictd-1.12.0.my/Makefile.in
+--- dictd-1.12.0/Makefile.in	2011-01-09 20:34:55.000000000 +0100
++++ dictd-1.12.0.my/Makefile.in	2012-01-03 22:12:41.000000000 +0100
+@@ -72,7 +72,7 @@
+ LIBMAA=		@LIBMAA@
+ LIBS=		@LIBS@ ${LIBMAA}
+ LDFLAGS=        @LDFLAGS@
+-LIBOBJS=        @LIBOBJS@
++LIBOBJS=        $(subst .o,.lo,@LIBOBJS@)
+ EXES=	 	dict dictd dictzip dictfmt
+ 
+ all: $(EXES) $(LIBRARIES)
+@@ -103,60 +103,60 @@
+ endif
+ 
+ ifdef USE_PLUGIN
+-SRCHOBJS=       index.o data.o str.o plugin.o #dictdplugin.o 
++SRCHOBJS=       index.lo data.lo str.lo plugin.lo #dictdplugin.o 
+ else
+-SRCHOBJS=       index.o data.o str.o #dictdplugin.o 
++SRCHOBJS=       index.lo data.lo str.lo #dictdplugin.o 
+ endif
+ 
+-NETOBJS=        daemon.o strategy.o net.o servscan.o servparse.o md5.o
+-CLIOBJS=        net.o clientscan.o clientparse.o md5.o
++NETOBJS=        daemon.lo strategy.lo net.lo servscan.lo servparse.lo md5.lo
++CLIOBJS=        net.lo clientscan.lo clientparse.lo md5.lo
+ 
+ TMPS=           servscan.c servparse.c servparse.h \
+ 		clientscan.c clientparse.c clientparse.h
+ 
+ @SET_MAKE@
+ 
+-%.o: %.c
++%.lo: %.c
+ 	$(LIBTOOL) --tag=CC --mode=compile $(CC) -c $(CFLAGS) $< -o $@
+-%.o: %.cpp
++%.lo: %.cpp
+ 	$(LIBTOOL) --tag=CXX --mode=compile $(CXX) -c $(CFLAGS) $< -o $@
+ 
+-%: %.o
++%: %.lo
+ 	$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -static \
+ 		$^ $(OBJS) $(LDFLAGS) -lz ${LIBS}
+ 
+ include $(srcdir)/deps
+ 
+-dictd.o : servparse.h
++dictd.lo : servparse.h
+ 
+ $(PLUGINS) dictdplugin_popen.la dictdplugin_exit.la : $(LIBOBJS)
+ #	libdictdplugin.a 
+ 
+-lib%.a : %.o
++lib%.a : .libs/%.o
+ 	$(AR) rc $@ $^
+ 
+-%.la : %.o $(LIBOBJS)
++%.la : %.lo $(LIBOBJS)
+ 	$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -module \
+ 		$(^:.o=.lo) \
+ 		-rpath "${PLUGIN_DIR}" \
+ 		$(LDFLAGS) ${LIBS}
+ 
+-dictdplugin_man.la : data.o str.o heap.o dictdplugin_man.o \
+-                      plugins_common.o $(LIBOBJS)
++dictdplugin_man.la : data.lo str.lo heap.lo dictdplugin_man.lo \
++                      plugins_common.lo $(LIBOBJS)
+ 	$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -module \
+ 		$(^:.o=.lo) \
+ 		-rpath "${PLUGIN_DIR}" \
+ 		$(LDFLAGS) ${LIBS}
+ 
+-dictdplugin_judy.la : data.o str.o heap.o dictdplugin_judy.o \
+-                      plugins_common.o $(LIBOBJS)
++dictdplugin_judy.la : data.lo str.lo heap.lo dictdplugin_judy.lo \
++                      plugins_common.lo $(LIBOBJS)
+ 	$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -module \
+ 		$(^:.o=.lo) \
+ 		-rpath "${PLUGIN_DIR}" \
+ 		$(LDFLAGS) -lJudy ${LIBS}
+ 
+-dictdplugin_dbi.la : heap.o dictdplugin_dbi.o str.o \
+-                     plugins_common.o $(LIBOBJS)
++dictdplugin_dbi.la : heap.lo dictdplugin_dbi.lo str.lo \
++                     plugins_common.lo $(LIBOBJS)
+ 	$(LIBTOOL) --tag=CC --mode=link $(CC) -o $@ -module \
+ 		$(^:.o=.lo) \
+ 		-rpath "${PLUGIN_DIR}" \
+@@ -165,15 +165,15 @@
+ .PHONY: plugins
+ plugins: $(PLUGINS)
+ 
+-dict    : $(CLIOBJS) $(LIBOBJS) parse.o
+-dictd   : $(NETOBJS) $(SRCHOBJS) $(LIBOBJS) parse.o
+-dictzip : data.o $(LIBOBJS)
+-dictfmt : str.o $(LIBOBJS)
++dict    : $(CLIOBJS) $(LIBOBJS) parse.lo
++dictd   : $(NETOBJS) $(SRCHOBJS) $(LIBOBJS) parse.lo
++dictzip : data.lo $(LIBOBJS)
++dictfmt : str.lo $(LIBOBJS)
+ 
+ servscan.c: servscan.l
+ 	$(LEX) $(LFLAGS) $< && mv lex.yy.c $@
+ 
+-servscan.o: servscan.c servparse.o servparse.h
++servscan.lo: servscan.c servparse.lo servparse.h
+ 
+ servparse.c servparse.h : servparse.y
+ 	$(YACC) -tdv $<; \
+@@ -181,12 +181,12 @@
+     cmp -s y.tab.c servparse.c || mv y.tab.c servparse.c; \
+     rm -f y.tab.h y.tab.c
+ 
+-servparse.o: servparse.c
++servparse.lo: servparse.c
+ 
+ clientscan.c: clientscan.l
+ 	$(LEX) $(LFLAGS) -o$@ $<
+ 
+-clientscan.o: clientscan.c clientparse.o clientparse.h
++clientscan.lo: clientscan.c clientparse.lo clientparse.h
+ 
+ clientparse.c clientparse.h: clientparse.y
+ 	$(YACC) -tdv $<; \
+@@ -194,7 +194,7 @@
+     cmp -s y.tab.c clientparse.c || mv y.tab.c clientparse.c; \
+     rm -f y.tab.h y.tab.c
+ 
+-clientparse.o: clientparse.c
++clientparse.lo: clientparse.c
+ 
+ .PHONY: install.dict install.dictzip install.dictfmt install.dictd \
+         install.libs install.includes install.colorit
-- 
id' Ash = Ash; id' Dust = Dust; id' _ = undefined
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to