cookutils rev 358
We may need LDFLAGS
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Thu Apr 26 13:34:41 2012 +0200 (2012-04-26) |
parents | 87c4568e2ced |
children | 740cd63ddb41 |
files | cook cook.conf |
line diff
1.1 --- a/cook Mon Apr 23 13:22:20 2012 +0200 1.2 +++ b/cook Thu Apr 26 13:34:41 2012 +0200 1.3 @@ -35,7 +35,7 @@ 1.4 list-wok $(gettext "List packages in the wok.") 1.5 search $(gettext "Simple packages search function.") 1.6 new $(gettext "Create a new package with a receipt".) 1.7 - list $(gettext "Cook a list of packages.") 1.8 + list $(gettext "Cook a list of packages.") 1.9 clean-wok $(gettext "Clean-up all packages files.") 1.10 clean-src $(gettext "Clean-up all packages sources.") 1.11 pkgdb $(gettext "Create packages DB lists and flavors.") 1.12 @@ -234,7 +234,7 @@ 1.13 git clone $url $pkgsrc || (echo "ERROR: git clone $url" && exit 1) 1.14 if [ "$BRANCH" ]; then 1.15 echo "Git branch: $BRANCH" 1.16 - cd $pkgsrc && git checkout $BRANCH && cd .. 1.17 + cd $pkgsrc && git checkout $BRANCH && cd .. 1.18 fi 1.19 create_tarball ;; 1.20 cvs*) 1.21 @@ -457,6 +457,7 @@ 1.22 # Export flags and path to be used by make and receipt. 1.23 DESTDIR=$pkgdir/install 1.24 export DESTDIR MAKEFLAGS CFLAGS CXXFLAGS CONFIG_SITE LC_ALL=C LANG=C 1.25 + #LDFLAGS 1.26 1.27 # Check for build deps and handle implicit depends of *-dev packages 1.28 # (ex: libusb-dev :: libusb). 1.29 @@ -501,7 +502,7 @@ 1.30 1.31 # Get the list of installed packages 1.32 cd $INSTALLED && ls -1 > $CACHE/installed.list 1.33 - 1.34 + 1.35 # Have we a missing build dep to cook ? 1.36 if [ -s "$CACHE/missing.dep" ] && [ "$AUTO_COOK" ]; then 1.37 gettext -e "Auto cook config is set : AUTO_COOK\n" 1.38 @@ -518,7 +519,7 @@ 1.39 rm -f $CACHE/missing.dep 1.40 mv $LOGS/$PACKAGE.log.$$ $LOGS/$PACKAGE.log 1.41 fi 1.42 - 1.43 + 1.44 # QA: Exit on missing dep errors. We exit in both cases, if AUTO_COOK 1.45 # is enabled and cook fails we have ERROR in log, if no auto cook we have 1.46 # missing dep in cached file. 1.47 @@ -526,7 +527,7 @@ 1.48 [ -s "$CACHE/missing.dep" ] && nb=$(cat $CACHE/missing.dep | wc -l) 1.49 echo "ERROR: missing dep $nb" && exit 1 1.50 fi 1.51 - 1.52 + 1.53 # Install local packages. 1.54 cd $PKGS 1.55 for i in $(uniq $CACHE/installed.local) 1.56 @@ -534,7 +535,7 @@ 1.57 gettext "Installing dep (pkg/local):"; echo " $i" 1.58 tazpkg install $i >/dev/null 1.59 done 1.60 - 1.61 + 1.62 # Install web or cached packages (if mirror is set to $PKGS we only 1.63 # use local packages). 1.64 for i in $(uniq $CACHE/installed.web) 1.65 @@ -542,7 +543,7 @@ 1.66 gettext "Installing dep (web/cache):"; echo " $i" 1.67 tazpkg get-install $i >/dev/null 1.68 done 1.69 - 1.70 + 1.71 # If a cook failed deps are removed. 1.72 cd $INSTALLED && ls -1 > $CACHE/installed.cook && cd $CACHE 1.73 [ ! -s "installed.cook.diff" ] && \ 1.74 @@ -573,7 +574,7 @@ 1.75 mv tmp-1 tmp/${SOURCE:-$PACKAGE}-$VERSION 1.76 fi 1.77 if [ -d "tmp/${SOURCE:-$PACKAGE}-$VERSION" ]; then 1.78 - cd tmp && tar -c * | lzma e $SRC/$TARBALL -si 1.79 + cd tmp && tar -c * | lzma e $SRC/$TARBALL -si 1.80 fi 1.81 fi 1.82 cd $pkgdir/source/tmp 1.83 @@ -591,6 +592,7 @@ 1.84 if grep -q ^compile_rules $receipt; then 1.85 echo "Executing: compile_rules" 1.86 echo "CFLAGS : $CFLAGS" 1.87 + #echo "LDFLAGS : $LDFLAGS" 1.88 [ -d "$src" ] && cd $src 1.89 compile_rules $@ || exit 1 1.90 # Stay compatible with _pkg 1.91 @@ -636,7 +638,7 @@ 1.92 if fgrep -q ERROR: $LOGS/$pkg.log; then 1.93 exit 1 1.94 fi 1.95 - 1.96 + 1.97 cd $taz 1.98 for file in receipt description.txt 1.99 do 1.100 @@ -645,7 +647,7 @@ 1.101 cp -f ../$file $pack && chown 0.0 $pack/$file && status 1.102 done 1.103 copy_generic_files 1.104 - 1.105 + 1.106 # Create files.list with redirecting find output. 1.107 gettext "Creating the list of files..." && cd $fs 1.108 find . -type f -print > ../files.list 1.109 @@ -670,7 +672,7 @@ 1.110 UNPACKED_SIZE=$(du -chs fs receipt files.list md5sum \ 1.111 description.txt 2> /dev/null | awk \ 1.112 '{ sz=$1 } END { print sz }') 1.113 - 1.114 + 1.115 # Build cpio archives. 1.116 gettext "Compressing the fs... " 1.117 find fs | cpio -o -H newc --quiet | lzma e fs.cpio.lzma -si 1.118 @@ -715,12 +717,12 @@ 1.119 #link=$(find $fs/usr -type l -follow) 1.120 #[ "$link" ] && echo -e "\nERROR: broken link in filesystem" 1.121 #status 1.122 - 1.123 + 1.124 # Exit if any error found in log file. 1.125 if fgrep -q ERROR: $LOGS/$pkg.log; then 1.126 rm -f $command && exit 1 1.127 fi 1.128 - 1.129 + 1.130 gettext "QA: Checking for empty package..." 1.131 files=$(cat $WOK/$pkg/taz/$pkg-*/files.list | wc -l) 1.132 if [ "$files" == 0 ] && [ "$CATEGORY" != "meta" ]; then 1.133 @@ -814,7 +816,7 @@ 1.134 exit 1 1.135 fi 1.136 fi 1.137 - 1.138 + 1.139 # Install package if part of the chroot to keep env up-to-date. 1.140 if [ -d "$INSTALLED/$pkg" ]; then 1.141 . /etc/slitaz/cook.conf 1.142 @@ -824,7 +826,7 @@ 1.143 cd $PKGS && tazpkg install \ 1.144 $pkg-${VERSION}${EXTRAVERSION}.tazpkg --forced 1.145 fi 1.146 - exit $status 1.147 + exit $status 1.148 } 1.149 1.150 # Create a XML feed for freshly builded package. 1.151 @@ -878,13 +880,13 @@ 1.152 done ;; 1.153 *\ --arm\ *) 1.154 hg clone $WOK_URL wok || exit 1 1.155 - sed -i s'/ARCH=.*/ARCH="arm"/' /etc/slitaz/cook.conf 1.156 + sed -i s'/ARCH=.*/ARCH="arm"/' /etc/slitaz/cook.conf 1.157 sed -i s'/BUILD_SYSTEM=.*/BUILD_SYSTEM=i486-slitaz-linux/' \ 1.158 /etc/slitaz/cook.conf ;; 1.159 - *) 1.160 + *) 1.161 for pkg in $SETUP_PKGS 1.162 do 1.163 - [ ! -f "$INSTALLED/$pkg/receipt" ] && 1.164 + [ ! -f "$INSTALLED/$pkg/receipt" ] && 1.165 tazpkg get-install $pkg 1.166 done ;; 1.167 esac 1.168 @@ -929,12 +931,12 @@ 1.169 gettext "Preparing the package receipt..." 1.170 cp $DATA/receipt . 1.171 sed -i s"/^PACKAGE=.*/PACKAGE=\"$pkg\"/" receipt 1.172 - status && echo "" 1.173 - 1.174 + status && echo "" 1.175 + 1.176 # Interactive mode, asking and seding. 1.177 case "$3" in 1.178 --interactive|-x) 1.179 - gettext -e "Entering interactive mode...\n" 1.180 + gettext -e "Entering interactive mode...\n" 1.181 separator 1.182 echo "Package : $pkg" 1.183 # Version. 1.184 @@ -1046,7 +1048,7 @@ 1.185 ${VERSION}$EXTRAVERSION 1.186 $SHORT_DESC 1.187 $PACKED_SIZE ($UNPACKED_SIZE installed) 1.188 - 1.189 + 1.190 EOT 1.191 # packages.equiv is used by tazpkg install to check depends. 1.192 for i in $PROVIDE; do 1.193 @@ -1064,23 +1066,23 @@ 1.194 $PKGS/files.list 1.195 fi 1.196 done 1.197 - 1.198 + 1.199 # Display list size. 1.200 gettext -e "Done: packages.desc\n" 1.201 gettext -e "Done: packages.txt\n" 1.202 gettext -e "Done: packages.equiv\n" 1.203 - 1.204 + 1.205 # files.list.lzma 1.206 gettext -e "Creating: files.list.lzma\n" 1.207 cd $PKGS && lzma e files.list files.list.lzma 1.208 rm -f files.list 1.209 - 1.210 + 1.211 # Display some info. 1.212 separator 1.213 nb=$(ls $PKGS/*.tazpkg | wc -l) 1.214 time=$(($(date +%s) - $time)) 1.215 echo -e "Packages: $nb - Time: ${time}s\n" 1.216 - 1.217 + 1.218 # Create all flavors files at once. Do we really need code to monitor 1.219 # flavors changes ? Lets just build them with packages lists before 1.220 # syncing the mirror. 1.221 @@ -1092,7 +1094,7 @@ 1.222 separator 1.223 gettext -e "Recharging lists to use latest packages...\n" 1.224 tazpkg recharge >/dev/null 2>/dev/null 1.225 - 1.226 + 1.227 # We need a custom tazlito config to set working dir to /home/slitaz. 1.228 if [ ! -f "$live/tazlito.conf" ]; then 1.229 echo "Creating configuration file: tazlito.conf" 1.230 @@ -1103,7 +1105,7 @@ 1.231 1.232 # Update Hg flavors repo and pack. 1.233 [ -d "$flavors/.hg" ] && cd $flavors && hg pull -u 1.234 - 1.235 + 1.236 cd $live 1.237 echo "Starting to generate flavors..." 1.238 rm -f flavors.list *.flavor 1.239 @@ -1145,7 +1147,7 @@ 1.240 unset inst 1.241 unset_receipt 1.242 . $receipt 1.243 - 1.244 + 1.245 # Handle --options 1.246 case "$2" in 1.247 --clean|-c) 1.248 @@ -1166,7 +1168,7 @@ 1.249 gettext "Unblocking:"; echo -n " $pkg" 1.250 sed -i "/^${pkg}$/"d $blocked 1.251 status && echo "" && exit 0 ;; 1.252 - 1.253 + 1.254 esac 1.255 1.256 # Check if wanted is built now so we have separate log files. 1.257 @@ -1196,10 +1198,10 @@ 1.258 debug_info | tee -a $LOGS/$pkg.log 1.259 rm -f $command && exit 1 1.260 fi 1.261 - 1.262 + 1.263 # Create an XML feed 1.264 gen_rss 1.265 - 1.266 + 1.267 # Time and summary 1.268 time=$(($(date +%s) - $time)) 1.269 summary | tee -a $LOGS/$pkg.log 1.270 @@ -1215,7 +1217,7 @@ 1.271 exit 1 1.272 fi 1.273 fi 1.274 - 1.275 + 1.276 # Install package if part of the chroot to keep env up-to-date. 1.277 if [ -d "$INSTALLED/$PACKAGE" ] && [ -z "$AUFS_MOUNTS" ]; then 1.278 echo "Updating chroot environment..." 1.279 @@ -1223,7 +1225,7 @@ 1.280 cd $PKGS && tazpkg install \ 1.281 $PACKAGE-${VERSION}${EXTRAVERSION}.tazpkg --forced 1.282 fi 1.283 - 1.284 + 1.285 # Finally we DONT WANT to build the *-dev or packages with WANTED="$pkg" 1.286 # You want automation: use the Cooker Build Bot. 1.287 #[ -d "$WOK/$pkg-dev" ] && cook $pkg-dev
2.1 --- a/cook.conf Mon Apr 23 13:22:20 2012 +0200 2.2 +++ b/cook.conf Thu Apr 26 13:34:41 2012 +0200 2.3 @@ -53,6 +53,9 @@ 2.4 CFLAGS="-march=$ARCH -Os -pipe -fomit-frame-pointer" 2.5 CXXFLAGS="$CFLAGS" 2.6 2.7 +# Binutils 2.22 break many packages build without LDFLAGS set correctly. 2.8 +#LDFLAGS="-Wl,--copy-dt-needed-entries -lXt" 2.9 + 2.10 # Default tool prefix for Binutils. 2.11 TOOLPREFIX="${HOST_SYSTEM}-" 2.12 2.13 @@ -71,6 +74,6 @@ 2.14 SETUP_PKGS="slitaz-toolchain pkg-config intltool gettext zlib-dev bzip2 2.15 aufs-utils aufs m4 syslinux-extra pcre pcre-dev bash xorg-dev" 2.16 2.17 -# List of filesystems into the aufs chroot (to protect / against modifications) 2.18 +# List of filesystems into the aufs chroot (to protect / against modifications) 2.19 # Default tank config: 2.20 AUFS_MOUNTS="/ /proc /sys /dev/shm /dev/pts /var/cache/tazpkg /home /home/slitaz/src /home/slitaz/packages"