[Libreoffice] gbuild question

Michael Stahl mst at openoffice.org
Tue Oct 4 11:12:27 PDT 2011


On 29.09.2011 15:54, Matúš Kukan wrote:
> Hi Peter
> 
> On 25 September 2011 01:05, Peter Foley <pefoley2 at verizon.net> wrote:
>> While working on converting xmerge to gbuild I found that the current
>> gbuild Jar.mk doesn't support adding non java files to the jar.
>> The xmerge jars need a component.xml file included in the jar.
>> I tried to implement file adding but couldn't get it to work. Help with
>> implementing this would be greatly appreciated.
>> I've included my (non-working) attempt at implementing this and a
>> usage example below.
>>
> Maybe you have already solved this but in case it could be helpful I'm
> sending something that should more or less work.
> See attached.
> 
> I think gd_Deliver is only for $(OUTDIR) so it can't be used in this case.
> And maybe you want to use cp --foo, I'm not sure about proper parameters.
> 
> Main part:
> 
> +define gb_Jar_get_workdir
> +$(call gb_JavaClassSet_get_classdir,$(call gb_Jar_get_classsetname,$(1)))
> +endef
> +
> +define gb_Jar_add_file
> +$(call gb_Jar_get_target,$(1)) : PACKAGEFILES += $(2)
> +$(call gb_Jar_get_target,$(1)) : $(call gb_Jar_get_workdir,$(1))/$(2)
> +$(call gb_Jar_get_workdir,$(1))/$(2) : $(3) $(call
> gb_JavaClassSet_get_target,$(call gb_Jar_get_classsetname,$(1)))
> +       cp $(3) $$@
> +
> +endef

i think this should indeed work.

i've looked at the jar manpage a bit and it could be possible to get rid
of the temporary copy to the workdir: jar apparently supports giving
multiple "-C dir" options, each only valid until the next one overrides
it, so the files can be in different directories; but i guess there are
only a handful of such files so the copying shouldn't be much of a problem
(now if only we could get rid of delivering c++ headers, that would be a
win...).

regards,
 michael



More information about the LibreOffice mailing list