servo / pathfinder

A fast, practical GPU rasterizer for fonts and vector graphics
Apache License 2.0
3.62k stars 206 forks source link

Simplify the cargo-c usage and generate the library as libpathfinder #406

Closed lu-zero closed 4 years ago

pcwalton commented 4 years ago

Will this make the Rust crate named pathfinder? I think people may expect a Rust crate named pathfinder to export Rust functions.

linkmauve commented 4 years ago

Is there any reason to use the c/ crate from Rust in any way? I would expect it to only ever be used to generate the C library, not be linked to Rust code, so its crate name shouldn’t matter.

lu-zero commented 4 years ago

This is what it produces:

❯ ls -alR /tmp/staging-pathfinder/
total 0
drwxr-xr-x   3 lu_zero  wheel   96 29 Jul 23:06 .
drwxrwxrwt  21 root     wheel  672 29 Jul 23:06 ..
drwxr-xr-x   3 lu_zero  wheel   96 29 Jul 23:06 usr

/tmp/staging-pathfinder//usr:
total 0
drwxr-xr-x  3 lu_zero  wheel   96 29 Jul 23:06 .
drwxr-xr-x  3 lu_zero  wheel   96 29 Jul 23:06 ..
drwxr-xr-x  5 lu_zero  wheel  160 29 Jul 23:06 local

/tmp/staging-pathfinder//usr/local:
total 0
drwxr-xr-x  5 lu_zero  wheel  160 29 Jul 23:06 .
drwxr-xr-x  3 lu_zero  wheel   96 29 Jul 23:06 ..
drwxr-xr-x  2 lu_zero  wheel   64 29 Jul 23:06 bin
drwxr-xr-x  3 lu_zero  wheel   96 29 Jul 23:06 include
drwxr-xr-x  7 lu_zero  wheel  224 29 Jul 23:06 lib

/tmp/staging-pathfinder//usr/local/bin:
total 0
drwxr-xr-x  2 lu_zero  wheel   64 29 Jul 23:06 .
drwxr-xr-x  5 lu_zero  wheel  160 29 Jul 23:06 ..

/tmp/staging-pathfinder//usr/local/include:
total 0
drwxr-xr-x  3 lu_zero  wheel   96 29 Jul 23:06 .
drwxr-xr-x  5 lu_zero  wheel  160 29 Jul 23:06 ..
drwxr-xr-x  3 lu_zero  wheel   96 29 Jul 23:06 pathfinder

/tmp/staging-pathfinder//usr/local/include/pathfinder:
total 32
drwxr-xr-x  3 lu_zero  wheel     96 29 Jul 23:06 .
drwxr-xr-x  3 lu_zero  wheel     96 29 Jul 23:06 ..
-rw-r--r--  1 lu_zero  wheel  15097 20 Jul 18:15 pathfinder.h

/tmp/staging-pathfinder//usr/local/lib:
total 428680
drwxr-xr-x  7 lu_zero  wheel        224 29 Jul 23:06 .
drwxr-xr-x  5 lu_zero  wheel        160 29 Jul 23:06 ..
-rwxr-xr-x  1 lu_zero  wheel   16470768 20 Jul 18:14 libpathfinder.0.1.0.dylib
lrwxr-xr-x  1 lu_zero  wheel         25 29 Jul 23:06 libpathfinder.0.dylib -> libpathfinder.0.1.0.dylib
-rw-r--r--  1 lu_zero  wheel  203009600 20 Jul 18:14 libpathfinder.a
lrwxr-xr-x  1 lu_zero  wheel         25 29 Jul 23:06 libpathfinder.dylib -> libpathfinder.0.1.0.dylib
drwxr-xr-x  3 lu_zero  wheel         96 29 Jul 23:06 pkgconfig

/tmp/staging-pathfinder//usr/local/lib/pkgconfig:
total 8
drwxr-xr-x  3 lu_zero  wheel   96 29 Jul 23:06 .
drwxr-xr-x  7 lu_zero  wheel  224 29 Jul 23:06 ..
-rw-r--r--  1 lu_zero  wheel  248 29 Jul 23:06 pathfinder.pc
pcwalton commented 4 years ago

Well, my concern would be uploading it to crates.io I guess.

pcwalton commented 4 years ago

I'll approve this for now and we can revisit if we ever want to push this to crates.io.

pcwalton commented 4 years ago

@bors-servo: r+

bors-servo commented 4 years ago

:pushpin: Commit 03017e9 has been approved by pcwalton

bors-servo commented 4 years ago

:hourglass: Testing commit 03017e9a23cad887c003393fe77b668bd31dfb3a with merge fed372229a4e4730b476be6436087d06f4f2ce0f...

bors-servo commented 4 years ago

:sunny: Test successful - checks-travis Approved by: pcwalton Pushing fed372229a4e4730b476be6436087d06f4f2ce0f to master...