-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2192 from alerque/debug-macos
Fixup macOS specific issues
- Loading branch information
Showing
21 changed files
with
213 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
println!("cargo:rustc-link-arg=-Wl,-undefined,dynamic_lookup"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
pkglib_LIBRARIES = @MODULE@.@SHARED_LIB_EXT@ | ||
@MODULE@_@SHARED_LIB_EXT@_SOURCES = @MODULE@/Cargo.toml @MODULE@/src/lib.rs build-aux/module.rs | ||
|
||
@builddir@/target/@RUST_TARGET_SUBDIR@/lib@MODULE@.@SHARED_LIB_EXT@: $(@MODULE@_@SHARED_LIB_EXT@_SOURCES) | ||
$(CARGO_ENV) $(CARGO) build $(CARGO_VERBOSE) --target $(CARGO_TARGET_TRIPLE) $(@MODULE@_FEATURE_ARGS) $(CARGO_RELEASE_ARGS) -p @MODULE@ | ||
|
||
@MODULE@.@SHARED_LIB_EXT@: @builddir@/target/@RUST_TARGET_SUBDIR@/lib@MODULE@.@SHARED_LIB_EXT@ | ||
$(INSTALL) $< $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ AC_PREREQ([2.69]) | |
AC_INIT([sile], [m4_esyscmd(build-aux/git-version-gen .tarball-version)], [[email protected]]) | ||
AC_CONFIG_AUX_DIR([build-aux]) | ||
AC_CONFIG_MACRO_DIR([build-aux]) | ||
AC_CANONICAL_TARGET | ||
AM_INIT_AUTOMAKE([foreign tar-pax dist-zstd dist-zip no-dist-gzip color-tests subdir-objects]) | ||
AM_SILENT_RULES([yes]) | ||
|
||
|
@@ -37,11 +38,24 @@ RANLIB=: | |
LT_PREREQ([2.2]) | ||
LT_INIT([dlopen]) | ||
|
||
AC_CANONICAL_HOST | ||
|
||
QUE_RUST_BOILERPLATE | ||
QUE_DOCKER_BOILERPLATE | ||
|
||
# Load Rust module bits, early since it stuffs rules in aminclude.am | ||
case $target_os in | ||
darwin*) | ||
SHARED_LIB_EXT="dylib" | ||
;; | ||
cygwin*|mingw*) | ||
SHARED_LIB_EXT="dll" | ||
;; | ||
*) | ||
SHARED_LIB_EXT="so" | ||
;; | ||
esac | ||
AC_SUBST([SHARED_LIB_EXT]) | ||
QUE_RUST_MODULE([rusile]) | ||
|
||
AM_CONDITIONAL([SHARED], [test "x$enable_shared" = "xyes"]) | ||
AM_CONDITIONAL([STATIC], [test "x$enable_static" = "xyes"]) | ||
|
||
|
@@ -111,7 +125,7 @@ AM_COND_IF([MANUAL], [ | |
|
||
AC_MSG_CHECKING([for OS X]) | ||
have_appkit=no | ||
case $host_os in | ||
case $target_os in | ||
darwin*) | ||
AC_MSG_RESULT([yes]) | ||
AC_MSG_CHECKING([for AppKit works]) | ||
|
@@ -244,20 +258,6 @@ AC_SUBST([HARFBUZZ_SUBSET_LIBS]) | |
AC_SUBST([ICU_TRUE]) | ||
AC_SUBST([ICU_CFLAGS]) | ||
AC_SUBST([ICU_LIBS]) | ||
|
||
case $host_os in | ||
darwin*) | ||
LUAROCKSARGS="EXPAT_DIR=/usr/local/opt/expat OPENSSL_DIR=/usr/local/opt/openssl ZLIB_DIR=/usr/local/opt/zlib" | ||
SHARED_LIB_EXT="so" | ||
;; | ||
cygwin*|mingw*) | ||
SHARED_LIB_EXT="dll" | ||
;; | ||
*) | ||
SHARED_LIB_EXT="so" | ||
;; | ||
esac | ||
AC_SUBST([SHARED_LIB_EXT]) | ||
AC_SUBST([LUAROCKSARGS]) | ||
|
||
# Avoid need for `--datarootdir=$(cd ..; pwd)` hack to run locally for | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,36 @@ | ||
local fontManager = {} | ||
|
||
fontManager.fontconfig = require("justenoughfontconfig") | ||
pcall(function () | ||
fontManager.macfonts = require("macfonts") | ||
end) | ||
|
||
local has_macfonts, macfonts = pcall(require, "macfonts") | ||
if has_macfonts and macfonts then | ||
fontManager.macfonts = macfonts | ||
end | ||
|
||
local function create_macfonts_fallback (self) | ||
return function (...) | ||
SU.debug("fonts", "Checking via macfonts") | ||
local status, result = pcall(self.macfonts._face, ...) | ||
if status and result and result.filename then | ||
SU.debug("fonts", "Found, returning result") | ||
return result | ||
else | ||
SU.debug("fonts", "Not found, trying fontconfig instead") | ||
return self.fontconfig._face(...) | ||
end | ||
end | ||
end | ||
|
||
fontManager.face = function (self, ...) | ||
local manager | ||
if SILE.forceFontManager then | ||
manager = self[SILE.forceFontManager] | ||
local face | ||
if SILE.input.fontmanager then | ||
face = self[SILE.input.fontmanager]._face | ||
elseif has_macfonts then | ||
face = create_macfonts_fallback(self) | ||
else | ||
manager = self.macfonts and self.macfonts or self.fontconfig | ||
end | ||
if not manager then | ||
SU.error("Failed to load any working font manager") | ||
face = self.fontconfig._face | ||
end | ||
return manager._face(...) | ||
return face(...) | ||
end | ||
|
||
return fontManager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.