Skip to content

Commit dd0ef75

Browse files
Build compiler with PCRE2 (#224)
1 parent 2d85f41 commit dd0ef75

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

linux/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
FROM debian:11 AS debian
22

33
RUN apt-get update \
4-
&& apt-get install -y build-essential libevent-dev libpcre3-dev automake libtool pkg-config git curl llvm-13 clang-13 \
4+
&& apt-get install -y build-essential libevent-dev libpcre2-dev automake libtool pkg-config git curl llvm-13 clang-13 \
55
&& (pkg-config || true)
66

77
ARG release
@@ -25,7 +25,7 @@ RUN apk add --no-cache \
2525
# Statically-compiled llvm
2626
llvm13-dev llvm13-static \
2727
# Static stdlib dependencies
28-
zlib-static yaml-static libxml2-dev pcre-dev libevent-static \
28+
zlib-static yaml-static libxml2-dev pcre2-dev libevent-static \
2929
# Static compiler dependencies
3030
libffi-dev \
3131
# Build tools

omnibus/config/software/crystal.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
source git: CRYSTAL_SRC
1414
end
1515

16-
dependency "pcre"
16+
dependency "pcre2"
1717
dependency "bdw-gc"
1818
dependency "llvm_bin" unless FIRST_RUN
1919
dependency "libevent"
@@ -75,7 +75,7 @@
7575

7676
make "crystal stats=true release=true target=aarch64-apple-darwin FLAGS=\"#{crflags}\" CRYSTAL_CONFIG_TARGET=aarch64-apple-darwin CRYSTAL_CONFIG_LIBRARY_PATH= O=#{output_path}", env: env
7777

78-
command "clang #{output_path}/crystal.o -o #{output_bin}_arm64 -target arm64-apple-darwin src/llvm/ext/llvm_ext.o `llvm-config --libs --system-libs --ldflags 2>/dev/null` -lstdc++ -lpcre -lgc -lpthread -levent -liconv -ldl -v", env: env
78+
command "clang #{output_path}/crystal.o -o #{output_bin}_arm64 -target arm64-apple-darwin src/llvm/ext/llvm_ext.o `llvm-config --libs --system-libs --ldflags 2>/dev/null` -lstdc++ -lpcre2-8 -lgc -lpthread -levent -liconv -ldl -v", env: env
7979
delete "#{output_path}/crystal.o"
8080

8181
# Lipo them up

omnibus/config/software/pcre.rb renamed to omnibus/config/software/pcre2.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
# limitations under the License.
1515
#
1616

17-
name "pcre"
18-
default_version "8.40"
17+
name "pcre2"
18+
default_version "10.42"
1919
skip_transitive_dependency_licensing true
2020

21-
source url: "https://ftp.exim.org/pub/pcre/pcre-#{version}.tar.gz",
22-
md5: "890c808122bd90f398e6bc40ec862102"
21+
source url: "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-#{version}/pcre2-#{version}.tar.gz",
22+
md5: "37d2f77cfd411a3ddf1c64e1d72e43f7"
2323

24-
relative_path "pcre-#{version}"
24+
relative_path "pcre2-#{version}"
2525

2626
build do
2727
env = with_standard_compiler_flags(with_embedded_path)
@@ -30,9 +30,12 @@
3030

3131
command "./configure" \
3232
" --prefix=#{install_dir}/embedded" \
33+
" --disable-cpp" \
3334
" --disable-shared" \
3435
" --enable-unicode-properties" \
35-
" --enable-utf8", env: env
36+
" --enable-utf", env: env
37+
# TODO: Enable JIT (Error: "Must target Big Sur or newer")
38+
# " --enable-jit" \
3639

3740
make "-j #{workers}", env: env
3841
make "install", env: env

omnibus/config/software/shards.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
# Build for ARM64
8787
crflags += " --cross-compile --target aarch64-apple-darwin"
8888
make "bin/shards SHARDS=false CRYSTAL=#{install_dir}/bin/crystal FLAGS='#{crflags}'", env: env
89-
command "clang bin/shards.o -o bin/shards_arm64 -target arm64-apple-darwin -L#{install_dir}/embedded/lib -lyaml -lpcre -lgc -lpthread -levent -liconv -ldl", env: env
89+
command "clang bin/shards.o -o bin/shards_arm64 -target arm64-apple-darwin -L#{install_dir}/embedded/lib -lyaml -lpcre2-8 -lgc -lpthread -levent -liconv -ldl", env: env
9090

9191
# Lipo them up
9292
command "lipo -create -output bin/shards bin/shards_x86_64 bin/shards_arm64"

0 commit comments

Comments
 (0)