Compare commits

..

5 Commits

Author SHA1 Message Date
5d948be506 Merge branch 'master' into add_scripts 2021-07-08 23:50:37 +02:00
4a80999f63 Merge branch 'master' into add_scripts 2021-07-08 13:21:59 +02:00
e8c98ab58e Update builder scripts
Update builder scripts

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2021-07-07 16:56:05 +02:00
438d2dcaaa Merge remote-tracking branch 'origin/master' into add_scripts 2021-07-07 16:54:42 +02:00
cb4653ac7a Add scripts
Add scripts

Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
2021-07-03 19:48:41 +02:00
13 changed files with 73 additions and 44 deletions

View File

@ -6,7 +6,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
exempt-issue-milestones: 'future,alpha,beta,release'

View File

@ -42,7 +42,7 @@ jobs:
image:
name: ${{ matrix.arch_name }}
needs: base
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:

View File

@ -1,28 +0,0 @@
name: Shellcheck CI
on:
push:
branches:
- '*'
paths-ignore:
- '**/README.md'
pull_request:
branches:
- '*'
paths-ignore:
- '**/README.md'
workflow_dispatch:
jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
with:
severity: error
format: gcc
env:
SHELLCHECK_OPTS: -s bash

View File

@ -50,12 +50,6 @@ endif
# Tag images with date and Git short hash in addition to revision
TAG := $(shell date '+%Y%m%d')-$(shell git rev-parse --short HEAD)
# shellcheck executable
SHELLCHECK := shellcheck
# Defines the level of verification (error, warning, info...)
SHELLCHECK_SEVERITY_LEVEL := error
#
# images: This target builds all IMAGES (because it is the first one, it is built by default)
#
@ -281,11 +275,6 @@ purge: clean
# Remove all images with organization (ex dockcross/*)
$(DOCKER) images --filter=reference='$(ORG)/*' --format='{{.Repository}}:{{.Tag}}' | xargs -r $(DOCKER) rmi -f
# Check bash syntax
bash-check:
find . -type f \( -name "*.sh" -o -name "*.bash" \) -print0 | xargs -0 -P"$(shell nproc)" -I{} \
$(SHELLCHECK) --check-sourced --color=auto --format=gcc --severity=error --shell=bash --enable=all "{}"
#
# testing implicit rule
#

View File

@ -13,4 +13,4 @@ RUN \
rm -rf /buildscripts
# Runtime scripts
COPY imagefiles/entrypoint.sh imagefiles/dockcross.sh /dockcross/
COPY imagefiles/entrypoint.sh imagefiles/dockcross /dockcross/

View File

@ -6,11 +6,11 @@ DEFAULT_DOCKCROSS_IMAGE=dockcross/base # DO NOT MOVE THIS LINE (see entrypoint.
# Helpers
#
err() {
echo -e >&2 "ERROR: $*\n"
echo -e >&2 ERROR: $@\\n
}
die() {
err "$*"
err $@
exit 1
}

6
tools/builder/cmake.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail
source $(dirname "$0")/functions/cmake_fn.sh
cmake_build $@

11
tools/builder/cmake_all.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -euo pipefail
curl https://raw.githubusercontent.com/dockcross/dockcross/master/Makefile -o dockcross-Makefile
make -f dockcross-Makefile display_images
source $(dirname "$0")/functions/cmake_fn.sh
for image in $(make -f dockcross-Makefile display_images); do
cmake_build $image $@
done

View File

@ -0,0 +1,19 @@
#!/bin/bash
set -euo pipefail
cmake_build () {
local image=$1
local build_file=build-${image%:*}
shift 1
local cmake_arg=$@
echo "cmake arg: $cmake_arg"
echo "Pulling dockcross/$image"
docker pull dockcross/$image
echo "Make script dockcross-$image"
docker run --rm dockcross/$image > ./dockcross-$image
chmod +x ./dockcross-$image
echo "Build $build_file"
./dockcross-$image cmake -B$build_file -H. -GNinja $cmake_arg
./dockcross-$image ninja -C$build_file
}

View File

@ -0,0 +1,15 @@
#!/bin/bash
set -euo pipefail
makefile_build () {
local image=$1
shift 1
echo "Pulling dockcross/$image"
docker pull dockcross/$image
echo "Make script dockcross-$image"
docker run --rm dockcross/$image > ./dockcross-$image
chmod +x ./dockcross-$image
echo "Build..."
./dockcross-$image bash -c 'make CXX=$CXX CC=$CC AR=$AR AS=$AS CPP=$CPP FC=$FC'
}

6
tools/builder/makefile.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail
source $(dirname "$0")/functions/makefile_fn.sh
makefile_build $@

11
tools/builder/makefile_all.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
set -euo pipefail
curl https://raw.githubusercontent.com/dockcross/dockcross/master/Makefile -o dockcross-Makefile
make -f dockcross-Makefile display_images
source $(dirname "$0")/functions/makefile_fn.sh
for image in $(make -f dockcross-Makefile display_images); do
makefile_build $image $@
done