From 5e505a8ab369343a2324c8f11f05ddd43726e518 Mon Sep 17 00:00:00 2001 From: Will Date: Thu, 24 Aug 2023 16:27:08 +0900 Subject: [PATCH] WIP: inital import --- .github/actions/setup-xcc/action.sh | 14 ++++++++++++++ .github/actions/setup-xcc/action.yml | 16 ++++++++++++++++ .github/workflows/build.yml | 27 +++++++++++++++++++++++++++ .gitmodules | 3 +++ libpcap | 1 + 5 files changed, 61 insertions(+) create mode 100755 .github/actions/setup-xcc/action.sh create mode 100644 .github/actions/setup-xcc/action.yml create mode 100644 .github/workflows/build.yml create mode 100644 .gitmodules create mode 160000 libpcap diff --git a/.github/actions/setup-xcc/action.sh b/.github/actions/setup-xcc/action.sh new file mode 100755 index 0000000..6e939ce --- /dev/null +++ b/.github/actions/setup-xcc/action.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -eu -x + +RELEASE=https://github.com/kentik/musl-xcc/releases/download/$VERSION/ +ARCHIVE=xcc-$TARGET.tar.gz + +curl -sL $RELEASE/$ARCHIVE | tar -xzf - -C / + +echo "CC=/opt/xcc/bin/$TARGET-gcc" >> $GITHUB_ENV +echo "CXX=/opt/xcc/bin/$TARGET-g++" >> $GITHUB_ENV +echo "AR=/opt/xcc/bin/$TARGET-ar" >> $GITHUB_ENV +echo "LD=/opt/xcc/bin/$TARGET-ld" >> $GITHUB_ENV +echo "RANLIB=/opt/xcc/bin/$TARGET-ranlib" >> $GITHUB_ENV diff --git a/.github/actions/setup-xcc/action.yml b/.github/actions/setup-xcc/action.yml new file mode 100644 index 0000000..3425724 --- /dev/null +++ b/.github/actions/setup-xcc/action.yml @@ -0,0 +1,16 @@ +name: package + +inputs: + target: + required: true + version: + required: true + +runs: + using: composite + steps: + - run: $GITHUB_ACTION_PATH/action.sh + shell: bash + env: + TARGET: ${{ inputs.target }} + VERSION: ${{ inputs.version }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..602cd3d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,27 @@ +name: build + +on: + push: + branches: "*" + +jobs: + build: + strategy: + matrix: + target: + - x86_64-linux-musl + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: true + - uses: ./.github/actions/setup-xcc + with: + target: ${{ matrix.target }} + version: f9cb5162 + - run: | + ./configure --build x86_64-pc-linux-gnu --disable-shared + make + ls -lR + working-directory: libpcap diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..10c1958 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "libpcap"] + path = libpcap + url = https://github.com/the-tcpdump-group/libpcap.git diff --git a/libpcap b/libpcap new file mode 160000 index 0000000..371b9e4 --- /dev/null +++ b/libpcap @@ -0,0 +1 @@ +Subproject commit 371b9e44a8364990147fbcb71eefcce9011b3efa