diff options
author | Swift Geek | 2015-01-26 00:00:04 +0000 |
---|---|---|
committer | Kyle Keen | 2015-01-26 00:00:04 +0000 |
commit | 7a20104fedafc4169d4140510e5cdb1150721ac9 (patch) | |
tree | 57899f840acbe3e1511de4ffffec2dfb536097de | |
parent | 9cc581614ef6434c84ae8748cc44686474e392ce (diff) | |
download | aur-7a20104fedafc4169d4140510e5cdb1150721ac9.tar.gz |
Import from pkgbuild.com service
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 167 | ||||
-rwxr-xr-x | slic3r.pl | 3 |
3 files changed, 90 insertions, 85 deletions
@@ -1,7 +1,7 @@ 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 - pkgrel = 13 + pkgrel = 14 url = http://slic3r.org/ arch = any license = GPL @@ -16,6 +16,7 @@ pkgbase = slic3r-git depends = perl-io-stringy depends = perl-encode-locale depends = perl-extutils-makemaker-aur>=6.82 + depends = perl-threads-aur>=1.96 depends = perl-extutils-parsexs>=3.22 optdepends = perl-wx: GUI support optdepends = perl-net-dbus: notifications support via any dbus-based notifier @@ -35,7 +36,7 @@ pkgbase = slic3r-git source = slic3r.pl md5sums = SKIP md5sums = 1b561afff48c79f86889664375d179ed - md5sums = 1371d698799ee97a43d22f6436a2e619 + md5sums = b0acc88252ad23ae80c5e2596cfc883a pkgname = slic3r-git @@ -6,13 +6,13 @@ pkgname=slic3r-git pkgver=a -pkgrel=13 +pkgrel=14 pkgdesc="Slic3r is an STL-to-GCODE translator for RepRap 3D printers, aiming to be a modern and fast alternative to Skeinforge." arch=('any') url="http://slic3r.org/" license=('GPL') depends=('perl' - 'perl-moo' 'perl-math-clipper' 'perl-math-convexhull' 'perl-math-geometry-voronoi' 'perl-math-planepath' 'perl-math-convexhull-monotonechain' 'perl-io-stringy' 'perl-encode-locale' 'perl-extutils-makemaker-aur>=6.82' 'perl-extutils-parsexs>=3.22' ) + 'perl-moo' 'perl-math-clipper' 'perl-math-convexhull' 'perl-math-geometry-voronoi' 'perl-math-planepath' 'perl-math-convexhull-monotonechain' 'perl-io-stringy' 'perl-encode-locale' 'perl-extutils-makemaker-aur>=6.82' 'perl-threads-aur>=1.96' 'perl-extutils-parsexs>=3.22' ) makedepends=('git') optdepends=('perl-wx: GUI support' 'perl-net-dbus: notifications support via any dbus-based notifier' @@ -29,7 +29,7 @@ conflicts=('slic3r' 'slic3r-xs' 'slic3r-xs-git') source=('git+https://github.com/alexrj/Slic3r.git' 'slic3r.desktop' 'slic3r.pl') md5sums=('SKIP' '1b561afff48c79f86889664375d179ed' - '1371d698799ee97a43d22f6436a2e619') + 'b0acc88252ad23ae80c5e2596cfc883a') _gitname="Slic3r" #TODO: derrive this from pkgbuild "fragment", skip checkout/reset if fragment is set in source (no need for doing this twice) @@ -44,107 +44,113 @@ countdown() { done } -prepare() { +pkgver() { export _src_dir="$srcdir/$_gitname" - # 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" - + # Disable detached head warning + ( 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) #------------------------------------------------------ # Welcome new interactive config overlord - - #TODO: Display warning with current branch/commit, just before prompt to press key - - if [[ "$(cat /proc/$$/cmdline)" != *noconfirm* ]] && tty -s ; then - countdown 3 & countdown_pid=$! - read -s -n 1 -t 3 ikey || true - kill -s SIGHUP $countdown_pid > /dev/null || true # Any key below 1sec fix - echo -e -n "\n" - elif [[ "$(cat /proc/$$/cmdline)" != *noconfirm* ]]; then - error "Interactivity prompt in make process is impossible with your AUR helper - change _gitfragment value to needed branch/tag/commit. Default value is ${_gitfragment}" - else - warning "Interactivity prompt skipped (noconfirm)" - fi - if [ "$ikey" = "i" -o "$ikey" = "I" ]; then - 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" - # 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 "}') ) - branch=$(dialog --keep-tite --backtitle "$pkgname" --no-items --radiolist 'Pick branch' 0 0 0 ${branches[*]} 2>&1 >/dev/tty) - unset branches - msg2 "Chosen \"${branch}\" branch " - git checkout $branch -f - # Pick commit - readarray -t git_log <<< "$(git --no-pager log -n 30 --pretty=oneline)" - for line in "${git_log[@]}" - do - commits+=( "$(echo $line | awk '{printf $1}')" ) - commits+=( "$(echo $line | awk '{for (i=2; i<=NF; i++) { printf $i; if (i<NF) printf " " } }')" ) - commits+=( 'off' ) - done - unset git_log - commits[2]='on' - commit=$(dialog --keep-tite --backtitle "$pkgname" --radiolist 'Pick commit' 0 0 0 "${commits[@]}" 2>&1 >/dev/tty) - unset commits - msg2 "Picked \"${commit}\" commit" - git checkout $commit -f - ;; - "tag") - 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" - git checkout "tags/${tag}" -f - ;; - *) - echo "WTF!? This shouldn't happen at all" - ;; - esac + { + #TODO: Display warning with current branch/commit, just before prompt to press key + if [[ "$(cat /proc/$$/cmdline)" != *noconfirm* ]] && tty -s ; then + countdown 3 & countdown_pid=$! + read -s -n 1 -t 3 ikey || true + kill -s SIGHUP $countdown_pid > /dev/null || true # Any key below 1sec fix + echo -e -n "\n" + elif [[ "$(cat /proc/$$/cmdline)" != *noconfirm* ]]; then + error "Interactivity prompt in make process is impossible with your AUR helper - change _gitfragment value to needed branch/tag/commit. Default value is ${_gitfragment}" + else + warning "Interactivity prompt skipped (noconfirm)" + fi + if [ "$ikey" = "i" -o "$ikey" = "I" ]; then + 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" + # 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 "}') ) + branch=$(dialog --keep-tite --backtitle "$pkgname" --no-items --radiolist 'Pick branch' 0 0 0 ${branches[*]} 2>&1 >/dev/tty) + unset branches + msg2 "Chosen \"${branch}\" branch " + git checkout $branch -f + # Pick commit + readarray -t git_log <<< "$(git --no-pager log -n 30 --pretty=oneline)" + for line in "${git_log[@]}" + do + commits+=( "$(echo $line | awk '{printf $1}')" ) + commits+=( "$(echo $line | awk '{for (i=2; i<=NF; i++) { printf $i; if (i<NF) printf " " } }')" ) + commits+=( 'off' ) + done + unset git_log + commits[2]='on' + commit=$(dialog --keep-tite --backtitle "$pkgname" --radiolist 'Pick commit' 0 0 0 "${commits[@]}" 2>&1 >/dev/tty) + unset commits + msg2 "Picked \"${commit}\" commit" + git checkout $commit -f + ;; + "tag") + 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" + git checkout "tags/${tag}" -f + ;; + *) + echo "WTF!? This shouldn't happen at all" + ;; + esac + else + cd "$_src_dir" + git checkout "${_gitfragment}" -f + fi + } 1>&2 + # + ### Now figure out PKGVER + # + if grep -sq '#define SLIC3R_VERSION' ./xs/src/libslic3r/libslic3r.h; then + # 6adc3477c9d08d2cfa0e6902b3d241a9193e50d4 intruduces libslic3r.h in that directory BUT + # 8b6a8e63079978646cd98a96d6ad178b28f3067c introduces version in that header + _pkgver="$(awk '/#define SLIC3R_VERSION/ {gsub(/"/, "", $3); print $3 }' ./xs/src/libslic3r/libslic3r.h).$(git rev-parse --short HEAD)" else - cd "$_src_dir" - git checkout "${_gitfragment}" -f + _pkgver="$(awk 'BEGIN{FS="\""}/VERSION/{gsub(/-dev/,"",$2); print $2 }' ./lib/Slic3r.pm).$(git rev-parse --short HEAD)" fi + _pkgver="${_pkgver//-/_}" + echo "${_pkgver}" +} + +prepare() { + export _src_dir="$srcdir/$_gitname" + # 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" - # Nasty fix for useless Growl dependency ... please post in comment real fix, if u know one ;) TODO: Change it to just line containing just like in netfabb -# sed -i "s/ 'Growl/\#&/" Build.PL + # Nasty fix for useless Growl dependency ... please post in comments/upstream real fix, if u know one ;) sed -i '/Growl/d' Build.PL # Nasty fix for useless warning sed -i '/^warn \"Running Slic3r under Perl/,+1 s/^/\#/' ./lib/Slic3r.pm - - # Why true? cuz pacman is crazy... and it still doesn't work as intended - if grep -sq '#define SLIC3R_VERSION' ./xs/src/libslic3r/libslic3r.h; then - # 6adc3477c9d08d2cfa0e6902b3d241a9193e50d4 intruduces libslic3r.h in that directory BUT - # 8b6a8e63079978646cd98a96d6ad178b28f3067c introduces version in that header - true && pkgver="$(awk '/#define SLIC3R_VERSION/ {gsub(/"/, "", $3); print $3 }' ./xs/src/libslic3r/libslic3r.h).$(git rev-parse --short HEAD)" - else - true && pkgver="$(awk 'BEGIN{FS="\""}/VERSION/{gsub(/-dev/,"",$2); print $2 }' ./lib/Slic3r.pm).$(git rev-parse --short HEAD)" - fi - export _pkgver="$pkgver" - msg2 "Fetched $_pkgver" } build() { cd "$_src_dir/xs" warning " ⚠ DO NOT respond to any question with 'yes'. Report a bug in comment instead.\n" - warning "Running Slic3r under Perl >= 5.16 is not supported nor recommended\nIn case of related to this issues please use ARM repository to get older perl package\n" # Cuz cpan will install fixes to $HOME ... which is not the point of this package + #warning "Running Slic3r under Perl = 5.16 is not supported nor recommended\nIn case of related to this issues please use ARM repository to get older perl package\n" + #↑ detect perl 5.16? Sound's commit 9cb6dc768fe187b0324927b5ec787307f36477cd states that only that version is affected. Cannot be done with pkg-config + # slic3r-xs Build stage msg2 "Building Slic3r::XS (1/3)" /usr/bin/perl Build.PL ./Build - } check () { @@ -187,8 +193,5 @@ package () { ### SLIC3R-XS MERGE cd "$_src_dir/xs" ./Build install - - # Why double? 1st one was just for messages, this one is for real - true && pkgver=$_pkgver } diff --git a/slic3r.pl b/slic3r.pl index fd8c89ac2c53..e9ca79651f21 100755 --- a/slic3r.pl +++ b/slic3r.pl @@ -1,4 +1,5 @@ #!/bin/bash -# This scrips is easy fix to perl and slic3r local problem +# This scrips is an easy fix to perl and slic3r locale problems +# This only has to be removed after i18n support will be added (not planned) export LC_ALL=C exec /usr/bin/vendor_perl/slic3r.pl "$@" |