diff options
author | Mattias Andrée <maandree@kth.se> | 2023-07-02 00:37:38 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-07-02 00:38:53 +0200 |
commit | 94683b40016c6011809ce9b88eb35f180aada647 (patch) | |
tree | 2d9b1b8fde7faed515ec335e8b2306b9bd20eb25 | |
parent | Improve makfile (diff) | |
download | simple-icon-theme-94683b40016c6011809ce9b88eb35f180aada647.tar.gz simple-icon-theme-94683b40016c6011809ce9b88eb35f180aada647.tar.bz2 simple-icon-theme-94683b40016c6011809ce9b88eb35f180aada647.tar.xz |
Fix icon listing and make Makefile portable
Signed-off-by: Mattias Andrée <maandree@kth.se>
48 files changed, 335 insertions, 220 deletions
@@ -6,4 +6,4 @@ conv *.o *.su -/generated-rules.mk +/generated.mk @@ -1,28 +1,39 @@ .POSIX: +DEVCHECK = @: + CONFIGFILE = config.mk include $(CONFIGFILE) all: -generated-rules.mk: $(CONFIGFILE) +generated.mk: $(CONFIGFILE) icons.mk Makefile + $(DEVCHECK) ./check-icons-listing @test ! -e $@ || chmod -- u+w $@ - printf '# %s\n' 'This file is generated from Makefile' > $@ - printf '\n%1i$$(DIR_SUFFIX)/%%.png: scalable$$(DIR_SUFFIX)/%%.svg conv\n\t./conv $$@\n' $(SIZES) | \ + printf '\043 %s\n' 'This file is generated from Makefile' > $@ + printf '\n%1i$$(DIR_SUFFIX)/%%.png: scalable$$(DIR_SUFFIX)/%%.svg conv\n\t./conv $$@\n' $(SIZES) |\ sed 's/^[0-9]\+/&x&/' >> $@ + set -e; \ + for size in $(SIZES); do\ + printf '\nALL_SIZE_%i_PNG_ICONS =\\\n' $$size >> $@;\ + sed '/^\s*\('"$$(printf '\043')"'.*\|\)$$/d' < icons.mk | sed 1d | sed 's/\\\?$$/\.png&/' |\ + sed 's/^\s*/&'"$${size}x$${size}"'\$$(DIR_SUFFIX)\//' >> $@;\ + done + printf '\nALL_PNG_ICONS =' >> $@ + printf ' $$(ALL_SIZE_%i_PNG_ICONS)' $(SIZES) >> $@ + printf '\n' >> $@ @chmod -- a-w $@ clean: - -rm -f -- index.theme *.o *.su conv generated-rules.mk - -if test -n "$(DIR_SUFFIX)"; then rm -rf -- scalable$(DIR_SUFFIX); fi + -rm -rf -- index.theme *.o *.su conv generated.mk scalable-"$(DIR_SUFFIX_)" -for s in $(SIZES); do printf "$${s}x$${s}$(DIR_SUFFIX)\n"; done | xargs rm -rf -- # These are just added so autocompletion works with them -all all-fast all-fast-icons install uninstall index.theme conv: generated-rules.mk +all all-fast all-fast-icons install uninstall index.theme conv: generated.mk +@$(MAKE) -f make-stage-2.mk $@ .DEFAULT: - +@$(MAKE) generated-rules.mk + +@$(MAKE) generated.mk +@$(MAKE) -f make-stage-2.mk $@ .PHONY: all all-fast all-fast-icons install uninstall clean diff --git a/check-icons-listing b/check-icons-listing new file mode 100755 index 0000000..404e089 --- /dev/null +++ b/check-icons-listing @@ -0,0 +1,89 @@ +#!/bin/sh +set -e + +rel () { + to="$1" + from="$2" + while test $(printf '%s\n' "$to" "$from" | grep / | wc -l) = 2; do + todir="$(printf '%s\n' "$to" | cut -d / -f 1)" + fromdir="$(printf '%s\n' "$from" | cut -d / -f 1)" + if test ! "$todir" = "$fromdir"; then + break + fi + to="$(printf '%s\n' "$to" | cut -d / -f 2-)" + from="$(printf '%s\n' "$frm" | cut -d / -f 2-)" + done + while test -n "$(printf '%s\n' "$from" | grep /)"; do + from="$(printf '%s\n' "$from" | cut -d / -f 2-)" + to="../$to" + done + printf '%s\n' "$to" +} + +lines=$(sed 's/\\$//' < icons.mk | sed '/^\s*\(#.*\|\)$/d' | sed 1d | wc -l) +test ! $lines = 0 + +test $(sed 's/\\$//' < icons.mk | sed '/^\s*\(#.*\|\)$/d' | sed 1d | sed 's/\t/ /g' | grep '^ ' | wc -l) = $lines + +test $(sed 's/\\$//' < icons.mk | sed '/^\s*\(#.*\|\)$/d' | sed '1s/^.*$//' | grep -n ' ' | wc -l) = 0 + +stack="" +i=0 +sed 's/\\$//' < icons.mk | sed '/^\s*\(#.*\|\)$/d' | sed 1d | sed 's/^\t/x/' | while read L; do + i=$(( i + 1 )) + printf 'Checking %i of %i\n\033[A' $i $lines >&2 + tabs=0 + while test ! $(printf '%s\n' "$L" | sed -n '/^x\t/p' | wc -l) = 0; do + L="$(printf '%s\n' "$L" | sed 's/^x\t/x/')" + tabs=$(( tabs + 1 )) + done + L="$(printf '%s\n' "$L" | sed 's/^x//')" + f="scalable/$L.svg" + if test ! $(printf '%s\n' $f | wc -l) = 1; then + printf '\033[K%s contains whitespace\n' "$L" >&2 + exit 1 + fi + tabsplus1=$(( tabs + 1 )) + if test -z "$(printf '%s\n' $stack x | sed -n ${tabsplus1}p)"; then + printf '\033[K%s is overtabulated\n' "$L" >&2 + exit 1 + else + stack="$(printf '%s\n' $stack | head -n $tabs; printf '%s\n' "$L")" + fi + if test ! -e "$f"; then + if test -L "$f"; then + printf '\033[K%s is a dangling symlink\n' "$L" >&2 + else + printf '\033[K%s is listed but does not exist\n' "$L" >&2 + fi + exit 1 + fi + if test $tabs = 0; then + if test -L "$f"; then + printf '\033[K%s is a symlink but not indented\n' "$L" >&2 + exit 1 + fi + else + goal_="$(printf '%s\n' $stack | sed -n "${tabs}p")" + if test ! -L "$f"; then + printf '\033[K%s is not a symlink but listed as linking to %s\n' "$L" "$goal" >&2 + exit 1 + fi + target="$(realpath -- "$f")" + goal="$(realpath -- "scalable/${goal_}.svg")" + if test "$target" = "$goal"; then + diff="same real file" + else + diff="different real file" + fi + target="$(readlink -- "$f")" + goal="$(rel "${goal_}.svg" "$L.svg")" + if test "$target" = "./$goal"; then + ln -sf -- "$target" "$f" + elif test ! "$target" = "$goal"; then + printf '\033[K%s links to %s but should link to %s (%s)\n' "$L" "$target" "$goal" "$diff" >&2 + exit 1 + fi + fi +done +printf '\033[K' >&2 @@ -3,6 +3,11 @@ ICONS =\ categories/plugin-snow\ categories/plugin-unityshell\ categories/preferences-desktop\ + apps/desktop-effects\ + apps/wmtweaks\ + apps/gnome-tweak-tool\ + apps/drakconf\ + apps/paprefs\ categories/gnome-control-center\ categories/kcontrol\ categories/gnome-settings\ @@ -12,16 +17,6 @@ ICONS =\ categories/redhat-preferences\ categories/applications-interfacedesign\ categories/configuration_section\ - apps/preferences-sound\ - apps/qt\ - apps/qtconfig\ - apps/qtconfig-qt4\ - apps/scribus\ - apps/quicktime\ - apps/skype\ - apps/teamviewer\ - apps/wesnoth\ - apps/wesnoth_editor-icon\ apps/dconf-editor\ apps/gconfeditor\ apps/gconf-editor\ @@ -39,6 +34,15 @@ ICONS =\ apps/redhat-server_settings\ apps/redhat-tools\ apps/unity-tweak-tool-overview\ + apps/qt\ + apps/qtconfig\ + apps/qtconfig-qt4\ + apps/scribus\ + apps/quicktime\ + apps/skype\ + apps/teamviewer\ + apps/wesnoth\ + apps/wesnoth_editor-icon\ categories/applications-chat\ categories/applications-mathematics\ categories/applications-internet\ @@ -138,8 +142,8 @@ ICONS =\ apps/gelemental\ apps/nitrogen\ categories/preferences-desktop-personal\ - apps/gnome-session-properties\ - apps/session-properties\ + apps/session-properties\ + apps/gnome-session-properties\ apps/preferences-system-session-services\ categories/preferences-system-network\ categories/preferences-system-network-proxy\ @@ -148,6 +152,7 @@ ICONS =\ categories/package_office\ categories/redhat-office\ categories/xfce-office\ + apps/preferences-sound\ apps/apport\ apps/anjuta\ apps/anjuta6\ @@ -300,6 +305,7 @@ ICONS =\ apps/xfce4-mixer-no-record\ apps/preferences-desktop-keyboard\ apps/system-config-keyboard\ + apps/yast-keyboard\ apps/wireshark\ apps/wire-shark\ apps/hi48-app-wireshark\ @@ -597,7 +603,7 @@ ICONS =\ categories/plugin-switcher\ categories/plugin-staticswitcher\ categories/plugin-swapper\ - categories/plugin-swap\ + categories/plugin-swap\ categories/plugin-animationism\ apps/system-file-manager\ apps/system_file_manager\ @@ -698,7 +704,7 @@ ICONS =\ apps/screensaver\ apps/kscreensaver\ apps/xscreensaver\ - categories/plugin-screensaver\ + categories/plugin-screensaver\ apps/preferences-system-time\ apps/mate-panel-clock\ apps/gnome-panel-clock\ @@ -767,8 +773,8 @@ ICONS =\ places/distributor-logo\ places/novell-button\ places/start-here\ + apps/start-here\ apps/distributor-logo\ - apps/start-here\ mimetypes/vmlinuz\ apps/baobab\ apps/org.gnome.baobab\ @@ -909,7 +915,6 @@ ICONS =\ categories/plugin-flash\ mimetypes/application-x-flash-video\ mimetypes/application-x-shockwave-flash\ - apps/steam\ apps/goa-panel\ apps/qv4l2\ apps/compton\ @@ -922,7 +927,6 @@ ICONS =\ mimetypes/application-x-blender\ apps/preferences-system-privacy\ apps/preferences-desktop-keyboard-shortcuts\ - apps/yast-keyboard\ apps/preferences-web-browser-shortcuts\ apps/gnome-settings-keybindings\ apps/key_bindings\ @@ -1175,7 +1179,6 @@ ICONS =\ status/battery-level-10\ status/xfpm-battery-010\ status/notification-gpm-battery-010\ - status/notification-battery-low\ status/notification-battery-010\ status/gpm-primary-010\ status/xfpm-primary-010\ @@ -1382,11 +1385,11 @@ ICONS =\ status/xfpm-primary-100\ status/battery-100\ status/gpm-ups-100\ - status/xfpm-ups-100-charging\ + status/xfpm-ups-100\ status/notification-gpm-ups-100\ status/battery_full\ status/gpm-battery-100-charging\ - status/battery-level-100\ + status/battery-level-100-charging\ status/xfpm-battery-100-charging\ status/notification-gpm-battery-100-charging\ status/notification-battery-100-plugged\ @@ -1396,8 +1399,8 @@ ICONS =\ status/gpm-ups-100-charging\ status/xfpm-ups-100-charging\ status/notification-gpm-ups-100-charging\ - status/battery_charged\ - status/battery-charged\ + status/battery-charged\ + status/battery_charged\ status/gpm-battery-empty\ status/notification-gpm-battery-empty\ status/notification-power-disconnected\ @@ -1975,7 +1978,7 @@ ICONS =\ actions/eye\ actions/visible\ actions/gimp-visible\ - actions/view-reveal\ + actions/view-reveal\ status/thunderbolt-acquiring\ status/night-light-on\ status/night-light\ @@ -2288,9 +2291,9 @@ ICONS =\ apps/graveman48\ apps/k3b\ actions/brasero-disc-100\ - apps/isomaster\ - apps/grip\ - apps/gcdmaster\ + apps/isomaster\ + apps/grip\ + apps/gcdmaster\ actions/brasero-disc-00\ actions/brasero-disc-05\ actions/brasero-disc-10\ @@ -2536,12 +2539,12 @@ ICONS =\ apps/deskbar-applet\ apps/gnome-search-tool\ apps/strigi\ + categories/plugins-search\ apps/panel-searchtool\ apps/tracker\ apps/xfce4-appfinder\ apps/kfind\ categories/plugin-mag\ - categories/plugins-search\ categories/plugin-ezoom\ actions/zoom\ actions/tool-zoom\ @@ -2970,7 +2973,7 @@ ICONS =\ actions/folder_new\ actions/stock_new-dir\ actions/svn_branch\ - actions/svn_branch\ + actions/svn-branch\ actions/format-indent-less\ actions/format-indent-more-rtl\ actions/gnome-stock-text-unindent\ @@ -3073,7 +3076,6 @@ ICONS =\ actions/media-seek-backward-rtl\ actions/player_fwd\ actions/stock_media-fwd\ - actions/media-skip-forward-rtl\ actions/media-skip-backward\ actions/gtk-media-next-rtl\ actions/gtk-media-previous-ltr\ @@ -3081,6 +3083,7 @@ ICONS =\ actions/player_start\ actions/stock_media-prev\ status/notification-audio-previous\ + actions/media-skip-forward-rtl\ actions/media-skip-forward\ actions/gtk-media-next-ltr\ actions/gtk-media-previous-rtl\ @@ -3134,7 +3137,7 @@ ICONS =\ actions/stock_last\ actions/go-first-rtl\ actions/last-page\ - actions/arrow-left-double\ + actions/arrow-right-double\ actions/go-next\ actions/forward\ actions/gtk-go-back-rtl\ @@ -3318,11 +3321,6 @@ ICONS =\ categories/preferences-desktop-peripherals\ categories/input_devices_settings\ apps/xfce4-mcs-manager\ - apps/desktop-effects\ - apps/wmtweaks\ - apps/gnome-tweak-tool\ - apps/paprefs\ - apps/drakconf\ devices/input-touchpad\ devices/input-keyboard\ devices/gnome-dev-keyboard\ @@ -3612,12 +3610,12 @@ ICONS =\ places/user-trash\ mimetypes/application-x-trash\ mimetypes/text-x-bak\ - places/emptytrash\ - places/gnome-fs-trash-empty\ places/gnome-stock-trash\ - places/trashcan_empty\ - actions/trash-empty\ - places/xfce-trash_empty\ + places/emptytrash\ + places/gnome-fs-trash-empty\ + places/trashcan_empty\ + actions/trash-empty\ + places/xfce-trash_empty\ places/network-server\ places/gnome-fs-server\ places/gnome-mime-x-directory-nfs-server\ @@ -3939,13 +3937,13 @@ ICONS =\ mimetypes/text-x-csharp\ mimetypes/gnome-mime-text-x-csharp\ mimetypes/text-x-c++src\ - mimetypes/text-x-c++\ mimetypes/gnome-mime-text-x-c++src\ - mimetypes/gnome-mime-text-x-c++\ + mimetypes/text-x-c++\ + mimetypes/gnome-mime-text-x-c++\ mimetypes/text-x-csrc\ - mimetypes/text-x-c\ mimetypes/gnome-mime-text-x-csrc\ - mimetypes/gnome-mime-text-x-c\ + mimetypes/text-x-c\ + mimetypes/gnome-mime-text-x-c\ mimetypes/text-x-hdr\ mimetypes/text-x-c++hdr\ mimetypes/gnome-mime-text-x-c++hdr\ @@ -3993,30 +3991,31 @@ ICONS =\ mimetypes/multipart-encrypted\ apps/kleopatra\ mimetypes/font-x-generic\ + mimetypes/font\ mimetypes/font-bitmap\ mimetypes/font_bitmap\ - mimetypes/gnome-mime-application-x-font-bdf\ - mimetypes/gnome-mime-application-x-font-linux-psf\ - mimetypes/gnome-mime-application-x-font-pcf\ - mimetypes/font\ - mimetypes/font_truetype\ - mimetypes/font_type1\ - mimetypes/gnome-mime-application-x-font-afm\ - mimetypes/gnome-mime-x-font-afm\ - mimetypes/gnome-mime-application-x-font-sunos-news\ - mimetypes/gnome-mime-application-x-font-ttf\ + mimetypes/application-x-font-bdf\ + mimetypes/gnome-mime-application-x-font-bdf\ + mimetypes/application-x-font-pcf\ + mimetypes/gnome-mime-application-x-font-pcf\ + mimetypes/gnome-mime-application-x-font-psf\ + mimetypes/gnome-mime-application-x-font-linux-psf\ + mimetypes/application-x-font-snf\ mimetypes/application-x-font-afm\ - mimetypes/application-x-font-bdf\ + mimetypes/gnome-mime-application-x-font-afm\ + mimetypes/gnome-mime-x-font-afm\ + mimetypes/gnome-mime-application-x-font-sunos-news\ mimetypes/application-x-font-otf\ - mimetypes/application-x-font-pcf\ - mimetypes/application-x-font-snf\ - mimetypes/application-x-font-ttf\ - mimetypes/application-x-font-type1\ - mimetypes/application-x-font-type\ mimetypes/font-truetype\ + mimetypes/application-x-font-ttf\ + mimetypes/gnome-mime-application-x-font-ttf\ + mimetypes/font_truetype\ mimetypes/font-type1\ - mimetypes/font_type\ + mimetypes/application-x-font-type1\ + mimetypes/font_type1\ mimetypes/font-type\ + mimetypes/application-x-font-type\ + mimetypes/font_type\ mimetypes/x-office-extension\ mimetypes/libreoffice-extension\ mimetypes/libreoffice34-extension\ @@ -4199,7 +4198,6 @@ ICONS =\ mimetypes/openofficeorg3-oasis-spreadsheet\ mimetypes/openofficeorg3-spreadsheet\ mimetypes/openofficeorg-oasis-spreadsheet\ - mimetypes/openofficeorg-spreadsheet\ mimetypes/spreadsheet\ mimetypes/text-csv\ mimetypes/application-vnd.oasis.opendocument.spreadsheet\ diff --git a/make-stage-2.mk b/make-stage-2.mk index 5482c26..4891da1 100644 --- a/make-stage-2.mk +++ b/make-stage-2.mk @@ -1,4 +1,4 @@ -## Not compatible with POSIX make, tested with GNU make +.POSIX: CONFIGFILE = config.mk include $(CONFIGFILE) @@ -16,114 +16,28 @@ DIRS =\ include icons.mk -ALL_PNG_ICONS = $(foreach S,$(SIZES),$(foreach I,$(ICONS),$(S)x$(S)$(DIR_SUFFIX)/$(I).png)) - -all: index.theme $(ALL_PNG_ICONS) - -all-fast: index.theme all-fast-icons - -index.theme: Makefile - set -e;\ - printf '%s\n' \ - '[Icon Theme]'\ - 'Name=$(THEME_NAME)'\ - 'Comment=$(THEME_DESC)'\ - 'Example=folder'\ - ''\ - '# KDE specific stuff'\ - 'DisplayDepth=32'\ - 'LinkOverlay=link_overlay'\ - 'LockOverlay=lock_overlay'\ - 'ZipOverlay=zip_overlay'\ - 'DesktopDefault=48'\ - 'DesktopSizes='$$(printf ',%s' $(SIZES) | sed 's/^,//')\ - 'ToolbarDefault=22'\ - 'ToolbarSizes=8,16,22,32,48'\ - 'MainToolbarDefault=22'\ - 'MainToolbarSizes=8,16,22,32,48'\ - 'SmallDefault=16'\ - 'SmallSizes=16'\ - 'PanelDefault=32'\ - 'PanelSizes='$$(printf ',%s' $(SIZES) | sed 's/^,//')\ - ''\ - > index.theme - printf 'Directories=' >> index.theme - set -e;\ - for s in $(SIZES); do\ - for d in $(DIRS); do\ - printf ',%sx%s/%s' $$s $$s $$d;\ - done;\ - done | sed 's/^,//' >> index.theme - set -e;\ - for d in $(DIRS); do\ - printf ',scalable/%s' $$d;\ - done >> index.theme - printf '\n' >> index.theme - set -e;\ - for s in $(SIZES) scalable; do\ - for d in $(DIRS); do\ - printf '\n';\ - ./make-dir-info $$s $$d;\ - done;\ - done >> index.theme - -all-fast-icons: $(ICONS:=.x) - -scalable-$(DIR_SUFFIX_)/%.svg: scalable/%.svg - @mkdir -p -- "$$(dirname "$@")" - if ! test "$@" = "scalable/$*.svg"; then\ - if test -L "scalable/$*.svg"; then\ - ln -sf "$$(readlink -- "scalable/$*.svg")" $@;\ - else\ - sed < scalable/$*.svg > $@\ - -e 's/#[bB][eE][bB][eE][bB][eE]/#$(BASE_COLOUR)/g'\ - -e 's/#[eE][fF]2929/#$(ALARM_RED)/g'\ - -e 's/#[fF]57900/#$(ALARM_ORANGE)/g'\ - -e 's/#[cC][dD]656[cC]/#$(RED)/g'\ - -e 's/#[dD]69553/#$(ORANGE)/g'\ - -e 's/#[cC][cC][aA][dD]47/#$(YELLOW)/g'\ - -e 's/#32[aA]679/#$(GREEN)/g'\ - -e 's/#00[aA]09[fF]/#$(CYAN)/g'\ - -e 's/#2495[bB][eE]/#$(BLUE)/g'\ - -e 's/#[aA]46[eE][bB]0/#$(MAGENTA)/g'\ - -e 's/#000000/#$(OUTLINE)/g';\ - fi;\ +all: + +include generated.mk +include portable.mk +include unportable.mk + +# For implementation that do not support pattern matching rules +.DEFAULT: + +@set -e;\ + if printf '%s\n' "$@" | grep '^scalable' > /dev/null; then\ + sed < unportable.mk '1s|%|'"$$(printf '%s\n' "$@" | sed 's|^scalable/\(.*\)\.svg$$|\1|')"'|g' | $(MAKE) -f - "$@";\ + elif printf '%s\n' "$@" | grep '\.png$$' > /dev/null; then\ + printf '%s\n' "$@" >&2 ;\ + $(MAKE) -f make-stage-2.mk conv &&\ + f="$$(printf '%s\n' "$@" | sed 's|^[^/]*\/\(.*\)\.png$$|\1|')" &&\ + if test -n "$(DIR_SUFFIX)"; then \ + $(MAKE) -f make-stage-2.mk scalable$(DIR_SUFFIX)/$$f.svg; \ + fi && \ + sed '/^[a-zA-Z0-9].*=/,$$d' < generated.mk | sed 's|%|'"$$f"'|g' | $(MAKE) -f - "$@";\ + else\ + printf 'No rule to make target %s\n' "$@" >&2;\ + exit 2;\ fi -%.x: conv - @if test -n "$(DIR_SUFFIX)"; then $(MAKE) scalable$(DIR_SUFFIX)/$*.svg; fi - @ # Does work as a dependeny in GNU make for some reason, - @ # additionally, this lets us avoid starting make once - @ # extra for every icon - ./conv scalable$(DIR_SUFFIX)/$*.svg $(SIZES) - -conv: conv.c - $(CC) -o $@ $< $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) - -include generated-rules.mk - -install: index.theme $(ALL_PNG_ICONS) - mkdir -p -- "$(DESTDIR)$(ICONPREFIX)" - set -e;\ - for d in $(DIRS); do\ - for s in $(SIZES); do\ - mkdir -p -- "$(DESTDIR)$(ICONPREFIX)/$(THEME_DIR)/$${s}x$${s}/$${d}";\ - done;\ - mkdir -p -- "$(DESTDIR)$(ICONPREFIX)/$(THEME_DIR)/scalable/$${d}";\ - done - set -e;\ - for i in $(ICONS); do\ - for s in $(SIZES); do\ - cp -P -- "$${s}x$${s}$(DIR_SUFFIX)/$${i}.png" "$(DESTDIR)$(ICONPREFIX)/$(THEME_DIR)/$${s}x$${s}/$${i}.png";\ - done;\ - cp -P -- "scalable$(DIR_SUFFIX)/$${i}.svg" "$(DESTDIR)$(ICONPREFIX)/$(THEME_DIR)/scalable/$${i}.svg";\ - done - cp -- index.theme "$(DESTDIR)$(ICONPREFIX)/$(THEME_DIR)/index.theme" - -uninstall: - rm -rf -- "$(DESTDIR)$(ICONPREFIX)/$(THEME_DIR)" - -clean: - +@$(MAKE) -f Makefile clean - .PHONY: all all-fast all-fast-icons install uninstall clean diff --git a/portable.mk b/portable.mk new file mode 100644 index 0000000..5f96410 --- /dev/null +++ b/portable.mk @@ -0,0 +1,81 @@ +all: index.theme $(ALL_PNG_ICONS) + +all-fast: index.theme all-fast-icons + +all-fast-icons: $(ICONS:=.x) + +$(ICONS:=.x): conv + @+test -z "$(DIR_SUFFIX)" || $(MAKE) scalable$(DIR_SUFFIX)/$(@:.x=.svg) + ./conv scalable$(DIR_SUFFIX)/$(@:.x=.svg) $(SIZES) + +index.theme: $(CONFIGFILE) portable.mk make-dir-info + set -e;\ + printf '%s\n' \ + '[Icon Theme]'\ + 'Name=$(THEME_NAME)'\ + 'Comment=$(THEME_DESC)'\ + 'Example=folder'\ + ''\ + '# KDE specific stuff'\ + 'DisplayDepth=32'\ + 'LinkOverlay=link_overlay'\ + 'LockOverlay=lock_overlay'\ + 'ZipOverlay=zip_overlay'\ + 'DesktopDefault=48'\ + 'DesktopSizes='$$(printf ',%s' $(SIZES) | sed 's/^,//')\ + 'ToolbarDefault=22'\ + 'ToolbarSizes=8,16,22,32,48'\ + 'MainToolbarDefault=22'\ + 'MainToolbarSizes=8,16,22,32,48'\ + 'SmallDefault=16'\ + 'SmallSizes=16'\ + 'PanelDefault=32'\ + 'PanelSizes='$$(printf ',%s' $(SIZES) | sed 's/^,//')\ + ''\ + > index.theme + printf 'Directories=' >> index.theme + set -e;\ + for s in $(SIZES); do\ + for d in $(DIRS); do\ + printf ',%sx%s/%s' $$s $$s $$d;\ + done;\ + done | sed 's/^,//' >> index.theme + set -e;\ + for d in $(DIRS); do\ + printf ',scalable/%s' $$d;\ + done >> index.theme + printf '\n' >> index.theme + set -e;\ + for s in $(SIZES) scalable; do\ + for d in $(DIRS); do\ + printf '\n';\ + ./make-dir-info $$s $$d;\ + done;\ + done >> index.theme + +conv: conv.c + $(CC) -o $@ $< $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) + +install: index.theme $(ALL_PNG_ICONS) + mkdir -p -- "$(DESTDIR)$(ICONPREFIX)" + set -e;\ + for d in $(DIRS); do\ + for s in $(SIZES); do\ + mkdir -p -- "$(DESTDIR)$(ICONPREFIX)/$(THEME_DIR)/$${s}x$${s}/$${d}";\ + done;\ + mkdir -p -- "$(DESTDIR)$(ICONPREFIX)/$(THEME_DIR)/scalable/$${d}";\ + done + set -e;\ + for i in $(ICONS); do\ + for s in $(SIZES); do\ + cp -P -- "$${s}x$${s}$(DIR_SUFFIX)/$${i}.png" "$(DESTDIR)$(ICONPREFIX)/$(THEME_DIR)/$${s}x$${s}/$${i}.png";\ + done;\ + cp -P -- "scalable$(DIR_SUFFIX)/$${i}.svg" "$(DESTDIR)$(ICONPREFIX)/$(THEME_DIR)/scalable/$${i}.svg";\ + done + cp -- index.theme "$(DESTDIR)$(ICONPREFIX)/$(THEME_DIR)/index.theme" + +uninstall: + -rm -rf -- "$(DESTDIR)$(ICONPREFIX)/$(THEME_DIR)" + +clean: + +@$(MAKE) -f Makefile clean diff --git a/scalable/actions/remmina-fit-window.svg b/scalable/actions/remmina-fit-window.svg index 68b6e24..6c87ad4 120000 --- a/scalable/actions/remmina-fit-window.svg +++ b/scalable/actions/remmina-fit-window.svg @@ -1 +1 @@ -zoom-fit-page.svg
\ No newline at end of file +gtk-zoom-fit.svg
\ No newline at end of file diff --git a/scalable/apps/gimmie.svg b/scalable/apps/gimmie.svg index 78f16af..ce31ade 120000 --- a/scalable/apps/gimmie.svg +++ b/scalable/apps/gimmie.svg @@ -1 +1 @@ -gnome-panel.svg
\ No newline at end of file +gnome-panel-launcher.svg
\ No newline at end of file diff --git a/scalable/apps/gnome-session-properties.svg b/scalable/apps/gnome-session-properties.svg index cada14f..1752c2f 120000 --- a/scalable/apps/gnome-session-properties.svg +++ b/scalable/apps/gnome-session-properties.svg @@ -1 +1 @@ -../categories/preferences-desktop-personal.svg
\ No newline at end of file +session-properties.svg
\ No newline at end of file diff --git a/scalable/apps/grip.svg b/scalable/apps/grip.svg index 65c3831..d2d6e29 120000 --- a/scalable/apps/grip.svg +++ b/scalable/apps/grip.svg @@ -1 +1 @@ -../actions/media-optical-burn.svg
\ No newline at end of file +brasero.svg
\ No newline at end of file diff --git a/scalable/apps/isomaster.svg b/scalable/apps/isomaster.svg index 65c3831..d2d6e29 120000 --- a/scalable/apps/isomaster.svg +++ b/scalable/apps/isomaster.svg @@ -1 +1 @@ -../actions/media-optical-burn.svg
\ No newline at end of file +brasero.svg
\ No newline at end of file diff --git a/scalable/apps/kalarm.svg b/scalable/apps/kalarm.svg index 47c2c55..bb8d8aa 120000 --- a/scalable/apps/kalarm.svg +++ b/scalable/apps/kalarm.svg @@ -1 +1 @@ -alarm-clock.svg
\ No newline at end of file +alarm.svg
\ No newline at end of file diff --git a/scalable/apps/session-properties.svg b/scalable/apps/session-properties.svg index 939fc2b..cada14f 120000 --- a/scalable/apps/session-properties.svg +++ b/scalable/apps/session-properties.svg @@ -1 +1 @@ -gnome-session-properties.svg
\ No newline at end of file +../categories/preferences-desktop-personal.svg
\ No newline at end of file diff --git a/scalable/apps/showfoto.svg b/scalable/apps/showfoto.svg index 0aef750..5e6ae56 120000 --- a/scalable/apps/showfoto.svg +++ b/scalable/apps/showfoto.svg @@ -1 +1 @@ -../devices/camera.svg
\ No newline at end of file +../devices/camera-photo.svg
\ No newline at end of file diff --git a/scalable/apps/start-here.svg b/scalable/apps/start-here.svg index eec3c3a..2de8995 120000 --- a/scalable/apps/start-here.svg +++ b/scalable/apps/start-here.svg @@ -1 +1 @@ -distributor-logo.svg
\ No newline at end of file +../places/start-here.svg
\ No newline at end of file diff --git a/scalable/apps/susers.svg b/scalable/apps/susers.svg index 2be78e5..12ff0ec 120000 --- a/scalable/apps/susers.svg +++ b/scalable/apps/susers.svg @@ -1 +1 @@ -./config-users.svg
\ No newline at end of file +system-users.svg
\ No newline at end of file diff --git a/scalable/apps/xfce4-mcs-manager.svg b/scalable/apps/xfce4-mcs-manager.svg index 5b45459..af49101 120000 --- a/scalable/apps/xfce4-mcs-manager.svg +++ b/scalable/apps/xfce4-mcs-manager.svg @@ -1 +1 @@ -../categories/preferences-desktop.svg
\ No newline at end of file +../categories/preferences-desktop-peripherals.svg
\ No newline at end of file diff --git a/scalable/categories/plugin-animationism.svg b/scalable/categories/plugin-animationism.svg index 125f913..0833484 120000 --- a/scalable/categories/plugin-animationism.svg +++ b/scalable/categories/plugin-animationism.svg @@ -1 +1 @@ -plugin-swapper.svg
\ No newline at end of file +plugin-switcher.svg
\ No newline at end of file diff --git a/scalable/mimetypes/application-x-font-bdf.svg b/scalable/mimetypes/application-x-font-bdf.svg index 5cf45d1..12862fd 120000 --- a/scalable/mimetypes/application-x-font-bdf.svg +++ b/scalable/mimetypes/application-x-font-bdf.svg @@ -1 +1 @@ -font-x-generic.svg
\ No newline at end of file +font-bitmap.svg
\ No newline at end of file diff --git a/scalable/mimetypes/application-x-font-pcf.svg b/scalable/mimetypes/application-x-font-pcf.svg index 5cf45d1..12862fd 120000 --- a/scalable/mimetypes/application-x-font-pcf.svg +++ b/scalable/mimetypes/application-x-font-pcf.svg @@ -1 +1 @@ -font-x-generic.svg
\ No newline at end of file +font-bitmap.svg
\ No newline at end of file diff --git a/scalable/mimetypes/application-x-font-snf.svg b/scalable/mimetypes/application-x-font-snf.svg index 5cf45d1..12862fd 120000 --- a/scalable/mimetypes/application-x-font-snf.svg +++ b/scalable/mimetypes/application-x-font-snf.svg @@ -1 +1 @@ -font-x-generic.svg
\ No newline at end of file +font-bitmap.svg
\ No newline at end of file diff --git a/scalable/mimetypes/application-x-font-ttf.svg b/scalable/mimetypes/application-x-font-ttf.svg index 5cf45d1..f2c89c4 120000 --- a/scalable/mimetypes/application-x-font-ttf.svg +++ b/scalable/mimetypes/application-x-font-ttf.svg @@ -1 +1 @@ -font-x-generic.svg
\ No newline at end of file +font-truetype.svg
\ No newline at end of file diff --git a/scalable/mimetypes/application-x-font-type.svg b/scalable/mimetypes/application-x-font-type.svg index 7e09b0c..6d6b67b 120000 --- a/scalable/mimetypes/application-x-font-type.svg +++ b/scalable/mimetypes/application-x-font-type.svg @@ -1 +1 @@ -application-x-font-type1.svg
\ No newline at end of file +font-type.svg
\ No newline at end of file diff --git a/scalable/mimetypes/application-x-font-type1.svg b/scalable/mimetypes/application-x-font-type1.svg index 5cf45d1..d2d9513 120000 --- a/scalable/mimetypes/application-x-font-type1.svg +++ b/scalable/mimetypes/application-x-font-type1.svg @@ -1 +1 @@ -font-x-generic.svg
\ No newline at end of file +font-type1.svg
\ No newline at end of file diff --git a/scalable/mimetypes/application-x-gnome-theme-package.svg b/scalable/mimetypes/application-x-gnome-theme-package.svg index 04f9de3..9b59dba 120000 --- a/scalable/mimetypes/application-x-gnome-theme-package.svg +++ b/scalable/mimetypes/application-x-gnome-theme-package.svg @@ -1 +1 @@ -./application-x-theme.svg
\ No newline at end of file +application-x-theme.svg
\ No newline at end of file diff --git a/scalable/mimetypes/font_truetype.svg b/scalable/mimetypes/font_truetype.svg index 5cf45d1..f2c89c4 120000 --- a/scalable/mimetypes/font_truetype.svg +++ b/scalable/mimetypes/font_truetype.svg @@ -1 +1 @@ -font-x-generic.svg
\ No newline at end of file +font-truetype.svg
\ No newline at end of file diff --git a/scalable/mimetypes/font_type.svg b/scalable/mimetypes/font_type.svg index 214568b..6d6b67b 120000 --- a/scalable/mimetypes/font_type.svg +++ b/scalable/mimetypes/font_type.svg @@ -1 +1 @@ -font_type1.svg
\ No newline at end of file +font-type.svg
\ No newline at end of file diff --git a/scalable/mimetypes/font_type1.svg b/scalable/mimetypes/font_type1.svg index 5cf45d1..d2d9513 120000 --- a/scalable/mimetypes/font_type1.svg +++ b/scalable/mimetypes/font_type1.svg @@ -1 +1 @@ -font-x-generic.svg
\ No newline at end of file +font-type1.svg
\ No newline at end of file diff --git a/scalable/mimetypes/gnome-mime-application-x-desktop.svg b/scalable/mimetypes/gnome-mime-application-x-desktop.svg index 04f9de3..9b59dba 120000 --- a/scalable/mimetypes/gnome-mime-application-x-desktop.svg +++ b/scalable/mimetypes/gnome-mime-application-x-desktop.svg @@ -1 +1 @@ -./application-x-theme.svg
\ No newline at end of file +application-x-theme.svg
\ No newline at end of file diff --git a/scalable/mimetypes/gnome-mime-application-x-font-afm.svg b/scalable/mimetypes/gnome-mime-application-x-font-afm.svg index 5cf45d1..96bdbae 120000 --- a/scalable/mimetypes/gnome-mime-application-x-font-afm.svg +++ b/scalable/mimetypes/gnome-mime-application-x-font-afm.svg @@ -1 +1 @@ -font-x-generic.svg
\ No newline at end of file +application-x-font-afm.svg
\ No newline at end of file diff --git a/scalable/mimetypes/gnome-mime-application-x-font-bdf.svg b/scalable/mimetypes/gnome-mime-application-x-font-bdf.svg index 12862fd..bc274bd 120000 --- a/scalable/mimetypes/gnome-mime-application-x-font-bdf.svg +++ b/scalable/mimetypes/gnome-mime-application-x-font-bdf.svg @@ -1 +1 @@ -font-bitmap.svg
\ No newline at end of file +application-x-font-bdf.svg
\ No newline at end of file diff --git a/scalable/mimetypes/gnome-mime-application-x-font-linux-psf.svg b/scalable/mimetypes/gnome-mime-application-x-font-linux-psf.svg index 5cf45d1..66693e2 120000 --- a/scalable/mimetypes/gnome-mime-application-x-font-linux-psf.svg +++ b/scalable/mimetypes/gnome-mime-application-x-font-linux-psf.svg @@ -1 +1 @@ -font-x-generic.svg
\ No newline at end of file +gnome-mime-application-x-font-psf.svg
\ No newline at end of file diff --git a/scalable/mimetypes/gnome-mime-application-x-font-pcf.svg b/scalable/mimetypes/gnome-mime-application-x-font-pcf.svg index 12862fd..4085265 120000 --- a/scalable/mimetypes/gnome-mime-application-x-font-pcf.svg +++ b/scalable/mimetypes/gnome-mime-application-x-font-pcf.svg @@ -1 +1 @@ -font-bitmap.svg
\ No newline at end of file +application-x-font-pcf.svg
\ No newline at end of file diff --git a/scalable/mimetypes/gnome-mime-application-x-font-ttf.svg b/scalable/mimetypes/gnome-mime-application-x-font-ttf.svg index 5cf45d1..cee8f73 120000 --- a/scalable/mimetypes/gnome-mime-application-x-font-ttf.svg +++ b/scalable/mimetypes/gnome-mime-application-x-font-ttf.svg @@ -1 +1 @@ -font-x-generic.svg
\ No newline at end of file +application-x-font-ttf.svg
\ No newline at end of file diff --git a/scalable/mimetypes/gnome-mime-application-x-gnome-app-info.svg b/scalable/mimetypes/gnome-mime-application-x-gnome-app-info.svg index 04f9de3..9b59dba 120000 --- a/scalable/mimetypes/gnome-mime-application-x-gnome-app-info.svg +++ b/scalable/mimetypes/gnome-mime-application-x-gnome-app-info.svg @@ -1 +1 @@ -./application-x-theme.svg
\ No newline at end of file +application-x-theme.svg
\ No newline at end of file diff --git a/scalable/mimetypes/gnome-mime-application-x-gnome-theme-package.svg b/scalable/mimetypes/gnome-mime-application-x-gnome-theme-package.svg index 04f9de3..9b59dba 120000 --- a/scalable/mimetypes/gnome-mime-application-x-gnome-theme-package.svg +++ b/scalable/mimetypes/gnome-mime-application-x-gnome-theme-package.svg @@ -1 +1 @@ -./application-x-theme.svg
\ No newline at end of file +application-x-theme.svg
\ No newline at end of file diff --git a/scalable/mimetypes/gnome-mime-application-x-theme.svg b/scalable/mimetypes/gnome-mime-application-x-theme.svg index 04f9de3..9b59dba 120000 --- a/scalable/mimetypes/gnome-mime-application-x-theme.svg +++ b/scalable/mimetypes/gnome-mime-application-x-theme.svg @@ -1 +1 @@ -./application-x-theme.svg
\ No newline at end of file +application-x-theme.svg
\ No newline at end of file diff --git a/scalable/mimetypes/gnome-mime-text-x-c++.svg b/scalable/mimetypes/gnome-mime-text-x-c++.svg index f011b4e..cac6576 120000 --- a/scalable/mimetypes/gnome-mime-text-x-c++.svg +++ b/scalable/mimetypes/gnome-mime-text-x-c++.svg @@ -1 +1 @@ -./text-x-c++.svg
\ No newline at end of file +text-x-c++.svg
\ No newline at end of file diff --git a/scalable/mimetypes/gnome-mime-text-x-c++src.svg b/scalable/mimetypes/gnome-mime-text-x-c++src.svg index f011b4e..9e22cda 120000 --- a/scalable/mimetypes/gnome-mime-text-x-c++src.svg +++ b/scalable/mimetypes/gnome-mime-text-x-c++src.svg @@ -1 +1 @@ -./text-x-c++.svg
\ No newline at end of file +text-x-c++src.svg
\ No newline at end of file diff --git a/scalable/mimetypes/gnome-mime-text-x-c.svg b/scalable/mimetypes/gnome-mime-text-x-c.svg index 9b2550b..728e410 120000 --- a/scalable/mimetypes/gnome-mime-text-x-c.svg +++ b/scalable/mimetypes/gnome-mime-text-x-c.svg @@ -1 +1 @@ -./text-x-c.svg
\ No newline at end of file +text-x-c.svg
\ No newline at end of file diff --git a/scalable/mimetypes/gnome-mime-text-x-csrc.svg b/scalable/mimetypes/gnome-mime-text-x-csrc.svg index 9b2550b..a50897f 120000 --- a/scalable/mimetypes/gnome-mime-text-x-csrc.svg +++ b/scalable/mimetypes/gnome-mime-text-x-csrc.svg @@ -1 +1 @@ -./text-x-c.svg
\ No newline at end of file +text-x-csrc.svg
\ No newline at end of file diff --git a/scalable/places/gnome-fs-trash-empty.svg b/scalable/places/gnome-fs-trash-empty.svg index a5a5bd8..9712870 120000 --- a/scalable/places/gnome-fs-trash-empty.svg +++ b/scalable/places/gnome-fs-trash-empty.svg @@ -1 +1 @@ -user-trash.svg
\ No newline at end of file +emptytrash.svg
\ No newline at end of file diff --git a/scalable/places/trashcan_empty.svg b/scalable/places/trashcan_empty.svg index a5a5bd8..9712870 120000 --- a/scalable/places/trashcan_empty.svg +++ b/scalable/places/trashcan_empty.svg @@ -1 +1 @@ -user-trash.svg
\ No newline at end of file +emptytrash.svg
\ No newline at end of file diff --git a/scalable/places/xfce-trash_empty.svg b/scalable/places/xfce-trash_empty.svg index a5a5bd8..9712870 120000 --- a/scalable/places/xfce-trash_empty.svg +++ b/scalable/places/xfce-trash_empty.svg @@ -1 +1 @@ -user-trash.svg
\ No newline at end of file +emptytrash.svg
\ No newline at end of file diff --git a/scalable/status/battery_charged.svg b/scalable/status/battery_charged.svg index d53d66a..e3c4e42 120000 --- a/scalable/status/battery_charged.svg +++ b/scalable/status/battery_charged.svg @@ -1 +1 @@ -battery-100-charging.svg
\ No newline at end of file +battery-charged.svg
\ No newline at end of file diff --git a/scalable/status/empathy-pending.svg b/scalable/status/empathy-pending.svg index 61df4d0..b0e1535 120000 --- a/scalable/status/empathy-pending.svg +++ b/scalable/status/empathy-pending.svg @@ -1 +1 @@ -../status/tray-connecting.svg
\ No newline at end of file +tray-connecting.svg
\ No newline at end of file diff --git a/scalable/status/notification-printer-error.svg b/scalable/status/notification-printer-error.svg index a3dc8cb..2e2774b 120000 --- a/scalable/status/notification-printer-error.svg +++ b/scalable/status/notification-printer-error.svg @@ -1 +1 @@ -../actions/gtk-print-error.svg
\ No newline at end of file +printer-error.svg
\ No newline at end of file diff --git a/unportable.mk b/unportable.mk new file mode 100644 index 0000000..5d26d20 --- /dev/null +++ b/unportable.mk @@ -0,0 +1,22 @@ +scalable-$(DIR_SUFFIX_)/%.svg: scalable/%.svg + @mkdir -p -- "$$(dirname -- "$@")" + set -e;\ + F=$$(printf '%s\n' "$@" | cut -d / -f 2-);\ + if ! test "$@" = "scalable/$$F"; then\ + if test -L "scalable/$$F"; then\ + ln -sf "$$(readlink -- "scalable/$$F")" "$@";\ + else\ + sed < "scalable/$$F" > "$@"\ + -e 's/#[bB][eE][bB][eE][bB][eE]/#$(BASE_COLOUR)/g'\ + -e 's/#[eE][fF]2929/#$(ALARM_RED)/g'\ + -e 's/#[fF]57900/#$(ALARM_ORANGE)/g'\ + -e 's/#[cC][dD]656[cC]/#$(RED)/g'\ + -e 's/#[dD]69553/#$(ORANGE)/g'\ + -e 's/#[cC][cC][aA][dD]47/#$(YELLOW)/g'\ + -e 's/#32[aA]679/#$(GREEN)/g'\ + -e 's/#00[aA]09[fF]/#$(CYAN)/g'\ + -e 's/#2495[bB][eE]/#$(BLUE)/g'\ + -e 's/#[aA]46[eE][bB]0/#$(MAGENTA)/g'\ + -e 's/#000000/#$(OUTLINE)/g';\ + fi;\ + fi |