diff options
Diffstat (limited to 'build')
-rw-r--r-- | build/common.gypi | 10 | ||||
-rwxr-xr-x | build/install-build-deps.sh | 69 |
2 files changed, 61 insertions, 18 deletions
diff --git a/build/common.gypi b/build/common.gypi index 6a95c4f..8a8d1fb 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -1007,6 +1007,16 @@ '-msse2', ], }], + # Install packages have started cropping up with + # different headers between the 32-bit and 64-bit + # versions, so we have to shadow those differences off + # and make sure a 32-bit-on-64-bit build picks up the + # right files. + ['host_arch!="ia32"', { + 'include_dirs+': [ + '/usr/include32', + ], + }], ], # -mmmx allows mmintrin.h to be used for mmx intrinsics. # video playback is mmx and sse2 optimized. diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh index f5ac8387..7e781cb 100755 --- a/build/install-build-deps.sh +++ b/build/install-build-deps.sh @@ -108,7 +108,7 @@ dev_list="apache2 bison fakeroot flex g++ gperf libapache2-mod-php5 ttf-kochi-mincho wdiff libcurl4-gnutls-dev $chromeos_dev_list" # Run-time libraries required by chromeos only -chromeos_lib_list="libpulse0" +chromeos_lib_list="libpulse0 libbz2-1.0 libcurl4-gnutls-dev" # Full list of required run-time libraries lib_list="libatk1.0-0 libc6 libasound2 libcairo2 libdbus-glib-1-2 libexpat1 @@ -340,19 +340,44 @@ EOF tar zCfx dpkg data.tar.gz tar zCfx dpkg/DEBIAN control.tar.gz - # Rename package, change architecture, remove dependencies - sed -i -e "s/\(Package:.*\)/\1-ia32/" \ - -e "s/\(Architecture:\).*/\1 amd64/" \ - -e "s/\(Depends:\).*/\1 ia32-libs/" \ - -e "/Recommends/d" \ - -e "/Conflicts/d" \ - dpkg/DEBIAN/control - - # Only keep files that live in "lib" directories - sed -i -e "/\/lib64\//d" -e "/\/.?bin\//d" \ - -e "s,\([ /]lib\)/,\132/g,;t1;d;:1" \ - -e "s,^/usr/lib32/debug\(.*/lib32\),/usr/lib/debug\1," \ - dpkg/DEBIAN/md5sums + # Create a posix extended regular expression fragment that will + # recognize the includes which have changed. Should be rare, + # will almost always be empty. + includes=`sed -n -e "s/^[0-9a-z]* //g" \ + -e "\,usr/include/,p" dpkg/DEBIAN/md5sums | + xargs -n 1 -I FILE /bin/sh -c \ + "cmp -s dpkg/FILE /FILE || echo FILE" | + tr "\n" "|" | + sed -e "s,|$,,"` + + # If empty, set it to not match anything. + test -z "$includes" && includes="^//" + + # Turn the conflicts into an extended RE for removal from the + # Provides line. + conflicts=`sed -n -e "/Conflicts/s/Conflicts: *//;T;s/, */|/g;p" \ + dpkg/DEBIAN/control` + + # Rename package, change architecture, remove conflicts and dependencies + sed -r -i \ + -e "/Package/s/$/-ia32/" \ + -e "/Architecture/s/:.*$/: amd64/" \ + -e "/Depends/s/:.*/: ia32-libs/" \ + -e "/Provides/s/($conflicts)(, *)?//g;T1;s/, *$//;:1" \ + -e "/Recommends/d" \ + -e "/Conflicts/d" \ + dpkg/DEBIAN/control + + # Only keep files that live in "lib" directories or the includes + # that have changed. + sed -r -i \ + -e "/\/lib64\//d" -e "/\/.?bin\//d" \ + -e "\,$includes,s,[ /]include/,&32/,g;s,include/32/,include32/,g" \ + -e "s, lib/, lib32/,g" \ + -e "s,/lib/,/lib32/,g" \ + -e "t;d" \ + -e "\,^/usr/lib32/debug\(.*/lib32\),s,^/usr/lib32/debug,/usr/lib/debug," \ + dpkg/DEBIAN/md5sums # Re-run ldconfig after installation/removal { echo "#!/bin/sh"; echo "[ \"x\$1\" = xconfigure ]&&ldconfig||:"; } \ @@ -366,13 +391,18 @@ EOF -name postinst -o -name postrm ")" -o -print | xargs -r rm -rf - # Remove any files/dirs that live outside of "lib" directories - find dpkg -mindepth 1 "(" -name DEBIAN -o -name lib ")" -prune -o \ - -print | tac | xargs -r -n 1 sh -c \ - "rm \$0 2>/dev/null || rmdir \$0 2>/dev/null || : " + # Remove any files/dirs that live outside of "lib" directories, + # or are not in our list of changed includes. + find dpkg -mindepth 1 -regextype posix-extended \ + "(" -name DEBIAN -o -name lib -o -regex "dpkg/($includes)" ")" \ + -prune -o -print | tac | + xargs -r -n 1 sh -c "rm \$0 2>/dev/null || rmdir \$0 2>/dev/null || : " find dpkg -name lib64 -o -name bin -o -name "?bin" | tac | xargs -r rm -rf + # Remove any symbolic links that were broken by the above steps. + find -L dpkg -type l -print | tac | xargs -r rm -rf + # Rename lib to lib32, but keep debug symbols in /usr/lib/debug/usr/lib32 # That is where gdb looks for them. find dpkg -type d -o -path "*/lib/*" -print | @@ -383,6 +413,9 @@ EOF mkdir -p \"\${i%/*}\"; mv \"\${0}\" \"\${i}\"" + # Rename include to include32. + [ -d "dpkg/usr/include" ] && mv "dpkg/usr/include" "dpkg/usr/include32" + # Prune any empty directories find dpkg -type d | tac | xargs -r -n 1 rmdir 2>/dev/null || : |