Check-in [af79362c78]
Overview
Comment:Added support for applying patches
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | packages
Files: files | file ages | folders
SHA1:af79362c783d9ab93143d33adb873540b6b752cb
User & Date: rkeene on 2014-11-12 08:04:31
Other Links: manifest | tags
Context
2014-11-12
08:04
Added "attr" package check-in: 5a12684aa8 user: rkeene tags: packages
08:04
Added support for applying patches check-in: af79362c78 user: rkeene tags: packages
07:38
Updated to build with latest version of dependencies if their version is not specified, otherwise, try to find one check-in: 5ceded1d7d user: rkeene tags: packages
Changes

Modified build from [68229c87b4] to [5526d031f2].

    72     72   			unzip "${pkgarchive}" || die 'Unable to uncompress archive'
    73     73   			;;
    74     74   		*)
    75     75   			"${decompress}" -dc "${pkgarchive}" | tar -xf - || die 'Unable to uncompress archive'
    76     76   			;;
    77     77   	esac
    78     78   }
           79  +
           80  +function apply_patches() {
           81  +	local patch
           82  +
           83  +	for patch in "${pkgdir}/patches"/*; do
           84  +		if [ ! -e "${patch}" ]; then
           85  +			continue
           86  +		fi
           87  +
           88  +		case "${patch}" in
           89  +			*.diff|*.patch)
           90  +				;;
           91  +			*)
           92  +				continue
           93  +				;;
           94  +		esac
           95  +
           96  +		if [ -e "${patch}.sh" ]; then
           97  +			if ! sh "${patch}.sh"; then
           98  +				continue
           99  +			fi
          100  +		fi
          101  +
          102  +		patch -p1 < "${patch}"
          103  +	done
          104  +}
    79    105   
    80    106   function verifyRequiredPackages() {
    81    107   	local pkg pkgdomain pkgversion
    82    108   	local pkgdir pkgconfigdir pkgfound
    83    109   
    84    110   	for pkg in "${require[@]}"; do
    85    111   		pkgdomain=''
................................................................................
   284    310   cd "${scriptdir}" || exit 1
   285    311   
   286    312   if [ -f 'build.conf' ]; then
   287    313   	. 'build.conf'
   288    314   fi
   289    315   
   290    316   if [ -d "pkgs/${pkg}" ]; then
   291         -	pkgdir="pkgs/${pkg}"
          317  +	pkgdir="$(pwd)/pkgs/${pkg}"
   292    318   	pkgfile="${pkgdir}/info"
   293    319   else
   294         -	pkgfile="pkgs/${pkg}"
          320  +	pkgfile="$(pwd)/pkgs/${pkg}"
   295    321   	pkgdir="${pkgfile}"
   296    322   fi
   297    323   
   298    324   if [ ! -e "${pkgfile}" ]; then
   299    325   	echo "Invalid package." >&2
   300    326   
   301    327   	exit 1
................................................................................
   333    359   verifyPrerequisites || die 'Prerequisities failed'
   334    360   
   335    361   # Start logging
   336    362   set -x
   337    363   
   338    364   # Determine properties
   339    365   determinePrefix
          366  +
          367  +# Apply patches
          368  +apply_patches
   340    369   
   341    370   # Start the build
   342    371   preconfigure || die 'preconfigure failed'
   343    372   configure || die 'configure failed'
   344    373   postconfigure || die 'postconfigure failed'
   345    374   
   346    375   prebuild || die 'prebuild failed'