From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Sep 9 07:50:08 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29E95106566C for ; Fri, 9 Sep 2011 07:50:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 019CC8FC14 for ; Fri, 9 Sep 2011 07:50:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p897o7DF053059 for ; Fri, 9 Sep 2011 07:50:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p897o7f3053057; Fri, 9 Sep 2011 07:50:07 GMT (envelope-from gnats) Resent-Date: Fri, 9 Sep 2011 07:50:07 GMT Resent-Message-Id: <201109090750.p897o7f3053057@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, takefu@airport.fm Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 050CA1065675 for ; Fri, 9 Sep 2011 07:44:40 +0000 (UTC) (envelope-from takefu@airport.fm) Received: from ae-osaka.co.jp (unknown [IPv6:2001:3e0:4ec:a000::1]) by mx1.freebsd.org (Postfix) with ESMTP id 905F78FC1B for ; Fri, 9 Sep 2011 07:44:39 +0000 (UTC) Received: from ae-osaka.co.jp (localhost.ae-osaka.co.jp [127.0.0.1]) by ae-osaka.co.jp (Postfix) with ESMTP id 322E511465; Fri, 9 Sep 2011 16:44:38 +0900 (JST) Received: from ae-osaka.co.jp ([127.0.0.1]) by ae-osaka.co.jp (ae-osaka.co.jp [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jg6S9je-CtWq; Fri, 9 Sep 2011 16:44:38 +0900 (JST) Received: from [IPv6:2001:3e0:4ec:a011:d084:55e7:ce13:d820] (unknown [IPv6:2001:3e0:4ec:a011:d084:55e7:ce13:d820]) by ae-osaka.co.jp (Postfix) with ESMTPSA id DA47D1145D; Fri, 9 Sep 2011 16:44:37 +0900 (JST) Message-Id: <4E69C3E5.7020108@airport.fm> Date: Fri, 09 Sep 2011 16:44:37 +0900 From: Takefu To: mark@foster.cc, freebsd-gnats-submit@FreeBSD.org In-Reply-To: <201109090732.p897Wur7078167@unbound.local.ae-osaka.co.jp> References: <201109090732.p897Wur7078167@unbound.local.ae-osaka.co.jp> Cc: Subject: ports/160579: [PATCH] audio/firefly: portlint(1) fixes and more X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: takefu@airport.fm List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2011 07:50:08 -0000 >Number: 160579 >Category: ports >Synopsis: [PATCH] audio/firefly: portlint(1) fixes and more >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Sep 09 07:50:07 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Takefu >Release: >Organization: FOX Amateur Radio Club >Environment: >Description: Add LICENSE_FILE portlint(1) fix FATAL Japanese support Reference http://www.kzsoft.to/~kazu/mt-daapd/patch/ >How-To-Repeat: >Fix: --- firefly.patch begins here --- diff -ruN /usr/ports/audio/firefly/Makefile audio/firefly/Makefile --- /usr/ports/audio/firefly/Makefile 2011-06-24 08:18:27.000000000 +0900 +++ audio/firefly/Makefile 2011-09-09 16:27:41.000000000 +0900 @@ -15,6 +15,9 @@ MAINTAINER= mark@foster.cc COMMENT= Open-source media server for the Roku SoundBridge and iTunes +LICENSE= GPLv2 +LICENSE_FILE= ${WRKSRC}/COPYING + BUILD_DEPENDS= ${LOCALBASE}/include/vorbis/codec.h:${PORTSDIR}/audio/libvorbis \ ${LOCALBASE}/include/FLAC/metadata.h:${PORTSDIR}/audio/flac RUN_DEPENDS= oggdec:${PORTSDIR}/audio/vorbis-tools \ @@ -27,13 +30,20 @@ GNU_CONFIGURE= yes CONFIGURE_ENV= CFLAGS+="${PTHREAD_CFLAGS}" \ - CPPFLAGS="${CPPFLAGS} -I${LOCALBASE}/include" \ - LDFLAGS="-L${LOCALBASE}/lib" \ - LIBS="-L${LOCALBASE}/lib ${PTHREAD_LIBS}" + CPPFLAGS+="${CPPFLAGS} -I${LOCALBASE}/include" \ + LDFLAGS+="-L${LOCALBASE}/lib" \ + LIBS+="-L${LOCALBASE}/lib ${PTHREAD_LIBS}" CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} CONFIGURE_ARGS= --prefix=${PREFIX} --with-id3tag=${PREFIX} \ --enable-sqlite3 --enable-oggvorbis --enable-flac +USE_ICONV= yes +CONFIGURE_ARGS+= --enable-iconv + +#PATCH_SITES+= http://www.kzsoft.to/~kazu/mt-daapd/patch/ +#PATCHFILES+= mt-daapd-svn-1586-cp932.patch +#PATCH_DIST_STRIP+= -p1 + DAAPD_USER?= daapd DAAPD_GROUP?= daapd DAAPD_DBDIR?= ${PREFIX}/var/db/${PORTNAME} @@ -46,7 +56,7 @@ USE_LDCONFIG= yes pre-everything:: - @${ECHO_CMD} "Define vars bellow if you need:" + @${ECHO_CMD} "Define vars below if you need:" @${ECHO_CMD} "DAAPD_USER=${DAAPD_USER} (default: daapd)" @${ECHO_CMD} "DAAPD_GROUP=${DAAPD_GROUP} (default: daapd)" @${ECHO_CMD} "DAAPD_DBDIR=${DAAPD_DBDIR} (default: ${PREFIX}/var/db/${PORTNAME})" diff -ruN /usr/ports/audio/firefly/files/patch-src_scan-mp3.c audio/firefly/files/patch-src_scan-mp3.c --- /usr/ports/audio/firefly/files/patch-src_scan-mp3.c 1970-01-01 09:00:00.000000000 +0900 +++ audio/firefly/files/patch-src_scan-mp3.c 2011-09-05 13:53:04.000000000 +0900 @@ -0,0 +1,139 @@ +--- src/scan-mp3.c.orig 2007-09-25 16:55:23.000000000 +0900 ++++ src/scan-mp3.c 2011-09-05 13:52:16.000000000 +0900 +@@ -18,6 +18,15 @@ + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + ++#define USE_CP932 ++ ++#ifdef USE_CP932 ++ #define UNKNOWN_STR "UNKNOWN" ++ #ifndef FILESYSTEM_CES ++ #define FILESYSTEM_CES "CP932" ++ #endif ++#endif ++ + #ifdef HAVE_CONFIG_H + # include "config.h" + #endif +@@ -34,6 +43,10 @@ + #include + #include + ++#ifdef USE_CP932 ++ #include ++#endif ++ + #include "daapd.h" + #include "conf.h" + #include "err.h" +@@ -289,6 +302,96 @@ + return 1; + } + ++#ifdef USE_CP932 ++#define MAX_ICONV_BUF 1024 ++ ++typedef enum { ++ ICONV_OK, ++ ICONV_TRYNEXT, ++ ICONV_FATAL ++} iconv_result; ++ ++static iconv_result do_convert(const char* to_ces, const char* from_ces, ++ char *inbuf, size_t inbytesleft, ++ char *outbuf_orig, size_t outbytesleft_orig) { ++ size_t rc; ++ iconv_result ret = ICONV_OK; ++ ++ size_t outbytesleft = outbytesleft_orig - 1; ++ char* outbuf = outbuf_orig; ++ ++ iconv_t cd = iconv_open(to_ces, from_ces); ++ if (cd == (iconv_t)-1) { ++ return ICONV_FATAL; ++ } ++ rc = iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); ++ if (rc == (size_t)-1) { ++ if (errno == E2BIG) { ++ ret = ICONV_FATAL; ++ } else { ++ ret = ICONV_TRYNEXT; ++ memset(outbuf_orig, '\0', outbytesleft_orig); ++ } ++ } ++ iconv_close(cd); ++ ++ return ret; ++} ++ ++static unsigned char* get_utf8_text(const id3_ucs4_t* native_text) { ++ unsigned char* utf8_text = NULL; ++ char * in, * in8, * iconv_buf; ++ iconv_result rc; ++ ++ in = (char*)id3_ucs4_latin1duplicate(native_text); ++ if (!in) goto out; ++ ++ in8 = (char*)id3_ucs4_utf8duplicate(native_text); ++ if (!in8) { ++ free(in); ++ goto out; ++ } ++ ++ iconv_buf = (char*)calloc(MAX_ICONV_BUF, sizeof(char)); ++ if (!iconv_buf) { ++ free(in); free(in8); ++ goto out; ++ } ++ ++ /* (1) try utf8 -> cp932 */ ++ rc = do_convert("CP932", "UTF-8", in8, strlen(in8), iconv_buf, MAX_ICONV_BUF); ++ if (rc == ICONV_OK) { ++ utf8_text = (unsigned char*)in8; ++ free(iconv_buf); ++ } else if (rc == ICONV_TRYNEXT) { ++ /* (2) try cp932 -> utf8 */ ++ rc = do_convert("UTF-8", "CP932", in, strlen(in), iconv_buf, MAX_ICONV_BUF); ++ if (rc == ICONV_OK) { ++ utf8_text = (unsigned char*)iconv_buf; ++ } else if (rc == ICONV_TRYNEXT) { ++ /* (3) try euc-jp -> utf8 */ ++ rc = do_convert("UTF-8", "EUC-JP", in, strlen(in), iconv_buf, MAX_ICONV_BUF); ++ if (rc == ICONV_OK) { ++ utf8_text = (unsigned char*)iconv_buf; ++ } else if (rc == ICONV_TRYNEXT) { ++ /* utf-8 including non-japanese char? fallback. */ ++ utf8_text = (unsigned char*)id3_ucs4_utf8duplicate(native_text); ++ free(iconv_buf); ++ } ++ } ++ free(in8); ++ } ++ free(in); ++ ++ out: ++ if (!utf8_text) { ++ utf8_text = (unsigned char*)strdup(UNKNOWN_STR); ++ } ++ ++ return utf8_text; ++} ++#endif ++ + int scan_mp3_get_mp3tags(char *file, MP3FILE *pmp3) { + struct id3_file *pid3file; + struct id3_tag *pid3tag; +@@ -352,8 +455,11 @@ + if(native_text) { + have_utf8=1; + +- ++#ifdef USE_CP932 ++ utf8_text = (char *)get_utf8_text(native_text); ++#else + utf8_text = (char*)id3_ucs4_utf8duplicate(native_text); ++#endif + if(utf8_text) + mem_register(utf8_text,0); + --- firefly.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: