Giter Site home page Giter Site logo

pistondevelopers / freetype-sys Goto Github PK

View Code? Open in Web Editor NEW
24.0 42.0 37.0 6.52 MB

Low level bindings for the FreeType font library

License: MIT License

Rust 0.59% CMake 0.34% Makefile 1.47% Shell 3.16% C 64.65% Awk 0.03% Python 1.26% M4 0.69% HTML 26.39% Roff 0.03% C++ 0.35% Perl 0.11% DIGITAL Command Language 0.56% CSS 0.03% JavaScript 0.21% Meson 0.13%

freetype-sys's Introduction

freetype-sys Build Status Build status

Low level bindings for the FreeType font library.

For Windows users

-pc-windows-gnu

In order to easily setup FreeType just get MSYS2 and install either the mingw-w64-x86_64-freetype or mingw-w64-i686-freetype package and then use Rust from within the correct MinGW shell of MSYS2.

More information on setting up MSYS2 for Rust can be found in the Rust installing from source document.

-pc-windows-msvc

Prebuilt libraries for FreeType are available here.

Then in the root of your project, in one of the parent directories, or in your home directory, create a .cargo directory. This directory should contain a config file that contains the following snippet:

[target.i686-pc-windows-msvc.freetype]
rustc-link-search = ["C:\\Path\\To\\binaries\\i686"]
rustc-link-lib = ["freetype"]

[target.x86_64-pc-windows-msvc.freetype]
rustc-link-search = ["C:\\Path\\To\\binaries\\x86_64"]
rustc-link-lib = ["freetype"]

For more informations, check the official Cargo documentation.

freetype-sys's People

Contributors

atouchet avatar bvssvni avatar chrisduerr avatar decathorpe avatar drgmr avatar flames519 avatar innocentuslime avatar jacquesh avatar jasper-bekkers avatar jesse-bakker avatar jhasse avatar jschwe avatar jwilm avatar jyc avatar kchibisov avatar ms2ger avatar pcwalton avatar potpourri avatar renato-zannon avatar retep998 avatar returntrip avatar rockyzhengwu avatar thendiscard avatar tomaka avatar waywardmonkeys avatar yoanlcq avatar zoxc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freetype-sys's Issues

Add a feature/environment variable to opt-out of pkg-config

On OSX, I have problem where pkg-config looks up a version of FreeType belonging to the Mono framework, which is built for another target platform. To fix this, I have to override "freetype-sys" through Cargo and change the main method of build.rs into:

fn main() {
    println!("cargo:rustc-flags=-l freetype:dylib");
    /*
    match pkg_config::find_library("freetype2") {
        Ok(_) => return,
        Err(_) => {
            if cfg!(windows) {
                println!("cargo:rustc-flags=-l freetype-6:dylib");
            } else {
                println!("cargo:rustc-flags=-l freetype:dylib");
            }
        }
    }
    */
}

It would be nice if there was a feature/environment variable to disable pkg-config.

Can't find freetype.dll despite having a config file etc.

I'm trying to build on windows with MSVC. I got the binaries and put a .cargo/config file in my project with these flags:
[target.x86_64-pc-windows-msvc.freetype] rustc-link-search = ["C:\\freetype\\x86_64"] rustc-link-lib = ["freetype"]

