Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Create symlinks when installing cursors |
| 2 | |
| 3 | This cuts down the installed size by ~11MB. |
| 4 | |
| 5 | Upstream-Status: Backport |
| 6 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> |
| 7 | |
| 8 | |
| 9 | From 1e8c0dd0a2de5e1d5ff60ff11f131e88510c7f50 Mon Sep 17 00:00:00 2001 |
| 10 | From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= |
| 11 | =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986@gmail.com> |
| 12 | Date: Sat, 16 May 2015 07:49:19 +0000 |
| 13 | Subject: [PATCH] Create symlinks when installing cursors |
| 14 | |
| 15 | Also support creating symlinks for W32 cursors (including L and XL variants). |
| 16 | |
| 17 | https://bugzilla.gnome.org/show_bug.cgi?id=749223 |
| 18 | --- |
| 19 | Makefile.am | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
| 20 | configure.ac | 24 ++++++++++++++++ |
| 21 | 2 files changed, 117 insertions(+) |
| 22 | |
| 23 | diff --git a/Makefile.am b/Makefile.am |
| 24 | index fed3972..4d00268 100644 |
| 25 | --- a/Makefile.am |
| 26 | +++ b/Makefile.am |
| 27 | @@ -6,6 +6,17 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} |
| 28 | |
| 29 | cursordir = $(datadir)/icons/Adwaita/cursors |
| 30 | cursor_DATA = $(wildcard $(srcdir)/Adwaita/cursors/*) |
| 31 | +if ENABLE_L_XL_VARIANTS |
| 32 | +cursorldir = $(datadir)/icons/Adwaita-Large/cursors |
| 33 | +cursorl_DATA = $(wildcard $(srcdir)/Adwaita-Large/cursors/*) |
| 34 | +cursorxldir = $(datadir)/icons/Adwaita-ExtraLarge/cursors |
| 35 | +cursorxl_DATA = $(wildcard $(srcdir)/Adwaita-ExtraLarge/cursors/*) |
| 36 | +else |
| 37 | +cursorldir = |
| 38 | +cursorl_DATA = |
| 39 | +cursorxldir = |
| 40 | +cursorxl_DATA = |
| 41 | +endif |
| 42 | |
| 43 | theme_in_files = index.theme.in.in |
| 44 | theme_DATA = $(theme_in_files:.theme.in.in=.theme) |
| 45 | @@ -99,6 +110,88 @@ install-data-local: |
| 46 | fi |
| 47 | |
| 48 | install-data-hook: |
| 49 | + cd $(DESTDIR)$(cursordir) && \ |
| 50 | + if test "x$(enable_w32_cursors)" = "xyes"; \ |
| 51 | + then \ |
| 52 | + cur=.cur && \ |
| 53 | + ani=.ani; \ |
| 54 | + else \ |
| 55 | + cur= && \ |
| 56 | + ani= ; \ |
| 57 | + fi; \ |
| 58 | + if test "x$(enable_l_xl_variants)" = "xyes"; \ |
| 59 | + then \ |
| 60 | + themedirs="$(cursordir) $(cursorldir) $(cursorxldir)"; \ |
| 61 | + else \ |
| 62 | + themedirs="$(cursordir)"; \ |
| 63 | + fi; \ |
| 64 | + for d in $$themedirs; \ |
| 65 | + do \ |
| 66 | + cd $(DESTDIR)$$d && \ |
| 67 | + echo Creating symlinks in $(DESTDIR)$$d && \ |
| 68 | + $(LN_S) -f dotbox$$cur draped_box$$cur && \ |
| 69 | + $(LN_S) -f dotbox$$cur icon$$cur && \ |
| 70 | + $(LN_S) -f dotbox$$cur target$$cur && \ |
| 71 | + $(LN_S) -f dotbox$$cur dot_box_mask$$cur && \ |
| 72 | + $(LN_S) -f X_cursor$$cur pirate$$cur && \ |
| 73 | + $(LN_S) -f left_ptr_watch$$ani 08e8e1c95fe2fc01f976f1e063a24ccd$$ani && \ |
| 74 | + $(LN_S) -f left_ptr_watch$$ani 3ecb610c1bf2410f44200f48c40d3599$$ani && \ |
| 75 | + $(LN_S) -f left_ptr$$cur arrow$$cur && \ |
| 76 | + $(LN_S) -f left_ptr$$cur top_left_arrow$$cur && \ |
| 77 | + $(LN_S) -f right_ptr$$cur draft_large$$cur && \ |
| 78 | + $(LN_S) -f right_ptr$$cur draft_small$$cur && \ |
| 79 | + $(LN_S) -f move$$cur 4498f0e0c1937ffe01fd06f973665830$$cur && \ |
| 80 | + $(LN_S) -f move$$cur 9081237383d90e509aa00f00170e968f$$cur && \ |
| 81 | + $(LN_S) -f copy$$cur 1081e37283d90000800003c07f3ef6bf$$cur && \ |
| 82 | + $(LN_S) -f copy$$cur 6407b0e94181790501fd1e167b474872$$cur && \ |
| 83 | + $(LN_S) -f cross$$cur cross_reverse$$cur && \ |
| 84 | + $(LN_S) -f cross$$cur diamond_cross$$cur && \ |
| 85 | + $(LN_S) -f hand1$$cur grab$$cur && \ |
| 86 | + $(LN_S) -f hand2$$cur 9d800788f1b08800ae810202380a0822$$cur && \ |
| 87 | + $(LN_S) -f hand2$$cur e29285e634086352946a0e7090d73106$$cur && \ |
| 88 | + $(LN_S) -f hand2$$cur hand$$cur && \ |
| 89 | + $(LN_S) -f grabbing$$cur fleur$$cur && \ |
| 90 | + $(LN_S) -f question_arrow$$cur d9ce0ab605698f320427677b458ad60b$$cur && \ |
| 91 | + $(LN_S) -f question_arrow$$cur 5c6cd98b3f3ebcb1f9c7f1c204630408$$cur && \ |
| 92 | + $(LN_S) -f question_arrow$$cur help$$cur && \ |
| 93 | + $(LN_S) -f question_arrow$$cur left_ptr_help$$cur && \ |
| 94 | + $(LN_S) -f link$$cur 3085a0e285430894940527032f8b26df$$cur && \ |
| 95 | + $(LN_S) -f link$$cur 640fb0e74195791501fd1ed57b41487f$$cur && \ |
| 96 | + $(LN_S) -f crossed_circle$$cur 03b6e0fcb3499374a867c041f52298f0$$cur && \ |
| 97 | + $(LN_S) -f fd_double_arrow$$cur fcf1c3c7cd4491d801f1e1c78f100000$$cur && \ |
| 98 | + $(LN_S) -f bd_double_arrow$$cur c7088f0f3e6c8088236ef8e1e3e70000$$cur && \ |
| 99 | + $(LN_S) -f sb_h_double_arrow$$cur h_double_arrow$$cur && \ |
| 100 | + $(LN_S) -f sb_h_double_arrow$$cur 14fef782d02440884392942c11205230$$cur && \ |
| 101 | + $(LN_S) -f h_double_arrow$$cur 028006030e0e7ebffc7f7070c0600140$$cur && \ |
| 102 | + $(LN_S) -f sb_v_double_arrow$$cur double_arrow$$cur && \ |
| 103 | + $(LN_S) -f sb_v_double_arrow$$cur v_double_arrow$$cur && \ |
| 104 | + $(LN_S) -f sb_v_double_arrow$$cur 2870a09082c103050810ffdffffe0204$$cur && \ |
| 105 | + $(LN_S) -f v_double_arrow$$cur 00008160000006810000408080010102$$cur && \ |
| 106 | + $(LN_S) -f left_ptr$$cur default$$cur && \ |
| 107 | + $(LN_S) -f hand$$cur pointer$$cur && \ |
| 108 | + $(LN_S) -f left_ptr_watch$$ani progress$$ani && \ |
| 109 | + $(LN_S) -f watch$$ani wait$$ani && \ |
| 110 | + $(LN_S) -f cross$$cur crosshair$$cur && \ |
| 111 | + $(LN_S) -f xterm$$cur text$$cur && \ |
| 112 | + $(LN_S) -f dnd-link$$cur alias$$cur && \ |
| 113 | + $(LN_S) -f dnd-copy$$cur copy$$cur && \ |
| 114 | + $(LN_S) -f dnd-none$$cur no-drop$$cur && \ |
| 115 | + $(LN_S) -f crossed_circle$$cur not-allowed$$cur && \ |
| 116 | + $(LN_S) -f sb_h_double_arrow$$cur col-resize$$cur && \ |
| 117 | + $(LN_S) -f sb_v_double_arrow$$cur row-resize$$cur && \ |
| 118 | + $(LN_S) -f top_side$$cur n-resize$$cur && \ |
| 119 | + $(LN_S) -f right_side$$cur e-resize$$cur && \ |
| 120 | + $(LN_S) -f bottom_side$$cur s-resize$$cur && \ |
| 121 | + $(LN_S) -f left_side$$cur w-resize$$cur && \ |
| 122 | + $(LN_S) -f top_right_corner$$cur ne-resize$$cur && \ |
| 123 | + $(LN_S) -f top_left_corner$$cur nw-resize$$cur && \ |
| 124 | + $(LN_S) -f bottom_right_corner$$cur se-resize$$cur && \ |
| 125 | + $(LN_S) -f bottom_left_corner$$cur sw-resize$$cur && \ |
| 126 | + $(LN_S) -f sb_h_double_arrow$$cur ew-resize$$cur && \ |
| 127 | + $(LN_S) -f sb_v_double_arrow$$cur ns-resize$$cur && \ |
| 128 | + $(LN_S) -f fd_double_arrow$$cur nesw-resize$$cur && \ |
| 129 | + $(LN_S) -f bd_double_arrow$$cur nwse-resize$$cur; \ |
| 130 | + done |
| 131 | if test -z "$(DESTDIR)" && test -n "$(GTK_UPDATE_ICON_CACHE)" ; then \ |
| 132 | $(GTK_UPDATE_ICON_CACHE) -q $(DESTDIR)$(themedir); \ |
| 133 | fi |
| 134 | diff --git a/configure.ac b/configure.ac |
| 135 | index 9e4d8a0..312b24c 100644 |
| 136 | --- a/configure.ac |
| 137 | +++ b/configure.ac |
| 138 | @@ -31,6 +31,7 @@ AC_SUBST([render_sizes], ["8x8 16x16 22x22 24x24 32x32 48x48 256x256"]) |
| 139 | AC_SUBST([symbolic_render_sizes], [""]) |
| 140 | AC_SUBST([install_sizes], ["8x8 16x16 22x22 24x24 32x32 48x48 64x64 96x96 256x256"]) |
| 141 | |
| 142 | +AC_PROG_LN_S |
| 143 | AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache) |
| 144 | |
| 145 | # need git, icontool, and inkscape for rendering |
| 146 | @@ -56,6 +57,29 @@ if test "x$GTK_ENCODE_SYMBOLIC_SVG" = "xfalse"; then |
| 147 | fi |
| 148 | AC_SUBST(symbolic_encode_sizes) |
| 149 | |
| 150 | +AC_ARG_ENABLE([w32-cursors], |
| 151 | + [AS_HELP_STRING([--enable-w32-cursors], |
| 152 | + [Make and install Windows cursors (.cur and .ani) instead of X cursors])], |
| 153 | + [case "${enableval}" in |
| 154 | + yes) enable_w32_cursors=yes ;; |
| 155 | + no) enable_w32_cursors=no ;; |
| 156 | + *) AC_MSG_ERROR([bad value ${enableval} for --enable-w32-cursors]) ;; |
| 157 | + esac], |
| 158 | + [enable_w32_cursors=no]) |
| 159 | +AC_SUBST(enable_w32_cursors) |
| 160 | + |
| 161 | +AC_ARG_ENABLE([l-xl-variants], |
| 162 | + [AS_HELP_STRING([--enable-l-xl-variants], |
| 163 | + [Also make and install Large and Extra Large Windows cursor versions])], |
| 164 | + [case "${enableval}" in |
| 165 | + yes) enable_l_xl_variants=yes ;; |
| 166 | + no) enable_l_xl_variants=no ;; |
| 167 | + *) AC_MSG_ERROR([bad value ${enableval} for --enable-l-xl-variants]) ;; |
| 168 | + esac], |
| 169 | + [enable_l_xl_variants=no]) |
| 170 | +AC_SUBST(enable_l_xl_variants) |
| 171 | +AM_CONDITIONAL([ENABLE_L_XL_VARIANTS], [test x$enable_l_xl_variants = xyes]) |
| 172 | + |
| 173 | AC_CONFIG_FILES([ |
| 174 | Makefile |
| 175 | adwaita-icon-theme.pc |
| 176 | -- |
| 177 | 2.1.4 |
| 178 | |