Skip to content

Commit

Permalink
Enable all terminal emulators by default
Browse files Browse the repository at this point in the history
We can't enable features in build.rs, see
rust-lang/cargo#5499, and cargo doesn't
support target-specific default features, see
rust-lang/cargo#1197.

Essentially we build as we used to do before we added features for
terminal emulators.  Downsides are more dependencies than needed—you
don’t need iterm2 on Linux after all—and Windows doesn't build with
default features at all.

This reverts commit 544943a.
  • Loading branch information
swsnr committed Aug 26, 2018
1 parent c8ec0d6 commit 7375eaf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 34 deletions.
6 changes: 3 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ install:
# syntect)
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
build_script:
- cargo build --release --verbose
- cargo build --no-default-features --release --verbose
after_build:
# The leading '.\' is important to avoid a command error with -windows being
# interpreted as flag if APPVEYOR_REPO_TAG_NAME is empty.
- 7z a .\%APPVEYOR_REPO_TAG_NAME%-windows.zip %APPVEYOR_BUILD_FOLDER%\target\release\mdcat.exe %APPVEYOR_BUILD_FOLDER%\README.md %APPVEYOR_BUILD_FOLDER%\CHANGELOG.md %APPVEYOR_BUILD_FOLDER%\LICENSE
test_script:
- cargo test --verbose
- cargo run -- sample/common-mark.md
- cargo test --no-default-features --verbose
- cargo run --no-default-features -- sample/common-mark.md
artifacts:
- path: '*.zip'
# Deploy tags to GitHub releases
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
### Changed
- Refactor internal terminal representation, replacing the terminal enum with a
new `Terminal` trait and dynamic dispatch (see [GH-35][]).
- Only include terminal backends supported on the platform (see [GH-35][]).
- Disable specific terminal backends by default (see [GH-35][]). You must build
with `--feature` to enable iTerm2 or Terminology.
- Update minimum Rust version to 1.27.

[GH-33]: https://github.com/lunaryorn/mdcat/pull/33
Expand Down
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ version = "0.8.1-pre"
categories = ["command-line-utilities", "text-processing"]
license = "Apache-2.0"
authors = ["Sebastian Wiesner <sebastian@swsnr.de>"]
build = "build.rs"

[badges]
travis-ci = { repository = "lunaryorn/mdcat" }
maintenance = { status = "actively-developed" }

[features]
default = []
default = ["iterm2", "terminology"]

# Enable special support for iTerm2.
iterm2 = ["mime", "base64"]
# Enable special support for Terminology.
terminology = ["immeta"]

[dependencies]
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ Not supported:
Install [Rust][rustup] and run `cargo install mdcat`. To keep mdcat up to date
install [cargo-update][] and run `cargo install-update mdcat`.

**Note:** On Windows you likely need `--no-default-features` to make `mdcat`
build.

### SVG support

`mdcat` needs `rsvg-convert` to show SVG images in [iTerm2][]; otherwise `mdcat`
Expand Down
28 changes: 0 additions & 28 deletions build.rs

This file was deleted.

0 comments on commit 7375eaf

Please sign in to comment.