My freetype.dll is inside of the directory specified but I get this error when I try to build the project, `The code execution cannot proceed because freetype.dll was not found. Reinstalling the program may fix this problem.

Any Ideas on how to fix this? I've tried re-downloading the dlls etc but its the same error.

Linkage fails on Android Cross Compile, using NDK `26.1.10909125`

I will try to provide a project to recreate this error but I'm hoping it just might ring a bell.

Our current Rust builds for android (using NDK 25.2.9519653 succeed), but moving to any 26 version brings out linkage errors like:

note: ld.lld: error: /tmp/rustc9ErbZO/libfreetype_sys-d92f0c941db0ed75.rlib(autofit.c.o) is incompatible with aarch64linux
          ld.lld: error: /tmp/rustc9ErbZO/libfreetype_sys-d92f0c941db0ed75.rlib(ftbase.c.o) is incompatible with aarch64linux
...

I believe the target and build configuration is correct, or at least it was correct enough to build with NDK 25.2.

Here's the reported configuration as the crate is being built:

[freetype-sys 0.13.1] CMAKE_TOOLCHAIN_FILE_aarch64-linux-android = None
[freetype-sys 0.13.1] CMAKE_TOOLCHAIN_FILE_aarch64_linux_android = None
[freetype-sys 0.13.1] TARGET_CMAKE_TOOLCHAIN_FILE = None
[freetype-sys 0.13.1] CMAKE_TOOLCHAIN_FILE = Some(".../Android/Sdk/ndk/26.1.10909125//build/cmake/android.toolchain.cmake")
[freetype-sys 0.13.1] CMAKE_GENERATOR_aarch64-linux-android = None
[freetype-sys 0.13.1] CMAKE_GENERATOR_aarch64_linux_android = None
[freetype-sys 0.13.1] TARGET_CMAKE_GENERATOR = None
[freetype-sys 0.13.1] CMAKE_GENERATOR = None
[freetype-sys 0.13.1] CMAKE_PREFIX_PATH_aarch64-linux-android = None
[freetype-sys 0.13.1] CMAKE_PREFIX_PATH_aarch64_linux_android = None
[freetype-sys 0.13.1] TARGET_CMAKE_PREFIX_PATH = None
[freetype-sys 0.13.1] CMAKE_PREFIX_PATH = None
[freetype-sys 0.13.1] CMAKE_aarch64-linux-android = None
[freetype-sys 0.13.1] CMAKE_aarch64_linux_android = None
[freetype-sys 0.13.1] TARGET_CMAKE = None
[freetype-sys 0.13.1] CMAKE = None

As shown, we're trying to use the android.toolchain.cmake provided by the NDK.

I'll add more detail if this seems strange. If you can vouch for the crate against NDK 26.x our build configuration probably needs to be updated in some way required by the NDK.

Support for pkgconfig / dynamically linking with system freetype2 (accidentally?) removed from 0.17.0

The support for using pkg-config and dynamically linking with system freetype2 was removed with this PR:
#106

The commit message and PR don't mention pkg-config support at all, but it was removed alongside the cmake support.
Would it be possible to restore this functionality? Statically linking against a vendored copy is usually forbidden for official Linux distribution packages, so the pkg-config functionality that was present until 0.16.0 was really nice for that :(

Build freetype in build script

As title. See https://github.com/Eljay/assimp-sys for an example of how it can be done (essentially he's keeping the actual library as a submodule and then just building it with cmake-rs in the build.rs script).

Doing it that way, you can (as a user of this library) get started without installing freetype first, as it will be built as part of the cargo build. Or if you have a local install you can also take advantage of that.

Can't compile with MSVC ABI and GnuWin32 freetype.lib

So, I did as the instructions on the readme says, it finds the library correctly, but then gives me a ton of missing symbol errors:

   Compiling testgui v0.1.0 (file:///C:/dev/testgui)
error: linking with `link.exe` failed: exit code: 1120
note: "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC/bin\\amd64\\link.exe" "/LIBPATH:C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC/lib\\amd64" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\x64" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\dev\\testgui\\target\\debug\\testgui.0.o" "/OUT:C:\\dev\\testgui\\target\\debug\\testgui.exe" "/OPT:REF,ICF" "/DEBUG" "/LIBPATH:C:\\dev\\testgui\\target\\debug" "/LIBPATH:C:\\dev\\testgui\\target\\debug\\deps" "/LIBPATH:C:\\Program Files (x86)\\GnuWin32\\lib" "/LIBPATH:C:\\dev\\testgui\\target\\debug\\build\\libz-sys-521f51dd8fade4c2\\out/lib" "/LIBPATH:C:\\dev\\testgui\\target\\debug\\build\\miniz-sys-f1c39e8e406fa25f\\out" "/LIBPATH:C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib" "/LIBPATH:C:\\dev\\testgui\\.rust\\bin\\x86_64-pc-windows-msvc" "/LIBPATH:C:\\dev\\testgui\\bin\\x86_64-pc-windows-msvc" "C:\\dev\\testgui\\target\\debug\\deps\\libconrod-116addbd19a314e7.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libfind_folder-8918d1206dae2083.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libpiston_window-ef7b6dfa617a6c78.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libglutin_window-d654a3e44a855e9b.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libglutin-ca9e57202d2cb0ad.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libshared_library-f4ac2cf3cc1e9597.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libpiston-fd6dc79ad82016b4.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libgfx_graphics-7f468e12bc913cff.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libgfx_texture-5720e2ea52c1d3df.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libimage-e7f2d20ae47bfb08.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libuser32-dc94dabda4876d9a.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libevent_loop-17f635dfb1b44576.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libwindow-ad67fd2b615641f5.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libshader_version-f684e92d2d314f91.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libfreetype-7b4c87beabcd8fe7.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libpng-4b704d4773932522.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libflate2-f631189bcf5818ae.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libminiz_sys-f1c39e8e406fa25f.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libdwmapi-9ad49f05afcefc91.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libinput-ce8af36c334a0d0b.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libgl-caccb99a7fc8e33d.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libfreetype_sys-5dbe1f179da1057a.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libinflate-b852113d32258b7b.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libshell32-7fc5728fe7652dea.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libdaggy-15bbe9f17d4bad73.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libpetgraph-6f64e652e095d54e.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libfixedbitset-691631c044f57fb9.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libgfx_device_gl-d32c04808be1031a.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libgfx_gl-25b339f39da46849.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libtime-b8d9c9e7ca5bced7.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libenum_primitive-f59ab0a46937bdae.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libgdi32-5ec2c9d6697f647a.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libgfx-b43b9d4ddc03f960.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libnum-1ef9aa8d582358bc.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\librand-204b49f864ff4762.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libadvapi32-cfef7a1f30f1e5f6.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\librustc_serialize-7ff5bfc027146194.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libshaders_graphics2d-bb347d3b5d5c0137.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\liblazy_static-f3aa6dfcc7c157cc.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libkernel32-35c1a745c861d23a.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libwinapi-d88a8c018c340227.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libbyteorder-8489290bbd10b018.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libgif-349733e89c61a899.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libcolor_quant-6695fde28ee2e395.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\liblzw-b298258ca3ee8886.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libgraphics-4666253153b9ad9d.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libdraw_state-8219476462483b29.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libread_color-309218e52cd2ef95.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libtexture-1c413c5bbaf9401a.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libvecmath-9b5adf5764bff9e1.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libbitflags-eec34728826d9769.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libinterpolation-ee7e041bd12b608b.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libviewport-2fa528cee63f2915.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\libfloat-5e49744bf68c9774.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\liblog-db195e915b7f1b50.rlib" "C:\\dev\\testgui\\target\\debug\\deps\\liblibc-53b3109cf33a6ace.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\libstd-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcollections-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\librustc_unicode-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\librand-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc_system-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\liblibc-35c36e89.rlib" "C:\\Program Files\\Rust stable 1.5\\bin\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcore-35c36e89.rlib" "opengl32.lib" "user32.lib" "dwmapi.lib" "freetype.lib" "shell32.lib" "gdi32.lib" "advapi32.lib" "kernel32.lib" "msvcrt.lib" "ws2_32.lib" "userenv.lib" "advapi32.lib" "kernel32.lib" "shell32.lib" "msvcrt.lib" "compiler-rt.lib"
note: testgui.0.o : error LNK2019: unresolved external symbol FT_New_Face referenced in function _ZN7library13_$LT$impl$GT$8new_face8new_face20h4160429053330431212E
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Reference_Library referenced in function _ZN4face13_$LT$impl$GT$5clone20hd2f3fbcb85dcc460BPbE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Reference_Face referenced in function _ZN4face13_$LT$impl$GT$5clone20hd2f3fbcb85dcc460BPbE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Attach_File referenced in function _ZN4face13_$LT$impl$GT$11attach_file20hdbb984a85167ead5tRbE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Set_Char_Size referenced in function _ZN4face13_$LT$impl$GT$13set_char_size20h09d2a3cc2d67521fCSbE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Set_Pixel_Sizes referenced in function _ZN4face13_$LT$impl$GT$15set_pixel_sizes20h706809c7a575cb33rTbE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Load_Glyph referenced in function _ZN4face13_$LT$impl$GT$10load_glyph20h6ef7425a8e9abf074TbE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Load_Char referenced in function _ZN4face13_$LT$impl$GT$9load_char20h66875f818ab9bd55IUbE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Set_Transform referenced in function _ZN4face13_$LT$impl$GT$13set_transform20h3c75d36e4e08d102oVbE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Get_Char_Index referenced in function _ZN4face13_$LT$impl$GT$14get_char_index20hdbde7d4a34280b68LVbE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Get_Kerning referenced in function _ZN4face13_$LT$impl$GT$11get_kerning20hd5e94e508d9280764VbE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b5c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Get_Postscript_Name referenced in function _ZN4face13_$LT$impl$GT$15postscript_name20hf62cc25c5e90308bg3bE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Done_Face referenced in function _ZN4face13_$LT$impl$GT$4drop20ha6a23216654714e2K4bE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Done_Library referenced in function _ZN4face13_$LT$impl$GT$4drop20ha6a23216654714e2K4bE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Glyph_Transform referenced in function _ZN5glyph13_$LT$impl$GT$9transform20hb432d30c0a7924b3E6bE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-6b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Glyph_Get_CBox referenced in function _ZN5glyph13_$LT$impl$GT$8get_cbox20hffc2f666d7d035aaT7bE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Glyph_To_Bitmap referenced in function _ZN5glyph13_$LT$impl$GT$9to_bitmap20hfd5aa88646d19d50m8bE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Glyph_Copy referenced in function _ZN5glyph13_$LT$impl$GT$5clone20ha4e07eda6bc22936xacE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Done_Glyph referenced in function _ZN5glyph13_$LT$impl$GT$4drop20h40c3a8cb12e16a5atbcE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Render_Glyph referenced in function _ZN10glyph_slot13_$LT$impl$GT$12render_glyph20h6fb3e3d6e63288b0bhcE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Get_SubGlyph_Info referenced in function _ZN10glyph_slot13_$LT$impl$GT$17get_subglyph_info20h63bdec2823a0aa3eMhcE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Get_Glyph referenced in function _ZN10glyph_slot13_$LT$impl$GT$9get_glyph20h4b45bb351f4002cbFicE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_New_Library referenced in function _ZN7library13_$LT$impl$GT$4init20h370ddb438430955dBncE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_Add_Default_Modules referenced in function _ZN7library13_$LT$impl$GT$4init20h370ddb438430955dBncE
libfreetype-7b4c87beabcd8fe7.rlib(freetype-7b4c87beabcd8fe7.0.o) : error LNK2019: unresolved external symbol FT_New_Memory_Face referenced in function _ZN7library13_$LT$impl$GT$15new_memory_face20h5543fde1bae245f0KpcE
C:\dev\testgui\target\debug\testgui.exe : fatal error LNK1120: 25 unresolved externals

error: aborting due to previous error
Could not compile `testgui`.

To learn more, run the command again with --verbose.

Install documentation is wrong

I've spent the last 3 hours screwing with installs and building, and rebuilding freetype, attempting to build a piston app. I'm not sure if this is caused by rustup, but I needed to copy the binaries over to "%USER_PROFILE%.multirust\toolchains\stable-i686-pc-windows-gnu\lib\rustlib\i686-pc-windows-gnu\lib", which is my Rust install directory.

Is this a specific issue with Rustup, or should I edit the README and send a PR?

Can't compile with msvc, "cannot open input file 'freetype.lib'"

Hi, I've been trying to compile the Kiss3D example program but I can't get past linking the freetype library. I did the config file as suggested in readme and I tried both .lib and .dll binaries, but both give the same error message on the linking stage, " cannot open input file 'freetype.lib' "

Here is the error log (using .dll binaries):

   Compiling freetype-sys v0.4.0
   Compiling freetype-rs v0.9.0
   Compiling kiss3d v0.8.0
   Compiling kiss3d_demo v0.1.0 (file:///C:/Users/mrZalli/Projects/kiss3d_demo)
error: linking with `link.exe` failed: exit code: 1181
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin\\amd64
\\link.exe" "/LIBPATH:C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\
\lib\\amd64" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.1439
3.0\\ucrt\\x64" "/LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.1
4393.0\\um\\x64" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Users\\mrZalli\\.rustup\\to
olchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\l
ib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\kiss3d_demo
-56c1a9f95fb658f9.0.o" "/OUT:C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\
debug\\deps\\kiss3d_demo-56c1a9f95fb658f9.exe" "/OPT:REF,NOICF" "/DEBUG" "/LIBPA
TH:C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps" "/LIBPATH:C:\
\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\build\\glfw-sys-79c50ef4a
5edfcd6\\out\\lib" "/LIBPATH:C:\\Program Files (x86)\\Microsoft Visual Studio 14
.0\\VC\\atlmfc\\lib\\amd64" "/LIBPATH:C:\\Users\\mrZalli\\Projects\\kiss3d_demo\
\target\\debug\\build\\miniz-sys-18005000ddedadf4\\out" "/LIBPATH:C:\\Users\\Zal
li\\.cargo\\temp_lib_x86_64\\freetype.dll" "/LIBPATH:C:\\Users\\mrZalli\\Project
s\\kiss3d_demo\\target\\debug\\build\\libz-sys-3f97c24ccab6f5c7\\out/lib" "/LIBP
ATH:C:\\Users\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\
\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\mrZalli\\Projects\\kiss3d_dem
o\\target\\debug\\deps\\libkiss3d-b001bdb38b073b38.rlib" "C:\\Users\\mrZalli\\Pr
ojects\\kiss3d_demo\\target\\debug\\deps\\libncollide_procedural-1532ba8794339fa
2.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libimag
e-ecef7b195adced54.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\deb
ug\\deps\\libgl-1d6a970e22c31f05.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_dem
o\\target\\debug\\deps\\libncollide_utils-83fca2784d294d5e.rlib" "C:\\Users\\mrZ
alli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libpng-9f834434d073ed8c.rlib"
"C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libbitflags-500
f5f87e6ab8395.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\d
eps\\libflate2-8c506f1983161f68.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo
\\target\\debug\\deps\\libminiz_sys-371886580b0e42eb.rlib" "C:\\Users\\mrZalli\\
Projects\\kiss3d_demo\\target\\debug\\deps\\libncollide_math-a73ce00dabad11e7.rl
ib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libnalgebra
-bbd2ecdde7a16e57.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debu
g\\deps\\libgeneric_array-b5db6f131cc5092f.rlib" "C:\\Users\\mrZalli\\Projects\\
kiss3d_demo\\target\\debug\\deps\\libtypenum-e1a1e7f3e2c882c2.rlib" "C:\\Users\\
mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libalga-5c61eed79552c8fc.rl
ib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libapprox-7
e5b6aca5f24d7b7.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\
\deps\\libbyteorder-35109819e11170bf.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d
_demo\\target\\debug\\deps\\libinflate-a5fe4b3d10215f46.rlib" "C:\\Users\\mrZall
i\\Projects\\kiss3d_demo\\target\\debug\\deps\\libgif-015bb0a9eaa1770e.rlib" "C:
\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libcolor_quant-916
38445defb0073.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\d
eps\\liblzw-3317b9e620d058a9.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\t
arget\\debug\\deps\\libfreetype-60cadb81e49f069d.rlib" "C:\\Users\\mrZalli\\Proj
ects\\kiss3d_demo\\target\\debug\\deps\\libfreetype_sys-90a42c68bc0e7bb4.rlib" "
C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libglfw-df7c22b7
5fdf1e3f.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\
libnum-6ce289b56f32382f.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target
\\debug\\deps\\libnum_rational-0162ef58e267dc13.rlib" "C:\\Users\\mrZalli\\Proje
cts\\kiss3d_demo\\target\\debug\\deps\\libnum_bigint-95c46fa16cd15b9e.rlib" "C:\
\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\librand-c9d9fbdab23
55ee4.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\lib
num_complex-57a11a875ce86980.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\t
arget\\debug\\deps\\librustc_serialize-54d2bf33b1d4b0b0.rlib" "C:\\Users\\mrZall
i\\Projects\\kiss3d_demo\\target\\debug\\deps\\libnum_iter-e3d53b72a44dd492.rlib
" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libnum_intege
r-bbbfaf8dce75e1b6.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\deb
ug\\deps\\libenum_primitive-b8ff90d65ad8e4c3.rlib" "C:\\Users\\mrZalli\\Projects
\\kiss3d_demo\\target\\debug\\deps\\libnum_traits-69f4129d46397118.rlib" "C:\\Us
ers\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\libbitflags-c5752d97fe
7cde2b.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\\debug\\deps\\li
blibc-5dc7b85e748840b4.rlib" "C:\\Users\\mrZalli\\Projects\\kiss3d_demo\\target\
\debug\\deps\\libsemver-f515919a8f1856d4.rlib" "C:\\Users\\mrZalli\\Projects\\ki
ss3d_demo\\target\\debug\\deps\\libnom-c11a5cbc9654b215.rlib" "C:\\Users\\mrZall
i\\Projects\\kiss3d_demo\\target\\debug\\deps\\liblog-d4c0e5c2504fbbea.rlib" "C:
\\Users\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustl
ib\\x86_64-pc-windows-msvc\\lib\\libstd-90fbcc8c07b4a644.rlib" "C:\\Users\\mrZal
li\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-
windows-msvc\\lib\\libpanic_unwind-d2e7baf2c0a36eaf.rlib" "C:\\Users\\mrZalli\\.
rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windo
ws-msvc\\lib\\libunwind-112baa0117a60076.rlib" "C:\\Users\\mrZalli\\.rustup\\too
lchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\li
b\\liblibc-ad15457034b2bf37.rlib" "C:\\Users\\mrZalli\\.rustup\\toolchains\\stab
le-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\librand-fa
1852079e0fefd1.rlib" "C:\\Users\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-
windows-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\libcollections-27e4c8cc
19e6faac.rlib" "C:\\Users\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-window
s-msvc\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc-588bb0bd8c9dd8ca.rli
b" "C:\\Users\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\
\rustlib\\x86_64-pc-windows-msvc\\lib\\liballoc_system-dbfe715efb71d408.rlib" "C
:\\Users\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rust
lib\\x86_64-pc-windows-msvc\\lib\\libstd_unicode-a2e15800b52a7a60.rlib" "C:\\Use
rs\\mrZalli\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x
86_64-pc-windows-msvc\\lib\\libcore-b2880fdfb9b2b596.rlib" "C:\\Users\\mrZalli\\
.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\\lib\\rustlib\\x86_64-pc-wind
ows-msvc\\lib\\libcompiler_builtins-9d27746f5ba8488f.rlib" "freetype.lib" "openg
l32.lib" "gdi32.lib" "advapi32.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "s
hell32.lib" "msvcrt.lib"
  = note: LINK : fatal error LNK1181: cannot open input file 'freetype.lib'


error: aborting due to previous error

error: Could not compile `kiss3d_demo`.

To learn more, run the command again with --verbose.

Missing APIs

The API in this crate doesn't seem to have all the FreeType API functions available. I was personally looking for FT_Get_Font_Format but it seems to be missing.

Is there any specific reason this crate isn't just using bindgen to get all the API functions included automatically?

Relicense under dual MIT/Apache-2.0

This issue was automatically generated. Feel free to close without ceremony if
you do not agree with re-licensing or if it is not possible for other reasons.
Respond to @cmr with any questions or concerns, or pop over to
#rust-offtopic on IRC to discuss.

You're receiving this because someone (perhaps the project maintainer)
published a crates.io package with the license as "MIT" xor "Apache-2.0" and
the repository field pointing here.

TL;DR the Rust ecosystem is largely Apache-2.0. Being available under that
license is good for interoperation. The MIT license as an add-on can be nice
for GPLv2 projects to use your code.

Why?

The MIT license requires reproducing countless copies of the same copyright
header with different names in the copyright field, for every MIT library in
use. The Apache license does not have this drawback. However, this is not the
primary motivation for me creating these issues. The Apache license also has
protections from patent trolls and an explicit contribution licensing clause.
However, the Apache license is incompatible with GPLv2. This is why Rust is
dual-licensed as MIT/Apache (the "primary" license being Apache, MIT only for
GPLv2 compat), and doing so would be wise for this project. This also makes
this crate suitable for inclusion and unrestricted sharing in the Rust
standard distribution and other projects using dual MIT/Apache, such as my
personal ulterior motive, the Robigalia project.

Some ask, "Does this really apply to binary redistributions? Does MIT really
require reproducing the whole thing?" I'm not a lawyer, and I can't give legal
advice, but some Google Android apps include open source attributions using
this interpretation. Others also agree with
it
.
But, again, the copyright notice redistribution is not the primary motivation
for the dual-licensing. It's stronger protections to licensees and better
interoperation with the wider Rust ecosystem.

How?

To do this, get explicit approval from each contributor of copyrightable work
(as not all contributions qualify for copyright) and then add the following to
your README:

## License

Licensed under either of
 * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
 * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.

and in your license headers, use the following boilerplate (based on that used in Rust):

// Copyright (c) 2016 freetype-sys developers
//
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. All files in the project carrying such notice may not be copied,
// modified, or distributed except according to those terms.

Be sure to add the relevant LICENSE-{MIT,APACHE} files. You can copy these
from the Rust repo for a plain-text
version.

And don't forget to update the license metadata in your Cargo.toml to:

license = "MIT/Apache-2.0"

I'll be going through projects which agree to be relicensed and have approval
by the necessary contributors and doing this changes, so feel free to leave
the heavy lifting to me!

Contributor checkoff

To agree to relicensing, comment with :

I license past and future contributions under the dual MIT/Apache-2.0 license, allowing licensees to chose either at their option

Or, if you're a contributor, you can check the box in this repo next to your
name. My scripts will pick this exact phrase up and check your checkbox, but
I'll come through and manually review this issue later as well.

Support static linking against FreeType

Static linking against FreeType is possible, and FreeType supplies a static form, libfreetype.a. It should be possible to link against this instead of the dynamic library.

This library is named incorrectly

Apparently the -sys suffix is intended for packages that contain actual system libraries that are built (eg. https://github.com/servo/libfreetype2), not for FFI binding libraries. This is causing problems for Servo as we're trying to switch to the freetype-rs bindings, as rust-azure requires our freetype-sys dependency and it conflicts with this one.

Issue compiling for aarch64-apple-ios

Hi,

I'm trying to compile the crate for ios, and when running the following command:

❯ cargo build --release --target=aarch64-apple-ios                        

I get:

  running: "cmake" "/Users/daddye/code/freetype-sys/freetype2" "-DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE" "-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE" "-DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE" "-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=TRUE" "-DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE" "-DCMAKE_INSTALL_PREFIX=/Users/daddye/code/freetype-sys/target/aarch64-apple-ios/release/build/freetype-sys-c6f1394b66138f11/out" "-DCMAKE_C_FLAGS= -fPIC --target=aarch64-apple-ios -arch arm64 -miphoneos-version-min=7.0 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -fembed-bitcode" "-DCMAKE_C_COMPILER=/usr/bin/clang" "-DCMAKE_CXX_FLAGS= -fPIC --target=aarch64-apple-ios -arch arm64 -miphoneos-version-min=7.0 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -fembed-bitcode" "-DCMAKE_CXX_COMPILER=/usr/bin/clang++" "-DCMAKE_ASM_FLAGS= -fPIC --target=aarch64-apple-ios -arch arm64 -miphoneos-version-min=7.0 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -fembed-bitcode" "-DCMAKE_ASM_COMPILER=/usr/bin/clang" "-DCMAKE_BUILD_TYPE=Release"
  -- The C compiler identification is AppleClang 13.0.0.13000029
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /usr/bin/clang
  -- Check for working C compiler: /usr/bin/clang - broken
  -- Configuring incomplete, errors occurred!
  See also "/Users/daddye/code/freetype-sys/target/aarch64-apple-ios/release/build/freetype-sys-c6f1394b66138f11/out/build/CMakeFiles/CMakeOutput.log".
  See also "/Users/daddye/code/freetype-sys/target/aarch64-apple-ios/release/build/freetype-sys-c6f1394b66138f11/out/build/CMakeFiles/CMakeError.log".

  --- stderr
  CMake Error at /usr/local/share/cmake-3.21/Modules/CMakeTestCCompiler.cmake:69 (message):
    The C compiler

      "/usr/bin/clang"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /Users/daddye/code/freetype-sys/target/aarch64-apple-ios/release/build/freetype-sys-c6f1394b66138f11/out/build/CMakeFiles/CMakeTmp
      
      Run Build Command(s):/usr/bin/make -f Makefile cmTC_6b07d/fast && /Applications/Xcode-beta.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_6b07d.dir/build.make CMakeFiles/cmTC_6b07d.dir/build
      Building C object CMakeFiles/cmTC_6b07d.dir/testCCompiler.c.o
      /usr/bin/clang   -fPIC --target=aarch64-apple-ios -arch arm64 -miphoneos-version-min=7.0 -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.0.sdk -fembed-bitcode  -isysroot /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk -mmacosx-version-min=11.5 -MD -MT CMakeFiles/cmTC_6b07d.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_6b07d.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_6b07d.dir/testCCompiler.c.o -c /Users/daddye/code/freetype-sys/target/aarch64-apple-ios/release/build/freetype-sys-c6f1394b66138f11/out/build/CMakeFiles/CMakeTmp/testCCompiler.c
      clang: error: invalid argument '-mmacosx-version-min=11.5' not allowed with '-miphoneos-version-min=7.0'
      clang: warning: overriding '-mmacosx-version-min=11.5' option with '--target=aarch64-apple-ios' [-Woverriding-t-option]
      clang: warning: using sysroot for 'MacOSX' but targeting 'iPhone' [-Wincompatible-sysroot]
      make[1]: *** [CMakeFiles/cmTC_6b07d.dir/testCCompiler.c.o] Error 1
      make: *** [cmTC_6b07d/fast] Error 2

I'm currently on BigSur, with Xcode 13, Cargo v0.15.0, and Rust v1.57.0-nightly

It seems it is passing both SDKs for ios and macos.

Any advice how to solve it?

Thanks again!

freetype6.dll misnamed in "For Windows Users" section

The sample .cargo/config file tells you to list "freetype-6" as the library name for freetype, but when you download the binaries from freetype's website it's actually freetype6.dll, not freetype-6.dll. This leads to a linker error when attempting to build.

Build script override on Windows thing

The build script override example in the readme specifies root = "C:\\Path\\To\\Freetype" but that variable has no special meaning so it is just extraneous work that serves to confuse people.

Linux Build CMake Error `--parallel` no longer supported

When using cargo build on Amazon Linux 5.2, I run into the following error. One of my dependencies depends on this library. After looking up the issue, it seems that --parallel has been removed from CMake since 3.20.

Reference: https://gitlab.kitware.com/cmake/cmake/-/issues/21978

This is preventing my entire project from building, I don't have a fix other than using an older CMake version.

error: failed to run custom build command for `freetype-sys v0.13.1`

Caused by:
  process didn't exit successfully: `/home/ec2-user/target/release/build/freetype-sys-c68579aa2b3671b8/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=FREETYPE2_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=FREETYPE2_STATIC
  cargo:rerun-if-env-changed=FREETYPE2_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
  CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
  CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
  CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-unknown-linux-gnu = None
  CMAKE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "/home/ec2-user/.cargo/registry/src/github.com-1ecc6299db9ec823/freetype-sys-0.13.1/freetype2" "-DWITH_BZip2=OFF" "-DWITH_HarfBuzz=OFF" "-DWITH_PNG=OFF" "-DWITH_ZLIB=OFF" "-DCMAKE_INSTALL_PREFIX=/home/ec2-user/target/release/build/freetype-sys-44b141b68bdcfa7a/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"
  -- The C compiler identification is GNU 7.3.1
  -- The CXX compiler identification is GNU 7.3.1
  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc -- works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++
  -- Check for working CXX compiler: /usr/bin/c++ -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Creating directory /home/ec2-user/target/release/build/freetype-sys-44b141b68bdcfa7a/out/build/include/freetype/config
  -- Creating file /home/ec2-user/target/release/build/freetype-sys-44b141b68bdcfa7a/out/build/include/freetype/config/ftconfig.h
  -- Looking for unistd.h
  -- Looking for unistd.h - found
  -- Looking for fcntl.h
  -- Looking for fcntl.h - found
  -- Looking for stdint.h
  -- Looking for stdint.h - found
  -- Creating file /home/ec2-user/target/release/build/freetype-sys-44b141b68bdcfa7a/out/build/include/freetype/config/ftoption.h
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /home/ec2-user/target/release/build/freetype-sys-44b141b68bdcfa7a/out/build
  running: "cmake" "--build" "." "--target" "install" "--config" "Release" "--parallel" "2"

  --- stderr
  CMake Warning:
    Manually-specified variables were not used by the project:

      CMAKE_ASM_COMPILER
      CMAKE_ASM_FLAGS


  Unknown argument --parallel
  Unknown argument 2
  Usage: cmake --build <dir> [options] [-- [native-options]]
  Options:
    <dir>          = Project binary directory to be built.
    --target <tgt> = Build <tgt> instead of default targets.
    --config <cfg> = For multi-configuration tools, choose <cfg>.
    --clean-first  = Build target 'clean' first, then build.
                     (To clean only, use --target 'clean'.)
    --use-stderr   = Don't merge stdout/stderr output and pass the
                     original stdout/stderr handles to the native
                     tool so it can use the capabilities of the
                     calling terminal (e.g. colored output).
    --             = Pass remaining options to the native tool.
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

  build script failed, must exit now', /home/ec2-user/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Cross compiling from Linux to macOS fails

