From 04aea491362a6457ded39af4e04daab41f9045ba Mon Sep 17 00:00:00 2001 From: phiresky Date: Wed, 19 Jun 2019 10:58:02 +0200 Subject: [PATCH] readd other platforms, fix windows --- .travis.yml | 33 +++++++++++++++++++++++++++++++++ ci/before_deploy.sh | 28 +++++++++++++++------------- src/bin/rga.rs | 3 ++- 3 files changed, 50 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8cc7010..55c312c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,6 +27,39 @@ addons: matrix: fast_finish: true include: + # Nightly channel. + # All *nix releases are done on the nightly channel to take advantage + # of the regex library's multiple pattern SIMD search. + - os: linux + env: TARGET=x86_64-unknown-linux-musl + - os: osx + rust: nightly + # XML_CATALOG_FILES is apparently necessary for asciidoc on macOS. + env: TARGET=x86_64-apple-darwin XML_CATALOG_FILES=/usr/local/etc/xml/catalog + # Minimum Rust supported channel. We enable these to make sure ripgrep + # continues to work on the advertised minimum Rust version. + - os: linux + rust: 1.35.0 + env: TARGET=x86_64-unknown-linux-gnu + - os: linux + rust: 1.35.0 + env: TARGET=x86_64-unknown-linux-musl + #- os: linux + # rust: 1.35.0 + # env: TARGET=arm-unknown-linux-gnueabihf GCC_VERSION=4.8 + # addons: + # apt: + # packages: + # - gcc-4.8-arm-linux-gnueabihf + # - binutils-arm-linux-gnueabihf + # - libc6-armhf-cross + # - libc6-dev-armhf-cross + # # For generating man page. + # - libxslt1-dev + # - asciidoc + # - docbook-xsl + # - xsltproc + # - libxml2-utils - os: windows rust: nightly env: TARGET=x86_64-pc-windows-msvc diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh index 31d3b0f..1792c4f 100755 --- a/ci/before_deploy.sh +++ b/ci/before_deploy.sh @@ -17,28 +17,30 @@ mk_artifacts() { # also currently just a fixed version of each tool since it doesn't matter much download_other_binaries() { outdir="$1" - mkdir -p "$outdir/licenses" + mkdir -p "$outdir/licenses" "$outdir/lib" # ffmpeg wget -q https://ffmpeg.zeranoe.com/builds/win64/static/ffmpeg-4.1.3-win64-static.zip -O ffmpeg.zip unzip ffmpeg.zip - cp ffmpeg-*/bin/{ffmpeg,ffprobe}.exe "$outdir" + cp ffmpeg-*/bin/{ffmpeg,ffprobe}.exe "$outdir/lib" cp ffmpeg-*/LICENSE.txt "$outdir/licenses/ffmpeg" - # xpdf - wget -q https://xpdfreader-dl.s3.amazonaws.com/xpdf-tools-win-4.01.01.zip -O xpdf.zip - unzip xpdf.zip - cp xpdf-tools*/bin64/pdftotext.exe "$outdir/" - cp xpdf-tools*/COPYING3 "$outdir/licenses/xpdf" + # poppler + wget -q https://blog.alivate.com.au/wp-content/uploads/2018/10/poppler-0.68.0_x86.7z -O poppler.7z + 7z x poppler.7z + for f in pdftotext.exe libpoppler-79.dll libgcc_s_dw2-1.dll libstdc++-6.dll jpeg62.dll libpng16-16.dll libtiff3.dll zlib1.dll freetype6.dll libpoppler-79.dll; do + cp poppler-*/bin/"$f" "$outdir/lib" + done + cp poppler-*/bin/COPYING3 "$outdir/licenses/poppler" wget -q https://github.com/jgm/pandoc/releases/download/2.7.3/pandoc-2.7.3-windows-x86_64.zip -O pandoc.zip unzip pandoc.zip - cp pandoc-*/pandoc.exe "$outdir/" + cp pandoc-*/pandoc.exe "$outdir/lib" cp pandoc-*/COPYRIGHT.txt "$outdir/licenses/pandoc" wget -q https://github.com/BurntSushi/ripgrep/releases/download/11.0.1/ripgrep-11.0.1-x86_64-pc-windows-msvc.zip -O ripgrep.zip unzip ripgrep.zip - cp rg.exe "$outdir/" + cp rg.exe "$outdir/lib" } @@ -82,12 +84,12 @@ mk_tarball() { # cp "$cargo_out_dir"/{rg.bash,rg.fish,_rg.ps1} "$staging/complete/" # cp complete/_rg "$staging/complete/" - #if is_windows; then + if is_windows; then (cd "$tmpdir" && download_other_binaries "$name") (cd "$tmpdir" && 7z a "$out_dir/$name.7z" "$name") - #else - # (cd "$tmpdir" && tar czf "$out_dir/$name.tar.gz" "$name") - #fi + else + (cd "$tmpdir" && tar czf "$out_dir/$name.tar.gz" "$name") + fi rm -rf "$tmpdir" } diff --git a/src/bin/rga.rs b/src/bin/rga.rs index 75d004a..f4056b2 100644 --- a/src/bin/rga.rs +++ b/src/bin/rga.rs @@ -117,7 +117,8 @@ fn add_exe_to_path() -> Fallible<()> { let path = env::var_os("PATH").unwrap_or("".into()); let mut paths = env::split_paths(&path).collect::>(); - paths.push(exe); // append: this way system PATH gets higher priority than bundled versions + paths.push(exe.to_owned()); // append: this way system PATH gets higher priority than bundled versions + paths.push(exe.join("lib")); let new_path = env::join_paths(paths)?; env::set_var("PATH", &new_path); Ok(())