From bed40ed8e3f981ce97268edb01fecf599d940633 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 26 Jul 2010 11:47:33 +0000 Subject: move directories: dlltool --> build_files/make/dlltool bin --> release/bin Since dlltool is only used make + mingw and ./bin is misleading because it would seem the blender binary would be copied there, but its just used for home directory files. updated scons/cmake/make --- Makefile | 2 +- bin/.blender/.Blanguages | 23 ------- bin/.blender/.bfont.ttf | Bin 65932 -> 0 bytes bin/blender-thumbnailer.py | 131 ------------------------------------- build_files/scons/tools/Blender.py | 10 +-- po/Makefile | 2 +- release/Makefile | 4 +- release/bin/.blender/.Blanguages | 23 +++++++ release/bin/.blender/.bfont.ttf | Bin 0 -> 65932 bytes release/bin/blender-thumbnailer.py | 131 +++++++++++++++++++++++++++++++++++++ source/creator/CMakeLists.txt | 22 +++---- source/darwin/Makefile | 2 +- 12 files changed, 175 insertions(+), 175 deletions(-) delete mode 100644 bin/.blender/.Blanguages delete mode 100644 bin/.blender/.bfont.ttf delete mode 100755 bin/blender-thumbnailer.py create mode 100644 release/bin/.blender/.Blanguages create mode 100644 release/bin/.blender/.bfont.ttf create mode 100755 release/bin/blender-thumbnailer.py diff --git a/Makefile b/Makefile index b16e046d5e8..d92edf2c02c 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ MAKEFLAGS=-I$(NANBLENDERHOME)/build_files/make --no-print-directory SOURCEDIR = ifeq ($(FREE_WINDOWS),true) - DIRS ?= dlltool extern intern source po + DIRS ?= $(NANBLENDERHOME)/build_files/make/dlltool extern intern source po else DIRS ?= extern intern source po endif diff --git a/bin/.blender/.Blanguages b/bin/.blender/.Blanguages deleted file mode 100644 index 9f3b3ef80dc..00000000000 --- a/bin/.blender/.Blanguages +++ /dev/null @@ -1,23 +0,0 @@ -English:en_US -Japanese:ja_JP -Dutch:nl_NL -Italian:it_IT -German:de_DE -Finnish:fi_FI -Swedish:sv_SE -French:fr_FR -Spanish:es_ES -Catalan:ca_ES -Czech:cs_CZ -Brazilian Portuguese:pt_BR -Simplified Chinese:zh_CN -Russian:ru_RU -Croatian:hr_HR -Serbian:sr -Ukrainian:uk_UA -Polish:pl_PL -Romanian:ro -Arabic:ar -Bulgarian:bg -Greek:el -Korean:ko diff --git a/bin/.blender/.bfont.ttf b/bin/.blender/.bfont.ttf deleted file mode 100644 index 58cd6b5e61e..00000000000 Binary files a/bin/.blender/.bfont.ttf and /dev/null differ diff --git a/bin/blender-thumbnailer.py b/bin/blender-thumbnailer.py deleted file mode 100755 index 27d6259d172..00000000000 --- a/bin/blender-thumbnailer.py +++ /dev/null @@ -1,131 +0,0 @@ -#!/usr/bin/python - -# ##### BEGIN GPL LICENSE BLOCK ##### -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# ##### END GPL LICENSE BLOCK ##### - -""" -Thumbnailer runs with python 2.6 and 3.x. -To run automatically with nautilus: - gconftool --type boolean --set /desktop/gnome/thumbnailers/application@x-blender/enable true - gconftool --type string --set /desktop/gnome/thumbnailers/application@x-blender/command "blender-thumbnailer.py %i %o" -""" - -import struct - -def blend_extract_thumb(path): - import os - - # def MAKE_ID(tag): ord(tag[0])<<24 | ord(tag[1])<<16 | ord(tag[2])<<8 | ord(tag[3]) - REND = 1145980242 # MAKE_ID(b'REND') - TEST = 1414743380 # MAKE_ID(b'TEST') - - blendfile = open(path, 'rb') - - head = blendfile.read(12) - - if head[0:2] == b'\x1f\x8b': # gzip magic - import gzip - blendfile.close() - blendfile = gzip.open(path, 'rb') - head = blendfile.read(12) - - if not head.startswith(b'BLENDER'): - blendfile.close() - return None, 0, 0 - - is_64_bit = (head[7] == b'-') - - # true for PPC, false for X86 - is_big_endian = (head[8] == b'V') - - # blender pre 2.5 had no thumbs - if head[9:11] <= b'24': - return None, 0, 0 - - sizeof_bhead = 24 if is_64_bit else 20 - int_endian_pair = '>ii' if is_big_endian else ' ") - else: - file_in = sys.argv[-2] - - buf, width, height = blend_extract_thumb(file_in) - - if buf: - file_out = sys.argv[-1] - - f = open(file_out, "wb") - f.write(write_png(buf, width, height)) - f.close() diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py index 7f5ce4767e3..1c2fccec322 100644 --- a/build_files/scons/tools/Blender.py +++ b/build_files/scons/tools/Blender.py @@ -529,13 +529,13 @@ def AppIt(target=None, source=None, env=None): # print cmd commands.getoutput(cmd) cmd = installdir + '/%s.app/Contents/MacOS/%s'%(binary,VERSION) - shutil.copy(bldroot + '/bin/.blender/.bfont.ttf', cmd) - shutil.copy(bldroot + '/bin/.blender/.Blanguages', cmd) - cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary) + shutil.copy(bldroot + '/release/bin/.blender/.bfont.ttf', cmd) + shutil.copy(bldroot + '/release/bin/.blender/.Blanguages', cmd) + cmd = 'cp -R %s/release/bin/%s/locale %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary) commands.getoutput(cmd) - cmd = 'cp -R %s/bin/%s/locale %s/%s.app/Contents/MacOS/%s/'%(bldroot,VERSION,installdir,binary,VERSION) + cmd = 'cp -R %s/release/bin/%s/locale %s/%s.app/Contents/MacOS/%s/'%(bldroot,VERSION,installdir,binary,VERSION) commands.getoutput(cmd) - cmd = 'cp %s/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary) + cmd = 'cp %s/release/bin/%s/.Blanguages %s/%s.app/Contents/Resources/'%(bldroot,VERSION,installdir,binary) commands.getoutput(cmd) cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION) commands.getoutput(cmd) diff --git a/po/Makefile b/po/Makefile index b656a00fb38..bbd1caa68ad 100644 --- a/po/Makefile +++ b/po/Makefile @@ -51,7 +51,7 @@ $(DIR)%/LC_MESSAGES/blender.mo: %.po mkdir -p $(@D) msgfmt -o $@ $< ifeq ($(BF_VERIFY_MO_FILES), true) - @cmp $@ $(NANBLENDERHOME)/bin/.blender/locale/$(basename $<)/LC_MESSAGES/blender.mo \ + @cmp $@ $(NANBLENDERHOME)/release/bin/.blender/locale/$(basename $<)/LC_MESSAGES/blender.mo \ || ( echo Mismatch between generated and commited $(basename $<).mo catalog && \ rm -f $@ && false ) endif diff --git a/release/Makefile b/release/Makefile index 809ac548724..e6d904ea13c 100644 --- a/release/Makefile +++ b/release/Makefile @@ -114,8 +114,8 @@ install: package ifneq ($(OS), darwin) @[ ! -d $(OCGDIR)/bin/.blender ] || \ cp -r $(OCGDIR)/bin/.blender $(DISTDIR) - @cp $(NANBLENDERHOME)/bin/.blender/.Blanguages $(CONFDIR) - @cp $(NANBLENDERHOME)/bin/.blender/.bfont.ttf $(CONFDIR) + @cp $(NANBLENDERHOME)/release/bin/.blender/.Blanguages $(CONFDIR) + @cp $(NANBLENDERHOME)/release/bin/.blender/.bfont.ttf $(CONFDIR) endif @echo "----> Copy blender$(EXT0) executable" ifeq ($(TYPE),-static) diff --git a/release/bin/.blender/.Blanguages b/release/bin/.blender/.Blanguages new file mode 100644 index 00000000000..9f3b3ef80dc --- /dev/null +++ b/release/bin/.blender/.Blanguages @@ -0,0 +1,23 @@ +English:en_US +Japanese:ja_JP +Dutch:nl_NL +Italian:it_IT +German:de_DE +Finnish:fi_FI +Swedish:sv_SE +French:fr_FR +Spanish:es_ES +Catalan:ca_ES +Czech:cs_CZ +Brazilian Portuguese:pt_BR +Simplified Chinese:zh_CN +Russian:ru_RU +Croatian:hr_HR +Serbian:sr +Ukrainian:uk_UA +Polish:pl_PL +Romanian:ro +Arabic:ar +Bulgarian:bg +Greek:el +Korean:ko diff --git a/release/bin/.blender/.bfont.ttf b/release/bin/.blender/.bfont.ttf new file mode 100644 index 00000000000..58cd6b5e61e Binary files /dev/null and b/release/bin/.blender/.bfont.ttf differ diff --git a/release/bin/blender-thumbnailer.py b/release/bin/blender-thumbnailer.py new file mode 100755 index 00000000000..27d6259d172 --- /dev/null +++ b/release/bin/blender-thumbnailer.py @@ -0,0 +1,131 @@ +#!/usr/bin/python + +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +""" +Thumbnailer runs with python 2.6 and 3.x. +To run automatically with nautilus: + gconftool --type boolean --set /desktop/gnome/thumbnailers/application@x-blender/enable true + gconftool --type string --set /desktop/gnome/thumbnailers/application@x-blender/command "blender-thumbnailer.py %i %o" +""" + +import struct + +def blend_extract_thumb(path): + import os + + # def MAKE_ID(tag): ord(tag[0])<<24 | ord(tag[1])<<16 | ord(tag[2])<<8 | ord(tag[3]) + REND = 1145980242 # MAKE_ID(b'REND') + TEST = 1414743380 # MAKE_ID(b'TEST') + + blendfile = open(path, 'rb') + + head = blendfile.read(12) + + if head[0:2] == b'\x1f\x8b': # gzip magic + import gzip + blendfile.close() + blendfile = gzip.open(path, 'rb') + head = blendfile.read(12) + + if not head.startswith(b'BLENDER'): + blendfile.close() + return None, 0, 0 + + is_64_bit = (head[7] == b'-') + + # true for PPC, false for X86 + is_big_endian = (head[8] == b'V') + + # blender pre 2.5 had no thumbs + if head[9:11] <= b'24': + return None, 0, 0 + + sizeof_bhead = 24 if is_64_bit else 20 + int_endian_pair = '>ii' if is_big_endian else ' ") + else: + file_in = sys.argv[-2] + + buf, width, height = blend_extract_thumb(file_in) + + if buf: + file_out = sys.argv[-1] + + f = open(file_out, "wb") + f.write(write_png(buf, width, height)) + f.close() diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 12bb371de63..b678dd88811 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -125,14 +125,14 @@ IF(WITH_INSTALL) TARGET blender POST_BUILD MAIN_DEPENDENCY blender COMMAND rm -Rf ${TARGETDIR}/.blender COMMAND mkdir ${TARGETDIR}/.blender/ - COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/.blender/ + COMMAND cp ${CMAKE_SOURCE_DIR}/release/bin/.blender/.bfont.ttf ${TARGETDIR}/.blender/ ) IF(WITH_INTERNATIONAL) ADD_CUSTOM_COMMAND( TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/.blender/ - COMMAND cp -R ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/.blender/ + COMMAND cp ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages ${TARGETDIR}/.blender/ + COMMAND cp -R ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale ${TARGETDIR}/.blender/ ) ENDIF(WITH_INTERNATIONAL) @@ -200,7 +200,7 @@ IF(WITH_INSTALL) DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps ) INSTALL( - PROGRAMS ${CMAKE_SOURCE_DIR}/bin/blender-thumbnailer.py + PROGRAMS ${CMAKE_SOURCE_DIR}/release/bin/blender-thumbnailer.py DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ) INSTALL( @@ -220,7 +220,7 @@ IF(WITH_INSTALL) ) IF(WITH_INTERNATIONAL) INSTALL( - DIRECTORY ${CMAKE_SOURCE_DIR}/bin/.blender/locale/ + DIRECTORY ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale/ DESTINATION ${BLENDERPATH}/datafiles/locale PATTERN ".svn" EXCLUDE ) @@ -243,14 +243,14 @@ IF(WITH_INSTALL) COMMAND cat ${SOURCEINFO} | sed s/VERSION/`cat ${CMAKE_SOURCE_DIR}/release/VERSION`/ | sed s/DATE/`date +'%Y-%b-%d'`/ > ${TARGETINFO} COMMAND rm -Rf ${TARGETDIR}/blender.app/Contents/MacOS/datafiles COMMAND mkdir ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/ - COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.bfont.ttf ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/ + COMMAND cp ${CMAKE_SOURCE_DIR}/release/bin/.blender/.bfont.ttf ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/ ) IF(WITH_INTERNATIONAL) ADD_CUSTOM_COMMAND( TARGET blender POST_BUILD MAIN_DEPENDENCY blender - COMMAND cp ${CMAKE_SOURCE_DIR}/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/ - COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/ + COMMAND cp ${CMAKE_SOURCE_DIR}/release/bin/.blender/.Blanguages ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/ + COMMAND cp -Rf ${CMAKE_SOURCE_DIR}/release/bin/.blender/locale ${TARGETDIR}/blender.app/Contents/MacOS/datafiles/ ) ENDIF(WITH_INTERNATIONAL) @@ -286,9 +286,9 @@ IF(WITH_INSTALL) COMMAND if not exist \"${TARGETDIR}\\.blender\\locale\" mkdir \"${TARGETDIR}\\.blender\\locale\" COMMAND if not exist \"${TARGETDIR}\\.blender\\scripts\" mkdir \"${TARGETDIR}\\.blender\\scripts\" COMMAND if not exist \"${TARGETDIR}\\plugins\" mkdir \"${TARGETDIR}\\plugins\" - COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\.blender\\\" - COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\bin\\.blender\\.bfont.ttf\" \"${TARGETDIR}\\.blender\\\" - COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\.blender\\locale\" + COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\bin\\.blender\\.Blanguages\" \"${TARGETDIR}\\.blender\\\" + COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\bin\\.blender\\.bfont.ttf\" \"${TARGETDIR}\\.blender\\\" + COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\bin\\.blender\\locale\\*.*\" \"${TARGETDIR}\\.blender\\locale\" COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\scripts\\*.*\" \"${TARGETDIR}\\.blender\\scripts\" COMMAND xcopy /E /Y \"${CMAKE_SOURCE_DIR}\\release\\plugins\\*.*\" \"${TARGETDIR}\\plugins\" COMMAND copy /Y \"${CMAKE_SOURCE_DIR}\\release\\text\\*.*\" \"${TARGETDIR}\" diff --git a/source/darwin/Makefile b/source/darwin/Makefile index 6007ff4d91c..9095f1d8e92 100644 --- a/source/darwin/Makefile +++ b/source/darwin/Makefile @@ -45,7 +45,7 @@ all:: @chmod +x $(DIR)/bin/$(APPLICATION).app/Contents/MacOS/$(APPLICATION) ifeq ($(APPLICATION), blender) @echo "---> copying message files" - @cp -R $(NANBLENDERHOME)/bin/.blender/locale $(DIR)/bin/$(APPLICATION).app/Contents/Resources + @cp -R $(NANBLENDERHOME)/release/bin/.blender/locale $(DIR)/bin/$(APPLICATION).app/Contents/Resources @echo "---> copying .Blanguages" @cp $(NANBLENDERHOME)/bin/.blender/.Blanguages $(DIR)/bin/$(APPLICATION).app/Contents/Resources @echo "---> copying .blender/ scripts" -- cgit v1.2.3