Date: Sun, 27 Jan 2013 11:40:04 -0800 From: Jason Helfman <jgh@FreeBSD.org> To: Yasuhiro KIMURA <yasu@utahime.org> Cc: FreeBSD Ports List <freebsd-ports@freebsd.org> Subject: Re: Issue about adapting japanese/ruby-mecab to new options framework Message-ID: <CAMuy=%2BiM3VV0oaXnka=6MBOs80MOvgV_CDzBrBu%2Bn1X5gSqn5A@mail.gmail.com> In-Reply-To: <20130128.021533.335602238.yasu@utahime.org> References: <20130128.021533.335602238.yasu@utahime.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Jan 27, 2013 at 9:15 AM, Yasuhiro KIMURA <yasu@utahime.org> wrote: > Hello all, > > I adapted japanese/ruby-mecab to new options framework and sent > following PR. > > http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/175258 > > But after submitting I found a issue that options setting dialog is > always displayed even if options save file is already created. > > According to the output of 'make' with '-d' option, following things > seem to happen: > > 1. PKGNAMEPREFIX variable is assigned to "ja-" and that causes > OPTIONSFILE variable to be expanded to "/var/db/ports/ja-mecab/options". > 2. /var/db/ports/ja-mecab/options is included as options save file. > 3. PKGNAMEPREFIX is re-assigned to "ja-ruby19-" and that causes > OPTIONFILE to be expanded to "/var/db/ports/ja-ruby-mecab/options". > 4. Options dialog is invoked and result is saved to > /var/db/ports/ja-ruby-mecab/options. > 5. Since input and output files of options setting are different, > dialog is displayed every time 'make' is invoked. > > And below is detail: > > 01. RUBY_DEFAULT_VER is assigned to "1.9" in /etc/make.conf of my > machine. > 02. PORTNAME is assigned to "mecab" in japanese/ruby-mecab/Makefile. > 03. PKGNAMEPREFIX is assigned to "ja-" in japanese/Makefile.inc. > 04. PORT_DBDIR is assigned to "/var/db/ports" in Mk/bsd.port.mk. > 05. UNIQUENAME is assigned to "${PKGNAMEPREFIX}${PORTNAME}" > in Mk/bsd.port.mk. > 06. OPTIONSFILE is assigned to "${PORT_DBDIR}/${UNIQUENAME}/options" > in Mk/bsd.options.mk. > 07. Check is done if ${OPTIONSFILES} exists in Mk/bsd.options.mk. > At this point ${OPTIONSFILES} is expanded to > "/var/db/ports/ja-mecab/options". > So file named /var/db/ports/ja-mecab/options is checked. > Since japanese/ruby-mecab is depend on japanese/mecab, this file > usually exists. So this file is included as saved options file of > japanese/ruby-mecab. > 08. PKGNAMEPREFIX is assigned with expansion (':=' is used) to > "${PKGNAMEPREFIX}${RUBY_PKGNAMEPREFIX"} in > japanese/ruby-mecab/Makefile. > 09. RUBY_RELVERSION is assigned to "1.9.3" in Mk/bsd.ruby.mk. > 10. RUBY_PATCHLEVEL is assigned to "327" in Mk/bsd.ruby.mk. > 11. RUBY_VERSION is assigned to "${RUBY_RELVERSION}.${RUBY_PATCHLEVEL} > in Mk/bsd.ruby.mk. > 12. RUBY_VER is assigned to > "${RUBY_VERSION:C/([[:digit:]]+\.[[:digit:]]+).*/\1/}" > in Mk/bsd.ruby.mk. > 13. RUBY_SUFFIX is assigned to "${RUBY_VER:S/.//}" in Mk/bsd.ruby.mk. > 14. RUBY_PKGNAMEPREFIX is assigned to "ruby${RUBY_SUFFIX}-" in Mk/ > bsd.ruby.mk. > 15. /usr/bin/dialog is invoked to show options setting dialog. > 16. Result of step 15 is saved to ${OPTIONSFILE}. At this point > ${OPTIONSFILE} is expanded to "/var/db/ports/ja-ruby19-mecab/options". > So file named /var/db/ports/ja-ruby19-mecab/options is created > and options setting is saved to it. > 17. Now options settings are saved to /var/db/ports/ja-ruby19-mecab/options > at step 16, and it is different from the file included at step 07. > So it cause step 01 to 16 to be repeated every time 'make' is invoked. > > And now, how should I fix this issue? Is it possible to fix it by only > patching japanese/ruby-mecab/Makefile? Or are some changes of Mk/bsd.*.mk > needed? > > Any suggestion is welcome. > > Best regards. > > --- > Yasuhiro KIMURA > > You could look at setting OPTIONSFILE in the ports Makefile, itself. For instance, this is set in net/rubygem-net-ssh. Although this may not be the exact entry, this is an example you can work with to get it to work as it should. OPTIONSFILE?= ${PORT_DBDIR}/rubygem-${PORTNAME}/options -jgh
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAMuy=%2BiM3VV0oaXnka=6MBOs80MOvgV_CDzBrBu%2Bn1X5gSqn5A>