Add ARM binaries
Before adoption: this commit came in with the history the project adopted, so no landing records it.
closes #331
authored by David Peter · committed by GitHub · parent b2a246c · Browse files · 3 files·+108 added−19 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
3 files+108 added−19 removed
- other:+108 added−19 removed
Provenance
- Commit
699d8ca- Tree
2d37bca- Author
David Peter <sharkdp@users.noreply.github.com>- Committer
GitHub <noreply@github.com>- Parent
b2a246c
3 files changed+108 added−19 removed
modified:ci/before_deploy.bash+64 added-6 removed
9 unmodified lines101112131415161718192021222324252627282930312432333435363738394033414243449 unmodified lines5455565758596061626364656667686970717273747576777860617980818283847 unmodified lines9293949577969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471484 unmodified lines15315415515610015715815916016116216316416512 unmodified lines9 unmodified linespack() { local tempdir local out_dir local package_name local gcc_prefix
tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp) out_dir=$(pwd) package_name="$PROJECT_NAME-$TRAVIS_TAG-$TARGET"
if [[ $TARGET == arm-unknown-linux-* ]]; then gcc_prefix="arm-linux-gnueabihf-" else gcc_prefix="" fi
# create a "staging" directory mkdir "$tempdir/$package_name" mkdir "$tempdir/$package_name/autocomplete"
# copying the main binary cp "target/$TARGET/release/$PROJECT_NAME" "$tempdir/$package_name/" strip "$tempdir/$package_name/$PROJECT_NAME" "${gcc_prefix}"strip "$tempdir/$package_name/$PROJECT_NAME"
# manpage, readme and license cp "doc/$PROJECT_NAME.1" "$tempdir/$package_name" cp README.md "$tempdir/$package_name" cp LICENSE-MIT "$tempdir/$package_name" cp LICENSE-APACHE "$tempdir/$package_name"
# various autocomplete mkdir "$tempdir/$package_name/autocomplete" cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".bash "$tempdir/$package_name/autocomplete/${PROJECT_NAME}.bash-completion" cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".fish "$tempdir/$package_name/autocomplete" cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/_"$PROJECT_NAME" "$tempdir/$package_name/autocomplete"
9 unmodified lines local architecture local version local dpkgname local conflictname local homepage local maintainer local gcc_prefix
homepage="https://github.com/sharkdp/$PROJECT_NAME" maintainer="David Peter <mail@david-peter.de>"
case $TARGET in x86_64*) architecture=amd64 gcc_prefix="" ;; i686*) architecture=i386 gcc_prefix="" ;; arm*hf) architecture=armhf gcc_prefix="arm-linux-gnueabihf-" ;; *) echo "ERROR: unknown target" >&2 return 1 echo "make_deb: skipping target '${TARGET}'" >&2 return 0 ;; esac version=${TRAVIS_TAG#v} if [[ $TARGET = *musl* ]]; then7 unmodified lines tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
# copy the main binary install -Dm755 "target/$TARGET/release/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME" strip "$tempdir/usr/bin/$PROJECT_NAME" "${gcc_prefix}"strip "$tempdir/usr/bin/$PROJECT_NAME"
# manpage install -Dm644 "doc/$PROJECT_NAME.1" "$tempdir/usr/share/man/man1/$PROJECT_NAME.1" gzip --best "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"
# readme and license install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md" install -Dm644 LICENSE-MIT "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-MIT" install -Dm644 LICENSE-APACHE "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-APACHE" cat > "$tempdir/usr/share/doc/$PROJECT_NAME/copyright" <<EOFFormat: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/Upstream-Name: $PROJECT_NAMESource: $homepage
Files: *Copyright: $maintainerLicense: Apache-2.0 or MIT
License: Apache-2.0 On Debian systems, the complete text of the Apache-2.0 can be found in the file /usr/share/common-licenses/Apache-2.0.
License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.EOF
# completions install -Dm644 target/$TARGET/release/build/$PROJECT_NAME-*/out/$PROJECT_NAME.bash "$tempdir/usr/share/bash-completion/completions/${PROJECT_NAME}" install -Dm644 target/$TARGET/release/build/$PROJECT_NAME-*/out/$PROJECT_NAME.fish "$tempdir/usr/share/fish/completions/$PROJECT_NAME.fish" install -Dm644 target/$TARGET/release/build/$PROJECT_NAME-*/out/_$PROJECT_NAME "$tempdir/usr/share/zsh/vendor-completions/_$PROJECT_NAME"4 unmodified linesPackage: $dpkgnameVersion: $versionSection: utilsPriority: optionalMaintainer: David Peter <mail@david-peter.de>Maintainer: $maintainerArchitecture: $architectureProvides: $PROJECT_NAMEConflicts: $conflictnameHomepage: $homepageDescription: A command-line benchmarking tool.EOF
fakeroot dpkg-deb --build "$tempdir" "${dpkgname}_${version}_${architecture}.deb"12 unmodified linesadded:ci/before_install.bash+26 added
1234567891011121314151617181920212223242526#!/usr/bin/env bash
set -ex
if [ "$TRAVIS_OS_NAME" != linux ]; then exit 0fi
sudo apt-get update
# needed to build deb packagessudo apt-get install -y fakeroot
# needed for i686 linux gnu targetif [[ $TARGET == i686-unknown-linux-* ]]; then sudo apt-get install -y gcc-multilibfi
# needed for cross-compiling for armif [[ $TARGET == arm-unknown-linux-* ]]; then sudo apt-get install -y \ gcc-4.8-arm-linux-gnueabihf \ binutils-arm-linux-gnueabihf \ libc6-armhf-cross \ libc6-dev-armhf-crossfimodified:.travis.yml+18 added-13 removed
1 language: rust2-cache: cargo3-matrix:2+jobs:3 include:4 # Stable channel.5 - os: linux6 rust: stable9 unmodified lines16 env: TARGET=i686-unknown-linux-musl17 - os: osx18 rust: stable19 env: TARGET=x86_64-apple-darwin20+ - os: linux21+ rust: stable22+ env:23+ - TARGET=arm-unknown-linux-gnueabihf24+ - CC_arm_unknown_linux_gnueabihf=/usr/bin/arm-linux-gnueabihf-gcc-4.825+ - CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc-4.826+ - os: linux27+ rust: stable28+ env:29+ - TARGET=arm-unknown-linux-musleabihf30+ - CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=arm-linux-gnueabihf-gcc-4.831 32 # Minimum Rust supported channel.33 - os: linux34 rust: 1.43.010 unmodified lines45 - os: osx46 rust: 1.43.047 env: TARGET=x86_64-apple-darwin48 39-addons:40- apt:41- packages:42- # needed for i686-unknown-linux-gnu target43- - gcc-multilib44- # needed to build deb packages45- - fakeroot49+before_install:50+ - ci/before_install.bash51 52 env:53 global:54 # Default target on travis-ci.8 unmodified lines63 64 script:65 # Incorporate TARGET env var to the build and test process66 - cargo build --target $TARGET --verbose62- - cargo test --target $TARGET --verbose67+ - '[[ $TARGET == arm-unknown-linux-* ]] || cargo test --target $TARGET --verbose'68 69 before_deploy:70 - bash ci/before_deploy.bash71 72 deploy:73 provider: releases69- # NOTE updating the `api_key.secure`74+ # NOTE updating the `token.secure`75 # - go to: https://github.com/settings/tokens/new76 # - generate new token using `public_repo` scope77 # - encrypt it using: `travis encrypt API_KEY_HERE`78 # - paste the output below74- api_key:79+ token:80 secure: "U9QfCOQkeozaDNrTV6i2vRocX2puB5p1WSN+w9t/1j33rAtXx6ZhFx67A8nl0+dQ9nvPu/RIsFWXrYzfHQskL1WulKNHm0S5otN+747dEzbSIfMNi1UfysyCiM1SNPq+FX3qOkva83+Fe2Lyd1g4gQObceE4xsgfplfzdm+ebIa6CrfKOypToEuetzP/r8V0WpW4Cp8ojQwvsL1nfHjr1gmvmr443Gr9Yvgq9SS/NAHldrpaJr8mD26W/7jbHdm3lvrNwqLbthYDUTPZsO+2B44h+T/tuhVYbur4fel1KMo4mkIwZwsSKvJbf3Q6Vdcc9dZM+niZU78UGLt0JNEMQNqQLPGYqh+TlFR2B++lcYlybT3LcUaSkt0YIX7C4DAbMLS6sl5Fq2pRNuM/eY2BWdHf0I+K19PDxUEliUifsfSQ3rbfl52aKKLcJa0WPyDJt0qldElagxOaTIk/jn1kKkdkQu9M4gVzKXImIauRQih3CLER7th8ADMxW5Plgq8fvffJBTKlubUznKrGeeR3Mjm8DsRjhkIvFO0Doqmki4sd5zE/BOFI5a/SHg73ms+bLXLuKFK+YzIlHszCHolzkAT44aq7+LEudk8jt+QVtBEocCN/4ew4Q9Qh2tcn22+hU3Aw88lO95PsbZzTzoFtX4X89Sl1fGtpkHFZvvL4ZT0="81 # for uploading multiple files82 file_glob: true83 # NOTE explanation on each env variable3 unmodified lines87 file:88 - $PROJECT_NAME-$TRAVIS_TAG-$TARGET.*89 - $PROJECT_NAME*.deb90 # don't delete artifacts from previous stage86- skip_cleanup: true91+ cleanup: false92 on:93 # deploy only if we push a tag94 tags: true95 # deploy only on stable channel that has TARGET env variable sets5 unmodified lines