Merge lp:~smartboyhw/ubuntu/raring/blender/2.66a-3ubuntu1-merge into lp:ubuntu/raring/blender

Proposed by Howard Chan on 2013-03-12
Status: Merged
Merge reported by: Andrew Starr-Bochicchio
Merged at revision: not available
Proposed branch: lp:~smartboyhw/ubuntu/raring/blender/2.66a-3ubuntu1-merge
Merge into: lp:ubuntu/raring/blender
Diff against target: 1931795 lines (+1068359/-446984) 5214 files modified
To merge this branch: bzr merge lp:~smartboyhw/ubuntu/raring/blender/2.66a-3ubuntu1-merge
Reviewer Review Type Date Requested Status
Andrew Starr-Bochicchio (community) Disapprove on 2013-03-20
Ubuntu branches 2013-03-12 Pending
Review via email: mp+152894@code.launchpad.net

Description of the Change

powerpc builds failed for 2.66a-2ubuntu1 in raring-proposed. Micah Gersten contacted Debian and they made a patch immediately to fix the bugs. Since the debian build in https://buildd.debian.org/status/package.php?p=blender&suite=experimental for 2.66a-3 works now, the Ubuntu build should work too. Henceforth I merged it and proposed to get this in to Raring. Especially the Ubuntu Studio team wants it in for Beta 1.

To post a comment you must log in.

It looks like Jeremy Bicha beat you to this. The same version is in raring and it builds on PPC.

https://launchpad.net/ubuntu/+source/blender/2.66a-3ubuntu1

review: Disapprove

Preview Diff

