forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.sh
executable file
·40 lines (37 loc) · 1.33 KB
/
package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env -S bash ../.port_include.sh
port='perl5'
version='5.40.0'
cross_version='1.5.3'
useconfigure='true'
files=(
"https://www.cpan.org/src/5.0/perl-${version}.tar.xz#d5325300ad267624cb0b7d512cfdfcd74fa7fe00c455c5b51a6bd53e5e199ef9"
"https://github.com/arsv/perl-cross/releases/download/${cross_version}/perl-cross-${cross_version}.tar.gz#ecc37b41a60cc3c030413a960cc386455f70c43781c6333d1fcaad02ece32ea8"
)
configopts=(
'-Dosname=serenity'
"--target=${SERENITY_ARCH}-pc-serenity"
"--targetarch=${SERENITY_ARCH}"
"--build=$(cc -dumpmachine)"
"--buildarch=$(uname -m)"
'--prefix=/usr/local'
"--sysroot="${SERENITY_INSTALL_ROOT}""
)
workdir="perl-${version}"
if [ "$(uname -s)" = 'Darwin' ]; then
makeopts+=('--ignore-errors')
# Make sure you have binutils and gnu-sed installed via homebrew
PATH="$(brew --prefix binutils)/bin:${PATH}"
PATH="$(brew --prefix gnu-sed)/libexec/gnubin:${PATH}"
export PATH="${SERENITY_BUILD_DIR}/Ports/${port}/${workdir}:${PATH}"
fi
post_fetch() {
run chmod -R +rw "${PWD}/perl-${version}"*
run cp -r "${PWD}/perl-cross-${cross_version}/"* "${PWD}/perl-${version}/"
if [ "$(uname -s)" = 'Darwin' ]; then
cat <<- 'EOH' > "${PWD}/perl-${version}/readelf"
#!/bin/bash
exec gobjdump "$@"
EOH
chmod +x "${PWD}/perl-${version}/readelf"
fi
}