From owner-freebsd-ports Wed Dec 18 2:55:33 2002 Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4D26137B401 for ; Wed, 18 Dec 2002 02:55:28 -0800 (PST) Received: from straylight.ringlet.net (office.sbnd.net [217.75.140.130]) by mx1.FreeBSD.org (Postfix) with SMTP id 029D243EC2 for ; Wed, 18 Dec 2002 02:55:24 -0800 (PST) (envelope-from roam@ringlet.net) Received: (qmail 37548 invoked by uid 1000); 18 Dec 2002 10:54:51 -0000 Date: Wed, 18 Dec 2002 12:54:51 +0200 From: Peter Pentchev To: Dima Dorfman Cc: Clive Lin , ports@freebsd.org, portmgr@freebsd.org Subject: Re: ports/45755: /usr/ports/net/dictd does not build, at least on 4.7-RELEASE Message-ID: <20021218105451.GC442@straylight.oblivion.bg> Mail-Followup-To: Dima Dorfman , Clive Lin , ports@freebsd.org, portmgr@freebsd.org References: <200212180830.gBI8U4V8042817@freefall.freebsd.org> <20021218085050.GA23253@trit.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sHrvAb52M6C8blB9" Content-Disposition: inline In-Reply-To: <20021218085050.GA23253@trit.org> User-Agent: Mutt/1.5.1i Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --sHrvAb52M6C8blB9 Content-Type: multipart/mixed; boundary="UHN/qo2QbUvPLonB" Content-Disposition: inline --UHN/qo2QbUvPLonB Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 18, 2002 at 08:50:50AM +0000, Dima Dorfman wrote: > [cc'd to ports in the hope that someone will make portmgr reply] >=20 > Clive Lin wrote: > > > cc -c -Ilibmaa -DHAVE_CONFIG_H -I. -O -pipe -I/usr/local/include= -DDICT_VERSION=3D\"1.8.0\" -DDICT_CONFIG_PATH=3D\"/usr/local/etc/\" index.c > > > In file included from index.c:26: > > > utf8_ucs4.h:26: syntax error before `wint_t' > > > utf8_ucs4.h:34: syntax error before `ucs4' > > > index.c: In function `tolower_alnumspace_utf8': > > > index.c:114: syntax error before `ucs4_char' > > > index.c:117: `ucs4_char' undeclared (first use in this function) > > > index.c:117: (Each undeclared identifier is reported only once > > > index.c:117: for each function it appears in.) > > > gmake: *** [index.o] Error 1 > > > *** Error code 2 > > > =20 > > > Stop in /usr/ports/net/dictd. > > > netcom1#=20 > > =20 > > I think it's impossible to fix dictd on RELENG_4. >=20 > I beg to differ. The attached patch makes it compile on RELENG_4, but > possibly breaks UTF8 dictionaries (I haven't tried). It does not > affect functionality on 5.0. I've sent this to portmgr three times > (this message is the fourth), but have heard no reply. >=20 > I think breaking a new feature is better than breaking it completely. > If someone wants to use UTF8 dictionaries, they can install 5.0--we > need more testers anyway. For most people, it will work just fine. > E.g.: That's great news! I'd almost given up the hope of getting dictd running on -STABLE, for the simple reason of lack of time to tinker with it... it seems that you have actually found the time :) However, if I may make a comment on the patch - as various people have pointed out, usually related to the source tree, not to ports, but still relevant here, it might be better to check for __FreeBSD_version, not __FreeBSD__, since __FreeBSD__ relates to the host environment, and __FreeBSD_version to the target. Thus, in cases of cross-compiling, including compiling for a different version of FreeBSD on the same arch, __FreeBSD__ might be somewhat misleading. Attached is a slight modification of your patch, which checks for __FreeBSD_version and places the bar at 500000 - this could possibly be refined by someone with knowledge of what changed when WRT UTF-8. About portmgr's reaction: it could be that they are currently severely understaffed, bearing in mind the Christmas holiday season, absences, lack of Internet access - possibly even conscious abstaining from Internet access for the holidays :) If it matters, though, I for one am for including some version of this patch into the ports tree - dictd is a good app, and it would be great to still have it working on -STABLE, albeit a bit hobbled. G'luck, Peter --=20 Peter Pentchev roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 I am the meaning of this sentence. --UHN/qo2QbUvPLonB Content-Type: text/plain; charset=windows-1251 Content-Disposition: attachment; filename="net-dictd.patch" Content-Transfer-Encoding: quoted-printable Index: ports/net/dictd/files/patch-break-utf8 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: ports/net/dictd/files/patch-break-utf8 diff -N ports/net/dictd/files/patch-break-utf8 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ ports/net/dictd/files/patch-break-utf8 18 Dec 2002 09:37:30 -0000 @@ -0,0 +1,98 @@ +diff -ru ../dictd-freebsd/dictd.c ./dictd.c +--- ../dictd-freebsd/dictd.c Sun Nov 24 09:35:55 2002 ++++ ./dictd.c Sun Dec 1 22:29:55 2002 +@@ -662,6 +662,7 @@ +=20 + static void set_utf8_mode (const char *locale) + { ++#if __FreeBSD_version > 499999 + char *locale_copy; + locale_copy =3D strdup (locale); + strlwr_8bit (locale_copy); +@@ -671,6 +672,9 @@ + strstr (locale_copy, "utf8"); +=20 + free (locale_copy); ++#else ++ utf8_mode =3D 0; ++#endif + } +=20 + static void init (const char *fn) +diff -ru ../dictd-freebsd/index.c ./index.c +--- ../dictd-freebsd/index.c Sun Dec 1 22:12:49 2002 ++++ ./index.c Sun Dec 1 22:25:06 2002 +@@ -111,6 +111,9 @@ + const char *src, char *dest, + int allchars_mode) + { ++#if __FreeBSD_version < 500000 ++ abort(); ++#else + wint_t ucs4_char; +=20 + while (src && src [0]){ +@@ -130,6 +133,7 @@ + *dest =3D 0; +=20 + return (src !=3D NULL); ++#endif + } +=20 + static void dict_table_init(void) +@@ -166,9 +170,11 @@ + p[i] =3D &s[2 * i]; + } + /* Sort those strings in the locale */ ++#if __FreeBSD_version > 499999 + if (utf8_mode) + qsort(p, UCHAR_MAX + 1, sizeof(p[0]), dict_table_init_compare_utf8); + else ++#endif + qsort(p, UCHAR_MAX + 1, sizeof(p[0]), dict_table_init_compare_strcoll); +=20 + /* Extract our unordered arrays */ +@@ -1126,6 +1132,9 @@ + */ + static int stranagram_utf8 (char *str) + { ++#if __FreeBSD_version < 500000 ++ abort(); ++#else + size_t len; + char *p; +=20 +@@ -1142,6 +1151,7 @@ +=20 + stranagram_8bit (str, -1); + return 1; ++#endif + } +=20 + /* makes anagram of utf-8 string 'str' */ +diff -ru ../dictd-freebsd/utf8_ucs4.c ./utf8_ucs4.c +--- ../dictd-freebsd/utf8_ucs4.c Sun Nov 24 09:35:55 2002 ++++ ./utf8_ucs4.c Sun Dec 1 22:44:40 2002 +@@ -1,3 +1,4 @@ ++#if __FreeBSD_version > 499999 + #include + #include + #include +@@ -210,3 +211,4 @@ + else + return (size_t) -1; + } ++#endif // __FreeBSD_version > 499999 +diff -ru ../dictd-freebsd/utf8_ucs4.h ./utf8_ucs4.h +--- ../dictd-freebsd/utf8_ucs4.h Sun Nov 24 09:35:55 2002 ++++ ./utf8_ucs4.h Sun Dec 1 22:26:15 2002 +@@ -1,3 +1,4 @@ ++#if __FreeBSD_version > 499999 + #ifndef _UTF8_UCS4_H_ + #define _UTF8_UCS4_H_ +=20 +@@ -73,3 +74,4 @@ + __END_DECLS +=20 + #endif // _UTF8_UCS4_H_ ++#endif // __FreeBSD_version > 499999 --UHN/qo2QbUvPLonB-- --sHrvAb52M6C8blB9 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+AFP77Ri2jRYZRVMRAgWeAJ0Vz6Impih6vW4qy0eYhBNKeih2pwCggWaC Yb1f7BGZ5uvLfx0MCiMz7Cw= =qrYM -----END PGP SIGNATURE----- --sHrvAb52M6C8blB9-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message