[J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed directory '.pc/0001-blender_thumbnailer.patch'
2=== removed directory '.pc/0001-blender_thumbnailer.patch/release'
3=== removed directory '.pc/0001-blender_thumbnailer.patch/release/bin'
4=== removed file '.pc/0001-blender_thumbnailer.patch/release/bin/blender-thumbnailer.py'
5--- .pc/0001-blender_thumbnailer.patch/release/bin/blender-thumbnailer.py 2012-01-27 00:39:28 +0000
6+++ .pc/0001-blender_thumbnailer.patch/release/bin/blender-thumbnailer.py 1970-01-01 00:00:00 +0000
7@@ -1,155 +0,0 @@
8-#!/usr/bin/python
9-
10-# ##### BEGIN GPL LICENSE BLOCK #####
11-#
12-# This program is free software; you can redistribute it and/or
13-# modify it under the terms of the GNU General Public License
14-# as published by the Free Software Foundation; either version 2
15-# of the License, or (at your option) any later version.
16-#
17-# This program is distributed in the hope that it will be useful,
18-# but WITHOUT ANY WARRANTY; without even the implied warranty of
19-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20-# GNU General Public License for more details.
21-#
22-# You should have received a copy of the GNU General Public License
23-# along with this program; if not, write to the Free Software Foundation,
24-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25-#
26-# ##### END GPL LICENSE BLOCK #####
27-
28-# <pep8 compliant>
29-
30-"""
31-Thumbnailer runs with python 2.6 and 3.x.
32-To run automatically with nautilus:
33- gconftool --type boolean --set /desktop/gnome/thumbnailers/application@x-blender/enable true
34- gconftool --type string --set /desktop/gnome/thumbnailers/application@x-blender/command "blender-thumbnailer.py %u %o"
35-"""
36-
37-import struct
38-
39-
40-def open_wrapper_get():
41- """ wrap OS spesific read functionality here, fallback to 'open()'
42- """
43-
44- def open_gio(path, mode):
45- g_file = gio.File(path).read()
46- g_file.orig_seek = g_file.seek
47-
48- def new_seek(offset, whence=0):
49- return g_file.orig_seek(offset, [1, 0, 2][whence])
50-
51- g_file.seek = new_seek
52- return g_file
53-
54- try:
55- import gio
56- return open_gio
57- except ImportError:
58- return open
59-
60-
61-def blend_extract_thumb(path):
62- import os
63- open_wrapper = open_wrapper_get()
64-
65- # def MAKE_ID(tag): ord(tag[0])<<24 | ord(tag[1])<<16 | ord(tag[2])<<8 | ord(tag[3])
66- REND = 1145980242 # MAKE_ID(b'REND')
67- TEST = 1414743380 # MAKE_ID(b'TEST')
68-
69- blendfile = open_wrapper(path, 'rb')
70-
71- head = blendfile.read(12)
72-
73- if head[0:2] == b'\x1f\x8b': # gzip magic
74- import gzip
75- blendfile.close()
76- blendfile = gzip.GzipFile('', 'rb', 0, open_wrapper(path, 'rb'))
77- head = blendfile.read(12)
78-
79- if not head.startswith(b'BLENDER'):
80- blendfile.close()
81- return None, 0, 0
82-
83- is_64_bit = (head[7] == b'-'[0])
84-
85- # true for PPC, false for X86
86- is_big_endian = (head[8] == b'V'[0])
87-
88- # blender pre 2.5 had no thumbs
89- if head[9:11] <= b'24':
90- return None, 0, 0
91-
92- sizeof_bhead = 24 if is_64_bit else 20
93- int_endian_pair = '>ii' if is_big_endian else '<ii'
94-
95- while True:
96- bhead = blendfile.read(sizeof_bhead)
97-
98- if len(bhead) < sizeof_bhead:
99- return None, 0, 0
100-
101- code, length = struct.unpack(int_endian_pair, bhead[0:8]) # 8 == sizeof(int) * 2
102-
103- if code == REND:
104- blendfile.seek(length, os.SEEK_CUR)
105- else:
106- break
107-
108- if code != TEST:
109- return None, 0, 0
110-
111- try:
112- x, y = struct.unpack(int_endian_pair, blendfile.read(8)) # 8 == sizeof(int) * 2
113- except struct.error:
114- return None, 0, 0
115-
116- length -= 8 # sizeof(int) * 2
117-
118- if length != x * y * 4:
119- return None, 0, 0
120-
121- image_buffer = blendfile.read(length)
122-
123- if len(image_buffer) != length:
124- return None, 0, 0
125-
126- return image_buffer, x, y
127-
128-
129-def write_png(buf, width, height):
130- import zlib
131-
132- # reverse the vertical line order and add null bytes at the start
133- width_byte_4 = width * 4
134- raw_data = b"".join(b'\x00' + buf[span:span + width_byte_4] for span in range((height - 1) * width * 4, -1, - width_byte_4))
135-
136- def png_pack(png_tag, data):
137- chunk_head = png_tag + data
138- return struct.pack("!I", len(data)) + chunk_head + struct.pack("!I", 0xFFFFFFFF & zlib.crc32(chunk_head))
139-
140- return b"".join([
141- b'\x89PNG\r\n\x1a\n',
142- png_pack(b'IHDR', struct.pack("!2I5B", width, height, 8, 6, 0, 0, 0)),
143- png_pack(b'IDAT', zlib.compress(raw_data, 9)),
144- png_pack(b'IEND', b'')])
145-
146-
147-if __name__ == '__main__':
148- import sys
149-
150- if len(sys.argv) < 3:
151- print("Expected 2 arguments <input.blend> <output.png>")
152- else:
153- file_in = sys.argv[-2]
154-
155- buf, width, height = blend_extract_thumb(file_in)
156-
157- if buf:
158- file_out = sys.argv[-1]
159-
160- f = open(file_out, "wb")
161- f.write(write_png(buf, width, height))
162- f.close()
163
164=== removed directory '.pc/0001-blender_thumbnailer.patch/source'
165=== removed directory '.pc/0001-blender_thumbnailer.patch/source/creator'
166=== removed file '.pc/0001-blender_thumbnailer.patch/source/creator/CMakeLists.txt'
167--- .pc/0001-blender_thumbnailer.patch/source/creator/CMakeLists.txt 2012-04-28 12:11:12 +0000
168+++ .pc/0001-blender_thumbnailer.patch/source/creator/CMakeLists.txt 1970-01-01 00:00:00 +0000
169@@ -1,946 +0,0 @@
170-# -*- mode: cmake; indent-tabs-mode: t; -*-
171-# ***** BEGIN GPL LICENSE BLOCK *****
172-#
173-# This program is free software; you can redistribute it and/or
174-# modify it under the terms of the GNU General Public License
175-# as published by the Free Software Foundation; either version 2
176-# of the License, or (at your option) any later version.
177-#
178-# This program is distributed in the hope that it will be useful,
179-# but WITHOUT ANY WARRANTY; without even the implied warranty of
180-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
181-# GNU General Public License for more details.
182-#
183-# You should have received a copy of the GNU General Public License
184-# along with this program; if not, write to the Free Software Foundation,
185-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
186-#
187-# The Original Code is Copyright (C) 2006, Blender Foundation
188-# All rights reserved.
189-#
190-# The Original Code is: all of this file.
191-#
192-# Contributor(s): Jacques Beaurain.
193-#
194-# ***** END GPL LICENSE BLOCK *****
195-
196-setup_libdirs()
197-
198-blender_include_dirs(
199- ../../intern/guardedalloc
200- ../blender/blenlib
201- ../blender/blenkernel
202- ../blender/blenloader
203- ../blender/editors/include
204- ../blender/makesrna
205- ../blender/imbuf
206- ../blender/render/extern/include
207- ../blender/makesdna
208- ../blender/gpu
209- ../blender/windowmanager
210-)
211-
212-if(WIN32)
213- blender_include_dirs(../../intern/utfconv)
214-endif()
215-
216-if(WITH_LIBMV)
217- blender_include_dirs(../../extern/libmv)
218- add_definitions(-DWITH_LIBMV)
219-endif()
220-
221-if(WITH_CODEC_FFMPEG)
222- add_definitions(-DWITH_FFMPEG)
223-endif()
224-
225-if(WITH_PYTHON)
226- blender_include_dirs(../blender/python)
227- add_definitions(-DWITH_PYTHON)
228-
229- if(WITH_PYTHON_SECURITY)
230- add_definitions(-DWITH_PYTHON_SECURITY)
231- endif()
232-endif()
233-
234-if(WITH_HEADLESS)
235- add_definitions(-DWITH_HEADLESS)
236-endif()
237-
238-if(WITH_GAMEENGINE)
239- blender_include_dirs(../gameengine/BlenderRoutines)
240-
241- add_definitions(-DWITH_GAMEENGINE)
242-endif()
243-
244-if(WITH_SDL)
245- add_definitions(-DWITH_SDL)
246-endif()
247-
248-if(WITH_BINRELOC)
249- add_definitions(-DWITH_BINRELOC)
250- blender_include_dirs(${BINRELOC_INCLUDE_DIRS})
251-endif()
252-
253-# Setup the exe sources and buildinfo
254-set(SRC
255- creator.c
256-)
257-
258-# MSVC 2010 gives linking errors with the manifest
259-if(WIN32 AND NOT UNIX)
260- string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1)
261- string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2)
262- string(SUBSTRING ${BLENDER_VERSION} 3 1 bver3)
263- if(MINGW)
264- add_definitions(
265- -DWINDRES
266- -DBLEN_VER_RC_STR_M=${BLENDER_VERSION}
267- -DBLEN_VER_RC_1=${bver1}
268- -DBLEN_VER_RC_2=${bver2}
269- -DBLEN_VER_RC_3=${bver3}
270- -DBLEN_VER_RC_4=0
271- )
272- else()
273- add_definitions(
274- -DBLEN_VER_RC_STR=${BLENDER_VERSION}
275- -DBLEN_VER_RC_1=${bver1}
276- -DBLEN_VER_RC_2=${bver2}
277- -DBLEN_VER_RC_3=${bver3}
278- -DBLEN_VER_RC_4=0
279- )
280- endif()
281-
282-
283- list(APPEND SRC
284- ../icons/winblender.rc
285- )
286-endif()
287-
288-if(WITH_BUILDINFO)
289- add_definitions(-DWITH_BUILDINFO)
290- # --------------------------------------------------------------------------
291- # These defines could all be moved into the header below
292- string(REPLACE " " "\ " BUILDINFO_CFLAGS "${CMAKE_C_FLAGS}")
293- string(REPLACE " " "\ " BUILDINFO_CXXFLAGS "${CMAKE_CXX_FLAGS}")
294- string(REPLACE " " "\ " BUILDINFO_LINKFLAGS "${PLATFORM_LINKFLAGS}")
295- add_definitions(
296- # # define in header now, else these get out of date on rebuilds.
297- # -DBUILD_DATE="${BUILD_DATE}"
298- # -DBUILD_TIME="${BUILD_TIME}"
299- # -DBUILD_REV="${BUILD_REV}"
300- -DWITH_BUILDINFO_HEADER # alternative to lines above
301- -DBUILD_PLATFORM="${CMAKE_SYSTEM_NAME}"
302- -DBUILD_TYPE="${CMAKE_BUILD_TYPE}"
303- -DBUILD_CFLAGS="${BUILDINFO_CFLAGS}"
304- -DBUILD_CXXFLAGS="${BUILDINFO_CXXFLAGS}"
305- -DBUILD_LINKFLAGS="${BUILDINFO_LINKFLAGS}"
306- -DBUILD_SYSTEM="CMake"
307- )
308-
309- # --------------------------------------------------------------------------
310- # write header for values that change each build
311- # note, generaed file is in build dir's source/creator
312- # except when used as an include path.
313-
314- # include the output directory, where the buildinfo.h file is generated
315- include_directories(${CMAKE_BINARY_DIR}/source/creator)
316-
317- # a custom target that is always built
318- add_custom_target(buildinfo ALL
319- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/buildinfo.h)
320-
321- # creates svnheader.h using cmake script
322- add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/buildinfo.h
323- COMMAND ${CMAKE_COMMAND}
324- -DSOURCE_DIR=${CMAKE_SOURCE_DIR}
325- -P ${CMAKE_SOURCE_DIR}/build_files/cmake/buildinfo.cmake)
326-
327- # buildinfo.h is a generated file
328- set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/buildinfo.h
329- PROPERTIES GENERATED TRUE
330- HEADER_FILE_ONLY TRUE)
331-
332- # add deps below, after adding blender
333- # -------------- done with header values.
334-
335- list(APPEND SRC
336- buildinfo.c
337- )
338-endif()
339-
340-# message(STATUS "Configuring blender")
341-if(WITH_PYTHON_MODULE)
342- add_definitions(-DWITH_PYTHON_MODULE)
343-
344- # creates ./bin/bpy.so which can be imported as a python module.
345- #
346- # note that 'SHARED' works on Linux and Windows,
347- # but not OSX which _must_ be 'MODULE'
348- add_library(blender MODULE ${SRC})
349- set_target_properties(
350- blender
351- PROPERTIES
352- PREFIX ""
353- OUTPUT_NAME bpy
354- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
355- RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin # only needed on windows
356- )
357-
358- if(APPLE)
359- set_target_properties(
360- blender
361- PROPERTIES
362- LINK_FLAGS_RELEASE "${PLATFORM_LINKFLAGS}"
363- LINK_FLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG}"
364- )
365- endif()
366-
367- if(WIN32)
368- # python modules use this
369- set_target_properties(
370- blender
371- PROPERTIES
372- SUFFIX ".pyd"
373- )
374- endif()
375-
376-else()
377- add_executable(blender ${EXETYPE} ${SRC})
378-endif()
379-
380-if(WITH_BUILDINFO)
381- # explicitly say that the executable depends on the buildinfo
382- add_dependencies(blender buildinfo)
383-endif()
384-
385-# Post build steps for bundling/packaging.
386-
387-
388-if(MSVC_IDE)
389- # ${CMAKE_CFG_INTDIR} should replace \${BUILD_TYPE} when using add_command
390- set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE})
391-elseif(APPLE)
392- set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE})
393-else()
394- set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH})
395-endif()
396-
397-set(BLENDER_TEXT_FILES
398- ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt
399- ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt
400- ${CMAKE_SOURCE_DIR}/release/text/copyright.txt
401- ${CMAKE_SOURCE_DIR}/release/text/readme.html
402-)
403-
404-
405-# -----------------------------------------------------------------------------
406-# Platform Specific Var: TARGETDIR_VER
407-
408-if(UNIX AND NOT APPLE)
409- if(WITH_INSTALL_PORTABLE)
410- set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
411- else()
412- if(WITH_PYTHON_MODULE)
413- set(TARGETDIR_VER ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/${BLENDER_VERSION})
414- else()
415- set(TARGETDIR_VER ${CMAKE_INSTALL_PREFIX}/share/blender/${BLENDER_VERSION})
416- endif()
417- endif()
418-
419-elseif(WIN32)
420- set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
421-
422-elseif(APPLE)
423- if(WITH_PYTHON_MODULE)
424- set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
425- else()
426- set(TARGETDIR_VER ${TARGETDIR}/blender.app/Contents/MacOS/${BLENDER_VERSION})
427- endif()
428-
429-endif()
430-
431-
432-# -----------------------------------------------------------------------------
433-# Install Targets (Generic, All Platforms)
434-
435-
436-# important to make a clean install each time, else old scripts get loaded.
437-install(
438- CODE
439- "file(REMOVE_RECURSE ${TARGETDIR_VER})"
440-)
441-
442-if(WITH_PYTHON)
443- # install(CODE "message(\"copying blender scripts...\")")
444-
445- # exclude addons_contrib if release
446- if("${BLENDER_VERSION_CYCLE}" STREQUAL "release")
447- set(ADDON_EXCLUDE_CONDITIONAL "addons_contrib/*")
448- else()
449- set(ADDON_EXCLUDE_CONDITIONAL "_addons_contrib/*") # dummy, wont do anything
450- endif()
451-
452- install(
453- DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts
454- DESTINATION ${TARGETDIR_VER}
455- PATTERN ".svn" EXCLUDE
456- PATTERN "__pycache__" EXCLUDE
457- PATTERN "${ADDON_EXCLUDE_CONDITIONAL}" EXCLUDE
458- )
459-
460- unset(ADDON_EXCLUDE_CONDITIONAL)
461-endif()
462-
463-# localization
464-if(WITH_INTERNATIONAL)
465- install(
466- DIRECTORY
467- ${CMAKE_SOURCE_DIR}/release/datafiles/locale
468- ${CMAKE_SOURCE_DIR}/release/datafiles/fonts
469- DESTINATION ${TARGETDIR_VER}/datafiles
470- PATTERN ".svn" EXCLUDE
471- )
472-endif()
473-
474-# helpful tip when using make
475-if("${CMAKE_GENERATOR}" MATCHES ".*Makefiles.*")
476- # message after building.
477- add_custom_command(
478- TARGET blender POST_BUILD MAIN_DEPENDENCY blender
479- COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files and scripts to ${TARGETDIR_VER}'
480- )
481-endif()
482-
483-
484-# -----------------------------------------------------------------------------
485-# Install Targets (Platform Specific)
486-
487-if(UNIX AND NOT APPLE)
488-
489- # there are a few differences between portable and system install
490- if(WITH_INSTALL_PORTABLE)
491- install(
492- FILES
493- ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
494- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
495- ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1
496- DESTINATION ${TARGETDIR}
497- )
498-
499- install(
500- PROGRAMS
501- ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
502- DESTINATION ${TARGETDIR}
503- )
504-
505- install(
506- FILES ${BLENDER_TEXT_FILES}
507- DESTINATION ${TARGETDIR}
508- )
509-
510- else()
511- # main blender binary
512- if(WITH_PYTHON_MODULE)
513- install(
514- TARGETS blender
515- LIBRARY
516- DESTINATION ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages
517- )
518- else()
519- install(
520- PROGRAMS ${TARGETDIR}/blender
521- DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
522- )
523- endif()
524-
525-
526- if(WITH_GAMEENGINE AND WITH_PLAYER)
527- install(
528- PROGRAMS ${TARGETDIR}/blenderplayer
529- DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
530- )
531- endif()
532-
533- # misc files
534- install(
535- FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
536- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
537- )
538- install(
539- DIRECTORY
540- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/16x16
541- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/22x22
542- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/24x24
543- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/32x32
544- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/48x48
545- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/256x256
546- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
547- PATTERN ".svn" EXCLUDE
548- PATTERN "*.svg" EXCLUDE
549- )
550- install(
551- FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
552- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps
553- )
554- install(
555- PROGRAMS ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
556- DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
557- )
558- install(
559- FILES ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1
560- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
561- )
562- install(
563- FILES ${BLENDER_TEXT_FILES}
564- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender
565- )
566- endif()
567-
568- # plugins in blender 2.6 don't work at the moment.
569- #
570- # install(
571- # DIRECTORY ${CMAKE_SOURCE_DIR}/release/plugins
572- # DESTINATION ${TARGETDIR_VER}
573- # PATTERN ".svn" EXCLUDE
574- # )
575-
576- if(WITH_PYTHON)
577- if(WITH_PYTHON_INSTALL)
578- # on some platforms (like openSUSE) Python is linked
579- # to be used from lib64 folder.
580- # determine this from Python's libraries path
581- if(${PYTHON_LIBPATH} MATCHES "lib64$")
582- set(_target_LIB "lib64")
583- else()
584- set(_target_LIB "lib")
585- endif()
586-
587- # Copy the systems python into the install directory
588- # Scons copy in tools/Blender.py
589- # install(CODE "message(\"copying a subset of the systems python...\")")
590- install(
591- DIRECTORY ${PYTHON_LIBPATH}/python${PYTHON_VERSION}
592- DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}
593- PATTERN ".svn" EXCLUDE
594- PATTERN "__pycache__" EXCLUDE # * any cache *
595- PATTERN "distutils" EXCLUDE # ./distutils
596- PATTERN "lib2to3" EXCLUDE # ./lib2to3
597- PATTERN "config" EXCLUDE # ./config
598- PATTERN "config-*" EXCLUDE # ./config-*
599- PATTERN "site-packages/*" EXCLUDE # ./site-packages/*
600- PATTERN "tkinter" EXCLUDE # ./tkinter
601- PATTERN "lib-dynload/_tkinter.*" EXCLUDE # ./lib-dynload/_tkinter.co
602- PATTERN "idlelib" EXCLUDE # ./idlelib
603- PATTERN "test" EXCLUDE # ./test
604- PATTERN "turtledemo" EXCLUDE # ./turtledemo
605- PATTERN "turtle.py" EXCLUDE # ./turtle.py
606- )
607-
608- # # doesnt work, todo
609- # install(CODE "execute_process(COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/ -name '*.so' -exec strip -s {} '\;')")
610- unset(_target_LIB)
611- endif()
612- endif()
613-elseif(WIN32)
614-
615- install(
616- FILES ${BLENDER_TEXT_FILES}
617- DESTINATION ${TARGETDIR}
618- )
619-
620- if(WITH_INTERNATIONAL AND (NOT WITH_MINGW64))
621- install(
622- FILES ${LIBDIR}/gettext/lib/gnu_gettext.dll
623- DESTINATION ${TARGETDIR}
624- )
625-
626- if(NOT CMAKE_CL_64)
627- install(
628- FILES ${LIBDIR}/iconv/lib/iconv.dll
629- DESTINATION ${TARGETDIR}
630- )
631- endif()
632- endif()
633-
634- # plugins in blender 2.6 don't work at the moment.
635- #
636- # install(
637- # DIRECTORY ${CMAKE_SOURCE_DIR}/release/plugins
638- # DESTINATION ${TARGETDIR_VER}
639- # PATTERN ".svn" EXCLUDE
640- # )
641-
642- if(WITH_PYTHON)
643- set_lib_path(PYLIB "python/lib")
644- install(
645- FILES ${PYLIB}/python32.dll
646- DESTINATION ${TARGETDIR}
647- CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
648- )
649-
650- install(
651- FILES ${PYLIB}/python32_d.dll
652- DESTINATION ${TARGETDIR}
653- CONFIGURATIONS Debug
654- )
655-
656- if(WITH_PYTHON_INSTALL)
657- # note, as far as python is concerned 'RelWithDebInfo' is not debug since its without debug flags.
658-
659- # create the directory in multiple steps, so it actually gets created when it doesn't exist yet
660- install(
661- CODE
662- "
663- message(\"creating ${TARGETDIR_VER}/python/lib\")
664- file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python\")
665- file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python/lib\")
666- message(\"done creating dir\")
667- "
668- )
669-
670- install(
671- CODE
672- "
673- if(\"\${CMAKE_INSTALL_CONFIG_NAME}\" STREQUAL \"Debug\")
674- execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\"
675- \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32_d.tar.gz\")
676- else()
677- execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\"
678- \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32.tar.gz\")
679- endif()
680- "
681- )
682-
683- # doesnt work, todo
684- # install(CODE "execute_process(COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/ -name '*.so' -exec strip -s {} '\;')")
685- endif()
686- endif()
687-
688- if(CMAKE_CL_64)
689- # gettext and png are statically linked on win64
690- install(
691- FILES ${LIBDIR}/zlib/lib/zlib.dll
692- DESTINATION ${TARGETDIR}
693- )
694- else()
695- #not needed since we link statically, maybe also unneeded for MinGW?
696- if(NOT WITH_MINGW64)
697- install(
698- FILES
699- ${LIBDIR}/zlib/lib/zlib.dll
700- DESTINATION ${TARGETDIR}
701- )
702- endif()
703- endif()
704-
705- if(MSVC)
706- install(
707- FILES ${LIBDIR}/pthreads/lib/pthreadVC2.dll
708- DESTINATION ${TARGETDIR}
709- )
710- else()
711- #MinGW64 comes with own version. For portable builds it will probaly have to be copied to work
712- if(NOT WITH_MINGW64)
713- install(
714- FILES ${LIBDIR}/pthreads/lib/pthreadGC2.dll
715- DESTINATION ${TARGETDIR}
716- )
717- endif()
718- endif()
719-
720- if(WITH_CODEC_FFMPEG)
721- install(
722- FILES
723- ${LIBDIR}/ffmpeg/lib/avcodec-53.dll
724- ${LIBDIR}/ffmpeg/lib/avformat-53.dll
725- ${LIBDIR}/ffmpeg/lib/avdevice-53.dll
726- ${LIBDIR}/ffmpeg/lib/avutil-51.dll
727- ${LIBDIR}/ffmpeg/lib/swscale-2.dll
728- DESTINATION ${TARGETDIR}
729- )
730-
731- endif()
732-
733- if(WITH_CODEC_SNDFILE)
734- install(
735- FILES ${LIBDIR}/sndfile/lib/libsndfile-1.dll
736- DESTINATION ${TARGETDIR}
737- )
738- endif()
739-
740- if(WITH_OPENAL)
741- install(
742- FILES
743- ${LIBDIR}/openal/lib/OpenAL32.dll
744- ${LIBDIR}/openal/lib/wrap_oal.dll
745- DESTINATION ${TARGETDIR}
746- )
747- endif()
748-
749- if(WITH_SDL)
750- if(NOT CMAKE_CL_64)
751- install(
752- FILES ${LIBDIR}/sdl/lib/SDL.dll
753- DESTINATION ${TARGETDIR}
754- )
755- endif()
756- endif()
757-
758- if(NOT CMAKE_CL_64)
759- install(
760- FILES ${LIBDIR}/thumbhandler/lib/BlendThumb.dll
761- DESTINATION ${TARGETDIR}
762- )
763- endif()
764-
765- install( # x86 builds can run on x64 Windows, so this is required at all times
766- FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
767- DESTINATION ${TARGETDIR}
768- )
769-
770- if(WITH_OPENIMAGEIO)
771- if(NOT MINGW)
772- set_lib_path(OIIOBIN "openimageio/bin")
773- install(
774- FILES
775- ${OIIOBIN}/OpenImageIO.dll
776- DESTINATION ${TARGETDIR}
777- )
778- endif()
779- endif()
780-
781-elseif(APPLE)
782-
783- # handy install macro to exclude files, we use \$ escape for the "to"
784- # argument when calling so ${BUILD_TYPE} does not get expanded
785- macro(install_dir from to)
786- install(
787- DIRECTORY ${from}
788- DESTINATION ${to}
789- PATTERN ".svn" EXCLUDE
790- PATTERN "*.pyc" EXCLUDE
791- PATTERN "*.pyo" EXCLUDE
792- PATTERN "*.orig" EXCLUDE
793- PATTERN "*.rej" EXCLUDE
794- PATTERN "__pycache__" EXCLUDE
795- PATTERN "__MACOSX" EXCLUDE
796- PATTERN ".DS_Store" EXCLUDE
797- )
798- endmacro()
799-
800- set(OSX_APP_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app)
801-
802- # setup Info.plist
803- execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BLENDER_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
804-
805- set_target_properties(blender PROPERTIES
806- MACOSX_BUNDLE_INFO_PLIST ${OSX_APP_SOURCEDIR}/Contents/Info.plist
807- MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION}
808- MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION} ${BLENDER_DATE}")
809-
810-
811- # install release and app files
812- install(
813- FILES ${BLENDER_TEXT_FILES}
814- DESTINATION ${TARGETDIR}
815- )
816-
817- install(
818- FILES ${OSX_APP_SOURCEDIR}/Contents/PkgInfo
819- DESTINATION ${TARGETDIR}/blender.app/Contents
820- )
821-
822- install_dir(
823- ${OSX_APP_SOURCEDIR}/Contents/Resources
824- \${TARGETDIR}/blender.app/Contents/
825- )
826-
827- # python
828- if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE)
829- # the python zip is first extract as part of the build process,
830- # and then later installed as part of make install. this is much
831- # quicker, and means we can easily exclude files on copy
832- # Not needed for PYTHON_MODULE or WEB_PLUGIN due uses Pyhon framework
833- add_custom_target(
834- extractpyzip
835- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/python)
836-
837- set(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
838-
839- add_custom_command(
840- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
841- COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/python/
842- COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/python/
843- COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${CMAKE_CURRENT_BINARY_DIR}/python/
844- DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
845-
846- add_dependencies(blender extractpyzip)
847-
848- # copy extracted python files
849- install_dir(
850- ${CMAKE_CURRENT_BINARY_DIR}/python
851- \${TARGETDIR_VER}
852- )
853-
854- endif()
855-
856- # install blenderplayer bundle - copy of blender.app above. re-using macros et al
857- # note we are using OSX Bundle as base and copying Blender dummy bundle on top of it
858- if(WITH_GAMEENGINE AND WITH_PLAYER)
859- set(OSX_APP_PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app)
860- set(PLAYER_SOURCEINFO ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Info.plist)
861- set(PLAYER_TARGETDIR_VER ${TARGETDIR}/blenderplayer.app/Contents/MacOS/${BLENDER_VERSION})
862-
863-
864- # important to make a clean install each time else old scripts get loaded.
865- install(
866- CODE
867- "file(REMOVE_RECURSE ${PLAYER_TARGETDIR_VER})"
868- )
869-
870- install(
871- FILES ${OSX_APP_PLAYER_SOURCEDIR}/Contents/PkgInfo
872- DESTINATION ${TARGETDIR}/blenderplayer.app/Contents
873- )
874-
875- install_dir(
876- ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Resources
877- \${TARGETDIR}/blenderplayer.app/Contents/
878- )
879-
880- # python
881- if(WITH_PYTHON)
882- add_custom_command(
883- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
884- COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/python/
885- COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/python/
886- COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${CMAKE_CURRENT_BINARY_DIR}/python/
887- DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
888-
889- # copy extracted python files
890- install_dir(
891- ${CMAKE_CURRENT_BINARY_DIR}/python
892- \${PLAYER_TARGETDIR_VER}
893- )
894- endif()
895-
896- endif()
897-endif()
898-
899-# -----------------------------------------------------------------------------
900-# Generic Install, for all targets
901-
902-
903-
904-# install more files specified elsewhere
905-delayed_do_install(${TARGETDIR_VER})
906-
907-unset(BLENDER_TEXT_FILES)
908-
909-
910-# -----------------------------------------------------------------------------
911-# Setup link libs
912-
913-add_dependencies(blender makesdna)
914-
915-get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)
916-
917-set(BLENDER_LINK_LIBS
918- ${BLENDER_LINK_LIBS}
919- bf_windowmanager
920- bf_render
921-)
922-
923-if(WITH_MOD_FLUID)
924- list(APPEND BLENDER_LINK_LIBS bf_intern_elbeem)
925-endif()
926-
927-if(WITH_CYCLES)
928- list(APPEND BLENDER_LINK_LIBS
929- cycles_render
930- cycles_bvh
931- cycles_device
932- cycles_kernel
933- cycles_util
934- cycles_subd)
935-endif()
936-
937-#if(UNIX)
938- # Sort libraries
939- set(BLENDER_SORTED_LIBS
940- bf_windowmanager
941-
942- bf_editor_space_api
943- bf_editor_space_action
944- bf_editor_space_buttons
945- bf_editor_space_console
946- bf_editor_space_file
947- bf_editor_space_graph
948- bf_editor_space_image
949- bf_editor_space_info
950- bf_editor_space_logic
951- bf_editor_space_nla
952- bf_editor_space_node
953- bf_editor_space_outliner
954- bf_editor_space_script
955- bf_editor_space_sequencer
956- bf_editor_space_time
957- bf_editor_space_userpref
958- bf_editor_space_view3d
959- bf_editor_space_clip
960-
961- bf_editor_text
962- bf_editor_transform
963- bf_editor_util
964- bf_editor_uvedit
965- bf_editor_curve
966- bf_editor_armature
967- bf_editor_gpencil
968- bf_editor_interface
969- bf_editor_mesh
970- bf_editor_metaball
971- bf_editor_object
972- bf_editor_physics
973- bf_editor_render
974- bf_editor_screen
975- bf_editor_sculpt_paint
976- bf_editor_sound
977- bf_editor_animation
978- bf_editor_datafiles
979-
980- bf_render
981- bf_intern_opennl
982- bf_python
983- bf_python_ext
984- bf_python_mathutils
985- bf_python_bmesh
986- bf_ikplugin
987- bf_modifiers
988- bf_bmesh
989- bf_blenkernel
990- bf_nodes
991- bf_gpu
992- bf_blenloader
993- bf_imbuf
994- bf_blenlib
995- bf_intern_ghost
996- bf_intern_string
997- bf_blenpluginapi
998- bf_avi
999- bf_imbuf_cineon
1000- bf_imbuf_openexr
1001- bf_imbuf_dds
1002- bf_collada
1003- bf_intern_bsp
1004- bf_intern_bop
1005- bf_intern_decimate
1006- bf_intern_elbeem
1007- bf_intern_ik
1008- bf_intern_memutil
1009- bf_intern_guardedalloc
1010- bf_intern_ctr
1011- bf_intern_utfconv
1012- ge_blen_routines
1013- ge_converter
1014- ge_phys_dummy
1015- ge_phys_bullet
1016- bf_intern_smoke
1017- extern_minilzo
1018- extern_lzma
1019- extern_colamd
1020- ge_logic_ketsji
1021- extern_recastnavigation
1022- ge_phys_common
1023- ge_logic
1024- ge_rasterizer
1025- ge_oglrasterizer
1026- ge_logic_expressions
1027- ge_scenegraph
1028- ge_logic_network
1029- ge_logic_ngnetwork
1030- extern_bullet
1031- ge_logic_loopbacknetwork
1032- bf_intern_moto
1033- extern_openjpeg
1034- extern_redcode
1035- ge_videotex
1036- bf_rna
1037- bf_dna
1038- bf_blenfont
1039- bf_intern_audaspace
1040- bf_intern_mikktspace
1041- bf_intern_dualcon
1042- bf_intern_cycles
1043- cycles_render
1044- cycles_bvh
1045- cycles_device
1046- cycles_kernel
1047- cycles_util
1048- cycles_subd
1049- )
1050-
1051- if(WITH_LIBMV)
1052- list(APPEND BLENDER_SORTED_LIBS extern_libmv)
1053- endif()
1054-
1055- if(WITH_MOD_CLOTH_ELTOPO)
1056- list(APPEND BLENDER_SORTED_LIBS extern_eltopo)
1057- endif()
1058-
1059- if(WITH_BUILTIN_GLEW)
1060- list(APPEND BLENDER_SORTED_LIBS extern_glew)
1061- endif()
1062-
1063- if(WITH_BINRELOC)
1064- list(APPEND BLENDER_SORTED_LIBS extern_binreloc)
1065- endif()
1066-
1067- if(WITH_CXX_GUARDEDALLOC)
1068- list(APPEND BLENDER_SORTED_LIBS bf_intern_guardedalloc_cpp)
1069- endif()
1070-
1071- if(WITH_IK_ITASC)
1072- list(APPEND BLENDER_SORTED_LIBS bf_intern_itasc)
1073- endif()
1074-
1075- if(WITH_CODEC_QUICKTIME)
1076- list(APPEND BLENDER_SORTED_LIBS bf_quicktime)
1077- endif()
1078-
1079- if(WITH_CARVE)
1080- list(APPEND BLENDER_SORTED_LIBS extern_carve)
1081- endif()
1082-
1083- if(WITH_GHOST_XDND)
1084- list(APPEND BLENDER_SORTED_LIBS extern_xdnd)
1085- endif()
1086-
1087- foreach(SORTLIB ${BLENDER_SORTED_LIBS})
1088- set(REMLIB ${SORTLIB})
1089- foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
1090- if(${SEARCHLIB} STREQUAL ${SORTLIB})
1091- set(REMLIB "")
1092- endif()
1093- endforeach()
1094- if(REMLIB)
1095- # message(STATUS "Removing library ${REMLIB} from blender linking because: not configured")
1096- list(APPEND REM_MSG ${REMLIB})
1097- list(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
1098- endif()
1099- endforeach()
1100- if(REM_MSG)
1101- list(SORT REM_MSG)
1102- message(STATUS "Blender Skipping: (${REM_MSG})")
1103- endif()
1104- target_link_libraries(blender ${BLENDER_SORTED_LIBS})
1105-
1106- unset(SEARCHLIB)
1107- unset(SORTLIB)
1108- unset(REMLIB)
1109- unset(REM_MSG)
1110-
1111-#else()
1112-# target_link_libraries(blender ${BLENDER_LINK_LIBS})
1113-#endif()
1114-
1115-setup_liblinks(blender)
1116
1117=== removed directory '.pc/0002-disable_tests.patch'
1118=== removed directory '.pc/0002-disable_tests.patch/source'
1119=== removed file '.pc/0002-disable_tests.patch/source/CMakeLists.txt'
1120--- .pc/0002-disable_tests.patch/source/CMakeLists.txt 2012-03-12 19:04:53 +0000
1121+++ .pc/0002-disable_tests.patch/source/CMakeLists.txt 1970-01-01 00:00:00 +0000
1122@@ -1,36 +0,0 @@
1123-# ***** BEGIN GPL LICENSE BLOCK *****
1124-#
1125-# This program is free software; you can redistribute it and/or
1126-# modify it under the terms of the GNU General Public License
1127-# as published by the Free Software Foundation; either version 2
1128-# of the License, or (at your option) any later version.
1129-#
1130-# This program is distributed in the hope that it will be useful,
1131-# but WITHOUT ANY WARRANTY; without even the implied warranty of
1132-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1133-# GNU General Public License for more details.
1134-#
1135-# You should have received a copy of the GNU General Public License
1136-# along with this program; if not, write to the Free Software Foundation,
1137-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1138-#
1139-# The Original Code is Copyright (C) 2006, Blender Foundation
1140-# All rights reserved.
1141-#
1142-# The Original Code is: all of this file.
1143-#
1144-# Contributor(s): Jacques Beaurain.
1145-#
1146-# ***** END GPL LICENSE BLOCK *****
1147-
1148-add_subdirectory(blender)
1149-
1150-if(WITH_GAMEENGINE)
1151- add_subdirectory(gameengine)
1152-endif()
1153-
1154-if(WINDOWS)
1155- add_subdirectory(icons)
1156-endif()
1157-
1158-add_subdirectory(tests)
1159
1160=== removed directory '.pc/0003-install_in_usr_lib.patch'
1161=== removed directory '.pc/0003-install_in_usr_lib.patch/intern'
1162=== removed directory '.pc/0003-install_in_usr_lib.patch/intern/ghost'
1163=== removed directory '.pc/0003-install_in_usr_lib.patch/intern/ghost/intern'
1164=== removed file '.pc/0003-install_in_usr_lib.patch/intern/ghost/intern/GHOST_SystemPathsX11.cpp'
1165--- .pc/0003-install_in_usr_lib.patch/intern/ghost/intern/GHOST_SystemPathsX11.cpp 2012-04-28 12:11:12 +0000
1166+++ .pc/0003-install_in_usr_lib.patch/intern/ghost/intern/GHOST_SystemPathsX11.cpp 1970-01-01 00:00:00 +0000
1167@@ -1,103 +0,0 @@
1168-/*
1169- * ***** BEGIN GPL LICENSE BLOCK *****
1170- *
1171- * This program is free software; you can redistribute it and/or
1172- * modify it under the terms of the GNU General Public License
1173- * as published by the Free Software Foundation; either version 2
1174- * of the License, or (at your option) any later version.
1175- *
1176- * This program is distributed in the hope that it will be useful,
1177- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1178- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1179- * GNU General Public License for more details.
1180- *
1181- * You should have received a copy of the GNU General Public License
1182- * along with this program; if not, write to the Free Software Foundation,
1183- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1184- *
1185- * The Original Code is Copyright (C) 2010 Blender Foundation.
1186- * All rights reserved.
1187- *
1188- *
1189- * Contributor(s): Blender Foundation
1190- *
1191- * ***** END GPL LICENSE BLOCK *****
1192- */
1193-
1194-/** \file ghost/intern/GHOST_SystemPathsX11.cpp
1195- * \ingroup GHOST
1196- */
1197-
1198-
1199-#include "GHOST_SystemPathsX11.h"
1200-
1201-#include "GHOST_Debug.h"
1202-
1203-// For timing
1204-
1205-#include <sys/time.h>
1206-#include <unistd.h>
1207-
1208-#include <stdio.h> // for fprintf only
1209-#include <cstdlib> // for exit
1210-
1211-#ifdef WITH_XDG_USER_DIRS
1212-# include <pwd.h> // for get home without use getenv()
1213-# include <limits.h> // for PATH_MAX
1214-#endif
1215-
1216-#ifdef PREFIX
1217-static const char *static_path= PREFIX "/share";
1218-#else
1219-static const char *static_path= NULL;
1220-#endif
1221-
1222-GHOST_SystemPathsX11::GHOST_SystemPathsX11()
1223-{
1224-}
1225-
1226-GHOST_SystemPathsX11::~GHOST_SystemPathsX11()
1227-{
1228-}
1229-
1230-const GHOST_TUns8* GHOST_SystemPathsX11::getSystemDir() const
1231-{
1232- /* no prefix assumes a portable build which only uses bundled scripts */
1233- return (const GHOST_TUns8 *)static_path;
1234-}
1235-
1236-const GHOST_TUns8* GHOST_SystemPathsX11::getUserDir() const
1237-{
1238-#ifndef WITH_XDG_USER_DIRS
1239- return (const GHOST_TUns8 *)getenv("HOME");
1240-#else /* WITH_XDG_USER_DIRS */
1241- const char *home= getenv("XDG_CONFIG_HOME");
1242-
1243- if (home) {
1244- return (const GHOST_TUns8 *)home;
1245- }
1246- else {
1247- static char user_path[PATH_MAX];
1248-
1249- home= getenv("HOME");
1250-
1251- if (home == NULL) {
1252- home= getpwuid(getuid())->pw_dir;
1253- }
1254-
1255- snprintf(user_path, sizeof(user_path), "%s/.config", home);
1256- return (const GHOST_TUns8 *)user_path;
1257- }
1258-#endif /* WITH_XDG_USER_DIRS */
1259-}
1260-
1261-const GHOST_TUns8* GHOST_SystemPathsX11::getBinaryDir() const
1262-{
1263- return NULL;
1264-}
1265-
1266-void GHOST_SystemPathsX11::addToSystemRecentFiles(const char* filename) const
1267-{
1268- /* XXXXX TODO: Implementation for X11 if possible */
1269-
1270-}
1271
1272=== removed directory '.pc/0003-install_in_usr_lib.patch/source'
1273=== removed directory '.pc/0003-install_in_usr_lib.patch/source/creator'
1274=== removed file '.pc/0003-install_in_usr_lib.patch/source/creator/CMakeLists.txt'
1275--- .pc/0003-install_in_usr_lib.patch/source/creator/CMakeLists.txt 2012-04-28 12:11:12 +0000
1276+++ .pc/0003-install_in_usr_lib.patch/source/creator/CMakeLists.txt 1970-01-01 00:00:00 +0000
1277@@ -1,946 +0,0 @@
1278-# -*- mode: cmake; indent-tabs-mode: t; -*-
1279-# ***** BEGIN GPL LICENSE BLOCK *****
1280-#
1281-# This program is free software; you can redistribute it and/or
1282-# modify it under the terms of the GNU General Public License
1283-# as published by the Free Software Foundation; either version 2
1284-# of the License, or (at your option) any later version.
1285-#
1286-# This program is distributed in the hope that it will be useful,
1287-# but WITHOUT ANY WARRANTY; without even the implied warranty of
1288-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1289-# GNU General Public License for more details.
1290-#
1291-# You should have received a copy of the GNU General Public License
1292-# along with this program; if not, write to the Free Software Foundation,
1293-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
1294-#
1295-# The Original Code is Copyright (C) 2006, Blender Foundation
1296-# All rights reserved.
1297-#
1298-# The Original Code is: all of this file.
1299-#
1300-# Contributor(s): Jacques Beaurain.
1301-#
1302-# ***** END GPL LICENSE BLOCK *****
1303-
1304-setup_libdirs()
1305-
1306-blender_include_dirs(
1307- ../../intern/guardedalloc
1308- ../blender/blenlib
1309- ../blender/blenkernel
1310- ../blender/blenloader
1311- ../blender/editors/include
1312- ../blender/makesrna
1313- ../blender/imbuf
1314- ../blender/render/extern/include
1315- ../blender/makesdna
1316- ../blender/gpu
1317- ../blender/windowmanager
1318-)
1319-
1320-if(WIN32)
1321- blender_include_dirs(../../intern/utfconv)
1322-endif()
1323-
1324-if(WITH_LIBMV)
1325- blender_include_dirs(../../extern/libmv)
1326- add_definitions(-DWITH_LIBMV)
1327-endif()
1328-
1329-if(WITH_CODEC_FFMPEG)
1330- add_definitions(-DWITH_FFMPEG)
1331-endif()
1332-
1333-if(WITH_PYTHON)
1334- blender_include_dirs(../blender/python)
1335- add_definitions(-DWITH_PYTHON)
1336-
1337- if(WITH_PYTHON_SECURITY)
1338- add_definitions(-DWITH_PYTHON_SECURITY)
1339- endif()
1340-endif()
1341-
1342-if(WITH_HEADLESS)
1343- add_definitions(-DWITH_HEADLESS)
1344-endif()
1345-
1346-if(WITH_GAMEENGINE)
1347- blender_include_dirs(../gameengine/BlenderRoutines)
1348-
1349- add_definitions(-DWITH_GAMEENGINE)
1350-endif()
1351-
1352-if(WITH_SDL)
1353- add_definitions(-DWITH_SDL)
1354-endif()
1355-
1356-if(WITH_BINRELOC)
1357- add_definitions(-DWITH_BINRELOC)
1358- blender_include_dirs(${BINRELOC_INCLUDE_DIRS})
1359-endif()
1360-
1361-# Setup the exe sources and buildinfo
1362-set(SRC
1363- creator.c
1364-)
1365-
1366-# MSVC 2010 gives linking errors with the manifest
1367-if(WIN32 AND NOT UNIX)
1368- string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1)
1369- string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2)
1370- string(SUBSTRING ${BLENDER_VERSION} 3 1 bver3)
1371- if(MINGW)
1372- add_definitions(
1373- -DWINDRES
1374- -DBLEN_VER_RC_STR_M=${BLENDER_VERSION}
1375- -DBLEN_VER_RC_1=${bver1}
1376- -DBLEN_VER_RC_2=${bver2}
1377- -DBLEN_VER_RC_3=${bver3}
1378- -DBLEN_VER_RC_4=0
1379- )
1380- else()
1381- add_definitions(
1382- -DBLEN_VER_RC_STR=${BLENDER_VERSION}
1383- -DBLEN_VER_RC_1=${bver1}
1384- -DBLEN_VER_RC_2=${bver2}
1385- -DBLEN_VER_RC_3=${bver3}
1386- -DBLEN_VER_RC_4=0
1387- )
1388- endif()
1389-
1390-
1391- list(APPEND SRC
1392- ../icons/winblender.rc
1393- )
1394-endif()
1395-
1396-if(WITH_BUILDINFO)
1397- add_definitions(-DWITH_BUILDINFO)
1398- # --------------------------------------------------------------------------
1399- # These defines could all be moved into the header below
1400- string(REPLACE " " "\ " BUILDINFO_CFLAGS "${CMAKE_C_FLAGS}")
1401- string(REPLACE " " "\ " BUILDINFO_CXXFLAGS "${CMAKE_CXX_FLAGS}")
1402- string(REPLACE " " "\ " BUILDINFO_LINKFLAGS "${PLATFORM_LINKFLAGS}")
1403- add_definitions(
1404- # # define in header now, else these get out of date on rebuilds.
1405- # -DBUILD_DATE="${BUILD_DATE}"
1406- # -DBUILD_TIME="${BUILD_TIME}"
1407- # -DBUILD_REV="${BUILD_REV}"
1408- -DWITH_BUILDINFO_HEADER # alternative to lines above
1409- -DBUILD_PLATFORM="${CMAKE_SYSTEM_NAME}"
1410- -DBUILD_TYPE="${CMAKE_BUILD_TYPE}"
1411- -DBUILD_CFLAGS="${BUILDINFO_CFLAGS}"
1412- -DBUILD_CXXFLAGS="${BUILDINFO_CXXFLAGS}"
1413- -DBUILD_LINKFLAGS="${BUILDINFO_LINKFLAGS}"
1414- -DBUILD_SYSTEM="CMake"
1415- )
1416-
1417- # --------------------------------------------------------------------------
1418- # write header for values that change each build
1419- # note, generaed file is in build dir's source/creator
1420- # except when used as an include path.
1421-
1422- # include the output directory, where the buildinfo.h file is generated
1423- include_directories(${CMAKE_BINARY_DIR}/source/creator)
1424-
1425- # a custom target that is always built
1426- add_custom_target(buildinfo ALL
1427- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/buildinfo.h)
1428-
1429- # creates svnheader.h using cmake script
1430- add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/buildinfo.h
1431- COMMAND ${CMAKE_COMMAND}
1432- -DSOURCE_DIR=${CMAKE_SOURCE_DIR}
1433- -P ${CMAKE_SOURCE_DIR}/build_files/cmake/buildinfo.cmake)
1434-
1435- # buildinfo.h is a generated file
1436- set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/buildinfo.h
1437- PROPERTIES GENERATED TRUE
1438- HEADER_FILE_ONLY TRUE)
1439-
1440- # add deps below, after adding blender
1441- # -------------- done with header values.
1442-
1443- list(APPEND SRC
1444- buildinfo.c
1445- )
1446-endif()
1447-
1448-# message(STATUS "Configuring blender")
1449-if(WITH_PYTHON_MODULE)
1450- add_definitions(-DWITH_PYTHON_MODULE)
1451-
1452- # creates ./bin/bpy.so which can be imported as a python module.
1453- #
1454- # note that 'SHARED' works on Linux and Windows,
1455- # but not OSX which _must_ be 'MODULE'
1456- add_library(blender MODULE ${SRC})
1457- set_target_properties(
1458- blender
1459- PROPERTIES
1460- PREFIX ""
1461- OUTPUT_NAME bpy
1462- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
1463- RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin # only needed on windows
1464- )
1465-
1466- if(APPLE)
1467- set_target_properties(
1468- blender
1469- PROPERTIES
1470- LINK_FLAGS_RELEASE "${PLATFORM_LINKFLAGS}"
1471- LINK_FLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG}"
1472- )
1473- endif()
1474-
1475- if(WIN32)
1476- # python modules use this
1477- set_target_properties(
1478- blender
1479- PROPERTIES
1480- SUFFIX ".pyd"
1481- )
1482- endif()
1483-
1484-else()
1485- add_executable(blender ${EXETYPE} ${SRC})
1486-endif()
1487-
1488-if(WITH_BUILDINFO)
1489- # explicitly say that the executable depends on the buildinfo
1490- add_dependencies(blender buildinfo)
1491-endif()
1492-
1493-# Post build steps for bundling/packaging.
1494-
1495-
1496-if(MSVC_IDE)
1497- # ${CMAKE_CFG_INTDIR} should replace \${BUILD_TYPE} when using add_command
1498- set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE})
1499-elseif(APPLE)
1500- set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE})
1501-else()
1502- set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH})
1503-endif()
1504-
1505-set(BLENDER_TEXT_FILES
1506- ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt
1507- ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt
1508- ${CMAKE_SOURCE_DIR}/release/text/copyright.txt
1509- ${CMAKE_SOURCE_DIR}/release/text/readme.html
1510-)
1511-
1512-
1513-# -----------------------------------------------------------------------------
1514-# Platform Specific Var: TARGETDIR_VER
1515-
1516-if(UNIX AND NOT APPLE)
1517- if(WITH_INSTALL_PORTABLE)
1518- set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
1519- else()
1520- if(WITH_PYTHON_MODULE)
1521- set(TARGETDIR_VER ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/${BLENDER_VERSION})
1522- else()
1523- set(TARGETDIR_VER ${CMAKE_INSTALL_PREFIX}/share/blender/${BLENDER_VERSION})
1524- endif()
1525- endif()
1526-
1527-elseif(WIN32)
1528- set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
1529-
1530-elseif(APPLE)
1531- if(WITH_PYTHON_MODULE)
1532- set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
1533- else()
1534- set(TARGETDIR_VER ${TARGETDIR}/blender.app/Contents/MacOS/${BLENDER_VERSION})
1535- endif()
1536-
1537-endif()
1538-
1539-
1540-# -----------------------------------------------------------------------------
1541-# Install Targets (Generic, All Platforms)
1542-
1543-
1544-# important to make a clean install each time, else old scripts get loaded.
1545-install(
1546- CODE
1547- "file(REMOVE_RECURSE ${TARGETDIR_VER})"
1548-)
1549-
1550-if(WITH_PYTHON)
1551- # install(CODE "message(\"copying blender scripts...\")")
1552-
1553- # exclude addons_contrib if release
1554- if("${BLENDER_VERSION_CYCLE}" STREQUAL "release")
1555- set(ADDON_EXCLUDE_CONDITIONAL "addons_contrib/*")
1556- else()
1557- set(ADDON_EXCLUDE_CONDITIONAL "_addons_contrib/*") # dummy, wont do anything
1558- endif()
1559-
1560- install(
1561- DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts
1562- DESTINATION ${TARGETDIR_VER}
1563- PATTERN ".svn" EXCLUDE
1564- PATTERN "__pycache__" EXCLUDE
1565- PATTERN "${ADDON_EXCLUDE_CONDITIONAL}" EXCLUDE
1566- )
1567-
1568- unset(ADDON_EXCLUDE_CONDITIONAL)
1569-endif()
1570-
1571-# localization
1572-if(WITH_INTERNATIONAL)
1573- install(
1574- DIRECTORY
1575- ${CMAKE_SOURCE_DIR}/release/datafiles/locale
1576- ${CMAKE_SOURCE_DIR}/release/datafiles/fonts
1577- DESTINATION ${TARGETDIR_VER}/datafiles
1578- PATTERN ".svn" EXCLUDE
1579- )
1580-endif()
1581-
1582-# helpful tip when using make
1583-if("${CMAKE_GENERATOR}" MATCHES ".*Makefiles.*")
1584- # message after building.
1585- add_custom_command(
1586- TARGET blender POST_BUILD MAIN_DEPENDENCY blender
1587- COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files and scripts to ${TARGETDIR_VER}'
1588- )
1589-endif()
1590-
1591-
1592-# -----------------------------------------------------------------------------
1593-# Install Targets (Platform Specific)
1594-
1595-if(UNIX AND NOT APPLE)
1596-
1597- # there are a few differences between portable and system install
1598- if(WITH_INSTALL_PORTABLE)
1599- install(
1600- FILES
1601- ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
1602- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
1603- ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1
1604- DESTINATION ${TARGETDIR}
1605- )
1606-
1607- install(
1608- PROGRAMS
1609- ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
1610- DESTINATION ${TARGETDIR}
1611- )
1612-
1613- install(
1614- FILES ${BLENDER_TEXT_FILES}
1615- DESTINATION ${TARGETDIR}
1616- )
1617-
1618- else()
1619- # main blender binary
1620- if(WITH_PYTHON_MODULE)
1621- install(
1622- TARGETS blender
1623- LIBRARY
1624- DESTINATION ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages
1625- )
1626- else()
1627- install(
1628- PROGRAMS ${TARGETDIR}/blender
1629- DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
1630- )
1631- endif()
1632-
1633-
1634- if(WITH_GAMEENGINE AND WITH_PLAYER)
1635- install(
1636- PROGRAMS ${TARGETDIR}/blenderplayer
1637- DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
1638- )
1639- endif()
1640-
1641- # misc files
1642- install(
1643- FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
1644- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
1645- )
1646- install(
1647- DIRECTORY
1648- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/16x16
1649- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/22x22
1650- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/24x24
1651- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/32x32
1652- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/48x48
1653- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/256x256
1654- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
1655- PATTERN ".svn" EXCLUDE
1656- PATTERN "*.svg" EXCLUDE
1657- )
1658- install(
1659- FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
1660- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps
1661- )
1662- install(
1663- PROGRAMS ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
1664- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/blender/scripts
1665- )
1666- install(
1667- FILES ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1
1668- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
1669- )
1670- install(
1671- FILES ${BLENDER_TEXT_FILES}
1672- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender
1673- )
1674- endif()
1675-
1676- # plugins in blender 2.6 don't work at the moment.
1677- #
1678- # install(
1679- # DIRECTORY ${CMAKE_SOURCE_DIR}/release/plugins
1680- # DESTINATION ${TARGETDIR_VER}
1681- # PATTERN ".svn" EXCLUDE
1682- # )
1683-
1684- if(WITH_PYTHON)
1685- if(WITH_PYTHON_INSTALL)
1686- # on some platforms (like openSUSE) Python is linked
1687- # to be used from lib64 folder.
1688- # determine this from Python's libraries path
1689- if(${PYTHON_LIBPATH} MATCHES "lib64$")
1690- set(_target_LIB "lib64")
1691- else()
1692- set(_target_LIB "lib")
1693- endif()
1694-
1695- # Copy the systems python into the install directory
1696- # Scons copy in tools/Blender.py
1697- # install(CODE "message(\"copying a subset of the systems python...\")")
1698- install(
1699- DIRECTORY ${PYTHON_LIBPATH}/python${PYTHON_VERSION}
1700- DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}
1701- PATTERN ".svn" EXCLUDE
1702- PATTERN "__pycache__" EXCLUDE # * any cache *
1703- PATTERN "distutils" EXCLUDE # ./distutils
1704- PATTERN "lib2to3" EXCLUDE # ./lib2to3
1705- PATTERN "config" EXCLUDE # ./config
1706- PATTERN "config-*" EXCLUDE # ./config-*
1707- PATTERN "site-packages/*" EXCLUDE # ./site-packages/*
1708- PATTERN "tkinter" EXCLUDE # ./tkinter
1709- PATTERN "lib-dynload/_tkinter.*" EXCLUDE # ./lib-dynload/_tkinter.co
1710- PATTERN "idlelib" EXCLUDE # ./idlelib
1711- PATTERN "test" EXCLUDE # ./test
1712- PATTERN "turtledemo" EXCLUDE # ./turtledemo
1713- PATTERN "turtle.py" EXCLUDE # ./turtle.py
1714- )
1715-
1716- # # doesnt work, todo
1717- # install(CODE "execute_process(COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/ -name '*.so' -exec strip -s {} '\;')")
1718- unset(_target_LIB)
1719- endif()
1720- endif()
1721-elseif(WIN32)
1722-
1723- install(
1724- FILES ${BLENDER_TEXT_FILES}
1725- DESTINATION ${TARGETDIR}
1726- )
1727-
1728- if(WITH_INTERNATIONAL AND (NOT WITH_MINGW64))
1729- install(
1730- FILES ${LIBDIR}/gettext/lib/gnu_gettext.dll
1731- DESTINATION ${TARGETDIR}
1732- )
1733-
1734- if(NOT CMAKE_CL_64)
1735- install(
1736- FILES ${LIBDIR}/iconv/lib/iconv.dll
1737- DESTINATION ${TARGETDIR}
1738- )
1739- endif()
1740- endif()
1741-
1742- # plugins in blender 2.6 don't work at the moment.
1743- #
1744- # install(
1745- # DIRECTORY ${CMAKE_SOURCE_DIR}/release/plugins
1746- # DESTINATION ${TARGETDIR_VER}
1747- # PATTERN ".svn" EXCLUDE
1748- # )
1749-
1750- if(WITH_PYTHON)
1751- set_lib_path(PYLIB "python/lib")
1752- install(
1753- FILES ${PYLIB}/python32.dll
1754- DESTINATION ${TARGETDIR}
1755- CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
1756- )
1757-
1758- install(
1759- FILES ${PYLIB}/python32_d.dll
1760- DESTINATION ${TARGETDIR}
1761- CONFIGURATIONS Debug
1762- )
1763-
1764- if(WITH_PYTHON_INSTALL)
1765- # note, as far as python is concerned 'RelWithDebInfo' is not debug since its without debug flags.
1766-
1767- # create the directory in multiple steps, so it actually gets created when it doesn't exist yet
1768- install(
1769- CODE
1770- "
1771- message(\"creating ${TARGETDIR_VER}/python/lib\")
1772- file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python\")
1773- file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python/lib\")
1774- message(\"done creating dir\")
1775- "
1776- )
1777-
1778- install(
1779- CODE
1780- "
1781- if(\"\${CMAKE_INSTALL_CONFIG_NAME}\" STREQUAL \"Debug\")
1782- execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\"
1783- \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32_d.tar.gz\")
1784- else()
1785- execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\"
1786- \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32.tar.gz\")
1787- endif()
1788- "
1789- )
1790-
1791- # doesnt work, todo
1792- # install(CODE "execute_process(COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/ -name '*.so' -exec strip -s {} '\;')")
1793- endif()
1794- endif()
1795-
1796- if(CMAKE_CL_64)
1797- # gettext and png are statically linked on win64
1798- install(
1799- FILES ${LIBDIR}/zlib/lib/zlib.dll
1800- DESTINATION ${TARGETDIR}
1801- )
1802- else()
1803- #not needed since we link statically, maybe also unneeded for MinGW?
1804- if(NOT WITH_MINGW64)
1805- install(
1806- FILES
1807- ${LIBDIR}/zlib/lib/zlib.dll
1808- DESTINATION ${TARGETDIR}
1809- )
1810- endif()
1811- endif()
1812-
1813- if(MSVC)
1814- install(
1815- FILES ${LIBDIR}/pthreads/lib/pthreadVC2.dll
1816- DESTINATION ${TARGETDIR}
1817- )
1818- else()
1819- #MinGW64 comes with own version. For portable builds it will probaly have to be copied to work
1820- if(NOT WITH_MINGW64)
1821- install(
1822- FILES ${LIBDIR}/pthreads/lib/pthreadGC2.dll
1823- DESTINATION ${TARGETDIR}
1824- )
1825- endif()
1826- endif()
1827-
1828- if(WITH_CODEC_FFMPEG)
1829- install(
1830- FILES
1831- ${LIBDIR}/ffmpeg/lib/avcodec-53.dll
1832- ${LIBDIR}/ffmpeg/lib/avformat-53.dll
1833- ${LIBDIR}/ffmpeg/lib/avdevice-53.dll
1834- ${LIBDIR}/ffmpeg/lib/avutil-51.dll
1835- ${LIBDIR}/ffmpeg/lib/swscale-2.dll
1836- DESTINATION ${TARGETDIR}
1837- )
1838-
1839- endif()
1840-
1841- if(WITH_CODEC_SNDFILE)
1842- install(
1843- FILES ${LIBDIR}/sndfile/lib/libsndfile-1.dll
1844- DESTINATION ${TARGETDIR}
1845- )
1846- endif()
1847-
1848- if(WITH_OPENAL)
1849- install(
1850- FILES
1851- ${LIBDIR}/openal/lib/OpenAL32.dll
1852- ${LIBDIR}/openal/lib/wrap_oal.dll
1853- DESTINATION ${TARGETDIR}
1854- )
1855- endif()
1856-
1857- if(WITH_SDL)
1858- if(NOT CMAKE_CL_64)
1859- install(
1860- FILES ${LIBDIR}/sdl/lib/SDL.dll
1861- DESTINATION ${TARGETDIR}
1862- )
1863- endif()
1864- endif()
1865-
1866- if(NOT CMAKE_CL_64)
1867- install(
1868- FILES ${LIBDIR}/thumbhandler/lib/BlendThumb.dll
1869- DESTINATION ${TARGETDIR}
1870- )
1871- endif()
1872-
1873- install( # x86 builds can run on x64 Windows, so this is required at all times
1874- FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
1875- DESTINATION ${TARGETDIR}
1876- )
1877-
1878- if(WITH_OPENIMAGEIO)
1879- if(NOT MINGW)
1880- set_lib_path(OIIOBIN "openimageio/bin")
1881- install(
1882- FILES
1883- ${OIIOBIN}/OpenImageIO.dll
1884- DESTINATION ${TARGETDIR}
1885- )
1886- endif()
1887- endif()
1888-
1889-elseif(APPLE)
1890-
1891- # handy install macro to exclude files, we use \$ escape for the "to"
1892- # argument when calling so ${BUILD_TYPE} does not get expanded
1893- macro(install_dir from to)
1894- install(
1895- DIRECTORY ${from}
1896- DESTINATION ${to}
1897- PATTERN ".svn" EXCLUDE
1898- PATTERN "*.pyc" EXCLUDE
1899- PATTERN "*.pyo" EXCLUDE
1900- PATTERN "*.orig" EXCLUDE
1901- PATTERN "*.rej" EXCLUDE
1902- PATTERN "__pycache__" EXCLUDE
1903- PATTERN "__MACOSX" EXCLUDE
1904- PATTERN ".DS_Store" EXCLUDE
1905- )
1906- endmacro()
1907-
1908- set(OSX_APP_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app)
1909-
1910- # setup Info.plist
1911- execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BLENDER_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
1912-
1913- set_target_properties(blender PROPERTIES
1914- MACOSX_BUNDLE_INFO_PLIST ${OSX_APP_SOURCEDIR}/Contents/Info.plist
1915- MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION}
1916- MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION} ${BLENDER_DATE}")
1917-
1918-
1919- # install release and app files
1920- install(
1921- FILES ${BLENDER_TEXT_FILES}
1922- DESTINATION ${TARGETDIR}
1923- )
1924-
1925- install(
1926- FILES ${OSX_APP_SOURCEDIR}/Contents/PkgInfo
1927- DESTINATION ${TARGETDIR}/blender.app/Contents
1928- )
1929-
1930- install_dir(
1931- ${OSX_APP_SOURCEDIR}/Contents/Resources
1932- \${TARGETDIR}/blender.app/Contents/
1933- )
1934-
1935- # python
1936- if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE)
1937- # the python zip is first extract as part of the build process,
1938- # and then later installed as part of make install. this is much
1939- # quicker, and means we can easily exclude files on copy
1940- # Not needed for PYTHON_MODULE or WEB_PLUGIN due uses Pyhon framework
1941- add_custom_target(
1942- extractpyzip
1943- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/python)
1944-
1945- set(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
1946-
1947- add_custom_command(
1948- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
1949- COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/python/
1950- COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/python/
1951- COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${CMAKE_CURRENT_BINARY_DIR}/python/
1952- DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
1953-
1954- add_dependencies(blender extractpyzip)
1955-
1956- # copy extracted python files
1957- install_dir(
1958- ${CMAKE_CURRENT_BINARY_DIR}/python
1959- \${TARGETDIR_VER}
1960- )
1961-
1962- endif()
1963-
1964- # install blenderplayer bundle - copy of blender.app above. re-using macros et al
1965- # note we are using OSX Bundle as base and copying Blender dummy bundle on top of it
1966- if(WITH_GAMEENGINE AND WITH_PLAYER)
1967- set(OSX_APP_PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app)
1968- set(PLAYER_SOURCEINFO ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Info.plist)
1969- set(PLAYER_TARGETDIR_VER ${TARGETDIR}/blenderplayer.app/Contents/MacOS/${BLENDER_VERSION})
1970-
1971-
1972- # important to make a clean install each time else old scripts get loaded.
1973- install(
1974- CODE
1975- "file(REMOVE_RECURSE ${PLAYER_TARGETDIR_VER})"
1976- )
1977-
1978- install(
1979- FILES ${OSX_APP_PLAYER_SOURCEDIR}/Contents/PkgInfo
1980- DESTINATION ${TARGETDIR}/blenderplayer.app/Contents
1981- )
1982-
1983- install_dir(
1984- ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Resources
1985- \${TARGETDIR}/blenderplayer.app/Contents/
1986- )
1987-
1988- # python
1989- if(WITH_PYTHON)
1990- add_custom_command(
1991- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
1992- COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/python/
1993- COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/python/
1994- COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${CMAKE_CURRENT_BINARY_DIR}/python/
1995- DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
1996-
1997- # copy extracted python files
1998- install_dir(
1999- ${CMAKE_CURRENT_BINARY_DIR}/python
2000- \${PLAYER_TARGETDIR_VER}
2001- )
2002- endif()
2003-
2004- endif()
2005-endif()
2006-
2007-# -----------------------------------------------------------------------------
2008-# Generic Install, for all targets
2009-
2010-
2011-
2012-# install more files specified elsewhere
2013-delayed_do_install(${TARGETDIR_VER})
2014-
2015-unset(BLENDER_TEXT_FILES)
2016-
2017-
2018-# -----------------------------------------------------------------------------
2019-# Setup link libs
2020-
2021-add_dependencies(blender makesdna)
2022-
2023-get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)
2024-
2025-set(BLENDER_LINK_LIBS
2026- ${BLENDER_LINK_LIBS}
2027- bf_windowmanager
2028- bf_render
2029-)
2030-
2031-if(WITH_MOD_FLUID)
2032- list(APPEND BLENDER_LINK_LIBS bf_intern_elbeem)
2033-endif()
2034-
2035-if(WITH_CYCLES)
2036- list(APPEND BLENDER_LINK_LIBS
2037- cycles_render
2038- cycles_bvh
2039- cycles_device
2040- cycles_kernel
2041- cycles_util
2042- cycles_subd)
2043-endif()
2044-
2045-#if(UNIX)
2046- # Sort libraries
2047- set(BLENDER_SORTED_LIBS
2048- bf_windowmanager
2049-
2050- bf_editor_space_api
2051- bf_editor_space_action
2052- bf_editor_space_buttons
2053- bf_editor_space_console
2054- bf_editor_space_file
2055- bf_editor_space_graph
2056- bf_editor_space_image
2057- bf_editor_space_info
2058- bf_editor_space_logic
2059- bf_editor_space_nla
2060- bf_editor_space_node
2061- bf_editor_space_outliner
2062- bf_editor_space_script
2063- bf_editor_space_sequencer
2064- bf_editor_space_time
2065- bf_editor_space_userpref
2066- bf_editor_space_view3d
2067- bf_editor_space_clip
2068-
2069- bf_editor_text
2070- bf_editor_transform
2071- bf_editor_util
2072- bf_editor_uvedit
2073- bf_editor_curve
2074- bf_editor_armature
2075- bf_editor_gpencil
2076- bf_editor_interface
2077- bf_editor_mesh
2078- bf_editor_metaball
2079- bf_editor_object
2080- bf_editor_physics
2081- bf_editor_render
2082- bf_editor_screen
2083- bf_editor_sculpt_paint
2084- bf_editor_sound
2085- bf_editor_animation
2086- bf_editor_datafiles
2087-
2088- bf_render
2089- bf_intern_opennl
2090- bf_python
2091- bf_python_ext
2092- bf_python_mathutils
2093- bf_python_bmesh
2094- bf_ikplugin
2095- bf_modifiers
2096- bf_bmesh
2097- bf_blenkernel
2098- bf_nodes
2099- bf_gpu
2100- bf_blenloader
2101- bf_imbuf
2102- bf_blenlib
2103- bf_intern_ghost
2104- bf_intern_string
2105- bf_blenpluginapi
2106- bf_avi
2107- bf_imbuf_cineon
2108- bf_imbuf_openexr
2109- bf_imbuf_dds
2110- bf_collada
2111- bf_intern_bsp
2112- bf_intern_bop
2113- bf_intern_decimate
2114- bf_intern_elbeem
2115- bf_intern_ik
2116- bf_intern_memutil
2117- bf_intern_guardedalloc
2118- bf_intern_ctr
2119- bf_intern_utfconv
2120- ge_blen_routines
2121- ge_converter
2122- ge_phys_dummy
2123- ge_phys_bullet
2124- bf_intern_smoke
2125- extern_minilzo
2126- extern_lzma
2127- extern_colamd
2128- ge_logic_ketsji
2129- extern_recastnavigation
2130- ge_phys_common
2131- ge_logic
2132- ge_rasterizer
2133- ge_oglrasterizer
2134- ge_logic_expressions
2135- ge_scenegraph
2136- ge_logic_network
2137- ge_logic_ngnetwork
2138- extern_bullet
2139- ge_logic_loopbacknetwork
2140- bf_intern_moto
2141- extern_openjpeg
2142- extern_redcode
2143- ge_videotex
2144- bf_rna
2145- bf_dna
2146- bf_blenfont
2147- bf_intern_audaspace
2148- bf_intern_mikktspace
2149- bf_intern_dualcon
2150- bf_intern_cycles
2151- cycles_render
2152- cycles_bvh
2153- cycles_device
2154- cycles_kernel
2155- cycles_util
2156- cycles_subd
2157- )
2158-
2159- if(WITH_LIBMV)
2160- list(APPEND BLENDER_SORTED_LIBS extern_libmv)
2161- endif()
2162-
2163- if(WITH_MOD_CLOTH_ELTOPO)
2164- list(APPEND BLENDER_SORTED_LIBS extern_eltopo)
2165- endif()
2166-
2167- if(WITH_BUILTIN_GLEW)
2168- list(APPEND BLENDER_SORTED_LIBS extern_glew)
2169- endif()
2170-
2171- if(WITH_BINRELOC)
2172- list(APPEND BLENDER_SORTED_LIBS extern_binreloc)
2173- endif()
2174-
2175- if(WITH_CXX_GUARDEDALLOC)
2176- list(APPEND BLENDER_SORTED_LIBS bf_intern_guardedalloc_cpp)
2177- endif()
2178-
2179- if(WITH_IK_ITASC)
2180- list(APPEND BLENDER_SORTED_LIBS bf_intern_itasc)
2181- endif()
2182-
2183- if(WITH_CODEC_QUICKTIME)
2184- list(APPEND BLENDER_SORTED_LIBS bf_quicktime)
2185- endif()
2186-
2187- if(WITH_CARVE)
2188- list(APPEND BLENDER_SORTED_LIBS extern_carve)
2189- endif()
2190-
2191- if(WITH_GHOST_XDND)
2192- list(APPEND BLENDER_SORTED_LIBS extern_xdnd)
2193- endif()
2194-
2195- foreach(SORTLIB ${BLENDER_SORTED_LIBS})
2196- set(REMLIB ${SORTLIB})
2197- foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
2198- if(${SEARCHLIB} STREQUAL ${SORTLIB})
2199- set(REMLIB "")
2200- endif()
2201- endforeach()
2202- if(REMLIB)
2203- # message(STATUS "Removing library ${REMLIB} from blender linking because: not configured")
2204- list(APPEND REM_MSG ${REMLIB})
2205- list(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
2206- endif()
2207- endforeach()
2208- if(REM_MSG)
2209- list(SORT REM_MSG)
2210- message(STATUS "Blender Skipping: (${REM_MSG})")
2211- endif()
2212- target_link_libraries(blender ${BLENDER_SORTED_LIBS})
2213-
2214- unset(SEARCHLIB)
2215- unset(SORTLIB)
2216- unset(REMLIB)
2217- unset(REM_MSG)
2218-
2219-#else()
2220-# target_link_libraries(blender ${BLENDER_LINK_LIBS})
2221-#endif()
2222-
2223-setup_liblinks(blender)
2224
2225=== removed directory '.pc/0004-filter_docs_to_install.patch'
2226=== removed directory '.pc/0004-filter_docs_to_install.patch/source'
2227=== removed directory '.pc/0004-filter_docs_to_install.patch/source/creator'
2228=== removed file '.pc/0004-filter_docs_to_install.patch/source/creator/CMakeLists.txt'
2229--- .pc/0004-filter_docs_to_install.patch/source/creator/CMakeLists.txt 2012-04-28 12:11:12 +0000
2230+++ .pc/0004-filter_docs_to_install.patch/source/creator/CMakeLists.txt 1970-01-01 00:00:00 +0000
2231@@ -1,946 +0,0 @@
2232-# -*- mode: cmake; indent-tabs-mode: t; -*-
2233-# ***** BEGIN GPL LICENSE BLOCK *****
2234-#
2235-# This program is free software; you can redistribute it and/or
2236-# modify it under the terms of the GNU General Public License
2237-# as published by the Free Software Foundation; either version 2
2238-# of the License, or (at your option) any later version.
2239-#
2240-# This program is distributed in the hope that it will be useful,
2241-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2242-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2243-# GNU General Public License for more details.
2244-#
2245-# You should have received a copy of the GNU General Public License
2246-# along with this program; if not, write to the Free Software Foundation,
2247-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2248-#
2249-# The Original Code is Copyright (C) 2006, Blender Foundation
2250-# All rights reserved.
2251-#
2252-# The Original Code is: all of this file.
2253-#
2254-# Contributor(s): Jacques Beaurain.
2255-#
2256-# ***** END GPL LICENSE BLOCK *****
2257-
2258-setup_libdirs()
2259-
2260-blender_include_dirs(
2261- ../../intern/guardedalloc
2262- ../blender/blenlib
2263- ../blender/blenkernel
2264- ../blender/blenloader
2265- ../blender/editors/include
2266- ../blender/makesrna
2267- ../blender/imbuf
2268- ../blender/render/extern/include
2269- ../blender/makesdna
2270- ../blender/gpu
2271- ../blender/windowmanager
2272-)
2273-
2274-if(WIN32)
2275- blender_include_dirs(../../intern/utfconv)
2276-endif()
2277-
2278-if(WITH_LIBMV)
2279- blender_include_dirs(../../extern/libmv)
2280- add_definitions(-DWITH_LIBMV)
2281-endif()
2282-
2283-if(WITH_CODEC_FFMPEG)
2284- add_definitions(-DWITH_FFMPEG)
2285-endif()
2286-
2287-if(WITH_PYTHON)
2288- blender_include_dirs(../blender/python)
2289- add_definitions(-DWITH_PYTHON)
2290-
2291- if(WITH_PYTHON_SECURITY)
2292- add_definitions(-DWITH_PYTHON_SECURITY)
2293- endif()
2294-endif()
2295-
2296-if(WITH_HEADLESS)
2297- add_definitions(-DWITH_HEADLESS)
2298-endif()
2299-
2300-if(WITH_GAMEENGINE)
2301- blender_include_dirs(../gameengine/BlenderRoutines)
2302-
2303- add_definitions(-DWITH_GAMEENGINE)
2304-endif()
2305-
2306-if(WITH_SDL)
2307- add_definitions(-DWITH_SDL)
2308-endif()
2309-
2310-if(WITH_BINRELOC)
2311- add_definitions(-DWITH_BINRELOC)
2312- blender_include_dirs(${BINRELOC_INCLUDE_DIRS})
2313-endif()
2314-
2315-# Setup the exe sources and buildinfo
2316-set(SRC
2317- creator.c
2318-)
2319-
2320-# MSVC 2010 gives linking errors with the manifest
2321-if(WIN32 AND NOT UNIX)
2322- string(SUBSTRING ${BLENDER_VERSION} 0 1 bver1)
2323- string(SUBSTRING ${BLENDER_VERSION} 2 1 bver2)
2324- string(SUBSTRING ${BLENDER_VERSION} 3 1 bver3)
2325- if(MINGW)
2326- add_definitions(
2327- -DWINDRES
2328- -DBLEN_VER_RC_STR_M=${BLENDER_VERSION}
2329- -DBLEN_VER_RC_1=${bver1}
2330- -DBLEN_VER_RC_2=${bver2}
2331- -DBLEN_VER_RC_3=${bver3}
2332- -DBLEN_VER_RC_4=0
2333- )
2334- else()
2335- add_definitions(
2336- -DBLEN_VER_RC_STR=${BLENDER_VERSION}
2337- -DBLEN_VER_RC_1=${bver1}
2338- -DBLEN_VER_RC_2=${bver2}
2339- -DBLEN_VER_RC_3=${bver3}
2340- -DBLEN_VER_RC_4=0
2341- )
2342- endif()
2343-
2344-
2345- list(APPEND SRC
2346- ../icons/winblender.rc
2347- )
2348-endif()
2349-
2350-if(WITH_BUILDINFO)
2351- add_definitions(-DWITH_BUILDINFO)
2352- # --------------------------------------------------------------------------
2353- # These defines could all be moved into the header below
2354- string(REPLACE " " "\ " BUILDINFO_CFLAGS "${CMAKE_C_FLAGS}")
2355- string(REPLACE " " "\ " BUILDINFO_CXXFLAGS "${CMAKE_CXX_FLAGS}")
2356- string(REPLACE " " "\ " BUILDINFO_LINKFLAGS "${PLATFORM_LINKFLAGS}")
2357- add_definitions(
2358- # # define in header now, else these get out of date on rebuilds.
2359- # -DBUILD_DATE="${BUILD_DATE}"
2360- # -DBUILD_TIME="${BUILD_TIME}"
2361- # -DBUILD_REV="${BUILD_REV}"
2362- -DWITH_BUILDINFO_HEADER # alternative to lines above
2363- -DBUILD_PLATFORM="${CMAKE_SYSTEM_NAME}"
2364- -DBUILD_TYPE="${CMAKE_BUILD_TYPE}"
2365- -DBUILD_CFLAGS="${BUILDINFO_CFLAGS}"
2366- -DBUILD_CXXFLAGS="${BUILDINFO_CXXFLAGS}"
2367- -DBUILD_LINKFLAGS="${BUILDINFO_LINKFLAGS}"
2368- -DBUILD_SYSTEM="CMake"
2369- )
2370-
2371- # --------------------------------------------------------------------------
2372- # write header for values that change each build
2373- # note, generaed file is in build dir's source/creator
2374- # except when used as an include path.
2375-
2376- # include the output directory, where the buildinfo.h file is generated
2377- include_directories(${CMAKE_BINARY_DIR}/source/creator)
2378-
2379- # a custom target that is always built
2380- add_custom_target(buildinfo ALL
2381- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/buildinfo.h)
2382-
2383- # creates svnheader.h using cmake script
2384- add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/buildinfo.h
2385- COMMAND ${CMAKE_COMMAND}
2386- -DSOURCE_DIR=${CMAKE_SOURCE_DIR}
2387- -P ${CMAKE_SOURCE_DIR}/build_files/cmake/buildinfo.cmake)
2388-
2389- # buildinfo.h is a generated file
2390- set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/buildinfo.h
2391- PROPERTIES GENERATED TRUE
2392- HEADER_FILE_ONLY TRUE)
2393-
2394- # add deps below, after adding blender
2395- # -------------- done with header values.
2396-
2397- list(APPEND SRC
2398- buildinfo.c
2399- )
2400-endif()
2401-
2402-# message(STATUS "Configuring blender")
2403-if(WITH_PYTHON_MODULE)
2404- add_definitions(-DWITH_PYTHON_MODULE)
2405-
2406- # creates ./bin/bpy.so which can be imported as a python module.
2407- #
2408- # note that 'SHARED' works on Linux and Windows,
2409- # but not OSX which _must_ be 'MODULE'
2410- add_library(blender MODULE ${SRC})
2411- set_target_properties(
2412- blender
2413- PROPERTIES
2414- PREFIX ""
2415- OUTPUT_NAME bpy
2416- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
2417- RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin # only needed on windows
2418- )
2419-
2420- if(APPLE)
2421- set_target_properties(
2422- blender
2423- PROPERTIES
2424- LINK_FLAGS_RELEASE "${PLATFORM_LINKFLAGS}"
2425- LINK_FLAGS_DEBUG "${PLATFORM_LINKFLAGS_DEBUG}"
2426- )
2427- endif()
2428-
2429- if(WIN32)
2430- # python modules use this
2431- set_target_properties(
2432- blender
2433- PROPERTIES
2434- SUFFIX ".pyd"
2435- )
2436- endif()
2437-
2438-else()
2439- add_executable(blender ${EXETYPE} ${SRC})
2440-endif()
2441-
2442-if(WITH_BUILDINFO)
2443- # explicitly say that the executable depends on the buildinfo
2444- add_dependencies(blender buildinfo)
2445-endif()
2446-
2447-# Post build steps for bundling/packaging.
2448-
2449-
2450-if(MSVC_IDE)
2451- # ${CMAKE_CFG_INTDIR} should replace \${BUILD_TYPE} when using add_command
2452- set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE})
2453-elseif(APPLE)
2454- set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH}/\${BUILD_TYPE})
2455-else()
2456- set(TARGETDIR ${EXECUTABLE_OUTPUT_PATH})
2457-endif()
2458-
2459-set(BLENDER_TEXT_FILES
2460- ${CMAKE_SOURCE_DIR}/release/text/GPL-license.txt
2461- ${CMAKE_SOURCE_DIR}/release/text/Python-license.txt
2462- ${CMAKE_SOURCE_DIR}/release/text/copyright.txt
2463- ${CMAKE_SOURCE_DIR}/release/text/readme.html
2464-)
2465-
2466-
2467-# -----------------------------------------------------------------------------
2468-# Platform Specific Var: TARGETDIR_VER
2469-
2470-if(UNIX AND NOT APPLE)
2471- if(WITH_INSTALL_PORTABLE)
2472- set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
2473- else()
2474- if(WITH_PYTHON_MODULE)
2475- set(TARGETDIR_VER ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages/${BLENDER_VERSION})
2476- else()
2477- set(TARGETDIR_VER ${CMAKE_INSTALL_PREFIX}/share/blender/${BLENDER_VERSION})
2478- endif()
2479- endif()
2480-
2481-elseif(WIN32)
2482- set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
2483-
2484-elseif(APPLE)
2485- if(WITH_PYTHON_MODULE)
2486- set(TARGETDIR_VER ${TARGETDIR}/${BLENDER_VERSION})
2487- else()
2488- set(TARGETDIR_VER ${TARGETDIR}/blender.app/Contents/MacOS/${BLENDER_VERSION})
2489- endif()
2490-
2491-endif()
2492-
2493-
2494-# -----------------------------------------------------------------------------
2495-# Install Targets (Generic, All Platforms)
2496-
2497-
2498-# important to make a clean install each time, else old scripts get loaded.
2499-install(
2500- CODE
2501- "file(REMOVE_RECURSE ${TARGETDIR_VER})"
2502-)
2503-
2504-if(WITH_PYTHON)
2505- # install(CODE "message(\"copying blender scripts...\")")
2506-
2507- # exclude addons_contrib if release
2508- if("${BLENDER_VERSION_CYCLE}" STREQUAL "release")
2509- set(ADDON_EXCLUDE_CONDITIONAL "addons_contrib/*")
2510- else()
2511- set(ADDON_EXCLUDE_CONDITIONAL "_addons_contrib/*") # dummy, wont do anything
2512- endif()
2513-
2514- install(
2515- DIRECTORY ${CMAKE_SOURCE_DIR}/release/scripts/
2516- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/blender/scripts/
2517- PATTERN ".svn" EXCLUDE
2518- PATTERN "__pycache__" EXCLUDE
2519- PATTERN "${ADDON_EXCLUDE_CONDITIONAL}" EXCLUDE
2520- )
2521-
2522- unset(ADDON_EXCLUDE_CONDITIONAL)
2523-endif()
2524-
2525-# localization
2526-if(WITH_INTERNATIONAL)
2527- install(
2528- DIRECTORY
2529- ${CMAKE_SOURCE_DIR}/release/datafiles/locale
2530- ${CMAKE_SOURCE_DIR}/release/datafiles/fonts
2531- DESTINATION ${TARGETDIR_VER}/datafiles
2532- PATTERN ".svn" EXCLUDE
2533- )
2534-endif()
2535-
2536-# helpful tip when using make
2537-if("${CMAKE_GENERATOR}" MATCHES ".*Makefiles.*")
2538- # message after building.
2539- add_custom_command(
2540- TARGET blender POST_BUILD MAIN_DEPENDENCY blender
2541- COMMAND ${CMAKE_COMMAND} -E echo 'now run: \"make install\" to copy runtime files and scripts to ${TARGETDIR_VER}'
2542- )
2543-endif()
2544-
2545-
2546-# -----------------------------------------------------------------------------
2547-# Install Targets (Platform Specific)
2548-
2549-if(UNIX AND NOT APPLE)
2550-
2551- # there are a few differences between portable and system install
2552- if(WITH_INSTALL_PORTABLE)
2553- install(
2554- FILES
2555- ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
2556- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
2557- ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1
2558- DESTINATION ${TARGETDIR}
2559- )
2560-
2561- install(
2562- PROGRAMS
2563- ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
2564- DESTINATION ${TARGETDIR}
2565- )
2566-
2567- install(
2568- FILES ${BLENDER_TEXT_FILES}
2569- DESTINATION ${TARGETDIR}
2570- )
2571-
2572- else()
2573- # main blender binary
2574- if(WITH_PYTHON_MODULE)
2575- install(
2576- TARGETS blender
2577- LIBRARY
2578- DESTINATION ${PYTHON_LIBPATH}/python${PYTHON_VERSION}/site-packages
2579- )
2580- else()
2581- install(
2582- PROGRAMS ${TARGETDIR}/blender
2583- DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
2584- )
2585- endif()
2586-
2587-
2588- if(WITH_GAMEENGINE AND WITH_PLAYER)
2589- install(
2590- PROGRAMS ${TARGETDIR}/blenderplayer
2591- DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
2592- )
2593- endif()
2594-
2595- # misc files
2596- install(
2597- FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/blender.desktop
2598- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications
2599- )
2600- install(
2601- DIRECTORY
2602- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/16x16
2603- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/22x22
2604- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/24x24
2605- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/32x32
2606- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/48x48
2607- ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/256x256
2608- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor
2609- PATTERN ".svn" EXCLUDE
2610- PATTERN "*.svg" EXCLUDE
2611- )
2612- install(
2613- FILES ${CMAKE_SOURCE_DIR}/release/freedesktop/icons/scalable/apps/blender.svg
2614- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/scalable/apps
2615- )
2616- install(
2617- PROGRAMS ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py
2618- DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/blender/scripts
2619- )
2620- install(
2621- FILES ${CMAKE_SOURCE_DIR}/doc/manpage/blender.1
2622- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
2623- )
2624- install(
2625- FILES ${BLENDER_TEXT_FILES}
2626- DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/blender
2627- )
2628- endif()
2629-
2630- # plugins in blender 2.6 don't work at the moment.
2631- #
2632- # install(
2633- # DIRECTORY ${CMAKE_SOURCE_DIR}/release/plugins
2634- # DESTINATION ${TARGETDIR_VER}
2635- # PATTERN ".svn" EXCLUDE
2636- # )
2637-
2638- if(WITH_PYTHON)
2639- if(WITH_PYTHON_INSTALL)
2640- # on some platforms (like openSUSE) Python is linked
2641- # to be used from lib64 folder.
2642- # determine this from Python's libraries path
2643- if(${PYTHON_LIBPATH} MATCHES "lib64$")
2644- set(_target_LIB "lib64")
2645- else()
2646- set(_target_LIB "lib")
2647- endif()
2648-
2649- # Copy the systems python into the install directory
2650- # Scons copy in tools/Blender.py
2651- # install(CODE "message(\"copying a subset of the systems python...\")")
2652- install(
2653- DIRECTORY ${PYTHON_LIBPATH}/python${PYTHON_VERSION}
2654- DESTINATION ${TARGETDIR_VER}/python/${_target_LIB}
2655- PATTERN ".svn" EXCLUDE
2656- PATTERN "__pycache__" EXCLUDE # * any cache *
2657- PATTERN "distutils" EXCLUDE # ./distutils
2658- PATTERN "lib2to3" EXCLUDE # ./lib2to3
2659- PATTERN "config" EXCLUDE # ./config
2660- PATTERN "config-*" EXCLUDE # ./config-*
2661- PATTERN "site-packages/*" EXCLUDE # ./site-packages/*
2662- PATTERN "tkinter" EXCLUDE # ./tkinter
2663- PATTERN "lib-dynload/_tkinter.*" EXCLUDE # ./lib-dynload/_tkinter.co
2664- PATTERN "idlelib" EXCLUDE # ./idlelib
2665- PATTERN "test" EXCLUDE # ./test
2666- PATTERN "turtledemo" EXCLUDE # ./turtledemo
2667- PATTERN "turtle.py" EXCLUDE # ./turtle.py
2668- )
2669-
2670- # # doesnt work, todo
2671- # install(CODE "execute_process(COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/ -name '*.so' -exec strip -s {} '\;')")
2672- unset(_target_LIB)
2673- endif()
2674- endif()
2675-elseif(WIN32)
2676-
2677- install(
2678- FILES ${BLENDER_TEXT_FILES}
2679- DESTINATION ${TARGETDIR}
2680- )
2681-
2682- if(WITH_INTERNATIONAL AND (NOT WITH_MINGW64))
2683- install(
2684- FILES ${LIBDIR}/gettext/lib/gnu_gettext.dll
2685- DESTINATION ${TARGETDIR}
2686- )
2687-
2688- if(NOT CMAKE_CL_64)
2689- install(
2690- FILES ${LIBDIR}/iconv/lib/iconv.dll
2691- DESTINATION ${TARGETDIR}
2692- )
2693- endif()
2694- endif()
2695-
2696- # plugins in blender 2.6 don't work at the moment.
2697- #
2698- # install(
2699- # DIRECTORY ${CMAKE_SOURCE_DIR}/release/plugins
2700- # DESTINATION ${TARGETDIR_VER}
2701- # PATTERN ".svn" EXCLUDE
2702- # )
2703-
2704- if(WITH_PYTHON)
2705- set_lib_path(PYLIB "python/lib")
2706- install(
2707- FILES ${PYLIB}/python32.dll
2708- DESTINATION ${TARGETDIR}
2709- CONFIGURATIONS Release;RelWithDebInfo;MinSizeRel
2710- )
2711-
2712- install(
2713- FILES ${PYLIB}/python32_d.dll
2714- DESTINATION ${TARGETDIR}
2715- CONFIGURATIONS Debug
2716- )
2717-
2718- if(WITH_PYTHON_INSTALL)
2719- # note, as far as python is concerned 'RelWithDebInfo' is not debug since its without debug flags.
2720-
2721- # create the directory in multiple steps, so it actually gets created when it doesn't exist yet
2722- install(
2723- CODE
2724- "
2725- message(\"creating ${TARGETDIR_VER}/python/lib\")
2726- file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python\")
2727- file(MAKE_DIRECTORY \"${TARGETDIR_VER}/python/lib\")
2728- message(\"done creating dir\")
2729- "
2730- )
2731-
2732- install(
2733- CODE
2734- "
2735- if(\"\${CMAKE_INSTALL_CONFIG_NAME}\" STREQUAL \"Debug\")
2736- execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\"
2737- \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32_d.tar.gz\")
2738- else()
2739- execute_process(COMMAND \"${CMAKE_COMMAND}\" -E chdir \"${TARGETDIR_VER}/python/lib\"
2740- \"${CMAKE_COMMAND}\" -E tar xzfv \"${LIBDIR}/release/python32.tar.gz\")
2741- endif()
2742- "
2743- )
2744-
2745- # doesnt work, todo
2746- # install(CODE "execute_process(COMMAND find ${TARGETDIR}/${BLENDER_VERSION}/python/lib/ -name '*.so' -exec strip -s {} '\;')")
2747- endif()
2748- endif()
2749-
2750- if(CMAKE_CL_64)
2751- # gettext and png are statically linked on win64
2752- install(
2753- FILES ${LIBDIR}/zlib/lib/zlib.dll
2754- DESTINATION ${TARGETDIR}
2755- )
2756- else()
2757- #not needed since we link statically, maybe also unneeded for MinGW?
2758- if(NOT WITH_MINGW64)
2759- install(
2760- FILES
2761- ${LIBDIR}/zlib/lib/zlib.dll
2762- DESTINATION ${TARGETDIR}
2763- )
2764- endif()
2765- endif()
2766-
2767- if(MSVC)
2768- install(
2769- FILES ${LIBDIR}/pthreads/lib/pthreadVC2.dll
2770- DESTINATION ${TARGETDIR}
2771- )
2772- else()
2773- #MinGW64 comes with own version. For portable builds it will probaly have to be copied to work
2774- if(NOT WITH_MINGW64)
2775- install(
2776- FILES ${LIBDIR}/pthreads/lib/pthreadGC2.dll
2777- DESTINATION ${TARGETDIR}
2778- )
2779- endif()
2780- endif()
2781-
2782- if(WITH_CODEC_FFMPEG)
2783- install(
2784- FILES
2785- ${LIBDIR}/ffmpeg/lib/avcodec-53.dll
2786- ${LIBDIR}/ffmpeg/lib/avformat-53.dll
2787- ${LIBDIR}/ffmpeg/lib/avdevice-53.dll
2788- ${LIBDIR}/ffmpeg/lib/avutil-51.dll
2789- ${LIBDIR}/ffmpeg/lib/swscale-2.dll
2790- DESTINATION ${TARGETDIR}
2791- )
2792-
2793- endif()
2794-
2795- if(WITH_CODEC_SNDFILE)
2796- install(
2797- FILES ${LIBDIR}/sndfile/lib/libsndfile-1.dll
2798- DESTINATION ${TARGETDIR}
2799- )
2800- endif()
2801-
2802- if(WITH_OPENAL)
2803- install(
2804- FILES
2805- ${LIBDIR}/openal/lib/OpenAL32.dll
2806- ${LIBDIR}/openal/lib/wrap_oal.dll
2807- DESTINATION ${TARGETDIR}
2808- )
2809- endif()
2810-
2811- if(WITH_SDL)
2812- if(NOT CMAKE_CL_64)
2813- install(
2814- FILES ${LIBDIR}/sdl/lib/SDL.dll
2815- DESTINATION ${TARGETDIR}
2816- )
2817- endif()
2818- endif()
2819-
2820- if(NOT CMAKE_CL_64)
2821- install(
2822- FILES ${LIBDIR}/thumbhandler/lib/BlendThumb.dll
2823- DESTINATION ${TARGETDIR}
2824- )
2825- endif()
2826-
2827- install( # x86 builds can run on x64 Windows, so this is required at all times
2828- FILES ${LIBDIR}/thumbhandler/lib/BlendThumb64.dll
2829- DESTINATION ${TARGETDIR}
2830- )
2831-
2832- if(WITH_OPENIMAGEIO)
2833- if(NOT MINGW)
2834- set_lib_path(OIIOBIN "openimageio/bin")
2835- install(
2836- FILES
2837- ${OIIOBIN}/OpenImageIO.dll
2838- DESTINATION ${TARGETDIR}
2839- )
2840- endif()
2841- endif()
2842-
2843-elseif(APPLE)
2844-
2845- # handy install macro to exclude files, we use \$ escape for the "to"
2846- # argument when calling so ${BUILD_TYPE} does not get expanded
2847- macro(install_dir from to)
2848- install(
2849- DIRECTORY ${from}
2850- DESTINATION ${to}
2851- PATTERN ".svn" EXCLUDE
2852- PATTERN "*.pyc" EXCLUDE
2853- PATTERN "*.pyo" EXCLUDE
2854- PATTERN "*.orig" EXCLUDE
2855- PATTERN "*.rej" EXCLUDE
2856- PATTERN "__pycache__" EXCLUDE
2857- PATTERN "__MACOSX" EXCLUDE
2858- PATTERN ".DS_Store" EXCLUDE
2859- )
2860- endmacro()
2861-
2862- set(OSX_APP_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blender.app)
2863-
2864- # setup Info.plist
2865- execute_process(COMMAND date "+%Y-%m-%d" OUTPUT_VARIABLE BLENDER_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
2866-
2867- set_target_properties(blender PROPERTIES
2868- MACOSX_BUNDLE_INFO_PLIST ${OSX_APP_SOURCEDIR}/Contents/Info.plist
2869- MACOSX_BUNDLE_SHORT_VERSION_STRING ${BLENDER_VERSION}
2870- MACOSX_BUNDLE_LONG_VERSION_STRING "${BLENDER_VERSION} ${BLENDER_DATE}")
2871-
2872-
2873- # install release and app files
2874- install(
2875- FILES ${BLENDER_TEXT_FILES}
2876- DESTINATION ${TARGETDIR}
2877- )
2878-
2879- install(
2880- FILES ${OSX_APP_SOURCEDIR}/Contents/PkgInfo
2881- DESTINATION ${TARGETDIR}/blender.app/Contents
2882- )
2883-
2884- install_dir(
2885- ${OSX_APP_SOURCEDIR}/Contents/Resources
2886- \${TARGETDIR}/blender.app/Contents/
2887- )
2888-
2889- # python
2890- if(WITH_PYTHON AND NOT WITH_PYTHON_MODULE)
2891- # the python zip is first extract as part of the build process,
2892- # and then later installed as part of make install. this is much
2893- # quicker, and means we can easily exclude files on copy
2894- # Not needed for PYTHON_MODULE or WEB_PLUGIN due uses Pyhon framework
2895- add_custom_target(
2896- extractpyzip
2897- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/python)
2898-
2899- set(PYTHON_ZIP "python_${CMAKE_OSX_ARCHITECTURES}.zip")
2900-
2901- add_custom_command(
2902- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
2903- COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/python/
2904- COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/python/
2905- COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${CMAKE_CURRENT_BINARY_DIR}/python/
2906- DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
2907-
2908- add_dependencies(blender extractpyzip)
2909-
2910- # copy extracted python files
2911- install_dir(
2912- ${CMAKE_CURRENT_BINARY_DIR}/python
2913- \${TARGETDIR_VER}
2914- )
2915-
2916- endif()
2917-
2918- # install blenderplayer bundle - copy of blender.app above. re-using macros et al
2919- # note we are using OSX Bundle as base and copying Blender dummy bundle on top of it
2920- if(WITH_GAMEENGINE AND WITH_PLAYER)
2921- set(OSX_APP_PLAYER_SOURCEDIR ${CMAKE_SOURCE_DIR}/source/darwin/blenderplayer.app)
2922- set(PLAYER_SOURCEINFO ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Info.plist)
2923- set(PLAYER_TARGETDIR_VER ${TARGETDIR}/blenderplayer.app/Contents/MacOS/${BLENDER_VERSION})
2924-
2925-
2926- # important to make a clean install each time else old scripts get loaded.
2927- install(
2928- CODE
2929- "file(REMOVE_RECURSE ${PLAYER_TARGETDIR_VER})"
2930- )
2931-
2932- install(
2933- FILES ${OSX_APP_PLAYER_SOURCEDIR}/Contents/PkgInfo
2934- DESTINATION ${TARGETDIR}/blenderplayer.app/Contents
2935- )
2936-
2937- install_dir(
2938- ${OSX_APP_PLAYER_SOURCEDIR}/Contents/Resources
2939- \${TARGETDIR}/blenderplayer.app/Contents/
2940- )
2941-
2942- # python
2943- if(WITH_PYTHON)
2944- add_custom_command(
2945- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/python
2946- COMMAND rm -rf ${CMAKE_CURRENT_BINARY_DIR}/python/
2947- COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/python/
2948- COMMAND unzip -q ${LIBDIR}/release/${PYTHON_ZIP} -d ${CMAKE_CURRENT_BINARY_DIR}/python/
2949- DEPENDS ${LIBDIR}/release/${PYTHON_ZIP})
2950-
2951- # copy extracted python files
2952- install_dir(
2953- ${CMAKE_CURRENT_BINARY_DIR}/python
2954- \${PLAYER_TARGETDIR_VER}
2955- )
2956- endif()
2957-
2958- endif()
2959-endif()
2960-
2961-# -----------------------------------------------------------------------------
2962-# Generic Install, for all targets
2963-
2964-
2965-
2966-# install more files specified elsewhere
2967-delayed_do_install(${TARGETDIR_VER})
2968-
2969-unset(BLENDER_TEXT_FILES)
2970-
2971-
2972-# -----------------------------------------------------------------------------
2973-# Setup link libs
2974-
2975-add_dependencies(blender makesdna)
2976-
2977-get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS)
2978-
2979-set(BLENDER_LINK_LIBS
2980- ${BLENDER_LINK_LIBS}
2981- bf_windowmanager
2982- bf_render
2983-)
2984-
2985-if(WITH_MOD_FLUID)
2986- list(APPEND BLENDER_LINK_LIBS bf_intern_elbeem)
2987-endif()
2988-
2989-if(WITH_CYCLES)
2990- list(APPEND BLENDER_LINK_LIBS
2991- cycles_render
2992- cycles_bvh
2993- cycles_device
2994- cycles_kernel
2995- cycles_util
2996- cycles_subd)
2997-endif()
2998-
2999-#if(UNIX)
3000- # Sort libraries
3001- set(BLENDER_SORTED_LIBS
3002- bf_windowmanager
3003-
3004- bf_editor_space_api
3005- bf_editor_space_action
3006- bf_editor_space_buttons
3007- bf_editor_space_console
3008- bf_editor_space_file
3009- bf_editor_space_graph
3010- bf_editor_space_image
3011- bf_editor_space_info
3012- bf_editor_space_logic
3013- bf_editor_space_nla
3014- bf_editor_space_node
3015- bf_editor_space_outliner
3016- bf_editor_space_script
3017- bf_editor_space_sequencer
3018- bf_editor_space_time
3019- bf_editor_space_userpref
3020- bf_editor_space_view3d
3021- bf_editor_space_clip
3022-
3023- bf_editor_text
3024- bf_editor_transform
3025- bf_editor_util
3026- bf_editor_uvedit
3027- bf_editor_curve
3028- bf_editor_armature
3029- bf_editor_gpencil
3030- bf_editor_interface
3031- bf_editor_mesh
3032- bf_editor_metaball
3033- bf_editor_object
3034- bf_editor_physics
3035- bf_editor_render
3036- bf_editor_screen
3037- bf_editor_sculpt_paint
3038- bf_editor_sound
3039- bf_editor_animation
3040- bf_editor_datafiles
3041-
3042- bf_render
3043- bf_intern_opennl
3044- bf_python
3045- bf_python_ext
3046- bf_python_mathutils
3047- bf_python_bmesh
3048- bf_ikplugin
3049- bf_modifiers
3050- bf_bmesh
3051- bf_blenkernel
3052- bf_nodes
3053- bf_gpu
3054- bf_blenloader
3055- bf_imbuf
3056- bf_blenlib
3057- bf_intern_ghost
3058- bf_intern_string
3059- bf_blenpluginapi
3060- bf_avi
3061- bf_imbuf_cineon
3062- bf_imbuf_openexr
3063- bf_imbuf_dds
3064- bf_collada
3065- bf_intern_bsp
3066- bf_intern_bop
3067- bf_intern_decimate
3068- bf_intern_elbeem
3069- bf_intern_ik
3070- bf_intern_memutil
3071- bf_intern_guardedalloc
3072- bf_intern_ctr
3073- bf_intern_utfconv
3074- ge_blen_routines
3075- ge_converter
3076- ge_phys_dummy
3077- ge_phys_bullet
3078- bf_intern_smoke
3079- extern_minilzo
3080- extern_lzma
3081- extern_colamd
3082- ge_logic_ketsji
3083- extern_recastnavigation
3084- ge_phys_common
3085- ge_logic
3086- ge_rasterizer
3087- ge_oglrasterizer
3088- ge_logic_expressions
3089- ge_scenegraph
3090- ge_logic_network
3091- ge_logic_ngnetwork
3092- extern_bullet
3093- ge_logic_loopbacknetwork
3094- bf_intern_moto
3095- extern_openjpeg
3096- extern_redcode
3097- ge_videotex
3098- bf_rna
3099- bf_dna
3100- bf_blenfont
3101- bf_intern_audaspace
3102- bf_intern_mikktspace
3103- bf_intern_dualcon
3104- bf_intern_cycles
3105- cycles_render
3106- cycles_bvh
3107- cycles_device
3108- cycles_kernel
3109- cycles_util
3110- cycles_subd
3111- )
3112-
3113- if(WITH_LIBMV)
3114- list(APPEND BLENDER_SORTED_LIBS extern_libmv)
3115- endif()
3116-
3117- if(WITH_MOD_CLOTH_ELTOPO)
3118- list(APPEND BLENDER_SORTED_LIBS extern_eltopo)
3119- endif()
3120-
3121- if(WITH_BUILTIN_GLEW)
3122- list(APPEND BLENDER_SORTED_LIBS extern_glew)
3123- endif()
3124-
3125- if(WITH_BINRELOC)
3126- list(APPEND BLENDER_SORTED_LIBS extern_binreloc)
3127- endif()
3128-
3129- if(WITH_CXX_GUARDEDALLOC)
3130- list(APPEND BLENDER_SORTED_LIBS bf_intern_guardedalloc_cpp)
3131- endif()
3132-
3133- if(WITH_IK_ITASC)
3134- list(APPEND BLENDER_SORTED_LIBS bf_intern_itasc)
3135- endif()
3136-
3137- if(WITH_CODEC_QUICKTIME)
3138- list(APPEND BLENDER_SORTED_LIBS bf_quicktime)
3139- endif()
3140-
3141- if(WITH_CARVE)
3142- list(APPEND BLENDER_SORTED_LIBS extern_carve)
3143- endif()
3144-
3145- if(WITH_GHOST_XDND)
3146- list(APPEND BLENDER_SORTED_LIBS extern_xdnd)
3147- endif()
3148-
3149- foreach(SORTLIB ${BLENDER_SORTED_LIBS})
3150- set(REMLIB ${SORTLIB})
3151- foreach(SEARCHLIB ${BLENDER_LINK_LIBS})
3152- if(${SEARCHLIB} STREQUAL ${SORTLIB})
3153- set(REMLIB "")
3154- endif()
3155- endforeach()
3156- if(REMLIB)
3157- # message(STATUS "Removing library ${REMLIB} from blender linking because: not configured")
3158- list(APPEND REM_MSG ${REMLIB})
3159- list(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB})
3160- endif()
3161- endforeach()
3162- if(REM_MSG)
3163- list(SORT REM_MSG)
3164- message(STATUS "Blender Skipping: (${REM_MSG})")
3165- endif()
3166- target_link_libraries(blender ${BLENDER_SORTED_LIBS})
3167-
3168- unset(SEARCHLIB)
3169- unset(SORTLIB)
3170- unset(REMLIB)
3171- unset(REM_MSG)
3172-
3173-#else()
3174-# target_link_libraries(blender ${BLENDER_LINK_LIBS})
3175-#endif()
3176-
3177-setup_liblinks(blender)
3178
3179=== removed directory '.pc/0005-locales_directory_install.patch'
3180=== removed directory '.pc/0005-locales_directory_install.patch/source'
3181=== removed directory '.pc/0005-locales_directory_install.patch/source/blender'
3182=== removed directory '.pc/0005-locales_directory_install.patch/source/blender/blenfont'
3183=== removed directory '.pc/0005-locales_directory_install.patch/source/blender/blenfont/intern'
3184=== removed file '.pc/0005-locales_directory_install.patch/source/blender/blenfont/intern/blf_lang.c'
3185--- .pc/0005-locales_directory_install.patch/source/blender/blenfont/intern/blf_lang.c 2012-04-28 12:11:12 +0000
3186+++ .pc/0005-locales_directory_install.patch/source/blender/blenfont/intern/blf_lang.c 1970-01-01 00:00:00 +0000
3187@@ -1,303 +0,0 @@
3188-/*
3189- * ***** BEGIN GPL LICENSE BLOCK *****
3190- *
3191- * This program is free software; you can redistribute it and/or
3192- * modify it under the terms of the GNU General Public License
3193- * as published by the Free Software Foundation; either version 2
3194- * of the License, or (at your option) any later version.
3195- *
3196- * This program is distributed in the hope that it will be useful,
3197- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3198- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3199- * GNU General Public License for more details.
3200- *
3201- * You should have received a copy of the GNU General Public License
3202- * along with this program; if not, write to the Free Software Foundation,
3203- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
3204- *
3205- * The Original Code is Copyright (C) 2008 Blender Foundation.
3206- * All rights reserved.
3207- *
3208- * Contributor(s): Blender Foundation.
3209- *
3210- * ***** END GPL LICENSE BLOCK *****
3211- */
3212-
3213-/** \file blender/blenfont/intern/blf_lang.c
3214- * \ingroup blf
3215- */
3216-
3217-
3218-#include <stdio.h>
3219-#include <stdlib.h>
3220-#include <string.h>
3221-
3222-#include "BKE_global.h"
3223-
3224-#include "BLF_api.h"
3225-
3226-#include "BLF_translation.h" /* own include */
3227-
3228-#ifdef WITH_INTERNATIONAL
3229-
3230-#include <locale.h>
3231-
3232-#if defined (_WIN32)
3233-#include <windows.h>
3234-#endif
3235-
3236-#include "libintl.h"
3237-
3238-#include "DNA_userdef_types.h"
3239-
3240-#include "DNA_listBase.h"
3241-#include "DNA_vec_types.h"
3242-
3243-#include "MEM_guardedalloc.h"
3244-
3245-#include "BLI_linklist.h" /* linknode */
3246-#include "BLI_string.h"
3247-#include "BLI_utildefines.h"
3248-#include "BLI_path_util.h"
3249-
3250-#define SYSTEM_ENCODING_DEFAULT "UTF-8"
3251-#define FONT_SIZE_DEFAULT 12
3252-
3253-/* locale options. */
3254-static char global_messagepath[1024];
3255-static char global_language[32];
3256-static char global_encoding_name[32];
3257-
3258-/* map from the rna_userdef.c:rna_def_userdef_system(BlenderRNA *brna):language_items */
3259-static const char *locales[] = {
3260- "", "",
3261- "english", "en_US",
3262- "japanese", "ja_JP",
3263- "dutch", "nl_NL",
3264- "italian", "it_IT",
3265- "german", "de_DE",
3266- "finnish", "fi_FI",
3267- "swedish", "sv_SE",
3268- "french", "fr_FR",
3269- "spanish", "es",
3270- "catalan", "ca_AD",
3271- "czech", "cs_CZ",
3272- "ptb", "pt",
3273-#if defined (_WIN32) && !defined(FREE_WINDOWS)
3274- "Chinese (Simplified)_China.1252", "zh_CN",
3275- "Chinese (Traditional)_China.1252", "zh_TW",
3276-#else
3277- "chs", "zh_CN",
3278- "cht", "zh_TW",
3279-#endif
3280- "russian", "ru_RU",
3281- "croatian", "hr_HR",
3282- "serbian", "sr_RS",
3283- "ukrainian", "uk_UA",
3284- "polish", "pl_PL",
3285- "romanian", "ro_RO",
3286- "arabic", "ar_EG",
3287- "bulgarian", "bg_BG",
3288- "greek", "el_GR",
3289- "korean", "ko_KR",
3290- "nepali", "ne_NP",
3291- "persian", "fa_IR",
3292- "indonesian", "id_ID",
3293- "serbian (latin)", "sr_RS@latin",
3294- "kyrgyz", "ky_KG",
3295- "turkish", "tr_TR",
3296-};
3297-
3298-void BLF_lang_init(void)
3299-{
3300- char *messagepath = BLI_get_folder(BLENDER_DATAFILES, "locale");
3301-
3302- BLI_strncpy(global_encoding_name, SYSTEM_ENCODING_DEFAULT, sizeof(global_encoding_name));
3303-
3304- if (messagepath) {
3305- BLI_strncpy(global_messagepath, messagepath, sizeof(global_messagepath));
3306- }
3307- else {
3308- printf("%s: 'locale' data path for translations not found, continuing\n", __func__);
3309- global_messagepath[0] = '\0';
3310- }
3311-
3312-}
3313-
3314-/* get LANG/LANGUAGE environment variable */
3315-static void get_language_variable(const char *varname, char *var, int maxlen)
3316-{
3317- char *env = getenv(varname);
3318-
3319- if (env) {
3320- char *s;
3321-
3322- /* store defaul locale */
3323- BLI_strncpy(var, env, maxlen);
3324-
3325- /* use first language as default */
3326- s = strchr(var, ':');
3327- if (s)
3328- s[0] = 0;
3329- }
3330-}
3331-
3332-/* get language to be used based on locale(which might be empty when using default language) and
3333- * LANG environment variable
3334- */
3335-static void get_language(const char *locale, const char *lang, char *language, int maxlen)
3336-{
3337- if (locale[0]) {
3338- BLI_strncpy(language, locale, maxlen);
3339- }
3340- else {
3341- char *s;
3342-
3343- BLI_strncpy(language, lang, maxlen);
3344-
3345- s = strchr(language, '.');
3346- if (s)
3347- s[0] = 0;
3348- }
3349-}
3350-
3351-/* XXX WARNING!!! IN osx somehow the previous function call jumps in this one??? (ton, ppc) */
3352-void BLF_lang_set(const char *str)
3353-{
3354- char *locreturn;
3355- const char *short_locale;
3356- int ok = 1;
3357- const char *long_locale = locales[2 * U.language];
3358-
3359- if ((U.transopts&USER_DOTRANSLATE) == 0)
3360- return;
3361-
3362- if (str)
3363- short_locale = str;
3364- else
3365- short_locale = locales[ 2 * U.language + 1];
3366-
3367-#if defined (_WIN32) && !defined(FREE_WINDOWS)
3368- if (short_locale) {
3369- char *envStr;
3370-
3371- if (U.language == 0)/* use system setting */
3372- envStr = BLI_sprintfN( "LANG=%s", getenv("LANG") );
3373- else
3374- envStr = BLI_sprintfN( "LANG=%s", short_locale );
3375-
3376- gettext_putenv(envStr);
3377- MEM_freeN(envStr);
3378- }
3379-
3380- locreturn = setlocale(LC_ALL, long_locale);
3381-
3382- if (locreturn == NULL) {
3383- if (G.debug & G_DEBUG)
3384- printf("Could not change locale to %s\n", long_locale);
3385-
3386- ok = 0;
3387- }
3388-#else
3389- {
3390- static char default_lang[64] ="\0";
3391- static char default_language[64] ="\0";
3392-
3393- if (default_lang[0] == 0)
3394- get_language_variable("LANG", default_lang, sizeof(default_lang));
3395-
3396- if (default_language[0] == 0)
3397- get_language_variable("LANGUAGE", default_language, sizeof(default_language));
3398-
3399- if (short_locale[0]) {
3400- if (G.debug & G_DEBUG)
3401- printf("Setting LANG= and LANGUAGE to %s\n", short_locale);
3402-
3403- BLI_setenv("LANG", short_locale);
3404- BLI_setenv("LANGUAGE", short_locale);
3405- }
3406- else {
3407- if (G.debug & G_DEBUG)
3408- printf("Setting LANG=%s and LANGUAGE=%s\n", default_lang, default_language);
3409-
3410- BLI_setenv("LANG", default_lang);
3411- BLI_setenv("LANGUAGE", default_language);
3412- }
3413-
3414- locreturn = setlocale(LC_ALL, short_locale);
3415-
3416- if (locreturn == NULL) {
3417- char *short_locale_utf8 = NULL;
3418-
3419- if (short_locale[0]) {
3420- short_locale_utf8 = BLI_sprintfN("%s.UTF-8", short_locale);
3421- locreturn = setlocale(LC_ALL, short_locale_utf8);
3422- }
3423-
3424- if (locreturn == NULL) {
3425- char language[65];
3426-
3427- get_language(long_locale, default_lang, language, sizeof(language));
3428-
3429- if (G.debug & G_DEBUG) {
3430- if (short_locale[0])
3431- printf("Could not change locale to %s nor %s\n", short_locale, short_locale_utf8);
3432- else
3433- printf("Could not reset locale\n");
3434-
3435- printf("Fallback to LANG=%s and LANGUAGE=%s\n", default_lang, language);
3436- }
3437-
3438- /* fallback to default settings */
3439- BLI_setenv("LANG", default_lang);
3440- BLI_setenv("LANGUAGE", language);
3441-
3442- locreturn = setlocale(LC_ALL, "");
3443-
3444- ok = 0;
3445- }
3446-
3447- if (short_locale_utf8)
3448- MEM_freeN(short_locale_utf8);
3449- }
3450- }
3451-#endif
3452-
3453- if (ok) {
3454- /*printf("Change locale to %s\n", locreturn ); */
3455- BLI_strncpy(global_language, locreturn, sizeof(global_language));
3456- }
3457-
3458- setlocale(LC_NUMERIC, "C");
3459-
3460- textdomain(TEXT_DOMAIN_NAME);
3461- bindtextdomain(TEXT_DOMAIN_NAME, global_messagepath);
3462- bind_textdomain_codeset(TEXT_DOMAIN_NAME, global_encoding_name);
3463-}
3464-
3465-void BLF_lang_encoding(const char *str)
3466-{
3467- BLI_strncpy(global_encoding_name, str, sizeof(global_encoding_name));
3468- /* bind_textdomain_codeset(TEXT_DOMAIN_NAME, encoding_name); */
3469-}
3470-
3471-#else /* ! WITH_INTERNATIONAL */
3472-
3473-void BLF_lang_init(void)
3474-{
3475- return;
3476-}
3477-
3478-void BLF_lang_encoding(const char *str)
3479-{
3480- (void)str;
3481- return;
3482-}
3483-
3484-void BLF_lang_set(const char *str)
3485-{
3486- (void)str;
3487- return;
3488-}
3489-
3490-#endif /* WITH_INTERNATIONAL */
3491
3492=== removed directory '.pc/0005-locales_directory_install.patch/source/blender/blenlib'
3493=== removed file '.pc/0005-locales_directory_install.patch/source/blender/blenlib/BLI_path_util.h'
3494--- .pc/0005-locales_directory_install.patch/source/blender/blenlib/BLI_path_util.h 2012-04-28 12:11:12 +0000
3495+++ .pc/0005-locales_directory_install.patch/source/blender/blenlib/BLI_path_util.h 1970-01-01 00:00:00 +0000
3496@@ -1,192 +0,0 @@
3497-/*
3498- * ***** BEGIN GPL LICENSE BLOCK *****
3499- *
3500- * This program is free software; you can redistribute it and/or
3501- * modify it under the terms of the GNU General Public License
3502- * as published by the Free Software Foundation; either version 2
3503- * of the License, or (at your option) any later version.
3504- *
3505- * This program is distributed in the hope that it will be useful,
3506- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3507- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3508- * GNU General Public License for more details.
3509- *
3510- * You should have received a copy of the GNU General Public License
3511- * along with this program; if not, write to the Free Software Foundation,
3512- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
3513- *
3514- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
3515- * All rights reserved.
3516- *
3517- * The Original Code is: all of this file.
3518- *
3519- * Contributor(s): none yet.
3520- *
3521- * ***** END GPL LICENSE BLOCK *****
3522- */
3523-#ifndef __BLI_PATH_UTIL_H__
3524-#define __BLI_PATH_UTIL_H__
3525-
3526-/** \file BLI_path_util.h
3527- * \ingroup bli
3528- */
3529-
3530-#ifdef __cplusplus
3531-extern "C" {
3532-#endif
3533-
3534-struct ListBase;
3535-struct direntry;
3536-
3537-const char *BLI_getDefaultDocumentFolder(void);
3538-
3539-char *BLI_get_folder(int folder_id, const char *subfolder);
3540-char *BLI_get_folder_create(int folder_id, const char *subfolder);
3541-char *BLI_get_user_folder_notest(int folder_id, const char *subfolder);
3542-char *BLI_get_folder_version(const int id, const int ver, const int do_check);
3543-
3544-/* folder_id */
3545-
3546-/* general, will find based on user/local/system priority */
3547-#define BLENDER_DATAFILES 2
3548-
3549-/* user-specific */
3550-#define BLENDER_USER_CONFIG 31
3551-#define BLENDER_USER_DATAFILES 32
3552-#define BLENDER_USER_SCRIPTS 33
3553-#define BLENDER_USER_PLUGINS 34
3554-#define BLENDER_USER_AUTOSAVE 35
3555-
3556-/* system */
3557-#define BLENDER_SYSTEM_DATAFILES 52
3558-#define BLENDER_SYSTEM_SCRIPTS 53
3559-#define BLENDER_SYSTEM_PLUGINS 54
3560-#define BLENDER_SYSTEM_PYTHON 54
3561-
3562-/* for BLI_get_folder_version only */
3563-#define BLENDER_RESOURCE_PATH_USER 0
3564-#define BLENDER_RESOURCE_PATH_LOCAL 1
3565-#define BLENDER_RESOURCE_PATH_SYSTEM 2
3566-
3567-#define BLENDER_STARTUP_FILE "startup.blend"
3568-#define BLENDER_BOOKMARK_FILE "bookmarks.txt"
3569-#define BLENDER_HISTORY_FILE "recent-files.txt"
3570-
3571-#ifdef WIN32
3572-#define SEP '\\'
3573-#define ALTSEP '/'
3574-#else
3575-#define SEP '/'
3576-#define ALTSEP '\\'
3577-#endif
3578-
3579-void BLI_setenv(const char *env, const char *val);
3580-void BLI_setenv_if_new(const char *env, const char* val);
3581-
3582-void BLI_make_file_string(const char *relabase, char *string, const char *dir, const char *file);
3583-void BLI_make_exist(char *dir);
3584-void BLI_make_existing_file(const char *name);
3585-void BLI_split_dirfile(const char *string, char *dir, char *file, const size_t dirlen, const size_t filelen);
3586-void BLI_split_dir_part(const char *string, char *dir, const size_t dirlen);
3587-void BLI_split_file_part(const char *string, char *file, const size_t filelen);
3588-void BLI_join_dirfile(char *string, const size_t maxlen, const char *dir, const char *file);
3589-char *BLI_path_basename(char *path);
3590-int BKE_rebase_path(char *abs, size_t abs_len, char *rel, size_t rel_len, const char *base_dir, const char *src_dir, const char *dest_dir);
3591-char *BLI_last_slash(const char *string);
3592-int BLI_add_slash(char *string);
3593-void BLI_del_slash(char *string);
3594-char *BLI_first_slash(char *string);
3595-
3596-void BLI_getlastdir(const char* dir, char *last, const size_t maxlen);
3597-int BLI_testextensie(const char *str, const char *ext);
3598-int BLI_testextensie_array(const char *str, const char **ext_array);
3599-int BLI_testextensie_glob(const char *str, const char *ext_fnmatch);
3600-int BLI_replace_extension(char *path, size_t maxlen, const char *ext);
3601-int BLI_ensure_extension(char *path, size_t maxlen, const char *ext);
3602-void BLI_uniquename(struct ListBase *list, void *vlink, const char defname[], char delim, short name_offs, short len);
3603-int BLI_uniquename_cb(int (*unique_check)(void *, const char *), void *arg, const char defname[], char delim, char *name, short name_len);
3604-void BLI_newname(char * name, int add);
3605-int BLI_stringdec(const char *string, char *head, char *start, unsigned short *numlen);
3606-void BLI_stringenc(char *string, const char *head, const char *tail, unsigned short numlen, int pic);
3607-int BLI_split_name_num(char *left, int *nr, const char *name, const char delim);
3608-void BLI_splitdirstring(char *di,char *fi);
3609-
3610-/* make sure path separators conform to system one */
3611-void BLI_clean(char *path);
3612-
3613-/**
3614- * dir can be any input, like from buttons, and this function
3615- * converts it to a regular full path.
3616- * Also removes garbage from directory paths, like /../ or double slashes etc
3617- */
3618-void BLI_cleanup_file(const char *relabase, char *dir); /* removes trailing slash */
3619-void BLI_cleanup_dir(const char *relabase, char *dir); /* same as above but adds a trailing slash */
3620-void BLI_cleanup_path(const char *relabase, char *dir); /* doesn't touch trailing slash */
3621-
3622-/* go back one directory */
3623-int BLI_parent_dir(char *path);
3624-
3625-/* return whether directory is root and thus has no parent dir */
3626-int BLI_has_parent(char *path);
3627-
3628-/**
3629- * Blender's path code replacement function.
3630- * Bases \a path strings leading with "//" by the
3631- * directory \a basepath, and replaces instances of
3632- * '#' with the \a framenum. Results are written
3633- * back into \a path.
3634- *
3635- * \a path The path to convert
3636- * \a basepath The directory to base relative paths with.
3637- * \a framenum The framenumber to replace the frame code with.
3638- * \retval Returns true if the path was relative (started with "//").
3639- */
3640-int BLI_path_abs(char *path, const char *basepath);
3641-int BLI_path_frame(char *path, int frame, int digits);
3642-int BLI_path_frame_range(char *path, int sta, int end, int digits);
3643-int BLI_path_cwd(char *path);
3644-void BLI_path_rel(char *file, const char *relfile);
3645-
3646-#ifdef WIN32
3647-# define BLI_path_cmp BLI_strcasecmp
3648-# define BLI_path_ncmp BLI_strncasecmp
3649-#else
3650-# define BLI_path_cmp strcmp
3651-# define BLI_path_ncmp strncmp
3652-#endif
3653-
3654-/**
3655- * Change every \a from in \a string into \a to. The
3656- * result will be in \a string
3657- *
3658- * \a string The string to work on
3659- * \a from The character to replace
3660- * \a to The character to replace with
3661- */
3662-void BLI_char_switch(char *string, char from, char to);
3663-
3664- /* Initialize path to program executable */
3665-void BLI_init_program_path(const char *argv0);
3666- /* Initialize path to temporary directory.
3667- * NOTE: On Window userdir will be set to the temporary directory! */
3668-void BLI_init_temporary_dir(char *userdir);
3669-
3670- /* Path to executable */
3671-const char *BLI_program_path(void);
3672- /* Path to directory of executable */
3673-const char *BLI_program_dir(void);
3674- /* Path to temporary directory (with trailing slash) */
3675-const char *BLI_temporary_dir(void);
3676- /* Path to the system temporary directory (with trailing slash) */
3677-void BLI_system_temporary_dir(char *dir);
3678-
3679-#ifdef WITH_ICONV
3680-void BLI_string_to_utf8(char *original, char *utf_8, const char *code);
3681-#endif
3682-
3683-#ifdef __cplusplus
3684-}
3685-#endif
3686-
3687-#endif
3688-
3689
3690=== removed directory '.pc/0005-locales_directory_install.patch/source/blender/blenlib/intern'
3691=== removed file '.pc/0005-locales_directory_install.patch/source/blender/blenlib/intern/path_util.c'
3692--- .pc/0005-locales_directory_install.patch/source/blender/blenlib/intern/path_util.c 2012-04-28 12:11:12 +0000
3693+++ .pc/0005-locales_directory_install.patch/source/blender/blenlib/intern/path_util.c 1970-01-01 00:00:00 +0000
3694@@ -1,1981 +0,0 @@
3695-/*
3696- * ***** BEGIN GPL LICENSE BLOCK *****
3697- *
3698- * This program is free software; you can redistribute it and/or
3699- * modify it under the terms of the GNU General Public License
3700- * as published by the Free Software Foundation; either version 2
3701- * of the License, or (at your option) any later version.
3702- *
3703- * This program is distributed in the hope that it will be useful,
3704- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3705- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3706- * GNU General Public License for more details.
3707- *
3708- * You should have received a copy of the GNU General Public License
3709- * along with this program; if not, write to the Free Software Foundation,
3710- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
3711- *
3712- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
3713- * All rights reserved.
3714- *
3715- * The Original Code is: all of this file.
3716- *
3717- * Contributor(s): none yet.
3718- *
3719- * ***** END GPL LICENSE BLOCK *****
3720- *
3721- * various string, file, list operations.
3722- */
3723-
3724-/** \file blender/blenlib/intern/path_util.c
3725- * \ingroup bli
3726- */
3727-
3728-
3729-#include <ctype.h>
3730-#include <string.h>
3731-#include <stdlib.h>
3732-#include <assert.h>
3733-
3734-#include "MEM_guardedalloc.h"
3735-
3736-#include "DNA_listBase.h"
3737-
3738-#include "BLI_fileops.h"
3739-#include "BLI_path_util.h"
3740-#include "BLI_string.h"
3741-#include "BLI_string_utf8.h"
3742-#include "BLI_utildefines.h"
3743-
3744-#include "BKE_utildefines.h"
3745-#include "BKE_blender.h" // BLENDER_VERSION
3746-
3747-#include "GHOST_Path-api.h"
3748-
3749-#if defined WIN32 && !defined _LIBC || defined __sun
3750-# include "BLI_fnmatch.h" /* use fnmatch included in blenlib */
3751-#else
3752-# ifndef _GNU_SOURCE
3753-# define _GNU_SOURCE
3754-# endif
3755-# include <fnmatch.h>
3756-#endif
3757-
3758-#ifdef WIN32
3759-#include "utf_winfunc.h"
3760-# include <io.h>
3761-# ifdef _WIN32_IE
3762-# undef _WIN32_IE
3763-# endif
3764-# define _WIN32_IE 0x0501
3765-# include <windows.h>
3766-# include <shlobj.h>
3767-# include "BLI_winstuff.h"
3768-#else /* non windows */
3769-# ifdef WITH_BINRELOC
3770-# include "binreloc.h"
3771-# endif
3772-#endif /* WIN32 */
3773-
3774-/* standard paths */
3775-#ifdef WIN32
3776-# define BLENDER_USER_FORMAT "%s\\Blender Foundation\\Blender\\%s"
3777-# define BLENDER_SYSTEM_FORMAT "%s\\Blender Foundation\\Blender\\%s"
3778-#elif defined(__APPLE__)
3779-# define BLENDER_USER_FORMAT "%s/Blender/%s"
3780-# define BLENDER_SYSTEM_FORMAT "%s/Blender/%s"
3781-#else /* UNIX */
3782-# ifndef WITH_XDG_USER_DIRS /* oldschool unix ~/.blender/ */
3783-# define BLENDER_USER_FORMAT "%s/.blender/%s"
3784-# else /* new XDG ~/blender/.config/ */
3785-# define BLENDER_USER_FORMAT "%s/blender/%s"
3786-# endif // WITH_XDG_USER_DIRS
3787-# define BLENDER_SYSTEM_FORMAT "%s/blender/%s"
3788-#endif
3789-
3790-/* local */
3791-#define UNIQUE_NAME_MAX 128
3792-
3793-static char bprogname[FILE_MAX]; /* path to program executable */
3794-static char bprogdir[FILE_MAX]; /* path in which executable is located */
3795-static char btempdir[FILE_MAX]; /* temporary directory */
3796-
3797-static int add_win32_extension(char *name);
3798-static char *blender_version_decimal(const int ver);
3799-
3800-/* implementation */
3801-
3802-int BLI_stringdec(const char *string, char *head, char *tail, unsigned short *numlen)
3803-{
3804- unsigned short len, len2, lenlslash = 0, nums = 0, nume = 0;
3805- short i, found = 0;
3806- char *lslash = BLI_last_slash(string);
3807- len2 = len = strlen(string);
3808- if (lslash)
3809- lenlslash= (int)(lslash - string);
3810-
3811- while (len > lenlslash && string[--len] != '.') {};
3812- if (len == lenlslash && string[len] != '.') len = len2;
3813-
3814- for (i = len - 1; i >= lenlslash; i--) {
3815- if (isdigit(string[i])) {
3816- if (found) {
3817- nums = i;
3818- }
3819- else {
3820- nume = i;
3821- nums = i;
3822- found = 1;
3823- }
3824- }
3825- else {
3826- if (found) break;
3827- }
3828- }
3829- if (found) {
3830- if (tail) strcpy(tail, &string[nume+1]);
3831- if (head) {
3832- strcpy(head,string);
3833- head[nums]=0;
3834- }
3835- if (numlen) *numlen = nume-nums+1;
3836- return ((int)atoi(&(string[nums])));
3837- }
3838- if (tail) strcpy(tail, string + len);
3839- if (head) {
3840- strncpy(head, string, len);
3841- head[len] = '\0';
3842- }
3843- if (numlen) *numlen=0;
3844- return 0;
3845-}
3846-
3847-
3848-void BLI_stringenc(char *string, const char *head, const char *tail, unsigned short numlen, int pic)
3849-{
3850- char fmtstr[16]="";
3851- if (pic < 0) pic= 0;
3852- sprintf(fmtstr, "%%s%%.%dd%%s", numlen);
3853- sprintf(string, fmtstr, head, pic, tail);
3854-}
3855-
3856-/* Foo.001 -> "Foo", 1
3857- * Returns the length of "Foo" */
3858-int BLI_split_name_num(char *left, int *nr, const char *name, const char delim)
3859-{
3860- int a;
3861-
3862- *nr= 0;
3863- a= strlen(name);
3864- memcpy(left, name, (a + 1) * sizeof(char));
3865-
3866- if (a>1 && name[a-1]==delim) return a;
3867-
3868- while (a--) {
3869- if ( name[a]==delim ) {
3870- left[a]= 0;
3871- *nr= atol(name+a+1);
3872- /* casting down to an int, can overflow for large numbers */
3873- if (*nr < 0)
3874- *nr= 0;
3875- return a;
3876- }
3877- if ( isdigit(name[a])==0 ) break;
3878-
3879- left[a]= 0;
3880- }
3881-
3882- for (a= 0; name[a]; a++)
3883- left[a]= name[a];
3884-
3885- return a;
3886-}
3887-
3888-void BLI_newname(char *name, int add)
3889-{
3890- char head[UNIQUE_NAME_MAX], tail[UNIQUE_NAME_MAX];
3891- int pic;
3892- unsigned short digits;
3893-
3894- pic = BLI_stringdec(name, head, tail, &digits);
3895-
3896- /* are we going from 100 -> 99 or from 10 -> 9 */
3897- if (add < 0 && digits < 4 && digits > 0) {
3898- int i, exp;
3899- exp = 1;
3900- for (i = digits; i > 1; i--) exp *= 10;
3901- if (pic >= exp && (pic + add) < exp) digits--;
3902- }
3903-
3904- pic += add;
3905-
3906- if (digits==4 && pic<0) pic= 0;
3907- BLI_stringenc(name, head, tail, digits, pic);
3908-}
3909-
3910-
3911-
3912-int BLI_uniquename_cb(int (*unique_check)(void *, const char *), void *arg, const char defname[], char delim, char *name, short name_len)
3913-{
3914- if (name[0] == '\0') {
3915- BLI_strncpy(name, defname, name_len);
3916- }
3917-
3918- if (unique_check(arg, name)) {
3919- char numstr[16];
3920- char tempname[UNIQUE_NAME_MAX];
3921- char left[UNIQUE_NAME_MAX];
3922- int number;
3923- int len= BLI_split_name_num(left, &number, name, delim);
3924- do {
3925- int numlen= BLI_snprintf(numstr, sizeof(numstr), "%c%03d", delim, ++number);
3926-
3927- /* highly unlikely the string only has enough room for the number
3928- * but support anyway */
3929- if ((len == 0) || (numlen >= name_len)) {
3930- /* number is know not to be utf-8 */
3931- BLI_strncpy(tempname, numstr, name_len);
3932- }
3933- else {
3934- char *tempname_buf;
3935- tempname[0]= '\0';
3936- tempname_buf = BLI_strncat_utf8(tempname, left, name_len - numlen);
3937- memcpy(tempname_buf, numstr, numlen + 1);
3938- }
3939- } while (unique_check(arg, tempname));
3940-
3941- BLI_strncpy(name, tempname, name_len);
3942-
3943- return 1;
3944- }
3945-
3946- return 0;
3947-}
3948-
3949-/* little helper macro for BLI_uniquename */
3950-#ifndef GIVE_STRADDR
3951- #define GIVE_STRADDR(data, offset) ( ((char *)data) + offset )
3952-#endif
3953-
3954-/* Generic function to set a unique name. It is only designed to be used in situations
3955- * where the name is part of the struct, and also that the name is at most UNIQUE_NAME_MAX chars long.
3956- *
3957- * For places where this is used, see constraint.c for example...
3958- *
3959- * name_offs: should be calculated using offsetof(structname, membername) macro from stddef.h
3960- * len: maximum length of string (to prevent overflows, etc.)
3961- * defname: the name that should be used by default if none is specified already
3962- * delim: the character which acts as a delimiter between parts of the name
3963- */
3964-static int uniquename_find_dupe(ListBase *list, void *vlink, const char *name, short name_offs)
3965-{
3966- Link *link;
3967-
3968- for (link = list->first; link; link= link->next) {
3969- if (link != vlink) {
3970- if (!strcmp(GIVE_STRADDR(link, name_offs), name)) {
3971- return 1;
3972- }
3973- }
3974- }
3975-
3976- return 0;
3977-}
3978-
3979-static int uniquename_unique_check(void *arg, const char *name)
3980-{
3981- struct {ListBase *lb; void *vlink; short name_offs;} *data= arg;
3982- return uniquename_find_dupe(data->lb, data->vlink, name, data->name_offs);
3983-}
3984-
3985-void BLI_uniquename(ListBase *list, void *vlink, const char defname[], char delim, short name_offs, short name_len)
3986-{
3987- struct {ListBase *lb; void *vlink; short name_offs;} data;
3988- data.lb= list;
3989- data.vlink= vlink;
3990- data.name_offs= name_offs;
3991-
3992- assert((name_len > 1) && (name_len <= UNIQUE_NAME_MAX));
3993-
3994- /* See if we are given an empty string */
3995- if (ELEM(NULL, vlink, defname))
3996- return;
3997-
3998- BLI_uniquename_cb(uniquename_unique_check, &data, defname, delim, GIVE_STRADDR(vlink, name_offs), name_len);
3999-}
4000-
4001-
4002-
4003-/* ******************** string encoding ***************** */
4004-
4005-/* This is quite an ugly function... its purpose is to
4006- * take the dir name, make it absolute, and clean it up, replacing
4007- * excess file entry stuff (like /tmp/../tmp/../)
4008- * note that dir isn't protected for max string names...
4009- *
4010- * If relbase is NULL then its ignored
4011- */
4012-
4013-void BLI_cleanup_path(const char *relabase, char *dir)
4014-{
4015- ptrdiff_t a;
4016- char *start, *eind;
4017- if (relabase) {
4018- BLI_path_abs(dir, relabase);
4019- }
4020- else {
4021- if (dir[0]=='/' && dir[1]=='/') {
4022- if (dir[2]== '\0') {
4023- return; /* path is "//" - cant clean it */
4024- }
4025- dir = dir+2; /* skip the first // */
4026- }
4027- }
4028-
4029- /* Note
4030- * memmove(start, eind, strlen(eind) + 1);
4031- * is the same as
4032- * strcpy( start, eind );
4033- * except strcpy should not be used because there is overlap,
4034- * so use memmove's slightly more obscure syntax - Campbell
4035- */
4036-
4037-#ifdef WIN32
4038-
4039- /* Note, this should really be moved to the file selector,
4040- * since this function is used in many areas */
4041- if (strcmp(dir, ".")==0) { /* happens for example in FILE_MAIN */
4042- get_default_root(dir);
4043- return;
4044- }
4045-
4046- while ( (start = strstr(dir, "\\..\\")) ) {
4047- eind = start + strlen("\\..\\") - 1;
4048- a = start-dir-1;
4049- while (a>0) {
4050- if (dir[a] == '\\') break;
4051- a--;
4052- }
4053- if (a<0) {
4054- break;
4055- }
4056- else {
4057- memmove(dir + a, eind, strlen(eind) + 1);
4058- }
4059- }
4060-
4061- while ( (start = strstr(dir,"\\.\\")) ) {
4062- eind = start + strlen("\\.\\") - 1;
4063- memmove(start, eind, strlen(eind) + 1);
4064- }
4065-
4066- while ( (start = strstr(dir,"\\\\" )) ) {
4067- eind = start + strlen("\\\\") - 1;
4068- memmove(start, eind, strlen(eind) + 1);
4069- }
4070-#else
4071- if (dir[0]=='.') { /* happens, for example in FILE_MAIN */
4072- dir[0]= '/';
4073- dir[1]= 0;
4074- return;
4075- }
4076-
4077- /* support for odd paths: eg /../home/me --> /home/me
4078- * this is a valid path in blender but we cant handle this the usual way below
4079- * simply strip this prefix then evaluate the path as usual. pythons os.path.normpath() does this */
4080- while ((strncmp(dir, "/../", 4)==0)) {
4081- memmove(dir, dir + 4, strlen(dir + 4) + 1);
4082- }
4083-
4084- while ( (start = strstr(dir, "/../")) ) {
4085- eind = start + (4 - 1) /* strlen("/../") - 1 */;
4086- a = start-dir-1;
4087- while (a>0) {
4088- if (dir[a] == '/') break;
4089- a--;
4090- }
4091- if (a<0) {
4092- break;
4093- }
4094- else {
4095- memmove(dir+a, eind, strlen(eind) + 1);
4096- }
4097- }
4098-
4099- while ( (start = strstr(dir,"/./")) ) {
4100- eind = start + (3 - 1) /* strlen("/./") - 1 */;
4101- memmove(start, eind, strlen(eind) + 1);
4102- }
4103-
4104- while ( (start = strstr(dir,"//" )) ) {
4105- eind = start + (2 - 1) /* strlen("//") - 1 */;
4106- memmove(start, eind, strlen(eind) + 1);
4107- }
4108-#endif
4109-}
4110-
4111-void BLI_cleanup_dir(const char *relabase, char *dir)
4112-{
4113- BLI_cleanup_path(relabase, dir);
4114- BLI_add_slash(dir);
4115-
4116-}
4117-
4118-void BLI_cleanup_file(const char *relabase, char *dir)
4119-{
4120- BLI_cleanup_path(relabase, dir);
4121- BLI_del_slash(dir);
4122-}
4123-
4124-void BLI_path_rel(char *file, const char *relfile)
4125-{
4126- char * lslash;
4127- char temp[FILE_MAX];
4128- char res[FILE_MAX];
4129-
4130- /* if file is already relative, bail out */
4131- if (file[0]=='/' && file[1]=='/') return;
4132-
4133- /* also bail out if relative path is not set */
4134- if (relfile[0] == 0) return;
4135-
4136-#ifdef WIN32
4137- if (BLI_strnlen(relfile, 3) > 2 && relfile[1] != ':') {
4138- char* ptemp;
4139- /* fix missing volume name in relative base,
4140- * can happen with old recent-files.txt files */
4141- get_default_root(temp);
4142- ptemp = &temp[2];
4143- if (relfile[0] != '\\' && relfile[0] != '/') {
4144- ptemp++;
4145- }
4146- BLI_strncpy(ptemp, relfile, FILE_MAX-3);
4147- }
4148- else {
4149- BLI_strncpy(temp, relfile, FILE_MAX);
4150- }
4151-
4152- if (BLI_strnlen(file, 3) > 2) {
4153- if ( temp[1] == ':' && file[1] == ':' && temp[0] != file[0] )
4154- return;
4155- }
4156-#else
4157- BLI_strncpy(temp, relfile, FILE_MAX);
4158-#endif
4159-
4160- BLI_char_switch(temp, '\\', '/');
4161- BLI_char_switch(file, '\\', '/');
4162-
4163- /* remove /./ which confuse the following slash counting... */
4164- BLI_cleanup_path(NULL, file);
4165- BLI_cleanup_path(NULL, temp);
4166-
4167- /* the last slash in the file indicates where the path part ends */
4168- lslash = BLI_last_slash(temp);
4169-
4170- if (lslash) {
4171- /* find the prefix of the filename that is equal for both filenames.
4172- * This is replaced by the two slashes at the beginning */
4173- char *p= temp;
4174- char *q= file;
4175-
4176-#ifdef WIN32
4177- while (tolower(*p) == tolower(*q))
4178-#else
4179- while (*p == *q)
4180-#endif
4181- {
4182- ++p; ++q;
4183- /* don't search beyond the end of the string
4184- * in the rare case they match */
4185- if ((*p=='\0') || (*q=='\0')) {
4186- break;
4187- }
4188- }
4189-
4190- /* we might have passed the slash when the beginning of a dir matches
4191- * so we rewind. Only check on the actual filename
4192- */
4193- if (*q != '/') {
4194- while ( (q >= file) && (*q != '/') ) { --q; --p; }
4195- }
4196- else if (*p != '/') {
4197- while ( (p >= temp) && (*p != '/') ) { --p; --q; }
4198- }
4199-
4200- strcpy(res, "//");
4201-
4202- /* p now points to the slash that is at the beginning of the part
4203- * where the path is different from the relative path.
4204- * We count the number of directories we need to go up in the
4205- * hierarchy to arrive at the common 'prefix' of the path
4206- */
4207- while (p && p < lslash) {
4208- if (*p == '/')
4209- strcat(res, "../");
4210- ++p;
4211- }
4212-
4213- strcat(res, q+1); /* don't copy the slash at the beginning */
4214-
4215-#ifdef WIN32
4216- BLI_char_switch(res+2, '/', '\\');
4217-#endif
4218- strcpy(file, res);
4219- }
4220-}
4221-
4222-int BLI_has_parent(char *path)
4223-{
4224- int len;
4225- int slashes = 0;
4226- BLI_clean(path);
4227- len = BLI_add_slash(path) - 1;
4228-
4229- while (len>=0) {
4230- if ((path[len] == '\\') || (path[len] == '/'))
4231- slashes++;
4232- len--;
4233- }
4234- return slashes > 1;
4235-}
4236-
4237-int BLI_parent_dir(char *path)
4238-{
4239- static char parent_dir[]= {'.', '.', SEP, '\0'}; /* "../" or "..\\" */
4240- char tmp[FILE_MAX+4];
4241- BLI_strncpy(tmp, path, sizeof(tmp)-4);
4242- BLI_add_slash(tmp);
4243- strcat(tmp, parent_dir);
4244- BLI_cleanup_dir(NULL, tmp);
4245-
4246- if (!BLI_testextensie(tmp, parent_dir)) {
4247- BLI_strncpy(path, tmp, sizeof(tmp));
4248- return 1;
4249- }
4250- else {
4251- return 0;
4252- }
4253-}
4254-
4255-static int stringframe_chars(char *path, int *char_start, int *char_end)
4256-{
4257- int ch_sta, ch_end, i;
4258- /* Insert current frame: file### -> file001 */
4259- ch_sta = ch_end = 0;
4260- for (i = 0; path[i] != '\0'; i++) {
4261- if (path[i] == '\\' || path[i] == '/') {
4262- ch_end = 0; /* this is a directory name, don't use any hashes we found */
4263- }
4264- else if (path[i] == '#') {
4265- ch_sta = i;
4266- ch_end = ch_sta+1;
4267- while (path[ch_end] == '#') {
4268- ch_end++;
4269- }
4270- i = ch_end-1; /* keep searching */
4271-
4272- /* don't break, there may be a slash after this that invalidates the previous #'s */
4273- }
4274- }
4275-
4276- if (ch_end) {
4277- *char_start= ch_sta;
4278- *char_end= ch_end;
4279- return 1;
4280- }
4281- else {
4282- *char_start= -1;
4283- *char_end= -1;
4284- return 0;
4285- }
4286-}
4287-
4288-static void ensure_digits(char *path, int digits)
4289-{
4290- char *file= BLI_last_slash(path);
4291-
4292- if (file==NULL)
4293- file= path;
4294-
4295- if (strrchr(file, '#') == NULL) {
4296- int len= strlen(file);
4297-
4298- while (digits--) {
4299- file[len++]= '#';
4300- }
4301- file[len]= '\0';
4302- }
4303-}
4304-
4305-int BLI_path_frame(char *path, int frame, int digits)
4306-{
4307- int ch_sta, ch_end;
4308-
4309- if (digits)
4310- ensure_digits(path, digits);
4311-
4312- if (stringframe_chars(path, &ch_sta, &ch_end)) { /* warning, ch_end is the last # +1 */
4313- char tmp[FILE_MAX];
4314- sprintf(tmp, "%.*s%.*d%s", ch_sta, path, ch_end-ch_sta, frame, path+ch_end);
4315- strcpy(path, tmp);
4316- return 1;
4317- }
4318- return 0;
4319-}
4320-
4321-int BLI_path_frame_range(char *path, int sta, int end, int digits)
4322-{
4323- int ch_sta, ch_end;
4324-
4325- if (digits)
4326- ensure_digits(path, digits);
4327-
4328- if (stringframe_chars(path, &ch_sta, &ch_end)) { /* warning, ch_end is the last # +1 */
4329- char tmp[FILE_MAX];
4330- BLI_snprintf(tmp, sizeof(tmp),
4331- "%.*s%.*d-%.*d%s",
4332- ch_sta, path, ch_end-ch_sta, sta, ch_end-ch_sta, end, path+ch_end);
4333- BLI_strncpy(path, tmp, FILE_MAX);
4334- return 1;
4335- }
4336- return 0;
4337-}
4338-
4339-int BLI_path_abs(char *path, const char *basepath)
4340-{
4341- int wasrelative = (strncmp(path, "//", 2)==0);
4342- char tmp[FILE_MAX];
4343- char base[FILE_MAX];
4344-#ifdef WIN32
4345- char vol[3] = {'\0', '\0', '\0'};
4346-
4347- BLI_strncpy(vol, path, 3);
4348- /* we are checking here if we have an absolute path that is not in the current
4349- * blend file as a lib main - we are basically checking for the case that a
4350- * UNIX root '/' is passed.
4351- */
4352- if (!wasrelative && (vol[1] != ':' && (vol[0] == '\0' || vol[0] == '/' || vol[0] == '\\'))) {
4353- char *p = path;
4354- get_default_root(tmp);
4355- // get rid of the slashes at the beginning of the path
4356- while (*p == '\\' || *p == '/') {
4357- p++;
4358- }
4359- strcat(tmp, p);
4360- }
4361- else {
4362- BLI_strncpy(tmp, path, FILE_MAX);
4363- }
4364-#else
4365- BLI_strncpy(tmp, path, sizeof(tmp));
4366-
4367- /* Check for loading a windows path on a posix system
4368- * in this case, there is no use in trying C:/ since it
4369- * will never exist on a unix os.
4370- *
4371- * Add a / prefix and lowercase the driveletter, remove the :
4372- * C:\foo.JPG -> /c/foo.JPG */
4373-
4374- if (isalpha(tmp[0]) && tmp[1] == ':' && (tmp[2]=='\\' || tmp[2]=='/') ) {
4375- tmp[1] = tolower(tmp[0]); /* replace ':' with driveletter */
4376- tmp[0] = '/';
4377- /* '\' the slash will be converted later */
4378- }
4379-
4380-#endif
4381-
4382- BLI_strncpy(base, basepath, sizeof(base));
4383-
4384- /* file component is ignored, so don't bother with the trailing slash */
4385- BLI_cleanup_path(NULL, base);
4386-
4387- /* push slashes into unix mode - strings entering this part are
4388- * potentially messed up: having both back- and forward slashes.
4389- * Here we push into one conform direction, and at the end we
4390- * push them into the system specific dir. This ensures uniformity
4391- * of paths and solving some problems (and prevent potential future
4392- * ones) -jesterKing. */
4393- BLI_char_switch(tmp, '\\', '/');
4394- BLI_char_switch(base, '\\', '/');
4395-
4396- /* Paths starting with // will get the blend file as their base,
4397- * this isn't standard in any os but is used in blender all over the place */
4398- if (wasrelative) {
4399- char *lslash= BLI_last_slash(base);
4400- if (lslash) {
4401- int baselen= (int) (lslash-base) + 1;
4402- /* use path for temp storage here, we copy back over it right away */
4403- BLI_strncpy(path, tmp+2, FILE_MAX);
4404-
4405- memcpy(tmp, base, baselen);
4406- BLI_strncpy(tmp+baselen, path, sizeof(tmp)-baselen);
4407- BLI_strncpy(path, tmp, FILE_MAX);
4408- }
4409- else {
4410- BLI_strncpy(path, tmp+2, FILE_MAX);
4411- }
4412- }
4413- else {
4414- BLI_strncpy(path, tmp, FILE_MAX);
4415- }
4416-
4417- BLI_cleanup_path(NULL, path);
4418-
4419-#ifdef WIN32
4420- /* skip first two chars, which in case of
4421- * absolute path will be drive:/blabla and
4422- * in case of relpath //blabla/. So relpath
4423- * // will be retained, rest will be nice and
4424- * shiny win32 backward slashes :) -jesterKing
4425- */
4426- BLI_char_switch(path+2, '/', '\\');
4427-#endif
4428-
4429- return wasrelative;
4430-}
4431-
4432-
4433-/*
4434- * Should only be done with command line paths.
4435- * this is NOT something blenders internal paths support like the // prefix
4436- */
4437-int BLI_path_cwd(char *path)
4438-{
4439- int wasrelative = 1;
4440- int filelen = strlen(path);
4441-
4442-#ifdef WIN32
4443- if (filelen >= 3 && path[1] == ':' && (path[2] == '\\' || path[2] == '/'))
4444- wasrelative = 0;
4445-#else
4446- if (filelen >= 2 && path[0] == '/')
4447- wasrelative = 0;
4448-#endif
4449-
4450- if (wasrelative==1) {
4451- char cwd[FILE_MAX]= "";
4452- BLI_current_working_dir(cwd, sizeof(cwd)); /* in case the full path to the blend isn't used */
4453-
4454- if (cwd[0] == '\0') {
4455- printf( "Could not get the current working directory - $PWD for an unknown reason.");
4456- }
4457- else {
4458- /* uses the blend path relative to cwd important for loading relative linked files.
4459- *
4460- * cwd should contain c:\ etc on win32 so the relbase can be NULL
4461- * relbase being NULL also prevents // being misunderstood as relative to the current
4462- * blend file which isn't a feature we want to use in this case since were dealing
4463- * with a path from the command line, rather than from inside Blender */
4464-
4465- char origpath[FILE_MAX];
4466- BLI_strncpy(origpath, path, FILE_MAX);
4467-
4468- BLI_make_file_string(NULL, path, cwd, origpath);
4469- }
4470- }
4471-
4472- return wasrelative;
4473-}
4474-
4475-
4476-/* 'di's filename component is moved into 'fi', di is made a dir path */
4477-void BLI_splitdirstring(char *di, char *fi)
4478-{
4479- char *lslash= BLI_last_slash(di);
4480-
4481- if (lslash) {
4482- BLI_strncpy(fi, lslash+1, FILE_MAXFILE);
4483- *(lslash+1)=0;
4484- }
4485- else {
4486- BLI_strncpy(fi, di, FILE_MAXFILE);
4487- di[0]= 0;
4488- }
4489-}
4490-
4491-void BLI_getlastdir(const char* dir, char *last, const size_t maxlen)
4492-{
4493- const char *s = dir;
4494- const char *lslash = NULL;
4495- const char *prevslash = NULL;
4496- while (*s) {
4497- if ((*s == '\\') || (*s == '/')) {
4498- prevslash = lslash;
4499- lslash = s;
4500- }
4501- s++;
4502- }
4503- if (prevslash) {
4504- BLI_strncpy(last, prevslash+1, maxlen);
4505- }
4506- else {
4507- BLI_strncpy(last, dir, maxlen);
4508- }
4509-}
4510-
4511-/* This is now only used to really get the user's default document folder */
4512-/* On Windows I chose the 'Users/<MyUserName>/Documents' since it's used
4513- * as default location to save documents */
4514-const char *BLI_getDefaultDocumentFolder(void)
4515-{
4516-#ifndef WIN32
4517-
4518-#ifdef WITH_XDG_USER_DIRS
4519- const char *xdg_documents_dir= getenv("XDG_DOCUMENTS_DIR");
4520- if (xdg_documents_dir) {
4521- return xdg_documents_dir;
4522- }
4523-#endif
4524-
4525- return getenv("HOME");
4526-
4527-#else /* Windows */
4528- static char documentfolder[MAXPATHLEN];
4529- HRESULT hResult;
4530-
4531- /* Check for %HOME% env var */
4532- if (uput_getenv("HOME",documentfolder,MAXPATHLEN)) {
4533- if (BLI_is_dir(documentfolder)) return documentfolder;
4534- }
4535-
4536- /* add user profile support for WIN 2K / NT.
4537- * This is %APPDATA%, which translates to either
4538- * %USERPROFILE%\Application Data or since Vista
4539- * to %USERPROFILE%\AppData\Roaming
4540- */
4541- hResult = SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, documentfolder);
4542-
4543- if (hResult == S_OK) {
4544- if (BLI_is_dir(documentfolder)) return documentfolder;
4545- }
4546-
4547- return NULL;
4548-#endif /* WIN32 */
4549-}
4550-
4551-/* NEW stuff, to be cleaned up when fully migrated */
4552-/* ************************************************************* */
4553-/* ************************************************************* */
4554-
4555-// #define PATH_DEBUG2
4556-
4557-static char *blender_version_decimal(const int ver)
4558-{
4559- static char version_str[5];
4560- sprintf(version_str, "%d.%02d", ver/100, ver%100);
4561- return version_str;
4562-}
4563-
4564-static int test_path(char *targetpath, const char *path_base, const char *path_sep, const char *folder_name)
4565-{
4566- char tmppath[FILE_MAX];
4567-
4568- if (path_sep) BLI_join_dirfile(tmppath, sizeof(tmppath), path_base, path_sep);
4569- else BLI_strncpy(tmppath, path_base, sizeof(tmppath));
4570-
4571- /* rare cases folder_name is omitted (when looking for ~/.blender/2.xx dir only) */
4572- if (folder_name)
4573- BLI_make_file_string("/", targetpath, tmppath, folder_name);
4574- else
4575- BLI_strncpy(targetpath, tmppath, sizeof(tmppath));
4576-
4577- if (BLI_is_dir(targetpath)) {
4578-#ifdef PATH_DEBUG2
4579- printf("\tpath found: %s\n", targetpath);
4580-#endif
4581- return 1;
4582- }
4583- else {
4584-#ifdef PATH_DEBUG2
4585- printf("\tpath missing: %s\n", targetpath);
4586-#endif
4587- //targetpath[0] = '\0';
4588- return 0;
4589- }
4590-}
4591-
4592-static int test_env_path(char *path, const char *envvar)
4593-{
4594- const char *env = envvar?getenv(envvar):NULL;
4595- if (!env) return 0;
4596-
4597- if (BLI_is_dir(env)) {
4598- BLI_strncpy(path, env, FILE_MAX);
4599- return 1;
4600- }
4601- else {
4602- path[0] = '\0';
4603- return 0;
4604- }
4605-}
4606-
4607-static int get_path_local(char *targetpath, const char *folder_name, const char *subfolder_name, const int ver)
4608-{
4609- char relfolder[FILE_MAX];
4610-
4611-#ifdef PATH_DEBUG2
4612- printf("get_path_local...\n");
4613-#endif
4614-
4615- if (folder_name) {
4616- if (subfolder_name) {
4617- BLI_join_dirfile(relfolder, sizeof(relfolder), folder_name, subfolder_name);
4618- }
4619- else {
4620- BLI_strncpy(relfolder, folder_name, sizeof(relfolder));
4621- }
4622- }
4623- else {
4624- relfolder[0]= '\0';
4625- }
4626-
4627- /* try EXECUTABLE_DIR/2.5x/folder_name - new default directory for local blender installed files */
4628- if (test_path(targetpath, bprogdir, blender_version_decimal(ver), relfolder))
4629- return 1;
4630-
4631- return 0;
4632-}
4633-
4634-static int is_portable_install(void)
4635-{
4636- /* detect portable install by the existance of config folder */
4637- const int ver= BLENDER_VERSION;
4638- char path[FILE_MAX];
4639-
4640- return get_path_local(path, "config", NULL, ver);
4641-}
4642-
4643-static int get_path_user(char *targetpath, const char *folder_name, const char *subfolder_name, const char *envvar, const int ver)
4644-{
4645- char user_path[FILE_MAX];
4646- const char *user_base_path;
4647-
4648- /* for portable install, user path is always local */
4649- if (is_portable_install())
4650- return get_path_local(targetpath, folder_name, subfolder_name, ver);
4651-
4652- user_path[0] = '\0';
4653-
4654- if (test_env_path(user_path, envvar)) {
4655- if (subfolder_name) {
4656- return test_path(targetpath, user_path, NULL, subfolder_name);
4657- }
4658- else {
4659- BLI_strncpy(targetpath, user_path, FILE_MAX);
4660- return 1;
4661- }
4662- }
4663-
4664- user_base_path = (const char *)GHOST_getUserDir();
4665- if (user_base_path) {
4666- BLI_snprintf(user_path, FILE_MAX, BLENDER_USER_FORMAT, user_base_path, blender_version_decimal(ver));
4667- }
4668-
4669- if (!user_path[0])
4670- return 0;
4671-
4672-#ifdef PATH_DEBUG2
4673- printf("get_path_user: %s\n", user_path);
4674-#endif
4675-
4676- if (subfolder_name) {
4677- /* try $HOME/folder_name/subfolder_name */
4678- return test_path(targetpath, user_path, folder_name, subfolder_name);
4679- }
4680- else {
4681- /* try $HOME/folder_name */
4682- return test_path(targetpath, user_path, NULL, folder_name);
4683- }
4684-}
4685-
4686-static int get_path_system(char *targetpath, const char *folder_name, const char *subfolder_name, const char *envvar, const int ver)
4687-{
4688- char system_path[FILE_MAX];
4689- const char *system_base_path;
4690-
4691-
4692- /* first allow developer only overrides to the system path
4693- * these are only used when running blender from source */
4694- char cwd[FILE_MAX];
4695- char relfolder[FILE_MAX];
4696-
4697- if (folder_name) {
4698- if (subfolder_name) {
4699- BLI_join_dirfile(relfolder, sizeof(relfolder), folder_name, subfolder_name);
4700- }
4701- else {
4702- BLI_strncpy(relfolder, folder_name, sizeof(relfolder));
4703- }
4704- }
4705- else {
4706- relfolder[0]= '\0';
4707- }
4708-
4709- /* try CWD/release/folder_name */
4710- if (BLI_current_working_dir(cwd, sizeof(cwd))) {
4711- if (test_path(targetpath, cwd, "release", relfolder)) {
4712- return 1;
4713- }
4714- }
4715-
4716- /* try EXECUTABLE_DIR/release/folder_name */
4717- if (test_path(targetpath, bprogdir, "release", relfolder))
4718- return 1;
4719- /* end developer overrides */
4720-
4721-
4722-
4723- system_path[0] = '\0';
4724-
4725- if (test_env_path(system_path, envvar)) {
4726- if (subfolder_name) {
4727- return test_path(targetpath, system_path, NULL, subfolder_name);
4728- }
4729- else {
4730- BLI_strncpy(targetpath, system_path, FILE_MAX);
4731- return 1;
4732- }
4733- }
4734-
4735- system_base_path = (const char *)GHOST_getSystemDir();
4736- if (system_base_path) {
4737- BLI_snprintf(system_path, FILE_MAX, BLENDER_SYSTEM_FORMAT, system_base_path, blender_version_decimal(ver));
4738- }
4739-
4740- if (!system_path[0])
4741- return 0;
4742-
4743-#ifdef PATH_DEBUG2
4744- printf("get_path_system: %s\n", system_path);
4745-#endif
4746-
4747- if (subfolder_name) {
4748- /* try $BLENDERPATH/folder_name/subfolder_name */
4749- return test_path(targetpath, system_path, folder_name, subfolder_name);
4750- }
4751- else {
4752- /* try $BLENDERPATH/folder_name */
4753- return test_path(targetpath, system_path, NULL, folder_name);
4754- }
4755-}
4756-
4757-/* get a folder out of the 'folder_id' presets for paths */
4758-/* returns the path if found, NULL string if not */
4759-char *BLI_get_folder(int folder_id, const char *subfolder)
4760-{
4761- const int ver= BLENDER_VERSION;
4762- static char path[FILE_MAX] = "";
4763-
4764- switch (folder_id) {
4765- case BLENDER_DATAFILES: /* general case */
4766- if (get_path_user(path, "datafiles", subfolder, "BLENDER_USER_DATAFILES", ver)) break;
4767- if (get_path_local(path, "datafiles", subfolder, ver)) break;
4768- if (get_path_system(path, "datafiles", subfolder, "BLENDER_SYSTEM_DATAFILES", ver)) break;
4769- return NULL;
4770-
4771- case BLENDER_USER_DATAFILES:
4772- if (get_path_user(path, "datafiles", subfolder, "BLENDER_USER_DATAFILES", ver)) break;
4773- return NULL;
4774-
4775- case BLENDER_SYSTEM_DATAFILES:
4776- if (get_path_local(path, "datafiles", subfolder, ver)) break;
4777- if (get_path_system(path, "datafiles", subfolder, "BLENDER_SYSTEM_DATAFILES", ver)) break;
4778- return NULL;
4779-
4780- case BLENDER_USER_AUTOSAVE:
4781- if (get_path_user(path, "autosave", subfolder, "BLENDER_USER_DATAFILES", ver)) break;
4782- return NULL;
4783-
4784- case BLENDER_USER_CONFIG:
4785- if (get_path_user(path, "config", subfolder, "BLENDER_USER_CONFIG", ver)) break;
4786- return NULL;
4787-
4788- case BLENDER_USER_SCRIPTS:
4789- if (get_path_user(path, "scripts", subfolder, "BLENDER_USER_SCRIPTS", ver)) break;
4790- return NULL;
4791-
4792- case BLENDER_SYSTEM_SCRIPTS:
4793- if (get_path_local(path, "scripts", subfolder, ver)) break;
4794- if (get_path_system(path, "scripts", subfolder, "BLENDER_SYSTEM_SCRIPTS", ver)) break;
4795- return NULL;
4796-
4797- case BLENDER_SYSTEM_PYTHON:
4798- if (get_path_local(path, "python", subfolder, ver)) break;
4799- if (get_path_system(path, "python", subfolder, "BLENDER_SYSTEM_PYTHON", ver)) break;
4800- return NULL;
4801- }
4802-
4803- return path;
4804-}
4805-
4806-char *BLI_get_user_folder_notest(int folder_id, const char *subfolder)
4807-{
4808- const int ver= BLENDER_VERSION;
4809- static char path[FILE_MAX] = "";
4810-
4811- switch (folder_id) {
4812- case BLENDER_USER_DATAFILES:
4813- get_path_user(path, "datafiles", subfolder, "BLENDER_USER_DATAFILES", ver);
4814- break;
4815- case BLENDER_USER_CONFIG:
4816- get_path_user(path, "config", subfolder, "BLENDER_USER_CONFIG", ver);
4817- break;
4818- case BLENDER_USER_AUTOSAVE:
4819- get_path_user(path, "autosave", subfolder, "BLENDER_USER_AUTOSAVE", ver);
4820- break;
4821- case BLENDER_USER_SCRIPTS:
4822- get_path_user(path, "scripts", subfolder, "BLENDER_USER_SCRIPTS", ver);
4823- break;
4824- }
4825- if ('\0' == path[0]) {
4826- return NULL;
4827- }
4828- return path;
4829-}
4830-
4831-char *BLI_get_folder_create(int folder_id, const char *subfolder)
4832-{
4833- char *path;
4834-
4835- /* only for user folders */
4836- if (!ELEM4(folder_id, BLENDER_USER_DATAFILES, BLENDER_USER_CONFIG, BLENDER_USER_SCRIPTS, BLENDER_USER_AUTOSAVE))
4837- return NULL;
4838-
4839- path = BLI_get_folder(folder_id, subfolder);
4840-
4841- if (!path) {
4842- path = BLI_get_user_folder_notest(folder_id, subfolder);
4843- if (path) BLI_dir_create_recursive(path);
4844- }
4845-
4846- return path;
4847-}
4848-
4849-char *BLI_get_folder_version(const int id, const int ver, const int do_check)
4850-{
4851- static char path[FILE_MAX] = "";
4852- int ok;
4853- switch(id) {
4854- case BLENDER_RESOURCE_PATH_USER:
4855- ok= get_path_user(path, NULL, NULL, NULL, ver);
4856- break;
4857- case BLENDER_RESOURCE_PATH_LOCAL:
4858- ok= get_path_local(path, NULL, NULL, ver);
4859- break;
4860- case BLENDER_RESOURCE_PATH_SYSTEM:
4861- ok= get_path_system(path, NULL, NULL, NULL, ver);
4862- break;
4863- default:
4864- path[0]= '\0'; /* in case do_check is false */
4865- ok= FALSE;
4866- BLI_assert(!"incorrect ID");
4867- }
4868-
4869- if ((ok == FALSE) && do_check) {
4870- return NULL;
4871- }
4872-
4873- return path;
4874-}
4875-
4876-/* End new stuff */
4877-/* ************************************************************* */
4878-/* ************************************************************* */
4879-
4880-
4881-
4882-#ifdef PATH_DEBUG
4883-#undef PATH_DEBUG
4884-#endif
4885-
4886-void BLI_setenv(const char *env, const char*val)
4887-{
4888- /* free windows */
4889-#if (defined(WIN32) || defined(WIN64)) && defined(FREE_WINDOWS)
4890- char *envstr= MEM_mallocN(sizeof(char) * (strlen(env) + strlen(val) + 2), "envstr"); /* one for = another for \0 */
4891-
4892- sprintf(envstr, "%s=%s", env, val);
4893- putenv(envstr);
4894- MEM_freeN(envstr);
4895-
4896- /* non-free windows */
4897-#elif (defined(WIN32) || defined(WIN64)) /* not free windows */
4898- uputenv(env, val);
4899-
4900-
4901-#else
4902- /* linux/osx/bsd */
4903- setenv(env, val, 1);
4904-#endif
4905-}
4906-
4907-
4908-/**
4909- * Only set an env var if already not there.
4910- * Like Unix setenv(env, val, 0);
4911- */
4912-void BLI_setenv_if_new(const char *env, const char* val)
4913-{
4914- if (getenv(env) == NULL)
4915- BLI_setenv(env, val);
4916-}
4917-
4918-
4919-void BLI_clean(char *path)
4920-{
4921- if (path==NULL) return;
4922-
4923-#ifdef WIN32
4924- if (path && BLI_strnlen(path, 3) > 2) {
4925- BLI_char_switch(path+2, '/', '\\');
4926- }
4927-#else
4928- BLI_char_switch(path, '\\', '/');
4929-#endif
4930-}
4931-
4932-void BLI_char_switch(char *string, char from, char to)
4933-{
4934- if (string==NULL) return;
4935- while (*string != 0) {
4936- if (*string == from) *string = to;
4937- string++;
4938- }
4939-}
4940-
4941-void BLI_make_exist(char *dir)
4942-{
4943- int a;
4944-
4945- BLI_char_switch(dir, ALTSEP, SEP);
4946-
4947- a = strlen(dir);
4948-
4949- while (BLI_is_dir(dir) == 0) {
4950- a --;
4951- while (dir[a] != SEP) {
4952- a--;
4953- if (a <= 0) break;
4954- }
4955- if (a >= 0) {
4956- dir[a+1] = '\0';
4957- }
4958- else {
4959-#ifdef WIN32
4960- get_default_root(dir);
4961-#else
4962- strcpy(dir,"/");
4963-#endif
4964- break;
4965- }
4966- }
4967-}
4968-
4969-void BLI_make_existing_file(const char *name)
4970-{
4971- char di[FILE_MAX], fi[FILE_MAXFILE];
4972-
4973- BLI_strncpy(di, name, sizeof(di));
4974- BLI_splitdirstring(di, fi);
4975-
4976- /* test exist */
4977- if (BLI_exists(di) == 0) {
4978- BLI_dir_create_recursive(di);
4979- }
4980-}
4981-
4982-
4983-void BLI_make_file_string(const char *relabase, char *string, const char *dir, const char *file)
4984-{
4985- int sl;
4986-
4987- if (string) {
4988- /* ensure this is always set even if dir/file are NULL */
4989- string[0]= '\0';
4990-
4991- if (ELEM(NULL, dir, file)) {
4992- return; /* We don't want any NULLs */
4993- }
4994- }
4995- else {
4996- return; /* string is NULL, probably shouldnt happen but return anyway */
4997- }
4998-
4999-
5000- /* we first push all slashes into unix mode, just to make sure we don't get
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: