Bug 162269

Summary: [PATCH] www/tdiary: runtime dependency iconv is missing.
Product: Ports & Packages Reporter: Yoshisato Yanagisawa <osho>
Component: Individual Port(s)Assignee: TAKATSU Tomonari <tota>
Status: Closed FIXED    
Severity: Affects Only Me CC: tota
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
tdiary-3.1.1.patch
none
tdiary.patch
none
tdiary2.patch
none
tdiary3.patch
none
tdiary4.txt none

Description Yoshisato Yanagisawa 2011-11-03 11:40:07 UTC
When I updated tDiary using the port, I saw "no such file to load -- iconv"
instead of the top page I usually see.  Since FreeBSD's ruby port is not
including iconv, which is included in the regular ruby tarball, we should
install it by ourselves from converters/ruby-iconv.
After I installed the ruby-iconv package, the problem above is fixed.

I request the port Makefile to show the runtime dependency to the iconv package
as I have written in the following patch.

Port maintainer (tota@FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99

Fix: Show runtime dependency:
How-To-Repeat: Uninstall converters/ruby-iconv if installed, and you will see the error
message when you connect to the tdiary web page.
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2011-11-03 11:40:19 UTC
Responsible Changed
From-To: freebsd-ports-bugs->tota

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 TAKATSU Tomonari freebsd_committer freebsd_triage 2011-11-03 13:50:36 UTC
If RUBY_VER < 1.9, ruby-iconv must be installed by the dependency defined in
devel/rubygem-json_pure/Makefile as follows.

.include <bsd.port.pre.mk>

.if ${RUBY_VER} < 1.9
USE_RUBY_FEATURES=      iconv
.endif

.include <bsd.port.post.mk>

See also http://www.freebsd.org/cgi/query-pr.cgi?pr=158984.

So, I have not noticed that tDiary has required ruby-iconv dependency.
Since 2011-09-06, tDiary has checked whether String class has encode
method or not
as following codes.

https://github.com/tdiary/tdiary-core/blob/631e2286be498de321797974840b1ccd8f0866e1/tdiary/config.rb#L99
https://github.com/tdiary/tdiary-core/blob/8ac01232e17ae1e1927a9e32e61080e64b9d38a1/tdiary/lang/ja.rb#L43

We should define ruby-iconv dependency in www/tdiary/Makefile
just as you say.
I have prepared a patch, attached in this e-mail, to fix above the issue.
Please confirm that the error does not occur with my patch if you can.

If RUBY_VER == 1.9 in your environment, please send to me a log
when you execute 'make install' in www/tdiary directory.

Thanks in advance,

-- 
TAKATSU Tomonari
Comment 3 TAKATSU Tomonari freebsd_committer freebsd_triage 2011-11-03 14:29:01 UTC
Please use tdiary2.patch instead of tdiary.patch in previous mail.

Thanks,

-- 
TAKATSU Tomonari
Comment 4 TAKATSU Tomonari freebsd_committer freebsd_triage 2011-11-03 14:47:20 UTC
State Changed
From-To: open->feedback

Awaiting confirmation
Comment 5 Yoshisato Yanagisawa 2011-11-03 15:42:23 UTC
I tried your latest patch (tdiary2.patch) but it does not install 
ruby-iconv.  Like this:
===>  License GPLv2 accepted by the user
===>  Extracting for ja-tdiary-3.1.1_1
===>  License GPLv2 accepted by the user
=> SHA256 Checksum OK for tdiary-full-3.1.1.tar.gz.
===>   ja-tdiary-3.1.1_1 depends on file: /usr/local/bin/ruby18 - found
===>  Patching for ja-tdiary-3.1.1_1
===>   ja-tdiary-3.1.1_1 depends on file: /usr/local/bin/ruby18 - found
===>  Fixing the #! line of index.fcgi
===>  Fixing the #! line of index.rb
===>  Fixing the #! line of update.fcgi
===>  Fixing the #! line of update.rb
===>  Fixing the #! line of misc/convert2.rb
===>  Fixing the #! line of misc/migrate.rb
===>  Fixing the #! line of misc/plugin/amazon/amazonimg.rb
===>  Fixing the #! line of misc/plugin/squeeze.rb
===>  Fixing the #! line of misc/plugin/xmlrpc/xmlrpc.rb
===>  Fixing the #! line of misc/standalone_cgi/bin/server
/usr/local/bin/ruby18 -i -pe "sub %r|((\s*)require 'json')|, 
%Q|\\\2require 'rubygems'\n\\\1|" 
/usr/ports/japanese/tdiary/work/tdiary-3.1.1/tdiary.rb
===>   ja-tdiary-3.1.1_1 depends on file: /usr/local/bin/ruby18 - found
===>  Configuring for ja-tdiary-3.1.1_1
===>  Installing for ja-tdiary-3.1.1_1
===>   ja-tdiary-3.1.1_1 depends on executable: hikidoc - found
===>   ja-tdiary-3.1.1_1 depends on package: rubygem-imagesize>=0.1.1 - 
found
===>   ja-tdiary-3.1.1_1 depends on package: rubygem-json_pure>=1.6.1 - 
found
===>   ja-tdiary-3.1.1_1 depends on file: /usr/local/bin/ruby18 - found
===>   ja-tdiary-3.1.1_1 depends on file: 
/usr/local/lib/ruby/site_ruby/1.8/amd64-freebsd8/web/escape_ext.so - found
===>   Generating temporary packing list
===>  Checking if japanese/tdiary already installed

=============================================================================
There is a script to install tDiary in a user directory.
This script should be run manually.

   # /usr/local/bin/ja-tdiary-inst.rb --user=User
    or
   % /usr/local/bin/ja-tdiary-inst.rb

  * Option: --suexec Use suExec for CGI execution
            --help   Display Help information

---
There are documents in the following directories.
   See ...
   /usr/local/share/doc/ja-tdiary
=============================================================================

===>   Registering installation for ja-tdiary-3.1.1_1


As far as I noticed, USE_RUBY_FEATURES=iconv should be defined before 
the line of .include <bsd.port.pre.mk>.  If I put there it is executed 
like this:
===>  License GPLv2 accepted by the user
===>  Extracting for ja-tdiary-3.1.1_1
===>  License GPLv2 accepted by the user
=> SHA256 Checksum OK for tdiary-full-3.1.1.tar.gz.
===>   ja-tdiary-3.1.1_1 depends on file: /usr/local/bin/ruby18 - found
===>  Patching for ja-tdiary-3.1.1_1
===>   ja-tdiary-3.1.1_1 depends on file: /usr/local/bin/ruby18 - found
===>  Fixing the #! line of index.fcgi
===>  Fixing the #! line of index.rb
===>  Fixing the #! line of update.fcgi
===>  Fixing the #! line of update.rb
===>  Fixing the #! line of misc/convert2.rb
===>  Fixing the #! line of misc/migrate.rb
===>  Fixing the #! line of misc/plugin/amazon/amazonimg.rb
===>  Fixing the #! line of misc/plugin/squeeze.rb
===>  Fixing the #! line of misc/plugin/xmlrpc/xmlrpc.rb
===>  Fixing the #! line of misc/standalone_cgi/bin/server
/usr/local/bin/ruby18 -i -pe "sub %r|((\s*)require 'json')|, 
%Q|\\\2require 'rubygems'\n\\\1|" 
/usr/ports/japanese/tdiary/work/tdiary-3.1.1/tdiary.rb
===>   ja-tdiary-3.1.1_1 depends on file: /usr/local/bin/ruby18 - found
===>   ja-tdiary-3.1.1_1 depends on file: 
/usr/local/lib/ruby/1.8/amd64-freebsd8/iconv.so - not found
===>    Verifying install for 
/usr/local/lib/ruby/1.8/amd64-freebsd8/iconv.so in 
/usr/ports/converters/ruby-iconv
===>  License check disabled, port has not defined LICENSE
===>  Extracting for ruby18-iconv-1.8.7.352,1
===>   ruby18-iconv-1.8.7.352,1 depends on file: /usr/local/bin/ruby18 - 
found
/bin/mkdir -p /usr/ports/converters/ruby-iconv/work
/bin/ln -sf /usr/ports/lang/ruby18/work/iconv 
/usr/ports/converters/ruby-iconv/work/
===>  Patching for ruby18-iconv-1.8.7.352,1
===>   ruby18-iconv-1.8.7.352,1 depends on file: /usr/local/bin/ruby18 - 
found
===>   ruby18-iconv-1.8.7.352,1 depends on file: /nonexistent - not found
===>    Verifying patch for /nonexistent in /usr/ports/lang/ruby18
===>  License check disabled, port has not defined LICENSE
===>  Found saved configuration for ruby-1.8.7.160_4,1
===>  Extracting for ruby-1.8.7.352_2,1
=> SHA256 Checksum OK for ruby/ruby-1.8.7-p352.tar.bz2.
/bin/mv /usr/ports/lang/ruby18/work/ruby-1.8.7-p352/ext/dl/h2rb 
/usr/ports/lang/ruby18/work/ruby-1.8.7-p352/bin/
===>  Patching for ruby-1.8.7.352_2,1
===>  Applying FreeBSD patches for ruby-1.8.7.352_2,1
/bin/rm -rf /usr/ports/lang/ruby18/work/ruby-1.8.7-p352/ext/Win32API
/bin/rm -rf /usr/ports/lang/ruby18/work/ruby-1.8.7-p352/ext/win32ole
/bin/mv /usr/ports/lang/ruby18/work/ruby-1.8.7-p352/ext/gdbm 
/usr/ports/lang/ruby18/work/
/bin/mv /usr/ports/lang/ruby18/work/ruby-1.8.7-p352/ext/iconv 
/usr/ports/lang/ruby18/work/
/bin/mv /usr/ports/lang/ruby18/work/ruby-1.8.7-p352/ext/tk 
/usr/ports/lang/ruby18/work/
===>   Returning to build of ruby18-iconv-1.8.7.352,1
===>   ruby18-iconv-1.8.7.352,1 depends on file: /usr/local/bin/ruby18 - 
found
===>   ruby18-iconv-1.8.7.352,1 depends on shared library: iconv.3 - found
===>  Configuring for ruby18-iconv-1.8.7.352,1
===>  Running extconf.rb to configure
checking for iconv() in iconv.h... no
checking for iconv() in -liconv... yes
checking for const of iconv() 2nd argument... yes
creating Makefile
===>  Building for ruby18-iconv-1.8.7.352,1
cc -I. -I. -I/usr/local/lib/ruby/1.8/amd64-freebsd8 -I. 
-DICONV_INPTR_CONST -I/usr/local/include -I/usr/include   -I/usr/include 
-fPIC -I/usr/include -O2 -pipe -fno-strict-aliasing  -fPIC  -c iconv.c
cc -shared -o iconv.so iconv.o -L. -L/usr/local/lib -Wl,-R/usr/local/lib 
-L/usr/local/lib -Wl,-R/usr/local/lib -L. -L/usr/lib 
-rpath=/usr/lib:/usr/local/lib -pthread -rdynamic -Wl,-soname,iconv.so 
  -Wl,-R -Wl,/usr/local/lib -L/usr/local/lib -lruby18 -liconv  -lcrypt 
-lm -L/usr/lib  -rpath=/usr/lib:/usr/local/lib -pthread
===>  Installing for ruby18-iconv-1.8.7.352,1
===>   ruby18-iconv-1.8.7.352,1 depends on file: /usr/local/bin/ruby18 - 
found
===>   Generating temporary packing list
===>  Checking if converters/ruby-iconv already installed
/usr/bin/install -c -o root -g wheel -m 0755 iconv.so 
/usr/local/lib/ruby/1.8/amd64-freebsd8
===>   Registering installation for ruby18-iconv-1.8.7.352,1
===>   Returning to build of ja-tdiary-3.1.1_1
===>  Configuring for ja-tdiary-3.1.1_1
===>  Installing for ja-tdiary-3.1.1_1
===>   ja-tdiary-3.1.1_1 depends on executable: hikidoc - found
===>   ja-tdiary-3.1.1_1 depends on package: rubygem-imagesize>=0.1.1 - 
found
===>   ja-tdiary-3.1.1_1 depends on package: rubygem-json_pure>=1.6.1 - 
found
===>   ja-tdiary-3.1.1_1 depends on file: /usr/local/bin/ruby18 - found
===>   ja-tdiary-3.1.1_1 depends on file: 
/usr/local/lib/ruby/1.8/amd64-freebsd8/iconv.so - found
===>   ja-tdiary-3.1.1_1 depends on file: 
/usr/local/lib/ruby/site_ruby/1.8/amd64-freebsd8/web/escape_ext.so - found
===>   Generating temporary packing list
===>  Checking if japanese/tdiary already installed

=============================================================================
There is a script to install tDiary in a user directory.
This script should be run manually.

   # /usr/local/bin/ja-tdiary-inst.rb --user=User
    or
   % /usr/local/bin/ja-tdiary-inst.rb

  * Option: --suexec Use suExec for CGI execution
            --help   Display Help information

---
There are documents in the following directories.
   See ...
   /usr/local/share/doc/ja-tdiary
=============================================================================

===>   Registering installation for ja-tdiary-3.1.1_1


It checks iconv.so.

Can I ask you why you cannot put USE_RUBY_FEATURES=iconv just after 
USE_RUBY as you did in the first patch?

diff -ruN tdiary.bak/Makefile tdiary/Makefile
--- tdiary.bak/Makefile 2011-10-30 01:09:56.000000000 +0900
+++ tdiary/Makefile     2011-11-04 00:28:09.181554512 +0900
@@ -7,6 +7,7 @@

  PORTNAME=      tdiary
  PORTVERSION=   3.1.1
+PORTREVISION=    1
  CATEGORIES?=   www ruby
  MASTER_SITES=  SF/${PORTNAME}/${PORTNAME}/ \
                 http://www.tdiary.org/download/
@@ -24,6 +25,7 @@

  NO_BUILD=      yes
  USE_RUBY=      yes
+USE_RUBY_FEATURES=        iconv
  RUBY_REQUIRE=  Ruby >= 185

  RUBY_SHEBANG_FILES=    index.fcgi \
Comment 6 TAKATSU Tomonari freebsd_committer freebsd_triage 2011-11-04 18:48:14 UTC
On Fri, Nov 4, 2011 at 12:42 AM, Yoshisato YANAGISAWA
<osho@pcc-software.org> wrote:
> I tried your latest patch (tdiary2.patch) but it does not install
> ruby-iconv.  Like this:

(snip)
> Can I ask you why you cannot put USE_RUBY_FEATURES=iconv just after USE_RUBY
> as you did in the first patch?

(snip)

Because tDiary does not need to require iconv in Ruby 1.9 environment.

Can you try tdiary3.patch?


-- 
TAKATSU Tomonari
Comment 7 Yoshisato Yanagisawa 2011-11-05 00:51:49 UTC
Your tdiary3.patch worked.  However, it do not need build dependency 
like tdiary4.txt.
Comment 8 dfilter service freebsd_committer freebsd_triage 2011-11-05 00:58:40 UTC
tota        2011-11-05 00:58:26 UTC

  FreeBSD ports repository

  Modified files:
    www/tdiary           Makefile 
  Log:
  - Add missing runtime dependency on ruby-iconv
  
  PR:             ports/162269
  Submitted by:   Yoshisato YANAGISAWA <osho_AT_pcc-software_DOT_org>
  
  Revision  Changes    Path
  1.32      +2 -0      ports/www/tdiary/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 9 TAKATSU Tomonari freebsd_committer freebsd_triage 2011-11-05 01:00:11 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!