diff options
author | Dan Davison <dandavison7@gmail.com> | 2019-07-21 22:07:06 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2019-07-22 09:52:10 -0400 |
commit | bd12fbe58658279f02fd5ef8816f2aef12628f85 (patch) | |
tree | 4ce171062a2321bdd48ad21c0047fe45119304d5 /src/bat | |
parent | 334d4ed0d665560838cd3798ec9195791b7c9b33 (diff) |
Update Windows build0.0.5
Diffstat (limited to 'src/bat')
-rw-r--r-- | src/bat/.travis.yml | 7 | ||||
-rw-r--r-- | src/bat/ci/.gitattributes | 1 | ||||
-rwxr-xr-x | src/bat/ci/before_deploy.bash | 160 | ||||
-rw-r--r-- | src/bat/ci/before_deploy.ps1 | 25 | ||||
-rwxr-xr-x | src/bat/ci/before_install.bash | 37 | ||||
-rwxr-xr-x | src/bat/ci/script.bash | 13 |
6 files changed, 3 insertions, 240 deletions
diff --git a/src/bat/.travis.yml b/src/bat/.travis.yml index 804d89f4..02ef3497 100644 --- a/src/bat/.travis.yml +++ b/src/bat/.travis.yml @@ -57,8 +57,7 @@ matrix: sudo: required before_install: - - cd src/bat - - ci/before_install.bash + - ci/before_install.sh env: global: @@ -73,10 +72,10 @@ install: - if [[ $TRAVIS_OS_NAME = linux && $HOST != $TARGET ]]; then rustup target add $TARGET; fi script: - - ci/script.bash + - ci/script.sh before_deploy: - - bash ci/before_deploy.bash + - bash ci/before_deploy.sh deploy: provider: releases diff --git a/src/bat/ci/.gitattributes b/src/bat/ci/.gitattributes deleted file mode 100644 index 36eaad9f..00000000 --- a/src/bat/ci/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* linguist-vendored diff --git a/src/bat/ci/before_deploy.bash b/src/bat/ci/before_deploy.bash deleted file mode 100755 index 2b6b2115..00000000 --- a/src/bat/ci/before_deploy.bash +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash -# Building and packaging for release - -set -ex - -build() { - cargo build --target "$TARGET" --release --verbose -} - -pack() { - 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-gnueabihf" ]]; then - gcc_prefix="arm-linux-gnueabihf-" - elif [[ $TARGET == "aarch64-unknown-linux-gnu" ]]; then - gcc_prefix="aarch64-linux-gnu-" - else - gcc_prefix="" - fi - - # create a "staging" directory - mkdir "$tempdir/$package_name" - - # copying the main binary - cp "target/$TARGET/release/$PROJECT_NAME" "$tempdir/$package_name/" - "${gcc_prefix}"strip "$tempdir/$package_name/$PROJECT_NAME" - - # manpage, readme and license - cp README.md "$tempdir/$package_name" - cp LICENSE "$tempdir/$package_name" - - # archiving - pushd "$tempdir" - tar czf "$out_dir/$package_name.tar.gz" "$package_name"/* - popd - rm -r "$tempdir" -} - -make_deb() { - local tempdir - local architecture - local version - local dpkgname - local conflictname - local gcc_prefix - local homepage - local maintainer - - homepage="https://github.com/dandavison/delta" - maintainer="Dan Davison <dandavison7@gmail.com>" - - case $TARGET in - x86_64*) - architecture=amd64 - gcc_prefix="" - ;; - i686*) - architecture=i386 - gcc_prefix="" - ;; - aarch64*) - architecture=arm64 - gcc_prefix="aarch64-linux-gnu-" - ;; - arm*hf) - architecture=armhf - gcc_prefix="arm-linux-gnueabihf-" - ;; - *) - echo "make_deb: skipping target '${TARGET}'" >&2 - return 0 - ;; - esac - version=${TRAVIS_TAG#v} - if [[ $TARGET = *musl* ]]; then - dpkgname=$PROJECT_NAME-musl - conflictname=$PROJECT_NAME - else - dpkgname=$PROJECT_NAME - conflictname=$PROJECT_NAME-musl - fi - - 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" - "${gcc_prefix}"strip "$tempdir/usr/bin/$PROJECT_NAME" - - # readme and license - install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md" - install -Dm644 LICENSE "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE" - cat > "$tempdir/usr/share/doc/$PROJECT_NAME/copyright" <<EOF -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: $PROJECT_NAME -Source: $homepage - -Files: * -Copyright: $maintainer -License: MIT - -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 - - # Control file - mkdir "$tempdir/DEBIAN" - cat > "$tempdir/DEBIAN/control" <<EOF -Package: $dpkgname -Version: $version -Section: utils -Priority: optional -Maintainer: Dan Davison <dandavison7@gmail.com> -Architecture: $architecture -Provides: $PROJECT_NAME -Conflicts: $conflictname -Description: A syntax highlighter for git. -EOF - - fakeroot dpkg-deb --build "$tempdir" "${dpkgname}_${version}_${architecture}.deb" -} - - -main() { - build - pack - if [[ $TARGET = *linux* ]]; then - make_deb - fi -} - -main diff --git a/src/bat/ci/before_deploy.ps1 b/src/bat/ci/before_deploy.ps1 deleted file mode 100644 index 918b1d93..00000000 --- a/src/bat/ci/before_deploy.ps1 +++ /dev/null @@ -1,25 +0,0 @@ -# This script takes care of packaging the build artifacts that will go in the -# release zipfile - -$SRC_DIR = $PWD.Path -$STAGE = [System.Guid]::NewGuid().ToString() - -Set-Location $ENV:Temp -New-Item -Type Directory -Name $STAGE -Set-Location $STAGE - -$ZIP = "$SRC_DIR\$($Env:CRATE_NAME)-$($Env:APPVEYOR_REPO_TAG_NAME)-$($Env:TARGET).zip" - -Copy-Item "$SRC_DIR\target\release\delta.exe" '.\' - -# readme and license -Copy-Item $SRC_DIR\README.md '.\' -Copy-Item $SRC_DIR\LICENSE '.\' - -7z a "$ZIP" * - -Push-AppveyorArtifact "$ZIP" - -Set-Location .. -Remove-Item $STAGE -Force -Recurse -Set-Location $SRC_DIR diff --git a/src/bat/ci/before_install.bash b/src/bat/ci/before_install.bash deleted file mode 100755 index 9acf6025..00000000 --- a/src/bat/ci/before_install.bash +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -if [ "$TRAVIS_OS_NAME" != linux ]; then - exit 0 -fi - -sudo apt-get update - -# needed for musl targets -sudo apt-get install -y musl-tools - -# needed to build deb packages -sudo apt-get install -y fakeroot - -# needed for i686 linux gnu target -if [[ $TARGET == i686-unknown-linux-gnu ]]; then - sudo apt-get install -y gcc-multilib -fi - -# needed for cross-compiling for arm -if [[ $TARGET == arm-unknown-linux-gnueabihf ]]; then - sudo apt-get install -y \ - gcc-4.8-arm-linux-gnueabihf \ - binutils-arm-linux-gnueabihf \ - libc6-armhf-cross \ - libc6-dev-armhf-cross -fi - -# needed for cross-compiling for arm64 -if [[ $TARGET == aarch64-unknown-linux-gnu ]]; then - sudo apt-get install -y \ - gcc-4.8-aarch64-linux-gnu \ - binutils-aarch64-linux-gnu \ - gcc-aarch64-linux-gnu -fi diff --git a/src/bat/ci/script.bash b/src/bat/ci/script.bash deleted file mode 100755 index 3b717e5f..00000000 --- a/src/bat/ci/script.bash +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -# Incorporate TARGET env var to the build and test process -cargo build --target "$TARGET" --verbose - -# We cannot run arm executables on linux -if [[ $TARGET != arm-unknown-linux-gnueabihf ]] && [[ $TARGET != aarch64-unknown-linux-gnu ]]; then - cargo test --target "$TARGET" --verbose - - cargo run --target "$TARGET" -- < /dev/null -fi |