sw: fail loading when the fallback text detection fails
[LibreOffice.git] / postprocess / CustomTarget_images.mk
blobf1e32f0b28ffb4045492d65a32a1396300f5b0d0
1 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
4 # This file is part of the LibreOffice project.
6 # This Source Code Form is subject to the terms of the Mozilla Public
7 # License, v. 2.0. If a copy of the MPL was not distributed with this
8 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
11 $(eval $(call gb_CustomTarget_CustomTarget,postprocess/images))
13 packimages_DIR := $(call gb_CustomTarget_get_workdir,postprocess/images)
15 $(eval $(call gb_CustomTarget_register_targets,postprocess/images,\
16 $(foreach theme,$(WITH_THEMES),images_$(theme).zip) \
17 $(foreach theme,$(WITH_THEMES),$(theme)_links.txt) \
18 commandimagelist.ilst \
19 sourceimagelist.ilst \
20 sorted.lst \
23 $(packimages_DIR)/images.zip : DEFAULT_THEME := $(true)
24 $(packimages_DIR)/images_%.zip : DEFAULT_THEME :=
26 # tdf#124023 make links.txt depend on phony sorted.lst depend
27 # so this is evaluated every time
28 $(packimages_DIR)/%_links.txt : $(packimages_DIR)/sorted.lst
29 @if test -f "$(SRCDIR)/icon-themes/$*/links.txt"; then \
30 cp "$(SRCDIR)/icon-themes/$*/links.txt" $@.tmp ; \
31 else \
32 THEME_FILE="$(SRCDIR)/icon-themes/$(subst _svg,,$*)/links.txt" ; \
33 if test -f "$${THEME_FILE}"; then \
34 sed 's/\.png/\.svg/g' "$${THEME_FILE}" > $@.tmp ; \
35 fi ; \
36 THEME_FILE="$(SRCDIR)/icon-themes/$(subst _dark,,$*)/links.txt" ; \
37 if test -f "$${THEME_FILE}"; then \
38 cp "$${THEME_FILE}" $@.tmp ; \
39 fi ; \
41 $(call gb_Helper_replace_if_different_and_touch,$@.tmp,$@)
43 $(packimages_DIR)/images_%.zip : \
44 $(packimages_DIR)/sorted.lst \
45 $(packimages_DIR)/commandimagelist.ilst \
46 $(packimages_DIR)/sourceimagelist.ilst \
47 $(SRCDIR)/wizards/source/imagelists/imagelists.ilst \
48 $(packimages_DIR)/%_links.txt \
49 $(call gb_Helper_get_imagelists) \
50 | $(call gb_ExternalExecutable_get_dependencies,python)
51 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,2)
52 $(call gb_Helper_abbreviate_dirs, \
53 ILSTFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,$(filter %.ilst,$^)) && \
54 $(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/solenv/bin/pack_images.py \
55 $(if $(DEFAULT_THEME),\
56 -g $(packimages_DIR) -m $(packimages_DIR) -c $(packimages_DIR),\
57 -g $(SRCDIR)/icon-themes/$* -m $(SRCDIR)/icon-themes/$* -c $(SRCDIR)/icon-themes/$* \
58 ) \
59 -l $${ILSTFILE} \
60 -L $(packimages_DIR)/$*_links.txt \
61 -s $< -o $@ \
62 $(if $(findstring s,$(MAKEFLAGS)),> /dev/null) && \
63 rm -rf $${ILSTFILE})
65 # turn the #defines foo "resource.png" of hlst into the final ilst format
66 $(packimages_DIR)/sourceimagelist.ilst : \
67 $(SRCDIR)/avmedia/inc/bitmaps.hlst \
68 $(SRCDIR)/basctl/inc/bitmaps.hlst \
69 $(SRCDIR)/connectivity/inc/bitmaps.hlst \
70 $(SRCDIR)/cui/inc/bitmaps.hlst \
71 $(SRCDIR)/chart2/inc/bitmaps.hlst \
72 $(SRCDIR)/dbaccess/inc/bitmaps.hlst \
73 $(SRCDIR)/desktop/inc/bitmaps.hlst \
74 $(SRCDIR)/extensions/inc/bitmaps.hlst \
75 $(SRCDIR)/formula/inc/bitmaps.hlst \
76 $(SRCDIR)/fpicker/inc/bitmaps.hlst \
77 $(SRCDIR)/framework/inc/bitmaps.hlst \
78 $(SRCDIR)/reportdesign/inc/bitmaps.hlst \
79 $(SRCDIR)/sc/inc/bitmaps.hlst \
80 $(SRCDIR)/sd/inc/bitmaps.hlst \
81 $(SRCDIR)/sdext/inc/bitmaps.hlst \
82 $(SRCDIR)/sfx2/inc/bitmaps.hlst \
83 $(SRCDIR)/svtools/inc/bitmaps.hlst \
84 $(SRCDIR)/svx/inc/bitmaps.hlst \
85 $(SRCDIR)/sw/inc/bitmaps.hlst \
86 $(SRCDIR)/vcl/inc/bitmaps.hlst \
87 $(SRCDIR)/xmlsecurity/inc/bitmaps.hlst
88 grep res $^ | cut -d'"' -f2 | sed "s/^/%MODULE%\//" | sed "s/%MODULE%.res/%GLOBALRES%/g" > $@.png
89 sed 's/\.png/\.svg/g' $@.png > $@.svg
90 cat $@.png $@.svg > $@
92 # commandimagelist.ilst and sorted.lst are phony to rebuild everything each time
93 .PHONY : $(packimages_DIR)/commandimagelist.ilst $(packimages_DIR)/sorted.lst
95 $(packimages_DIR)/commandimagelist.ilst :
96 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
97 $(call gb_Helper_abbreviate_dirs, \
98 $(FIND) $(SRCDIR)/icon-themes -name "*.png" -o -name "*.svg" | \
99 grep -e '/cmd/' | sed 's#^.*/icon-themes/[^/]*##' | \
100 sed "s#^#%MODULE%#" | \
101 LC_ALL=C $(SORT) -u > $@.tmp && \
102 $(call gb_Helper_replace_if_different_and_touch,$@.tmp,$@))
104 $(packimages_DIR)/sorted.lst : \
105 $(SRCDIR)/postprocess/packimages/image-sort.lst \
106 $(call gb_Postprocess_get_target,AllUIConfigs)
107 $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,1)
108 $(call gb_Helper_abbreviate_dirs, \
109 $(PERL) $(SRCDIR)/solenv/bin/image-sort.pl \
110 $< $(INSTROOT)/$(gb_UIConfig_INSTDIR) $@)
112 # vim: set noet sw=4 ts=4: