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

Add harfbuzz library #115

Merged
merged 6 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion create-matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ directories.forEach(library => {
let info = library;
const deps = [];
dependencies.forEach((dependency) => {
if (dependant.get(dependency))
if (dependant.get(dependency) && !deps.includes(dependency))
deps.push(dependency);
});
deps.forEach(dependency => info = dependency + " " + info);
Expand Down
46 changes: 46 additions & 0 deletions harfbuzz/PSPBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
pkgname=harfbuzz
pkgver=8.3.0
pkgrel=1
pkgdesc="OpenType text shaping engine"
arch=('mips')
url="https://harfbuzz.github.io/"
license=('MIT')
depends=('freetype2')
makedepends=()
optdepends=()
source=(
"https://github.com/harfbuzz/harfbuzz/releases/download/${pkgver}/harfbuzz-${pkgver}.tar.xz"
"fix-cmake.patch"
)
sha256sums=(
"109501eaeb8bde3eadb25fab4164e993fbace29c3d775bcaa1c1e58e2f15f847"
"9248557e549775ce9f3689bf271722bedab9bceba4cbc9ba452c68b652d31616"
)

prepare() {
cd "harfbuzz-${pkgver}/src"
sed -i 's#%prefix%#${PSPDEV}/psp#' harfbuzz*.pc.in
sed -i 's#%exec_prefix%#${prefix}#' harfbuzz*.pc.in
sed -i 's#%libdir%#${prefix}/lib#' harfbuzz*.pc.in
sed -i 's#%includedir%#${prefix}/include#' harfbuzz*.pc.in

cd ..
patch -p1 < ../fix-cmake.patch
}

build() {
cd "harfbuzz-${pkgver}"
mkdir -p build
cd build
cmake -Wno-dev -DCMAKE_TOOLCHAIN_FILE=$PSPDEV/psp/share/pspdev.cmake -DCMAKE_INSTALL_PREFIX=${pkgdir}/psp -DBUILD_SHARED_LIBS=OFF \
-DHB_HAVE_FREETYPE=ON "${XTRA_OPTS[@]}" .. || { exit 1; }
make --quiet $MAKEFLAGS || { exit 1; }
}

package() {
cd "harfbuzz-${pkgver}/build"
make --quiet $MAKEFLAGS install

mkdir -m 755 -p "$pkgdir/psp/share/licenses/$pkgname"
install -m 644 ../COPYING "$pkgdir/psp/share/licenses/$pkgname"
}
14 changes: 14 additions & 0 deletions harfbuzz/fix-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff -ruN original/CMakeLists.txt new/CMakeLists.txt
--- original/CMakeLists.txt 2023-11-11 15:08:45.000000000 +0100
+++ new/CMakeLists.txt 2024-03-18 22:57:40.191313381 +0100
@@ -116,7 +116,9 @@
find_package(Threads)
if (CMAKE_USE_PTHREADS_INIT)
add_definitions("-DHAVE_PTHREAD")
- list(APPEND THIRD_PARTY_LIBS Threads::Threads)
+ if (NOT PSP)
+ list(APPEND THIRD_PARTY_LIBS Threads::Threads)
+ endif()
list(APPEND PC_LIBS_PRIV -pthread)
sharkwouter marked this conversation as resolved.
Show resolved Hide resolved
endif ()
endif ()
8 changes: 4 additions & 4 deletions sdl2-ttf/PSPBUILD
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
pkgname=sdl2-ttf
pkgver=2.20.2
pkgrel=1
pkgrel=2
pkgdesc="a companion library to SDL2 for working with TrueType (tm) fonts"
arch=('mips')
url="https://www.libsdl.org/projects/SDL_ttf/"
license=('MIT')
depends=('sdl2' 'freetype2')
depends=('sdl2' 'harfbuzz')
makedepends=()
optdepends=()
source=(
Expand Down Expand Up @@ -35,8 +35,8 @@ build() {
mkdir -p build
cd build
cmake -Wno-dev -DCMAKE_TOOLCHAIN_FILE="${PSPDEV}/psp/share/pspdev.cmake" -DCMAKE_INSTALL_PREFIX=/psp \
-DBUILD_SHARED_LIBS=OFF -DSDL2TTF_SAMPLES=OFF -DSDL2TTF_VENDORED=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=OFF \
-DSDL2TTF_INSTALL=ON "${XTRA_OPTS[@]}" .. || { exit 1; }
-DSDL2TTF_HARFBUZZ=ON -DBUILD_SHARED_LIBS=OFF -DSDL2TTF_SAMPLES=OFF -DSDL2TTF_VENDORED=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=OFF -DSDL2TTF_INSTALL=ON "${XTRA_OPTS[@]}" .. || { exit 1; }
make --quiet $MAKEFLAGS || { exit 1; }
}

Expand Down