Skip to content

Commit

Permalink
Merge pull request #2299 from sparklemotion/flavorjones-bsd-gumbo-sup…
Browse files Browse the repository at this point in the history
…port

fix BSD support for libgumbo
  • Loading branch information
flavorjones committed Aug 3, 2021
2 parents 8cafcee + 1159a9b commit 0e5fece
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 3 deletions.
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

0 comments on commit 0e5fece

Please sign in to comment.