I'm trying to cross-compile my crate, which depends on freetype-sys, from Linux to macOS.
When I run cargo build --target x86_64-apple-darwin, the compilation of freetype-sys fails very much like gfx-rs/wgpu#2956.

Am I doing something wrong here, or is the problem with freetype-sys?

Full error message:

error: failed to run custom build command for `freetype-sys v0.13.1`

Caused by:
  process didn't exit successfully: `/data/swire/Prog/Apps/Cards/target/debug/build/freetype-sys-b224166380e3333c/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=FREETYPE2_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64-apple-darwin
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS_x86_64_apple_darwin
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_ALLOW_CROSS
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-apple-darwin
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_apple_darwin
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-apple-darwin
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_apple_darwin
  cargo:rerun-if-env-changed=TARGET_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  CMAKE_TOOLCHAIN_FILE_x86_64-apple-darwin = None
  CMAKE_TOOLCHAIN_FILE_x86_64_apple_darwin = None
  TARGET_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-apple-darwin = None
  CMAKE_GENERATOR_x86_64_apple_darwin = None
  TARGET_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-apple-darwin = None
  CMAKE_PREFIX_PATH_x86_64_apple_darwin = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-apple-darwin = None
  CMAKE_x86_64_apple_darwin = None
  TARGET_CMAKE = None
  CMAKE = None
  running: "cmake" "/home/swire/.cargo/registry/src/github.com-1ecc6299db9ec823/freetype-sys-0.13.1/freetype2" "-DWITH_BZip2=OFF" "-DWITH_HarfBuzz=OFF" "-DWITH_PNG=OFF" "-DWITH_ZLIB=OFF" "-DCMAKE_INSTALL_PREFIX=/data/swire/Prog/Apps/Cards/target/x86_64-apple-darwin/debug/build/freetype-sys-f0a0d91373846782/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"
  -- The C compiler identification is GNU 12.2.0
  -- The CXX compiler identification is GNU 12.2.0
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - failed
  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc - broken
  -- Configuring incomplete, errors occurred!
  See also "/data/swire/Prog/Apps/Cards/target/x86_64-apple-darwin/debug/build/freetype-sys-f0a0d91373846782/out/build/CMakeFiles/CMakeOutput.log".
  See also "/data/swire/Prog/Apps/Cards/target/x86_64-apple-darwin/debug/build/freetype-sys-f0a0d91373846782/out/build/CMakeFiles/CMakeError.log".

  --- stderr
  CMake Deprecation Warning at CMakeLists.txt:78 (cmake_minimum_required):
    Compatibility with CMake < 2.8.12 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value or use a ...<max> suffix to tell
    CMake that the project does not need compatibility with older versions.


  CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
    The C compiler

      "/usr/bin/cc"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /data/swire/Prog/Apps/Cards/target/x86_64-apple-darwin/debug/build/freetype-sys-f0a0d91373846782/out/build/CMakeFiles/CMakeTmp

      Run Build Command(s):/usr/bin/make -f Makefile cmTC_54e32/fast && /usr/bin/make  -f CMakeFiles/cmTC_54e32.dir/build.make CMakeFiles/cmTC_54e32.dir/build
      make[1]: Entering directory '/data/swire/Prog/Apps/Cards/target/x86_64-apple-darwin/debug/build/freetype-sys-f0a0d91373846782/out/build/CMakeFiles/CMakeTmp'
      Building C object CMakeFiles/cmTC_54e32.dir/testCCompiler.c.o
      /usr/bin/cc   -ffunction-sections -fdata-sections -fPIC -m64 -arch x86_64  -o CMakeFiles/cmTC_54e32.dir/testCCompiler.c.o -c /data/swire/Prog/Apps/Cards/target/x86_64-apple-darwin/debug/build/freetype-sys-f0a0d91373846782/out/build/CMakeFiles/CMakeTmp/testCCompiler.c
      cc: error: unrecognized command-line option ‘-arch’
      make[1]: *** [CMakeFiles/cmTC_54e32.dir/build.make:78: CMakeFiles/cmTC_54e32.dir/testCCompiler.c.o] Error 1
      make[1]: Leaving directory '/data/swire/Prog/Apps/Cards/target/x86_64-apple-darwin/debug/build/freetype-sys-f0a0d91373846782/out/build/CMakeFiles/CMakeTmp'
      make: *** [Makefile:127: cmTC_54e32/fast] Error 2





    CMake will not be able to correctly generate this project.
  Call Stack (most recent call first):
    CMakeLists.txt:119 (project)


  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

  build script failed, must exit now', /home/swire/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Undefined reference to `FT_Select_CharMap`

