Skip to content

Commit 25bdb82

Browse files
committed
Support c++17 by backporting tectonic-typesetting/tectonic#1202
1 parent 76238fb commit 25bdb82

File tree

4 files changed

+357
-11
lines changed

4 files changed

+357
-11
lines changed

recipe/bld.bat

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
@REM Here we ditch the -GL flag, which messes up our static libraries.
44
set "CFLAGS=-MD -DGRAPHITE2_STATIC"
5-
set "CXXFLAGS=-MD -DGRAPHITE2_STATIC"
5+
set "CXXFLAGS=-MD -DGRAPHITE2_STATIC -std:c++17"
66
set "PKG_CONFIG_PATH=%LIBRARY_PREFIX:\=/%/lib/pkgconfig;%LIBRARY_PREFIX:\=/%/share/pkgconfig"
77

88
@REM FIX UP LIBZ-SYS
@@ -14,10 +14,10 @@ cargo-bundle-licenses --format yaml --output THIRDPARTY.yml
1414
@REM Also need to skip the Unicode filename test due to conda-build issue:
1515
@REM https://github.com/conda/conda-build/issues/4043
1616
set RUST_TEST_THREADS=1
17-
cargo test --release -- --skip unicode_file_name
17+
cargo test --release --features external-harfbuzz -- --skip unicode_file_name
1818
if errorlevel 1 exit 1
1919

20-
cargo install --path . --bin tectonic --root %LIBRARY_PREFIX%
20+
cargo install --path . --bin tectonic --root %LIBRARY_PREFIX% --features external-harfbuzz
2121
if errorlevel 1 exit 1
2222

2323
del %LIBRARY_PREFIX%\.crates.toml

recipe/build.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/bash
1+
#!/usr/bin/env bash
22

33
set -ex
44

@@ -7,23 +7,23 @@ export PKG_CONFIG_ALLOW_CROSS=1
77
# https://github.com/rust-lang/cargo/issues/10583#issuecomment-1129997984
88
export CARGO_NET_GIT_FETCH_WITH_CLI=true
99

10-
if [ $(uname) = Darwin ] ; then
11-
export CXXFLAGS="-arch $OSX_ARCH -stdlib=libc++ -std=c++11"
10+
if [ $(uname) = Darwin ]; then
11+
export CXXFLAGS="-arch $OSX_ARCH -stdlib=libc++ -std=c++17"
1212
export RUSTFLAGS="-C link-args=-Wl,-rpath,$PREFIX/lib"
1313

1414
if [[ "${CONDA_BUILD_CROSS_COMPILATION}" != "1" ]]; then
15-
DYLD_FALLBACK_LIBRARY_PATH=$PREFIX/lib RUSTDOCFLAGS="-C linker=$CC" cargo test --release
15+
DYLD_FALLBACK_LIBRARY_PATH=$PREFIX/lib RUSTDOCFLAGS="-C linker=$CC" cargo test --release --features external-harfbuzz
1616
fi
1717
else
1818
export CFLAGS="-std=gnu99 $CFLAGS"
1919
export RUSTFLAGS="-C link-args=-Wl,-rpath-link,$PREFIX/lib"
2020

2121
if [[ "${CONDA_BUILD_CROSS_COMPILATION}" != "1" ]]; then
22-
LD_LIBRARY_PATH=$PREFIX/lib RUSTDOCFLAGS="-C linker=$CC" cargo test --release
22+
LD_LIBRARY_PATH=$PREFIX/lib RUSTDOCFLAGS="-C linker=$CC" cargo test --release --features external-harfbuzz
2323
fi
2424
fi
2525

2626
cargo-bundle-licenses --format yaml --output THIRDPARTY.yml
27-
cargo install --locked --no-track --path . --bin tectonic --root $PREFIX
27+
cargo install --no-track --locked --path . --bin tectonic --root $PREFIX --features external-harfbuzz
2828
rm -f $PREFIX/.crates.toml
2929
rm -f $PREFIX/.crates2.json

recipe/meta.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% set name = "tectonic" %}
22
{% set version = "0.15.0" %}
3-
{% set sha256 = "fe58806e4ffc54487f40b91da4cbd46717807937e33e2fc830fcfef7e023ab39" %}
3+
{% set sha256 = "3c13de312c4fe39ff905ad17e64a15a3a59d33ab65dacb0a8b9482c57e6bc6aa" %}
44
{% set posix = 'm2-' if win else '' %}
55
{% set native = 'm2w64-' if win else '' %}
66

@@ -10,9 +10,10 @@ package:
1010

1111
source:
1212
fn: {{ name }}-{{ version }}.tar.gz
13-
url: https://crates.io/api/v1/crates/{{ name }}/{{ version }}/download
13+
url: https://github.com/tectonic-typesetting/{{ name }}/archive/refs/tags/{{ name }}@{{ version }}.tar.gz
1414
sha256: {{ sha256 }}
1515
patches:
16+
- pr-1202-fix-use-cxx-17.patch
1617
- winzip.patch # [win]
1718

1819
build:
@@ -31,6 +32,7 @@ requirements:
3132
- harfbuzz # [build_platform != target_platform]
3233

3334
host:
35+
- expat # [not osx]
3436
- fontconfig # [not osx]
3537
- freetype
3638
- glib # development files needed by harfbuzz
@@ -72,3 +74,4 @@ about:
7274
extra:
7375
recipe-maintainers:
7476
- pkgw
77+
- anjos

0 commit comments

Comments
 (0)