diff options
author | Grey Christoforo | 2015-06-21 14:03:25 +0200 |
---|---|---|
committer | Grey Christoforo | 2015-06-21 14:03:25 +0200 |
commit | 88f053d8a2b0d5efe94e0d6d2c731f243619a9a6 (patch) | |
tree | 7b53648e0f7085c2fda02280a6641af84b7f7a38 | |
parent | 25b0cb66f0c33d66a95a3bfafff1d837e1359cb6 (diff) | |
download | aur-88f053d8a2b0d5efe94e0d6d2c731f243619a9a6.tar.gz |
switch to unpacking the installer binary instead of running it
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | .gitignore | 5 | ||||
-rw-r--r-- | PKGBUILD | 96 | ||||
-rw-r--r-- | liblzmadec0.2.so | bin | 0 -> 29008 bytes | |||
-rw-r--r-- | microchip-mplabxc32-bin.install | 34 |
5 files changed, 104 insertions, 53 deletions
@@ -1,15 +1,19 @@ pkgbase = microchip-mplabxc32-bin - pkgdesc = C/C++ compiler for PIC32 MCUs - pkgver = 1.33 - pkgrel = 3 + pkgdesc = Microchip's MPLAB XC32 C compiler toolchain for all of their 32bit microcontrollers + pkgver = 1.34 + pkgrel = 1 url = http://www.microchip.com/xc32 install = microchip-mplabxc32-bin.install arch = i686 arch = x86_64 license = custom - depends = xclm-dirs - provides = mplabxc32 - conflicts = mplabxc32 + makedepends = sdx + makedepends = tcl + makedepends = tcl-vfs + depends = lib32-expat + depends = lib32-gcc-libs + noextract = installerBlobFromMicrochip + noextract = liblzmadec0.2.so options = !strip options = docs options = libtool @@ -17,8 +21,10 @@ pkgbase = microchip-mplabxc32-bin options = !zipman options = staticlibs options = !upx - source = http://ww1.microchip.com/downloads/en/DeviceDoc/xc32-v1.33-full-install-linux-installer.run - md5sums = 9f4f086d6f2b9c044f9cd2e46ec3f56c + source = installerBlobFromMicrochip::http://ww1.microchip.com/downloads/en/DeviceDoc/xc32-v1.34-full-install-linux-installer.run + source = liblzmadec0.2.so + md5sums = 538d2e0c00fcb4f85bb15166f2320b83 + md5sums = e43a1f543ba4f67a2d5b2e8d9656a6c7 pkgname = microchip-mplabxc32-bin diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..f3c9ec7feae5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*.tar.gz +*.tar.xz +src/ +pkg/ +installerBlobFromMicrochip @@ -1,36 +1,82 @@ -# Maintainer: Peter Ivanov <ivanovp@gmail.com> -# Contributor: joat <joat at lavabit dot com> -# Submitter: BxS <bxsbxs at gmail dot com> - -pkgname=microchip-mplabxc32-bin -pkgver=1.33 -pkgrel=3 -pkgdesc="C/C++ compiler for PIC32 MCUs" +# Maintainer: Grey Christoforo <grey@christoforo.net> + +_number_of_bits=32 +pkgname=microchip-mplabxc${_number_of_bits}-bin +pkgver=1.34 +pkgrel=1 +pkgdesc="Microchip's MPLAB XC${_number_of_bits} C compiler toolchain for all of their 32bit microcontrollers" arch=(i686 x86_64) -url=http://www.microchip.com/xc32 +url=http://www.microchip.com/xc${_number_of_bits} license=(custom) -depends=(xclm-dirs) -[ $CARCH = x86_64 ] && depends+=(lib32-gcc-libs lib32-expat) -[ $CARCH = x86_64 ] && makedepends=(lib32-fakeroot) -provides=(mplabxc32) -conflicts=(mplabxc32) +if [[ $CARCH = i686 ]]; then + depends=( + 'expat' + 'gcc-libs' + ) +else + depends=( + 'lib32-expat' + 'lib32-gcc-libs' + ) +fi +makedepends=(sdx tcl tcl-vfs) options=(!strip docs libtool emptydirs !zipman staticlibs !upx) -PKGEXT='.pkg.tar' +source=("installerBlobFromMicrochip::http://ww1.microchip.com/downloads/en/DeviceDoc/xc${_number_of_bits}-v$pkgver-full-install-linux-installer.run" liblzmadec0.2.so) +noextract=(installerBlobFromMicrochip liblzmadec0.2.so) +md5sums=('538d2e0c00fcb4f85bb15166f2320b83' + 'e43a1f543ba4f67a2d5b2e8d9656a6c7') install=$pkgname.install -instdir=/opt/microchip/xc32/v$pkgver -installer=xc32-v$pkgver-full-install-linux-installer.run -source=(http://ww1.microchip.com/downloads/en/DeviceDoc/$installer) -md5sums=('9f4f086d6f2b9c044f9cd2e46ec3f56c') + +build() { + # unwrap installer files + sdx.kit unwrap installerBlobFromMicrochip + + # read unpack options + _unpack_options=$(cat installerBlobFromMicrochip.vfs/cookfsinfo.txt) + + # write unpack tcl script to file +cat > unpack.tcl <<EOF +package require vfs::cookfs +package require Tcllzmadec +vfs::cookfs::Mount ${_unpack_options} installerBlobFromMicrochip virtual +file copy virtual unpacked.vfs +EOF + + # if this is a 64bit machine, we need to use the packaged zlma decoder so since the insaller only provides a 32bit one + if [[ $CARCH = x86_64 ]]; then + mv liblzmadec0.2.so installerBlobFromMicrochip.vfs/libraries/lzma*/. + fi + + msg2 "Unpacking installer. This might take a while..." + LD_LIBRARY_PATH=./usr/lib: TCL_LIBRARY=./installerBlobFromMicrochip.vfs/lib TCLLIBPATH=./installerBlobFromMicrochip.vfs/libraries tclsh unpack.tcl + + #now reassemble files larger than 5MB in the archive, which were split up for whatever reason + #msg2 "Reassembling files..." + #ifor f in `find ./unpacked.vfs -name '*___bitrockBigFile1'` + #do + # firstChunk="$f" + # baseName="${firstChunk//___bitrockBigFile1/}" + # allPieces="$(find -path "${baseName}*" | sort --version-sort)" + # cat $allPieces > "$baseName".reassembled + # rm $allPieces + # mv "$baseName".reassembled "$baseName" + #done +} package() { - echo -e "Creating the Package\n Please wait..." + mv unpacked.vfs/compiler/programfilesosx/* unpacked.vfs/compiler/programfiles/ + mv unpacked.vfs/compiler/programfiles/*License.txt unpacked.vfs/compiler/programfiles/docs/. - chmod 755 $srcdir/$installer - echo -e "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ny\n1\nn\n$pkgdir$instdir\nn\ny\ni\n" > $srcdir/inst_input + mkdir -p "$pkgdir"/opt/$pkgname + mv unpacked.vfs/compiler/programfiles/* "$pkgdir"/opt/$pkgname/. - HOME=$srcdir $srcdir/$installer --mode text < $srcdir/inst_input &> /dev/null || true + msg2 "Making executables executable" + find "$pkgdir"/opt/$pkgname/bin -type f -exec /bin/sh -c "file {} | grep -q executable && chmod +x {}" \; - chmod -R 755 $pkgdir$instdir/{bin,etc} + mkdir -p "$pkgdir/etc/profile.d" + echo "export PATH="'$PATH'":/opt/${pkgname}/bin" > "$pkgdir/etc/profile.d/${pkgname}.sh" + echo "export XC${_number_of_bits}_TOOLCHAIN_ROOT=/opt/${pkgname}" >> "$pkgdir/etc/profile.d/${pkgname}.sh" + mkdir -p $pkgdir/usr/share/licenses/$pkgname - ln -s $instdir/MPLAB_XC32_Compiler_License.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE + ln -s /opt/$pkgname/docs/*icense.txt $pkgdir/usr/share/licenses/$pkgname/LICENSE } diff --git a/liblzmadec0.2.so b/liblzmadec0.2.so Binary files differnew file mode 100644 index 000000000000..cdfdce1d5c3c --- /dev/null +++ b/liblzmadec0.2.so diff --git a/microchip-mplabxc32-bin.install b/microchip-mplabxc32-bin.install index 81bba8d1eb42..a5f15ce9b061 100644 --- a/microchip-mplabxc32-bin.install +++ b/microchip-mplabxc32-bin.install @@ -1,31 +1,25 @@ -post_install() { - echo " +message_to_user(){ + echo ' +This package provides a file: /etc/profile.d/microchip-mplabxc32-bin.sh +It will add the toolchain binaries to the PATH variable for every user. +It also defines XC32_TOOLCHAIN_ROOT pointing to the toolchain install dir. +Log out and log back in to update your environment varibles. + Before using MPLAB_XC32 you have to agree with the LICENSE at: /usr/share/licenses/microchip-mplabxc32-bin/LICENSE -For using MPLAB_XC32 with MPALB_X (microchip-mplabx-bin), in MPLAB_X go to: +For using MPLAB_XC32 with MPLAB_X (microchip-mplabx-bin), in MPLAB_X go to: Tools->Options->Embedded->Add and enter: -/opt/microchip/xc32/v1.33/bin - -//-------- C++ -------- -If you never activated the free C++ support to get it working you will need to get a free C++ activation key at: -http://www.microchip.com/MPLABXCcompilers - -and them run: -sudo /opt/microchip/xc32/v1.33/bin/xclm -actkey activation-key hostid=mac hostname=host - -To get hostid and hostname you can use: -/opt/microchip/xc32/v1.33/bin/xclm -hostinfo - -This will install a license file at '/opt/microchip/xclm/license/' +$XC32_TOOLCHAIN_ROOT/bin +' +} -This activation should only need to be done once. -//-------- C++ -------- -" +post_install() { + message_to_user } post_upgrade() { - post_install + message_to_user } |