My code has just failed to compile on Ubuntu with the following message:

error: linking with `cc` failed: exit code: 1
  |
  = note: [command]
  = note: [some path data]: undefined reference to `FT_Select_CharMap'
          collect2: error: ld returned 1 exit status

As evidenced by docs for FT_Select_CharMap and the source code which is used in this lib, the function is called FT_Select_Charmap, while in the interface for Rust has the "M" capitalized, which might be the problem.

Unable to Build On Windows With MinGw

I got Msys2 and I used pacman to install freetype. I installed the mingw seperately like it says to in the rust repo. When I try to link piston it gives me the error
ld: cannot find -lfreetype-6
I looked around a bit but I can't seem to find what I am doing wrong.

Library name is ignored and freetype-6 is always used instead

I have the following .cargo/config:

[target.x86_64-pc-windows-gnu.freetype]
rustc-link-search = ["C:/msys64/mingw64/lib"]
rustc-link-lib = ["freetype.dll"]
root = "C:/msys64/mingw64/lib"

I am expecting that it will try to link to C:/msys64/mingw64/lib/libfreetype.dll.a however it always tries to link to libfreetype-6.a (which doesn't exist) regardless of the rustc-link-lib value. I have to copy & rename libfreetype.dll.a to libfreetype-6.a to make it work.

Does not compile with Rust nightly (42deaa5e4 2014-12-16)

Add, Sub, Div and Mul have changed signatures.

src/lib.rs:79:5: 84:6 error: method `add` has an incompatible type for trait: expected struct FT_Vector, found &-ptr [E0053]
src/lib.rs:79     fn add(&self, other: &FT_Vector) -> FT_Vector {
src/lib.rs:80         FT_Vector {
src/lib.rs:81             x: self.x + other.x,
src/lib.rs:82             y: self.y + other.y,
src/lib.rs:83         }
src/lib.rs:84     }
src/lib.rs:88:5: 93:6 error: method `sub` has an incompatible type for trait: expected struct FT_Vector, found &-ptr [E0053]
src/lib.rs:88     fn sub(&self, other: &FT_Vector) -> FT_Vector {
src/lib.rs:89         FT_Vector {
src/lib.rs:90             x: self.x - other.x,
src/lib.rs:91             y: self.y - other.y,
src/lib.rs:92         }
src/lib.rs:93     }
src/lib.rs:97:5: 102:6 error: method `mul` has an incompatible type for trait: expected struct FT_Vector, found &-ptr [E0053]
src/lib.rs:97     fn mul(&self, other: &FT_Pos) -> FT_Vector {
src/lib.rs:98         FT_Vector {
src/lib.rs:99             x: self.x * *other,
src/lib.rs:100             y: self.y * *other,
src/lib.rs:101         }
src/lib.rs:102     }
src/lib.rs:106:5: 111:6 error: method `div` has an incompatible type for trait: expected struct FT_Vector, found &-ptr [E0053]
src/lib.rs:106     fn div(&self, other: &FT_Pos) -> FT_Vector {
src/lib.rs:107         FT_Vector {
src/lib.rs:108             x: self.x / *other,
src/lib.rs:109             y: self.y / *other,
src/lib.rs:110         }
src/lib.rs:111     }
error: aborting due to 4 previous errors

Unknown `deny` attribute

rustc 1.6.0-nightly (338cdd7e0 2015-11-24)

/Users/sven/rust/freetype-sys/src/lib.rs:5:9: 5:27 warning: unknown `deny` attribute: `raw_pointer_derive`, #[warn(unknown_lints)] on by default
/Users/sven/rust/freetype-sys/src/lib.rs:5 #![deny(raw_pointer_derive)]
                                                   ^~~~~~~~~~~~~~~~~~   Compiling time v0.1.34

/Users/sven/rust/freetype-sys/src/lib.rs:5:9: 5:27 warning: unknown `deny` attribute: `raw_pointer_derive`, #[warn(unknown_lints)] on by default
/Users/sven/rust/freetype-sys/src/lib.rs:5 #![deny(raw_pointer_derive)]

FT_Get_Sfnt_Table only available on Linux and OSX

The FT_Get_Sfnt_Table function is currently in its own extern block separate from all the other functions, marked with #[cfg(any(target_os = "linux", target_os = "macos"))]. This would be fairly easy to fix, but why was this restriction made in the first place? Removing the tag and calling the function seems to work on my Windows 10 machine, and I don't see any OS restrictions in the FreeType source code.

@bvssvni

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.