Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Prebuilt Linux Libraries for SkiaSharp.HarfBuzz #1376

Closed
mlptownsend opened this issue Jul 2, 2020 · 5 comments
Closed

[FEATURE] Prebuilt Linux Libraries for SkiaSharp.HarfBuzz #1376

mlptownsend opened this issue Jul 2, 2020 · 5 comments

Comments

@mlptownsend
Copy link

We have SkiaSharp.NativeAssets.Linux for SkiaSharp. It'd be really nice if there was a prebuilt native library for the libHarfBuzzSharp.so dependency for the SkiaSharp.HarfBuzz package too. They do get generated at the same time in the bootstrapper, after all.

It'd also be nice if the wiki page for "Building SkiaSharp" would list the parameters for the -t targets that are available. It has "everything" on the page, but it doesn't mention that you can do "externals-linux" to just build the linux only. I had to find that by searching through all the issues.

With everything, the build fails with tizen, and I'm not sure if I was just having problems finding it, but I don't think they have a headless installer anymore? Not that it's your problem :)


To help anyone else who might want to build them, I kept track of what I did to do it. This is for Ubuntu 18.04. No warranties or guarantees though!

sudo apt-get update
wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

sudo apt install gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update

sudo apt-get install libfontconfig1-dev apt-transport-https dotnet-sdk-2.2 dotnet-sdk-3.1 mono-devel python2.7 python-pip -y

git clone https://github.com/mono/SkiaSharp.git
cd SkiaSharp
git checkout tags/v1.68.3
git submodule update --init --recursive
./bootstrapper.sh -t externals-linux

The generated files will be found in SkiaSharp/output/native/linux/x64.

@mattleibow
Copy link
Contributor

mattleibow commented Jul 2, 2020

@mlptownsend Good news! This is already done!

The library for harfbuzz is actually "libHarfBuzzSharp", which is in the "HarfBuzzSharp" series of packages: https://www.nuget.org/packages/HarfBuzzSharp.NativeAssets.Linux

SkiaSharp.HarfBuzz is just a convenience package that adds some easy use cases.

Thanks for taking the time to open the issue and post your workings! Hopefully this helps.

@mlptownsend
Copy link
Author

Wow I totally overlooked it. Thanks!

@mlptownsend
Copy link
Author

I'll add one more workings. I don't have the free time to make a CentOS 7 package, but if someone else does... This is what I just did to get 1.68.3 to build on a random server I had lying around.

sudo yum update
sudo rpm --import "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'
sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
sudo yum update

sudo yum install -y centos-release-scl epel-release
sudo yum install -y git bzip2 gmp-devel mpfr-devel libmpc-devel clang gcc gcc-c++ python27 python-pip openssl-devel bzip2-devel mono-devel dotnet-sdk-2.2 dotnet-sdk-3.1 fontconfig-devel freetype-devel
sudo yum group install "Development Tools" -y
sudo yum install -y devtoolset-8-gcc* llvm-toolset-7

To compile using gcc:

scl enable devtoolset-8 bash

To compile using clang (recommended):

scl enable llvm-toolset-7 bash
export CC=clang
export CXX=clang++

Then the bootstrapper step.

git clone https://github.com/mono/SkiaSharp.git
cd SkiaSharp
git checkout tags/v1.68.3
git submodule update --init --recursive
./bootstrapper.sh -t externals-linux

Something for #453?

@mattleibow
Copy link
Contributor

Yes please! Share this over there too.

But, did the package on nuget not work for you for centos?

@mlptownsend
Copy link
Author

It might take me a bit to try it out and see but I'll try and circle back and report back on this. Chances are it will actually work though. The .so's I built for CentOS did work on Ubuntu. I'm not really a Linux person and assumed that you had to have a .so built on the specific OS or it wouldn't work at all. I guess it's not THAT inflexible.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants