Ticket #25208: tbb.diff
File tbb.diff, 6.4 KB (added by stromnov (Andrey Stromnov), 14 years ago) |
---|
-
files/patch-Makefile.diff
1 --- Makefile.orig 2010-06-11 10:47:00.000000000 +0400 2 +++ Makefile 2010-06-11 11:25:31.000000000 +0400 3 @@ -58,6 +58,11 @@ 4 examples: tbb tbbmalloc 5 $(MAKE) -C examples -r -f Makefile tbb_root=.. release test 6 7 +install: tbb tbbmalloc 8 + $(shell cp $(work_dir)_release/lib*.dylib $(DESTDIR)@PREFIX@/lib) 9 + $(shell cp -r $(work_dir)_release/../../include/tbb $(DESTDIR)@PREFIX@/include/tbb) 10 + $(shell cp $(work_dir)_release/tbbvars.*sh $(DESTDIR)@PREFIX@/bin) 11 + 12 .PHONY: clean clean_examples mkdir info 13 14 clean: clean_examples -
files/patch-build_generate_tbbvars.sh.diff
1 --- build/generate_tbbvars.sh.orig 2010-06-11 11:30:32.000000000 +0400 2 +++ build/generate_tbbvars.sh 2010-06-11 11:36:20.000000000 +0400 3 @@ -34,8 +34,8 @@ 4 [ "`uname`" = "Darwin" ] && dll_path="DYLD_LIBRARY_PATH" || dll_path="LD_LIBRARY_PATH" # 5 [ -f ./tbbvars.sh ] || cat >./tbbvars.sh <<EOF 6 #!/bin/bash 7 -export TBB30_INSTALL_DIR="${tbb_root}" # 8 -tbb_bin="${bin_dir}" # 9 +export TBB30_INSTALL_DIR="@PREFIX@" # 10 +tbb_bin="@PREFIX@/lib" # 11 if [ -z "\$CPATH" ]; then # 12 export CPATH="\${TBB30_INSTALL_DIR}/include" # 13 else # 14 @@ -55,8 +55,8 @@ 15 EOF 16 [ -f ./tbbvars.csh ] || cat >./tbbvars.csh <<EOF 17 #!/bin/csh 18 -setenv TBB30_INSTALL_DIR "${tbb_root}" # 19 -setenv tbb_bin "${bin_dir}" # 20 +setenv TBB30_INSTALL_DIR "@PREFIX@" # 21 +setenv tbb_bin "@PREFIX@/lib" # 22 if (! \$?CPATH) then # 23 setenv CPATH "\${TBB30_INSTALL_DIR}/include" # 24 else # -
files/patch-build_macos.inc.diff
1 --- build/macos.inc.orig 2010-06-11 01:45:01.000000000 +0400 2 +++ build/macos.inc 2010-06-11 01:52:05.000000000 +0400 3 @@ -25,21 +25,7 @@ 4 # the GNU General Public License. 5 6 ####### Detections and Commands ############################################### 7 -ifndef arch 8 - ifeq ($(shell /usr/sbin/sysctl -n hw.machine),Power Macintosh) 9 - ifeq ($(shell /usr/sbin/sysctl -n hw.optional.64bitops),1) 10 - export arch:=ppc64 11 - else 12 - export arch:=ppc32 13 - endif 14 - else 15 - ifeq ($(shell /usr/sbin/sysctl -n hw.optional.x86_64 2>/dev/null),1) 16 - export arch:=intel64 17 - else 18 - export arch:=ia32 19 - endif 20 - endif 21 -endif 22 +export arch:=$(if $(findstring x86_64,$(shell pwd)),intel64,ia32) 23 24 ifndef runtime 25 #gcc_version:=$(shell gcc -v 2>&1 | grep 'gcc version' | sed -e 's/^gcc version //' | sed -e 's/ .*$$//' ) -
Portfile
2 2 # $Id$ 3 3 4 4 PortSystem 1.0 5 PortGroup muniversal 1.0 5 6 6 7 name tbb 7 set rel_date 20 0908098 set vers 2.28 set rel_date 20100406 9 set vers 3.0 9 10 version ${vers}-${rel_date} 10 revision 111 revision 0 11 12 maintainers mnick openmaintainer 12 13 13 14 categories devel … … 19 20 platforms darwin 20 21 21 22 homepage http://www.threadingbuildingblocks.org 22 master_sites ${homepage}/uploads/77/1 42/${vers}/23 worksrcdir ${name} 22_${rel_date}oss23 master_sites ${homepage}/uploads/77/151/${vers}/ 24 worksrcdir ${name}30_${rel_date}oss 24 25 distname ${worksrcdir}_src 25 26 extract.suffix .tgz 26 27 27 checksums md5 c621053887c7ee86932da43e2deb3bff\28 sha1 12af8e2bdddb51aa62312523a70ebf2a0f6de8d6\29 rmd160 2c0fac8c9ef3648dcf3d1f2b03a56672ab4eaab228 checksums md5 645aeaa5473e7a8986cd629c5f7262bb \ 29 sha1 0c10aaa7f60762a4a2c2c907a2fee552eba4132c \ 30 rmd160 52882e20b0753b669bda60bce7f61f20f3245a86 30 31 31 universal_variant no32 32 build.target tbb tbbmalloc 33 33 34 configure { 35 if {${build_arch} eq "i386"} { 36 set arch_flag intel32 37 } elseif {${build_arch} eq "x86_64"} { 38 set arch_flag intel64 39 } 40 build.env-append arch=${arch_flag} 41 test.env-append arch=${arch_flag} 34 patchfiles patch-Makefile.diff \ 35 patch-build_macos.inc.diff \ 36 patch-build_generate_tbbvars.sh.diff 37 38 if {![variant_isset universal]} { 39 patchfiles-delete patch-build_macos.inc.diff 42 40 } 43 41 44 destroot { 45 set build_dir [exec sh -c "cd ${worksrcpath} && ${build.env} make info | grep build_prefix | cut -f2 -d'='"] 46 set build_dir "${worksrcpath}/build/${build_dir}_release" 47 48 # fix paths 49 reinplace "s|\\(TBB22_INSTALL_DIR.\\)\".*\"|\\1\"${prefix}\"|g" \ 50 ${build_dir}/tbbvars.sh ${build_dir}/tbbvars.csh 51 reinplace "s|\\(tbb_bin.\\)\".*\"|\\1\"${prefix}/lib\"|g" \ 52 ${build_dir}/tbbvars.sh ${build_dir}/tbbvars.csh 42 post-patch { 43 reinplace "s|@PREFIX@|${prefix}|g" \ 44 ${worksrcpath}/Makefile ${worksrcpath}/build/generate_tbbvars.sh 53 45 54 # copy lib, include & bin 55 eval file copy [glob ${build_dir}/lib*.dylib] ${destroot}${prefix}/lib 56 eval file copy [glob ${build_dir}/tbbvars.*sh] ${destroot}${prefix}/bin 57 file copy ${worksrcpath}/include/tbb ${destroot}${prefix}/include/tbb 58 46 # create fake configure for muniversal variant 47 touch ${worksrcpath}/configure 48 system "chmod 755 ${worksrcpath}/configure" 49 50 # delete unnecessary files 51 file delete -force ${worksrcpath}/include/tbb/index.html 52 } 53 54 55 if {${build_arch} eq "i386"} { 56 set arch_flag ia32 57 } elseif {${build_arch} eq "x86_64"} { 58 set arch_flag intel64 59 } 60 61 build.env-append arch=${arch_flag} 62 destroot.env-append arch=${arch_flag} 63 test.env-append arch=${arch_flag} 64 65 post-destroot { 59 66 # fix install_name paths 60 67 system "install_name_tool -id ${prefix}/lib/libtbb.dylib ${destroot}${prefix}/lib/libtbb.dylib" 61 68 system "install_name_tool -id ${prefix}/lib/libtbbmalloc.dylib ${destroot}${prefix}/lib/libtbbmalloc.dylib" 62 69 63 70 # copy examples & docs 64 71 file mkdir ${destroot}${prefix}/share/${name} 65 72 file copy ${worksrcpath}/doc ${destroot}${prefix}/share/${name}/doc