Merge remote-tracking branch 'github/pr/94' into github-ci
diff --git a/.cirrus.yml b/.cirrus.yml
deleted file mode 100644
index d2dc34e..0000000
--- a/.cirrus.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-env:
- CIRRUS_CLONE_DEPTH: 1
-
-freebsd_13_task:
- freebsd_instance:
- image: freebsd-13-0-release-amd64
- install_script:
- pkg install -y bison gmake pkgconf
- build_script:
- gmake
- test_script:
- gmake check
-
-linux_gcc_task:
- container:
- image: gcc:latest
- install_script:
- - apt-get update
- - apt-get -y install bison flex
- build_script:
- - make
- test_script:
- - make check
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..6daaa8d
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,33 @@
+---
+name: Build test
+'on':
+ push:
+ branches:
+ - main
+ pull_request:
+ branches:
+ - main
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Install Dependencies
+ run:
+ sudo apt install
+ flex
+ libyaml-dev
+ pkg-config
+ python3-dev
+ swig
+ valgrind
+ bison
+
+ - name: Build
+ run: make
+
+ - name: Run check
+ run: make check
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index a5163de..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-language: c
-
-# Coverity Scan uploads
-env:
- global:
- # COVERITY_SCAN_TOKEN (dgibson/dtc)
- - secure: "vlHvXe618//IM9LQaKzqsrUbjs7ng0L9UCST4kJbJnFQDXvVe5JiSmJGd4ef7mm0NUv5bMRl2W3xCiu6BYAu/NvU3tMNHoLG+JgCJs0+wLJXbWOwji/NmH7olqgJG+CmpaCMXjARF6+nrTnBYHJL6cYyf4KVoV4B0I/hLUW91+s="
-
-matrix:
- include:
- - addons:
- apt:
- packages:
- - swig
- - python-dev
- - valgrind
- - libyaml-0-2
- coverity_scan:
- project:
- name: dtc
- description: Device Tree Compiler
- notification_email: david@gibson.dropbear.id.au
- build_command: make
- branch_pattern: coverity_scan
- script:
- - make
- - make check && make checkm
-
- # Check it builds properly without optional packages:
- # python, valgrind, libyaml
- - script:
- - make
- - make check
-
- - arch: arm64
- addons:
- apt_packages:
- - swig
- - python-dev
- - valgrind
- - libyaml-0-2
- script:
- - make
- - make check checkm
-
- - arch: ppc64le
- addons:
- apt_packages:
- - swig
- - python-dev
- - libyaml-0-2
- script:
- - make
- - make check
-
- - arch: s390x
- addons:
- apt_packages:
- - swig
- - python-dev
- - valgrind
- - libyaml-0-2
- script:
- - make
- - make check checkm
diff --git a/Makefile b/Makefile
index 6ccee13..784e2f8 100644
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,11 @@
CFLAGS += $(shell $(PKG_CONFIG) --cflags valgrind)
endif
-NO_YAML := $(shell $(PKG_CONFIG) --exists yaml-0.1; echo $$?)
+# libyaml before version 0.2.3 expects non-const string parameters. Supporting
+# both variants would require either cpp magic or passing
+# -Wno-error=discarded-qualifiers to the compiler. For the sake of simplicity
+# just support libyaml >= 0.2.3.
+NO_YAML := $(shell $(PKG_CONFIG) --atleast-version 0.2.3 yaml-0.1; echo $$?)
ifeq ($(NO_YAML),1)
CFLAGS += -DNO_YAML
else
diff --git a/meson.build b/meson.build
index cef113f..4654803 100644
--- a/meson.build
+++ b/meson.build
@@ -42,7 +42,7 @@
endif
yamltree = 'yamltree.c'
-yaml = dependency('yaml-0.1', required: get_option('yaml'), static: static_build)
+yaml = dependency('yaml-0.1', version: '>=0.2.3', required: get_option('yaml'), static: static_build)
if not yaml.found()
add_project_arguments('-DNO_YAML', language: 'c')
yamltree = []
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 2af8c15..d7a6d49 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -32,7 +32,7 @@
no_yaml=false
fi
else
- if pkg-config --exists yaml-0.1; then
+ if pkg-config --atleast-version 0.2.3 yaml-0.1; then
no_yaml=false
else
no_yaml=true