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

fix BSD support for libgumbo #2299

Merged
merged 4 commits into from Aug 3, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -272,3 +272,24 @@ jobs:
bundler-cache: true
- run: bundle exec rake compile
- run: bundle exec rake test

bsd:
needs: ["basic"]
strategy:
fail-fast: false
matrix:
sys: ["enable", "disable"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: vmactions/freebsd-vm@v0.1.5
with:
usesh: true
prepare: pkg install -y ruby devel/ruby-gems pkgconf libxml2 libxslt
run: |
gem install bundler
bundle install --local || bundle install
bundle exec rake compile -- --${{matrix.sys}}-system-libraries
bundle exec rake test
3 changes: 3 additions & 0 deletions Vagrantfile
Expand Up @@ -24,6 +24,9 @@ boxen << Box.new("bionic32", "mkorenkov/ubuntu-bionic32", <<~EOF)
apt-get install -y libxslt-dev libxml2-dev pkg-config
apt-get install -y ruby ruby-dev bundler git
EOF
boxen << Box.new("freebsd", "freebsd/FreeBSD-13.0-CURRENT", <<~EOF)
pkg install rbenv ruby-build
EOF

Vagrant.configure("2") do |config|
boxen.each do |box|
Expand Down
23 changes: 20 additions & 3 deletions gumbo-parser/src/Makefile
Expand Up @@ -2,15 +2,32 @@
# to enable a mini_portile2 recipe to build the gumbo parser
.PHONY: clean

override CFLAGS += -std=c99 -Wall
CFLAGS += -std=c99 -Wall

# allow the ENV var to override this
RANLIB ?= ranlib

gumbo_objs := $(patsubst %.c,%.o,$(wildcard *.c))
gumbo_objs := \
ascii.o \
attribute.o \
char_ref.o \
error.o \
foreign_attrs.o \
parser.o \
string_buffer.o \
string_piece.o \
svg_attrs.o \
svg_tags.o \
tag.o \
tag_lookup.o \
token_buffer.o \
tokenizer.o \
utf8.o \
util.o \
vector.o

libgumbo.a: $(gumbo_objs)
$(AR) $(ARFLAGS) $@ $^
$(AR) $(ARFLAGS) $@ $(gumbo_objs)
- ($(RANLIB) $@ || true) >/dev/null 2>&1

clean:
Expand Down