Date: Wed, 31 Dec 2014 14:51:15 +0000 (UTC) From: "Vanilla I. Shu" <vanilla@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r375891 - in head/textproc: . pecl-cld pecl-cld/files Message-ID: <201412311451.sBVEpFeY084398@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: vanilla Date: Wed Dec 31 14:51:14 2014 New Revision: 375891 URL: https://svnweb.freebsd.org/changeset/ports/375891 QAT: https://qat.redports.org/buildarchive/r375891/ Log: Add pecl-cld 0.5.0, PHP Bindings for Chromium Compact Language Detector. PR: ports/196375 Submitted by: Gasol Wu <gasol.wu@gmail.com> Added: head/textproc/pecl-cld/ head/textproc/pecl-cld/Makefile (contents, props changed) head/textproc/pecl-cld/distinfo (contents, props changed) head/textproc/pecl-cld/files/ head/textproc/pecl-cld/files/patch-cld.cc (contents, props changed) head/textproc/pecl-cld/files/patch-cld__encodings.h (contents, props changed) head/textproc/pecl-cld/files/patch-config.m4 (contents, props changed) head/textproc/pecl-cld/pkg-descr (contents, props changed) Modified: head/textproc/Makefile Modified: head/textproc/Makefile ============================================================================== --- head/textproc/Makefile Wed Dec 31 14:45:06 2014 (r375890) +++ head/textproc/Makefile Wed Dec 31 14:51:14 2014 (r375891) @@ -1091,6 +1091,7 @@ SUBDIR += pear-XML_HTMLSax SUBDIR += pear-XML_Wddx SUBDIR += pear-YAML + SUBDIR += pecl-cld SUBDIR += pecl-ctemplate SUBDIR += pecl-doublemetaphone SUBDIR += pecl-enchant Added: head/textproc/pecl-cld/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/pecl-cld/Makefile Wed Dec 31 14:51:14 2014 (r375891) @@ -0,0 +1,28 @@ +# Created by: Gasol Wu <gasol.wu@gmail.com> +# $FreeBSD$ + +PORTNAME= cld +PORTVERSION= 0.5.0 +CATEGORIES= textproc pear +MASTER_SITES= http://pecl.php.net/get/ +PKGNAMEPREFIX= pecl- +DIST_SUBDIR= PECL + +MAINTAINER= gasol.wu@gmail.com +COMMENT= PHP Bindings for Chromium Compact Language Detector + +LICENSE= BSD2CLAUSE + +LIB_DEPENDS= libcld.so:${PORTSDIR}/devel/cld + +CONFIGURE_ARGS= --enable-cld --with-libcld-dir=${LOCALBASE}/lib +USES= tar:tgz +USE_PHP= yes +USE_PHP_BUILD= yes +USE_PHPIZE= yes +USE_PHPEXT= yes + +post-install: + @${STRIP_CMD} ${STAGEDIR}/${PREFIX}/lib/php/${PHP_EXT_DIR}/cld.so + +.include <bsd.port.mk> Added: head/textproc/pecl-cld/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/pecl-cld/distinfo Wed Dec 31 14:51:14 2014 (r375891) @@ -0,0 +1,2 @@ +SHA256 (PECL/cld-0.5.0.tgz) = b7f56a69274b2d8addcd37cafee50db0670c4384cf3c388c878449f47b86619c +SIZE (PECL/cld-0.5.0.tgz) = 12367 Added: head/textproc/pecl-cld/files/patch-cld.cc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/pecl-cld/files/patch-cld.cc Wed Dec 31 14:51:14 2014 (r375891) @@ -0,0 +1,14 @@ +--- cld.cc.orig 2011-11-15 01:13:43 UTC ++++ cld.cc +@@ -30,8 +30,9 @@ + #include <ctype.h> + #define CLD_WINDOWS + +-#include "encodings/compact_lang_det/compact_lang_det.h" +-#include "encodings/compact_lang_det/ext_lang_enc.h" ++#include "compact_lang_det.h" ++#include "ext_lang_enc.h" ++#include "lang_enc.h" + #include "base/string_util.h" + #include "cld_encodings.h" + Added: head/textproc/pecl-cld/files/patch-cld__encodings.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/pecl-cld/files/patch-cld__encodings.h Wed Dec 31 14:51:14 2014 (r375891) @@ -0,0 +1,98 @@ +--- cld_encodings.h.orig 2014-12-30 06:17:16 UTC ++++ cld_encodings.h +@@ -0,0 +1,95 @@ ++// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. ++// Use of this source code is governed by a BSD-style license that can be ++// found in the LICENSE file. ++ ++// MKM: I copied this from the PHP port ++// (https://github.com/lstrojny/php-cld/blob/master/cld_encodings.h); ++// it just copies the encodings out of encodings.pb.h and ++// gives them string matching string constants ++ ++#include "encodings/proto/encodings.pb.h" ++ ++struct cld_encoding { ++ const char *name; ++ Encoding encoding; ++}; ++ ++const cld_encoding cld_encoding_info[] = { ++{"ISO_8859_1", ISO_8859_1}, ++{"ISO_8859_2", ISO_8859_2}, ++{"ISO_8859_3", ISO_8859_3}, ++{"ISO_8859_4", ISO_8859_4}, ++{"ISO_8859_5", ISO_8859_5}, ++{"ISO_8859_6", ISO_8859_6}, ++{"ISO_8859_7", ISO_8859_7}, ++{"ISO_8859_8", ISO_8859_8}, ++{"ISO_8859_9", ISO_8859_9}, ++{"ISO_8859_10", ISO_8859_10}, ++{"JAPANESE_EUC_JP", JAPANESE_EUC_JP}, ++{"JAPANESE_SHIFT_JIS", JAPANESE_SHIFT_JIS}, ++{"JAPANESE_JIS", JAPANESE_JIS}, ++{"CHINESE_BIG5", CHINESE_BIG5}, ++{"CHINESE_GB", CHINESE_GB}, ++{"CHINESE_EUC_CN", CHINESE_EUC_CN}, ++{"KOREAN_EUC_KR", KOREAN_EUC_KR}, ++{"UNICODE", UNICODE}, ++{"CHINESE_EUC_DEC", CHINESE_EUC_DEC}, ++{"CHINESE_CNS", CHINESE_CNS}, ++{"CHINESE_BIG5_CP950", CHINESE_BIG5_CP950}, ++{"JAPANESE_CP932", JAPANESE_CP932}, ++{"UTF8", UTF8}, ++{"UNKNOWN_ENCODING", UNKNOWN_ENCODING}, ++{"ASCII_7BIT", ASCII_7BIT}, ++{"RUSSIAN_KOI8_R", RUSSIAN_KOI8_R}, ++{"RUSSIAN_CP1251", RUSSIAN_CP1251}, ++{"MSFT_CP1252", MSFT_CP1252}, ++{"RUSSIAN_KOI8_RU", RUSSIAN_KOI8_RU}, ++{"MSFT_CP1250", MSFT_CP1250}, ++{"ISO_8859_15", ISO_8859_15}, ++{"MSFT_CP1254", MSFT_CP1254}, ++{"MSFT_CP1257", MSFT_CP1257}, ++{"ISO_8859_11", ISO_8859_11}, ++{"MSFT_CP874", MSFT_CP874}, ++{"MSFT_CP1256", MSFT_CP1256}, ++{"MSFT_CP1255", MSFT_CP1255}, ++{"ISO_8859_8_I", ISO_8859_8_I}, ++{"HEBREW_VISUAL", HEBREW_VISUAL}, ++{"CZECH_CP852", CZECH_CP852}, ++{"CZECH_CSN_369103", CZECH_CSN_369103}, ++{"MSFT_CP1253", MSFT_CP1253}, ++{"RUSSIAN_CP866", RUSSIAN_CP866}, ++{"ISO_8859_13", ISO_8859_13}, ++{"ISO_2022_KR", ISO_2022_KR}, ++{"GBK", GBK}, ++{"GB18030", GB18030}, ++{"BIG5_HKSCS", BIG5_HKSCS}, ++{"ISO_2022_CN", ISO_2022_CN}, ++{"TSCII", TSCII}, ++{"TAMIL_MONO", TAMIL_MONO}, ++{"TAMIL_BI", TAMIL_BI}, ++{"JAGRAN", JAGRAN}, ++{"MACINTOSH_ROMAN", MACINTOSH_ROMAN}, ++{"UTF7", UTF7}, ++{"BHASKAR", BHASKAR}, ++{"HTCHANAKYA", HTCHANAKYA}, ++{"UTF16BE", UTF16BE}, ++{"UTF16LE", UTF16LE}, ++{"UTF32BE", UTF32BE}, ++{"UTF32LE", UTF32LE}, ++{"BINARYENC", BINARYENC}, ++{"HZ_GB_2312", HZ_GB_2312}, ++{"UTF8UTF8", UTF8UTF8}, ++{"TAM_ELANGO", TAM_ELANGO}, ++{"TAM_LTTMBARANI", TAM_LTTMBARANI}, ++{"TAM_SHREE", TAM_SHREE}, ++{"TAM_TBOOMIS", TAM_TBOOMIS}, ++{"TAM_TMNEWS", TAM_TMNEWS}, ++{"TAM_WEBTAMIL", TAM_WEBTAMIL}, ++{"KDDI_SHIFT_JIS", KDDI_SHIFT_JIS}, ++{"DOCOMO_SHIFT_JIS", DOCOMO_SHIFT_JIS}, ++{"SOFTBANK_SHIFT_JIS", SOFTBANK_SHIFT_JIS}, ++{"KDDI_ISO_2022_JP", KDDI_ISO_2022_JP}, ++{"SOFTBANK_ISO_2022_JP", SOFTBANK_ISO_2022_JP}, ++}; ++ ++COMPILE_ASSERT(arraysize(cld_encoding_info) == NUM_ENCODINGS, cld_encoding_info_length_is_wrong); Added: head/textproc/pecl-cld/files/patch-config.m4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/pecl-cld/files/patch-config.m4 Wed Dec 31 14:51:14 2014 (r375891) @@ -0,0 +1,17 @@ +--- config.m4.orig 2011-11-15 01:13:43 UTC ++++ config.m4 +@@ -7,13 +7,9 @@ if test -z "$PHP_LIBCLD_DIR"; then + fi + + if test "$PHP_CLD" != "no"; then +- if ! test -f $PHP_LIBCLD_DIR/libcld.a; then +- AC_MSG_ERROR([libcld not found. Specify installation directory with --with-libcld-dir=]) +- fi +- + PHP_REQUIRE_CXX() + PHP_SUBST(CLD_SHARED_LIBADD) +- PHP_ADD_INCLUDE($PHP_LIBCLD_DIR) ++ PHP_ADD_INCLUDE([/usr/local/include/cld]) + PHP_ADD_LIBRARY(stdc++, 1, CLD_SHARED_LIBADD) + PHP_ADD_LIBRARY_WITH_PATH(cld, $PHP_LIBCLD_DIR, CLD_SHARED_LIBADD) + PHP_NEW_EXTENSION(cld, cld.cc, $ext_shared) Added: head/textproc/pecl-cld/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/pecl-cld/pkg-descr Wed Dec 31 14:51:14 2014 (r375891) @@ -0,0 +1,4 @@ +Exposes Chromium Compact Language Detector to PHP to find out what language a +text is + +WWW: http://pecl.php.net/package/cld
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412311451.sBVEpFeY084398>