patch-Makefile 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. $OpenBSD: patch-Makefile,v 1.7 2014/09/04 11:56:52 ajacoutot Exp $
  2. --- Makefile.orig Tue Aug 19 09:28:33 2014
  3. +++ Makefile Thu Sep 4 13:43:47 2014
  4. @@ -37,7 +37,7 @@ STDC_LIB:=-lstdc++.r4
  5. endif
  6. else
  7. OS:=linux
  8. -GPERF:=/usr/bin/gperf
  9. +GPERF:=${LOCALBASE}/bin/gperf
  10. endif
  11. endif
  12. endif
  13. @@ -110,7 +110,7 @@ osx_PREFIX:=/usr/local
  14. beos_PREFIX=$(shell finddir B_APPS_DIRECTORY)/TuxPaint
  15. linux_PREFIX:=/usr/local
  16. -PREFIX:=$($(OS)_PREFIX)
  17. +PREFIX:=${TRUEPREFIX}
  18. # Root directory to place files when creating packages.
  19. # PKG_ROOT is the old name for this, and should be undefined.
  20. @@ -143,19 +143,15 @@ MAGIC_PREFIX:=$(DESTDIR)$(LIBDIR)/lib/tuxpaint/plugins
  21. # Docs and man page:
  22. DOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/doc/tuxpaint
  23. -DEVDOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/doc/tuxpaint-dev
  24. -MAN_PREFIX:=$(DESTDIR)$(PREFIX)/share/man
  25. -DEVMAN_PREFIX:=$(DESTDIR)$(PREFIX)/share/man
  26. +DEVDOC_PREFIX:=$(DESTDIR)$(PREFIX)/share/doc/tuxpaint/tuxpaint-dev
  27. +MAN_PREFIX:=$(DESTDIR)$(PREFIX)/man
  28. +DEVMAN_PREFIX:=$(DESTDIR)$(PREFIX)/man
  29. # BASH tab-completion file:
  30. COMPLETIONDIR:=$(DESTDIR)/etc/bash_completion.d
  31. # 'System-wide' Config file:
  32. -ifeq ($(PREFIX),/usr)
  33. - CONFDIR:=$(DESTDIR)/etc/tuxpaint
  34. -else
  35. - CONFDIR:=$(DESTDIR)$(PREFIX)/etc/tuxpaint
  36. -endif
  37. +CONFDIR=${SYSCONFDIR}/tuxpaint
  38. ifeq ($(SYSNAME),Haiku)
  39. CONFDIR:=$(shell finddir B_USER_SETTINGS_DIRECTORY)/TuxPaint
  40. @@ -164,9 +160,9 @@ endif
  41. # Icons and launchers:
  42. ICON_PREFIX:=$(DESTDIR)$(PREFIX)/share/pixmaps
  43. X11_ICON_PREFIX:=$(DESTDIR)$(PREFIX)/X11R6/include/X11/pixmaps
  44. -GNOME_PREFIX:=$(shell gnome-config --prefix 2> /dev/null)
  45. -KDE_PREFIX:=$(shell kde-config --install apps --expandvars 2> /dev/null)
  46. -KDE_ICON_PREFIX:=$(shell kde-config --install icon --expandvars 2> /dev/null)
  47. +#GNOME_PREFIX:=$(shell gnome-config --prefix 2> /dev/null)
  48. +#KDE_PREFIX:=$(shell kde-config --install apps --expandvars 2> /dev/null)
  49. +#KDE_ICON_PREFIX:=$(shell kde-config --install icon --expandvars 2> /dev/null)
  50. # Maemo flag
  51. MAEMOFLAG:=
  52. @@ -225,8 +221,9 @@ endif
  53. # The entire set of CFLAGS:
  54. #-ffast-math
  55. -OPTFLAGS:=-O2
  56. -CFLAGS:=$(CPPFLAGS) $(OPTFLAGS) -W -Wall -fno-common -ffloat-store \
  57. +#OPTFLAGS:=-O2
  58. +CFLAGS:=-I${LOCALBASE}/include \
  59. + $(CPPFLAGS) $(OPTFLAGS) -W -Wall -fno-common -ffloat-store \
  60. $(if $(filter windows,$(OS)),,$(call comptest,-fvisibility=hidden,)) \
  61. -Wcast-align -Wredundant-decls \
  62. -Wbad-function-cast -Wwrite-strings \
  63. @@ -259,20 +256,6 @@ MOUSE_CFLAGS:=-Isrc/$(MOUSEDIR) -D$(CURSOR_SHAPES)_CUR
  64. #
  65. .PHONY: all
  66. all: tuxpaint translations magic-plugins tp-magic-config
  67. -# thumb-starters
  68. - @echo
  69. - @echo "--------------------------------------------------------------"
  70. - @echo
  71. - @echo "Done compiling."
  72. - @echo
  73. - @echo "Now run 'make install' with any options you ran 'make' with."
  74. - @echo "to install Tux Paint."
  75. - @echo
  76. - @echo "You may need superuser ('root') privileges, depending on"
  77. - @echo "where you're installing."
  78. - @echo "(Depending on your system, you either need to 'su' first,"
  79. - @echo "or run 'sudo make install'.)"
  80. - @echo
  81. .PHONY: releaseclean
  82. releaseclean:
  83. @@ -451,23 +434,6 @@ install: install-bin install-data install-man install-
  84. install-bash-completion \
  85. install-osk \
  86. $(ARCH_INSTALL)
  87. -#install-thumb-starters
  88. - @echo
  89. - @echo "--------------------------------------------------------------"
  90. - @echo
  91. - @echo "All done! Now (preferably NOT as 'root' superuser),"
  92. - @echo "you can type the command 'tuxpaint' to run the program!!!"
  93. - @echo
  94. - @echo "For more information, see the 'tuxpaint' man page,"
  95. - @echo "run 'tuxpaint --usage' or see $(DOC_PREFIX)/README.txt"
  96. - @echo
  97. - @echo "Visit Tux Paint's home page for more information, updates"
  98. - @echo "and to learn how you can help out!"
  99. - @echo
  100. - @echo " http://www.tuxpaint.org/"
  101. - @echo
  102. - @echo "Enjoy!"
  103. - @echo
  104. .PHONY: install-magic-plugins
  105. install-magic-plugins:
  106. @@ -609,9 +575,8 @@ uninstall: uninstall-i18n
  107. install-default-config:
  108. @echo
  109. @echo "...Installing default config file..."
  110. - @install -d $(CONFDIR)
  111. - @cp src/tuxpaint.conf $(CONFDIR)
  112. - @chmod 644 $(CONFDIR)/tuxpaint.conf
  113. + ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(PREFIX)/share/examples/tuxpaint
  114. + ${BSD_INSTALL_DATA} src/tuxpaint.conf $(DESTDIR)$(PREFIX)/share/examples/tuxpaint
  115. # Install BASH completion file:
  116. .PHONY: install-bash-completion
  117. @@ -628,7 +593,7 @@ install-bash-completion:
  118. install-example-stamps:
  119. @echo
  120. @echo "...Installing example stamps..."
  121. - @install -d $(DATA_PREFIX)/stamps
  122. + ${BSD_INSTALL_DATA_DIR} $(DATA_PREFIX)/stamps
  123. @cp -R stamps/* $(DATA_PREFIX)/stamps
  124. @chmod -R a+rX,g-w,o-w $(DATA_PREFIX)/stamps
  125. @@ -675,7 +640,10 @@ $(THUMB_STARTERS):
  126. fi
  127. $(INSTALLED_THUMB_STARTERS): $(DATA_PREFIX)/%: %
  128. - @install -D -m 644 $< $@
  129. + @cd starters ; \
  130. + ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(PREFIX)/share/tuxpaint/starters ; \
  131. + for i in `ls *.*` ; do \
  132. + ${BSD_INSTALL_DATA} $$i $(DESTDIR)$(PREFIX)/share/tuxpaint/starters ; done
  133. .PHONY: echo-thumb-starters
  134. echo-thumb-starters:
  135. @@ -817,12 +785,9 @@ install-kde-icons:
  136. install-icon:
  137. @echo
  138. @echo "...Installing launcher icon graphics..."
  139. - @install -d $(ICON_PREFIX)
  140. - @cp data/images/icon.png $(ICON_PREFIX)/tuxpaint.png
  141. - @chmod 644 $(ICON_PREFIX)/tuxpaint.png
  142. - @install -d $(X11_ICON_PREFIX)
  143. - @cp data/images/icon32x32.xpm $(X11_ICON_PREFIX)/tuxpaint.xpm
  144. - @chmod 644 $(X11_ICON_PREFIX)/tuxpaint.xpm
  145. + ${BSD_INSTALL_DATA_DIR} $(ICON_PREFIX)
  146. + ${BSD_INSTALL_DATA} data/images/icon.png $(ICON_PREFIX)/tuxpaint.png
  147. + ${BSD_INSTALL_DATA} data/images/icon32x32.xpm $(ICON_PREFIX)/tuxpaint.xpm
  148. # Install the program:
  149. @@ -830,9 +795,8 @@ install-icon:
  150. install-bin:
  151. @echo
  152. @echo "...Installing program itself..."
  153. - @install -d $(BIN_PREFIX)
  154. - @cp tuxpaint$(EXE_EXT) $(BIN_PREFIX)
  155. - @chmod a+rx,g-w,o-w $(BIN_PREFIX)/tuxpaint$(EXE_EXT)
  156. + ${BSD_INSTALL_DATA_DIR} $(BIN_PREFIX)
  157. + ${BSD_INSTALL_PROGRAM} tuxpaint $(BIN_PREFIX)
  158. # Install the required Windows DLLs into the 'bdist' directory
  159. .PHONY: install-dlls
  160. @@ -909,8 +873,7 @@ install-haiku:
  161. install-importscript:
  162. @echo
  163. @echo "...Installing 'tuxpaint-import' script..."
  164. - @cp src/tuxpaint-import.sh $(BIN_PREFIX)/tuxpaint-import
  165. - @chmod a+rx,g-w,o-w $(BIN_PREFIX)/tuxpaint-import
  166. + ${BSD_INSTALL_SCRIPT} src/tuxpaint-import.sh $(BIN_PREFIX)/tuxpaint-import
  167. # Install the data (sound, graphics, fonts):
  168. @@ -918,12 +881,14 @@ install-importscript:
  169. install-data:
  170. @echo
  171. @echo "...Installing data files..."
  172. - @install -d $(DATA_PREFIX)
  173. + ${BSD_INSTALL_DATA_DIR} $(DATA_PREFIX)
  174. @cp -R data/* $(DATA_PREFIX)
  175. @chmod -R a+rX,g-w,o-w $(DATA_PREFIX)
  176. + ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(PREFIX)/share/applications
  177. + ${BSD_INSTALL_DATA} src/tuxpaint.desktop $(DESTDIR)$(PREFIX)/share/applications
  178. @echo
  179. @echo "...Installing fonts..."
  180. - @install -d $(DATA_PREFIX)/fonts/locale
  181. + ${BSD_INSTALL_DATA_DIR} $(DATA_PREFIX)/fonts/locale
  182. @cp -R fonts/locale/* $(DATA_PREFIX)/fonts/locale
  183. @chmod -R a+rX,g-w,o-w $(DATA_PREFIX)/fonts/locale
  184. @@ -943,7 +908,7 @@ install-osk:
  185. install-doc:
  186. @echo
  187. @echo "...Installing documentation..."
  188. - @install -d $(DOC_PREFIX)
  189. + ${BSD_INSTALL_DATA_DIR} $(DOC_PREFIX)
  190. @cp -R docs/* $(DOC_PREFIX)
  191. @cp -R magic/magic-docs $(DOC_PREFIX)
  192. @chmod -R a=rX,g=rX,u=rwX $(DOC_PREFIX)
  193. @@ -955,25 +920,13 @@ install-man:
  194. @echo
  195. @echo "...Installing man pages..."
  196. @# man1 directory...
  197. - @install -d $(MAN_PREFIX)/man1
  198. + ${BSD_INSTALL_MAN_DIR} $(MAN_PREFIX)/man1
  199. @# tuxpaint.1
  200. - @cp src/manpage/tuxpaint.1 $(MAN_PREFIX)/man1
  201. - @gzip -f $(MAN_PREFIX)/man1/tuxpaint.1
  202. - @chmod a+rx,g-w,o-w $(MAN_PREFIX)/man1/tuxpaint.1.gz
  203. - @# pl/man1 directory...
  204. - @install -d $(MAN_PREFIX)/pl/man1/
  205. - @# tuxpaint-pl.1
  206. - @cp src/manpage/tuxpaint-pl.1 $(MAN_PREFIX)/pl/man1/tuxpaint.1
  207. - @gzip -f $(MAN_PREFIX)/pl/man1/tuxpaint.1
  208. - @chmod a+rx,g-w,o-w $(MAN_PREFIX)/pl/man1/tuxpaint.1.gz
  209. + ${BSD_INSTALL_MAN} src/manpage/tuxpaint.1 $(MAN_PREFIX)/man1
  210. @# tuxpaint-import.1
  211. - @cp src/manpage/tuxpaint-import.1 $(MAN_PREFIX)/man1/
  212. - @gzip -f $(MAN_PREFIX)/man1/tuxpaint-import.1
  213. - @chmod a+rx,g-w,o-w $(MAN_PREFIX)/man1/tuxpaint-import.1.gz
  214. + ${BSD_INSTALL_MAN} src/manpage/tuxpaint-import.1 $(MAN_PREFIX)/man1
  215. @# tp-magic-config.1
  216. - @cp src/manpage/tp-magic-config.1 $(MAN_PREFIX)/man1/
  217. - @gzip -f $(MAN_PREFIX)/man1/tp-magic-config.1
  218. - @chmod a+rx,g-w,o-w $(MAN_PREFIX)/man1/tp-magic-config.1.gz
  219. + ${BSD_INSTALL_MAN} src/manpage/tp-magic-config.1 $(MAN_PREFIX)/man1
  220. @@ -987,7 +940,7 @@ tuxpaint: obj/tuxpaint.o obj/i18n.o obj/im.o obj/curso
  221. @echo "...Linking Tux Paint..."
  222. $(CC) $(CFLAGS) $(LDFLAGS) $(DEBUG_FLAGS) $(SDL_CFLAGS) $(FRIBIDI_CFLAGS) $(DEFS) \
  223. -o tuxpaint $^ \
  224. - $(SDL_LIBS) $(SVG_LIB) $(ARCH_LINKS)
  225. + $(SDL_LIBS) $(SVG_LIB) $(ARCH_LINKS) $(PAPER_LIB) -lpaper
  226. @$(RSRC_CMD)
  227. @$(MIMESET_CMD)
  228. @@ -1178,8 +1131,8 @@ linux_PLUGIN_LIBS:=
  229. PLUGIN_LIBS:=$($(OS)_PLUGIN_LIBS)
  230. #MAGIC_CFLAGS:=-g3 -O2 -fvisibility=hidden -fno-common -W -Wstrict-prototypes -Wmissing-prototypes -Wall $(MAGIC_SDL_CPPFLAGS) -Isrc/
  231. -MAGIC_CFLAGS:=-g3 -O2 -fno-common -W -Wstrict-prototypes -Wmissing-prototypes -Wall $(MAGIC_SDL_CPPFLAGS) -Isrc/
  232. -SHARED_FLAGS:=-shared -fpic -Wl,--warn-shared-textrel
  233. +MAGIC_CFLAGS:=-g3 -fno-common -W -Wstrict-prototypes -Wmissing-prototypes -Wall $(MAGIC_SDL_CPPFLAGS) -Isrc/ -I${LOCALBASE}/include
  234. +SHARED_FLAGS:=-shared -fpic
  235. MAGIC_C:=$(wildcard magic/src/*.c)
  236. MAGIC_SO:=$(patsubst magic/src/%.c,magic/%.$(SO_TYPE),$(MAGIC_C))