diff --git a/.github/workflows/build_containers.yml b/.github/workflows/build_containers.yml index 85351e1..71eee87 100644 --- a/.github/workflows/build_containers.yml +++ b/.github/workflows/build_containers.yml @@ -5,7 +5,7 @@ on: - 'docker/**' - '.github/workflows/build_containers.yml' jobs: - build_skiabuild-64: + build_skiabuild: runs-on: [self-hosted, linux, x64] container: jameswalmsley/container-builder:latest steps: @@ -19,7 +19,7 @@ jobs: username: ${{ secrets.JAMES_DOCKER_HUB_USERNAME }} password: ${{ secrets.JAMES_DOCKER_HUB_PASSWORD }} - - name: Build and push + - name: Build skiabuild:latest uses: docker/build-push-action@v2 with: context: docker/skiabuild @@ -27,3 +27,42 @@ jobs: push: true tags: jameswalmsley/skiabuild:latest + + + build_skiatest-archlinux: + runs-on: ubuntu-latest + steps: + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v2 + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.JAMES_DOCKER_HUB_USERNAME }} + password: ${{ secrets.JAMES_DOCKER_HUB_PASSWORD }} + - name: Build skiatest:archlinux + uses: docker/build-push-action@v2 + with: + context: docker/skiabuild + file: docker/skiabuild/skiatest-archlinux.Dockerfile + push: true + tags: jameswalmsley/skiatest:archlinux + + build_skiatest-debian: + runs-on: ubuntu-latest + steps: + - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v2 + - name: Login to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.JAMES_DOCKER_HUB_USERNAME }} + password: ${{ secrets.JAMES_DOCKER_HUB_PASSWORD }} + - name: Build skiatest:debian + uses: docker/build-push-action@v2 + with: + context: docker/skiabuild + file: docker/skiabuild/skiatest-debian.Dockerfile + push: true + tags: jameswalmsley/skiatest:debian diff --git a/.github/workflows/skiabuild.yml b/.github/workflows/skiabuild.yml index 98eb56e..bcc2497 100644 --- a/.github/workflows/skiabuild.yml +++ b/.github/workflows/skiabuild.yml @@ -30,30 +30,62 @@ jobs: test_skia_archlinux: runs-on: ubuntu-latest needs: build_skia_64 - container: archlinux:latest - steps: - - run: echo "Testing skia shim on archlinux" - - test_skia_fedora: - runs-on: ubuntu-latest - needs: build_skia_64 - container: fedora:latest + container: jameswalmsley/skiatest:archlinux steps: + - uses: actions/download-artifact@v3 - run: echo "Testing skia shim on archlinux" + - name: Test skialib with testprog + run: | + mkdir out + cd out && tar xvf ../libskia-x86_64-linux-gnu/sysroot.tar.gz + LD_LIBRARY_PATH=$(pwd)/usr/local/lib64 ./usr/local/bin/testprog + md5sum *.png test_skia_debian: runs-on: ubuntu-latest needs: build_skia_64 - container: debian:latest + container: jameswalmsley/skiatest:debian steps: - - run: echo "Testing skia shim on archlinux" + - uses: actions/download-artifact@v3 + - run: echo "Testing skia shim on debian" + - name: Test skialib with testprog + run: | + mkdir out + cd out && tar xvf ../libskia-x86_64-linux-gnu/sysroot.tar.gz + LD_LIBRARY_PATH=$(pwd)/usr/local/lib64 ./usr/local/bin/testprog + md5sum *.png + + # test_skia_fedora: + # runs-on: ubuntu-latest + # needs: build_skia_64 + # container: fedora:latest + # steps: + # - uses: actions/download-artifact@v3 + # - run: echo "Testing skia shim on fedora" + # - name: Test skialib with testprog + # run: | + # mkdir out + # cd out && tar xvf ../libskia-x86_64-linux-gnu/sysroot.tar.gz + # ls -la && pwd + # ls -la ./usr/local/bin + # LD_LIBRARY_PATH=$(pwd)/usr/local/lib64 ./usr/local/bin/testprog + + + # test_skia_alpine: + # runs-on: ubuntu-latest + # needs: build_skia_64 + # container: alpine:latest + # steps: + # - uses: actions/download-artifact@v3 + # - run: echo "Testing skia shim on alpine linux" + # - name: Test skialib with testprog + # run: | + # mkdir out + # cd out && tar xvf ../libskia-x86_64-linux-gnu/sysroot.tar.gz + # ls -la && pwd + # ls -la ./usr/local/bin + # LD_LIBRARY_PATH=$(pwd)/usr/local/lib64 ./usr/local/bin/testprog - test_skia_alpine: - runs-on: ubuntu-latest - needs: build_skia_64 - container: alpine:latest - steps: - - run: echo "Testing skia shim on archlinux" release_libskia: needs: [build_skia_64] diff --git a/Makefile b/Makefile index 44c9b69..80565fd 100644 --- a/Makefile +++ b/Makefile @@ -6,22 +6,7 @@ DOCKER_IMAGE:=skiabuild DOCKER:=skiabuild CONTAINER?=skiabuild - -# all: -# cd skia && python ./tools/git-sync-deps -# cd skia && ./bin/gn gen out/Shared --args='is_official_build=true skia_use_system_harfbuzz=false is_component_build=true' -# cd skia/out/Shared && ninja -j16 - - -# docker.build: -# cd docker/$(DOCKER) && BASE=$(shell pwd) docker-compose build $(CONTAINER) - -# docker.pull: -# cd docker/$(DOCKER) && BASE=$(shell pwd) docker-compose pull $(CONTAINER) - -# .PHONY: docker -# docker: -# cd docker/$(DOCKER) && BASE=$(shell pwd) CURRENT_DIR=$(shell pwd) CURRENT_UID=$(shell id -u) \ -# CURRENT_GID=$(shell id -g) CURRENT_USER=$(shell whoami) docker-compose run --rm $(CONTAINER) /bin/bash - +.PHONY:test +test: + LD_LIBRARY_PATH=$(SYSROOT)/$(PREFIX)/$(LIBDIR) $(SYSROOT)/$(PREFIX)/bin/testprog diff --git a/docker/skiabuild/docker-compose.yml b/docker/skiabuild/docker-compose.yml index 8af6ec1..94a1395 100644 --- a/docker/skiabuild/docker-compose.yml +++ b/docker/skiabuild/docker-compose.yml @@ -32,3 +32,56 @@ services: image: jameswalmsley/skiabuild:latest volumes: - /home/${CURRENT_USER}:/home/${CURRENT_USER} + + skiatest_archlinux: + build: + context: . + dockerfile: skiatest-archlinux.Dockerfile + image: jameswalmsley/skiatest:archlinux + volumes: + - /home/${CURRENT_USER}:/home/${CURRENT_USER} + - ./entrypoint.sh:/entrypoint.sh + - ./userentry.sh:/userentry.sh + - /tmp/.X11-unix:/tmp/.X11-unix + - /dev:/dev + - /tmp:/tmp + environment: + - DISPLAY + - CURRENT_UID + - CURRENT_GID + - CURRENT_USER + - CURRENT_DIR + - TERM=xterm-256color + hostname: skiatest + stdin_open: true + tty: true + privileged: true + entrypoint: /entrypoint.sh + working_dir: /work + + skiatest_debian: + build: + context: . + dockerfile: skiatest-debian.Dockerfile + image: jameswalmsley/skiatest:debian + volumes: + - /home/${CURRENT_USER}:/home/${CURRENT_USER} + - ./entrypoint.sh:/entrypoint.sh + - ./userentry.sh:/userentry.sh + - /tmp/.X11-unix:/tmp/.X11-unix + - /dev:/dev + - /tmp:/tmp + environment: + - DISPLAY + - CURRENT_UID + - CURRENT_GID + - CURRENT_USER + - CURRENT_DIR + - TERM=xterm-256color + hostname: skiatest + stdin_open: true + tty: true + privileged: true + entrypoint: /entrypoint.sh + working_dir: /work + diff --git a/docker/skiabuild/skiatest-archlinux.Dockerfile b/docker/skiabuild/skiatest-archlinux.Dockerfile new file mode 100644 index 0000000..d3d9758 --- /dev/null +++ b/docker/skiabuild/skiatest-archlinux.Dockerfile @@ -0,0 +1,7 @@ +FROM archlinux:latest + +RUN pacman --noconfirm -Syu \ + sudo \ + libgl \ + make \ + which diff --git a/docker/skiabuild/skiatest-debian.Dockerfile b/docker/skiabuild/skiatest-debian.Dockerfile new file mode 100644 index 0000000..3f2cf3e --- /dev/null +++ b/docker/skiabuild/skiatest-debian.Dockerfile @@ -0,0 +1,6 @@ +FROM debian:latest +RUN apt-get -y update && \ + apt-get -y install \ + sudo \ + libgl1-mesa-glx \ + make diff --git a/recipes/skia/layers/skia.mk b/recipes/skia/layers/skia.mk index dfc90aa..3af250a 100644 --- a/recipes/skia/layers/skia.mk +++ b/recipes/skia/layers/skia.mk @@ -7,7 +7,7 @@ skia:=$(LSTAMP)/skia skia_sync_deps:=$(LSTAMP)/skia_sync_deps skia_config:=$(LSTAMP)/skia_config skia_install:=$(LSTAMP)/skia_install -skia_pkgconfig:=$(LSTAMP)/skia_pkgconfig +skia_pkgconfig:=$(SYSROOT)/$(PREFIX)/$(LIBDIR)/pkgconfig/skia.pc $(call git_clone, skia, https://github.com/google/skia.git, $(SKIA_GIT_REF)) @@ -63,7 +63,7 @@ $(skia_install): $(skia) $(stamp) $(skia_pkgconfig): $(skia_install) - cp $(BASE_skia)/skia.pc.in $(SYSROOT)/usr/local/lib64/pkgconfig/skia.pc + cp $(BASE_skia)/skia.pc.in $@ $(L).clean: diff --git a/recipes/skia/recipe.mk b/recipes/skia/recipe.mk index a23bfca..0c13866 100644 --- a/recipes/skia/recipe.mk +++ b/recipes/skia/recipe.mk @@ -8,13 +8,13 @@ PREFIX=usr/local LIBDIR=lib64 export LIBRARY_PATH="$(SYSROOT)/$(PREFIX)/$(LIBDIR):$(SYSROOT)/usr/lib64" -ifneq ($(shell which distcc),) +ifneq ($(shell which distcc 2> /dev/null),) export DISTCC_HOSTS=10.1.0.16/4 10.1.0.24/32 10.1.0.40/20 10.1.0.48/16 export CC:=distcc $(CC) export CXX:=distcc $(CXX) endif -ifneq ($(shell which distcc),) +ifneq ($(shell which distcc 2> /dev/null),) ifdef DISTCC_HOSTS BUILD_JOBS=-j $$(distcc -j) testy: