summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian 'Swift Geek' Grzywna2017-02-28 02:52:01 +0100
committerSebastian 'Swift Geek' Grzywna2017-02-28 03:04:50 +0100
commit5e9d515cc5eb48133fb68118417c39e55de8a540 (patch)
tree0d1601722f7bd29a9248229b0610699e3c8b9842
parent672cae010cd97e4bdfb5cb08e35690b12a87e0e9 (diff)
downloadaur-5e9d515cc5eb48133fb68118417c39e55de8a540.tar.gz
Fix use with makepkg -e and -o options
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD41
2 files changed, 21 insertions, 22 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 68db73f10cd2..436d9cb60bda 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,5 +1,5 @@
# Generated by mksrcinfo v8
-# Thu Jan 5 14:46:12 UTC 2017
+# Tue Feb 28 01:52:01 UTC 2017
pkgbase = slic3r-git
pkgdesc = Slic3r is an STL-to-GCODE translator for RepRap 3D printers, aiming to be a modern and fast alternative to Skeinforge.
pkgver = a
diff --git a/PKGBUILD b/PKGBUILD
index c7dc99ed5a58..ee14489b85d6 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -35,6 +35,7 @@ md5sums=('SKIP'
_gitname="Slic3r"
#TODO: derrive this from pkgbuild "fragment", skip checkout/reset if fragment is set in source (no need for doing this twice)
_gitfragment="stable"
+_src_dir='$srcdir/$_gitname'
countdown() {
local i
@@ -46,8 +47,7 @@ countdown() {
}
pkgver() {
- export _src_dir="$srcdir/$_gitname"
- cd "$_src_dir"
+ eval cd "$_src_dir"
#
### Now figure out PKGVER
#
@@ -63,9 +63,8 @@ pkgver() {
}
prepare() {
- export _src_dir="$srcdir/$_gitname"
# Disable detached head warning
- ( cd ${_src_dir} ; git config advice.detachedHead false )
+ ( eval cd ${_src_dir} ; git config advice.detachedHead false )
# TODO: After all done ramp up pkgver++
# TODO: Remind user about stable branch and others
# TODO: ASK for disabling checks in case of failure (or even press something to ignore for N seconds)
@@ -87,7 +86,7 @@ prepare() {
select_mode=$(dialog --keep-tite --backtitle "$pkgname" --noitem --radiolist 'Specify revision based on:' 0 0 0 branch/commit on tag off 2>&1 >/dev/tty)
case $select_mode in
"branch/commit")
- cd "$_src_dir"
+ eval cd "$_src_dir"
# Pick a branch - default is stable… for now
# TODO: derrive actual current state of selection (commit/branch from fragment)
branches=( $(git ls-remote --heads origin | sed 's?.*refs/heads/??' | awk '{printf $1; if ($1 == "stable") printf " on ";else printf " off "}') )
@@ -111,7 +110,7 @@ prepare() {
git checkout $commit -f
;;
"tag")
- cd "$_src_dir"
+ eval cd "$_src_dir"
tags=( $(git tag -l | tac | awk '{printf $1; if ($1 == "1.0.0RC1") printf " on ";else printf " off "}') )
tag=$(dialog --keep-tite --backtitle "$pkgname" --no-items --radiolist 'Pick tag' 0 0 0 ${tags[*]} 2>&1 >/dev/tty)
msg2 "Picked \"${tag}\" tag"
@@ -122,20 +121,13 @@ prepare() {
;;
esac
else
- cd "$_src_dir"
+ eval cd "$_src_dir"
git checkout "${_gitfragment}" -f
fi
} 1>&2
### OLD PREPARE
- # Setting these env variables overwrites any command-line-options we don't want...
- export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps \
- PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
- PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
- MODULEBUILDRC=/dev/null
- export SLIC3R_NO_AUTO="true"
-
- cd "$_src_dir"
+ eval cd "$_src_dir"
# Nasty fix for useless Growl dependency ... please post in comments/upstream real fix, if u know one ;)
sed -i '/Growl/d' Build.PL
@@ -145,16 +137,23 @@ prepare() {
# Nasty fix for local::lib use
find . -iregex '.*\.\(pl\|pm\|t\)' -print0 | xargs -0 -l sed -i -e '/use local::lib/d'
+}
+
+build() {
+ # Setting these env variables overwrites any command-line-options we don't want...
+ export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps \
+ PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
+ PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
+ MODULEBUILDRC=/dev/null
+ export SLIC3R_NO_AUTO="true"
+ eval cd "$_src_dir/xs"
# Dependency check - intended of package maintainer only, for now
#TODO: make sure that this if actually works when !check inside makepkg.conf and check inside pkgbuild... find last check and check if it has ! in front?. Is check default?
if [[ " ${BUILDENV[*]} " != *" !check "* ]] || [[ " ${BUILDENV[*]} " == *" !check"*" check "* ]]; then
msg2 "Checking prerequisites"
/usr/bin/perl Build.PL --gui || true #TODO: make enough seds so true is not needed
fi
-}
-build() {
- cd "$_src_dir/xs"
warning " ⚠ DO NOT respond to any question with 'yes'. Report a bug in comment instead.\n"
# Cuz cpan will install fixes to $HOME ... which is not the point of this package
@@ -168,7 +167,7 @@ build() {
}
check () {
- cd "$_src_dir"
+ eval cd "$_src_dir"
msg2 "Testing Slic3r::XS - (2/3)"
prove -Ixs/blib/arch -Ixs/blib/lib/ xs/t/
@@ -178,7 +177,7 @@ check () {
}
package () {
- cd "$_src_dir"
+ eval cd "$_src_dir"
install -d $pkgdir/usr/share/perl5/vendor_perl/
cp -R $srcdir/$_gitname/lib/* $pkgdir/usr/share/perl5/vendor_perl/
@@ -205,7 +204,7 @@ package () {
install -m 755 $srcdir/slic3r.pl $pkgdir/usr/bin/slic3r.pl
### SLIC3R-XS MERGE
- cd "$_src_dir/xs"
+ eval cd "$_src_dir/xs"
./Build install
}