LOCDIR/LOCALEDIR and plugins

Message ID 200804061950.26187.ville.skytta@iki.fi
State New
Headers

Commit Message

Ville Skyttä April 6, 2008, 4:50 p.m. UTC
  Hello,

I'm a bit confused about the locale dir stuff in VDR 1.6.0 especially wrt. 
plugins.  newplugin hardcodes LOCALEDIR to $(VDRDIR)/locale without taking 
Make.config into account at all.  The result is that plugins will try to 
place their *.mo into a wrong location if LOCDIR was customized in in VDR's 
Make.config and/or "make install" was used.  I suppose the attached patch 
would fix that.

However that does not address weirdness in main VDR's locale dir handling; the 
value set for LOCDIR in Make.config gets built into vdr as the compile time 
default locale dir, but but "make install-i18n" will install the *.mo 
somewhere else unless one sets identical value for LOCALEDIR in Makefile 
(setting it in Make.config does not have any effect).  Are both LOCDIR and 
LOCALEDIR needed?  I'd try to clean this up and post a patch that fixes it if 
I knew what the intention is :)
  

Comments

Udo Richter April 6, 2008, 7:58 p.m. UTC | #1
Ville Skyttä wrote:
> I'm a bit confused about the locale dir stuff in VDR 1.6.0 especially wrt. 
> plugins.  newplugin hardcodes LOCALEDIR to $(VDRDIR)/locale without taking 
> Make.config into account at all.  The result is that plugins will try to 
> place their *.mo into a wrong location if LOCDIR was customized in in VDR's 
> Make.config and/or "make install" was used.  I suppose the attached patch 
> would fix that.

I think the intention is that plugins copy their i18n files into 
LOCALEDIR in the VDR source dir, and the VDR makefile copies the files 
from LOCALEDIR to the LOCDIR install location. That way, LOCALEDIR 
should never change and there's no need to modify it in Make.config.
I don't have any real world experience though, as I am using my own 
packaging scripts anyway.

Cheers,

Udo
  

Patch

--- newplugin~	2008-01-13 15:00:23.000000000 +0200
+++ newplugin	2008-04-06 19:34:52.000000000 +0300
@@ -84,6 +84,7 @@ 
 VDRDIR = ../../..
 LIBDIR = ../../lib
 TMPDIR = /tmp
+LOCDIR = \$(VDRDIR)/locale
 
 ### Allow user defined options to overwrite defaults:
 
@@ -129,9 +130,8 @@ 
 ### Internationalization (I18N):
 
 PODIR     = po
-LOCALEDIR = \$(VDRDIR)/locale
 I18Npo    = \$(wildcard \$(PODIR)/*.po)
-I18Nmsgs  = \$(addprefix \$(LOCALEDIR)/, \$(addsuffix /LC_MESSAGES/vdr-\$(PLUGIN).mo, \$(notdir \$(foreach file, \$(I18Npo), \$(basename \$(file))))))
+I18Nmsgs  = \$(addprefix \$(LOCDIR)/, \$(addsuffix /LC_MESSAGES/vdr-\$(PLUGIN).mo, \$(notdir \$(foreach file, \$(I18Npo), \$(basename \$(file))))))
 I18Npot   = \$(PODIR)/\$(PLUGIN).pot
 
 %.mo: %.po
@@ -144,7 +144,7 @@ 
 	msgmerge -U --no-wrap --no-location --backup=none -q \$\@ \$<
 	\@touch \$\@
 
-\$(I18Nmsgs): \$(LOCALEDIR)/%/LC_MESSAGES/vdr-\$(PLUGIN).mo: \$(PODIR)/%.mo
+\$(I18Nmsgs): \$(LOCDIR)/%/LC_MESSAGES/vdr-\$(PLUGIN).mo: \$(PODIR)/%.mo
 	\@mkdir -p \$(dir \$@)
 	cp \$< \$\@