Skip to content

Commit 011830e

Browse files
matyalattetimschumi
authored andcommitted
Ports: Add msttcorefonts
1 parent 45f2376 commit 011830e

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

Documentation/BuildInstructions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ For select ports you might need slightly more exotic dependencies such as:
146146
- `libpython3-dev` (most prominently for boost)
147147
- `lua` (for luarocks)
148148
- `openjdk-17-jdk` (to compile OpenJDK)
149+
- `p7zip-full` (for msttcorefonts)
149150
- `rake` (to build mruby).
150151

151152
You may also need a symlink from "/usr/bin/python" to "/usr/bin/python3"; some ports depend on "python" existing, most notably ninja.

Ports/.port_include.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,9 @@ fetch_simple() {
364364
run_nocd bsdtar xf "${PORT_META_DIR}/${filename}" || run_nocd unzip -qo "${PORT_META_DIR}/${filename}"
365365
run touch ".${filename}_extracted"
366366
;;
367+
*.exe|*.htm)
368+
cp "${PORT_META_DIR}/${filename}" ./
369+
;;
367370
*)
368371
echo "Note: no case for file $filename."
369372
cp "${PORT_META_DIR}/${filename}" ./

Ports/AvailablePorts.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n
223223
| [`mpfr`](mpfr/) | GNU Multiple Precision Floating-Point Reliable Library (MPFR) | 4.2.1 | https://www.mpfr.org/ |
224224
| [`mrsh`](mrsh/) | mrsh | cd3c3a4 | https://mrsh.sh/ |
225225
| [`mruby`](mruby/) | mruby | 3.0.0 | https://mruby.org/ |
226+
| [`msttcorefonts`](msttcorefonts/) | Microsoft's TrueType core fonts | | https://corefonts.sourceforge.net/ |
226227
| [`mysthous`](mysthous/) | Hi-Res Adventure #1: Mystery House | 1.0 | https://www.scummvm.org/games/#games-hires1 |
227228
| [`nano`](nano/) | GNU nano | 8.2 | https://www.nano-editor.org/ |
228229
| [`nasm`](nasm/) | Netwide Assembler (NASM) | 2.16.03 | https://www.nasm.us/ |

Ports/msttcorefonts/package.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env -S bash ../.port_include.sh
2+
3+
port='msttcorefonts'
4+
# Note: Using 'git' as a placeholder since msttcorefonts versioning is for .spec files, which are not used here.
5+
version=git
6+
archive='https://sourceforge.net/projects/corefonts/files/the%20fonts/final'
7+
files=(
8+
"${archive}/andale32.exe#0524fe42951adc3a7eb870e32f0920313c71f170c859b5f770d82b4ee111e970"
9+
"${archive}/arial32.exe#85297a4d146e9c87ac6f74822734bdee5f4b2a722d7eaa584b7f2cbf76f478f6"
10+
"${archive}/arialb32.exe#a425f0ffb6a1a5ede5b979ed6177f4f4f4fdef6ae7c302a7b7720ef332fec0a8"
11+
"${archive}/comic32.exe#9c6df3feefde26d4e41d4a4fe5db2a89f9123a772594d7f59afd062625cd204e"
12+
"${archive}/courie32.exe#bb511d861655dde879ae552eb86b134d6fae67cb58502e6ff73ec5d9151f3384"
13+
"${archive}/georgi32.exe#2c2c7dcda6606ea5cf08918fb7cd3f3359e9e84338dc690013f20cd42e930301"
14+
"${archive}/impact32.exe#6061ef3b7401d9642f5dfdb5f2b376aa14663f6275e60a51207ad4facf2fccfb"
15+
"${archive}/times32.exe#db56595ec6ef5d3de5c24994f001f03b2a13e37cee27bc25c58f6f43e8f807ab"
16+
"${archive}/trebuc32.exe#5a690d9bb8510be1b8b4fe49f1f2319651fe51bbe54775ddddd8ef0bd07fdac9"
17+
"${archive}/verdan32.exe#c1cb61255e363166794e47664e2f21af8e3a26cb6346eb8d2ae2fa85dd5aad96"
18+
"${archive}/webdin32.exe#64595b5abc1080fba8610c5c34fab5863408e806aafe84653ca8575bed17d75a"
19+
"https://corefonts.sourceforge.net/eula.htm#2ce80d12c33e740344ade3f62ec162fa902704d0cc141f4f83e28901a8650bab"
20+
)
21+
workdir="."
22+
23+
build() {
24+
if ! command -v 7z >/dev/null 2>&1; then
25+
echo "Error: Host system requires p7zip to build ${port}."
26+
exit 1
27+
fi
28+
29+
# Extract .ttf files
30+
mkdir -p fonts
31+
for f in *.exe; do
32+
7z x "$f" -o"fonts" -y -r -ir!*.ttf -ir!*.TTF -bso0
33+
done
34+
35+
# Convert file names to lowercase
36+
cd fonts
37+
for f in *; do
38+
lower=$(echo "$f" | tr '[:upper:]' '[:lower:]')
39+
if [[ "$f" != "$lower" ]]; then
40+
mv -f "$f" "$lower"
41+
fi
42+
echo "${lower} extracted"
43+
done
44+
}
45+
46+
install() {
47+
install_dir="${SERENITY_INSTALL_ROOT}/usr/local/share/fonts/truetype/msttcorefonts"
48+
mkdir -p "${install_dir}"
49+
cp -v ./fonts/* "${install_dir}"
50+
51+
doc_dir="${SERENITY_INSTALL_ROOT}/usr/local/share/doc/msttcorefonts"
52+
mkdir -p "${doc_dir}"
53+
cp -v "eula.htm" "${doc_dir}/eula.html"
54+
echo "Microsoft's EULA applies. See /usr/local/share/doc/msttcorefonts/eula.html for details."
55+
}

0 commit comments

Comments
 (0)