Skip to content

Commit

Permalink
Merge pull request #115 from tpimh/harfbuzz
Browse files Browse the repository at this point in the history
Add harfbuzz library
  • Loading branch information
sharkwouter authored Apr 18, 2024
2 parents 55fa56d + 8461ae7 commit 31d4a3c
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 5 deletions.
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)
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

0 comments on commit 31d4a3c

Please sign in to comment.