Skip to content

Commit

Permalink
Remove Docker and upload Python build scripts for libcurl, mbedtls an…
Browse files Browse the repository at this point in the history
…d freeimage
  • Loading branch information
HerrNamenlos123 committed Dec 25, 2023
1 parent 1b164e8 commit 70abbbe
Show file tree
Hide file tree
Showing 26 changed files with 511 additions and 828 deletions.
41 changes: 41 additions & 0 deletions .github/actions/build-package/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build Package

runs:
using: composite

steps:
- uses: seanmiddleditch/gha-setup-ninja@master

- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{matrix.cfg.ARCHITECTURE}}

- uses: shogo82148/actions-setup-perl@v1
with:
perl-version: '5.32'

- name: Install Python deps
shell: bash
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
[ -f packages/$PACKAGE/requirements.txt ] && python3 -m pip install -r packages/$PACKAGE/requirements.txt || true
- name: Invoke Python build script
shell: bash
run: |
FULL_PACKAGE_NAME=${{matrix.cfg.FULL_PACKAGE_NAME}} \
CC_COMPILER=${{matrix.cfg.CC_COMPILER}} \
CC_COMPILER_PACKAGE=${{matrix.cfg.CC_COMPILER_PACKAGE}} \
CXX_COMPILER=${{matrix.cfg.CXX_COMPILER}} \
CXX_COMPILER_PACKAGE=${{matrix.cfg.CXX_COMPILER_PACKAGE}} \
TOOLCHAIN_FILE=${{matrix.cfg.TOOLCHAIN_FILE}} \
python3 build.py $PACKAGE
- name: Upload files to a GitHub release
uses: svenstaro/upload-release-action@2.6.1
with:
file: out/**.tar.gz
file_glob: true
tag: latest
overwrite: true
67 changes: 67 additions & 0 deletions .github/workflows/build-freeimage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build freeimage

on:
push:
paths:
- .github/workflows/build-freeimage.yml
- packages/freeimage/**
- build.py
- scripts/tools.py

jobs:
build:
runs-on: ${{ matrix.cfg.os }}

env:
PACKAGE: freeimage

strategy:
fail-fast: false
matrix:
cfg:
- { os: ubuntu-20.04,
CC_COMPILER_PACKAGE: gcc-9,
CXX_COMPILER_PACKAGE: g++-9,
CC_COMPILER: gcc-9,
CXX_COMPILER: g++-9,
TOOLCHAIN_FILE: "",
ARCHITECTURE: amd64
}
- { os: windows-2022,
CC_COMPILER_PACKAGE: msvc,
CXX_COMPILER_PACKAGE: msvc,
CC_COMPILER: msvc,
CXX_COMPILER: msvc,
TOOLCHAIN_FILE: "",
ARCHITECTURE: amd64
}
# - { os: windows, architecture: x64, compiler: mingw }
# - { os: windows, architecture: x64, compiler: msys2 }
# - { os: windows, architecture: x64, compiler: clang }
# - { os: linux, architecture: x64, compiler: gcc }
# - { os: linux, architecture: x64, compiler: clang }
# - { os: linux, architecture: x64, compiler: mingw }
# - { os: linux, architecture: arm64, compiler: gcc }
# - { os: linux, architecture: arm64, compiler: clang }
# - { os: linux, architecture: arm64, compiler: mingw }
# - { os: android, architecture: arm64, compiler: gcc }
# - { os: android, architecture: arm64, compiler : clang }
# - { os: emscripten, architecture: emscripten, compiler: emscripten }
# - { os: macos, architecture: x64, compiler: gcc }
# - { os: macos, architecture: x64, compiler: clang }
# - { os: macos, architecture: arm64, compiler: gcc }
# - { os: macos, architecture: arm64, compiler: clang }
# - { os: tvos, architecture: x64, compiler: gcc }
# - { os: tvos, architecture: x64, compiler: clang }
# - { os: tvos, architecture: arm64, compiler: gcc }
# - { os: tvos, architecture: arm64, compiler: clang }
# - { os: ios, architecture: arm64, compiler: gcc }
# - { os: ios, architecture: arm64, compiler: clang }

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build package
uses: ./.github/actions/build-package

67 changes: 67 additions & 0 deletions .github/workflows/build-libcurl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build libcurl

on:
push:
paths:
- .github/workflows/build-libcurl.yml
- packages/libcurl/**
- build.py
- scripts/tools.py

jobs:
build:
runs-on: ${{ matrix.cfg.os }}

env:
PACKAGE: libcurl

strategy:
fail-fast: false
matrix:
cfg:
- { os: ubuntu-20.04,
CC_COMPILER_PACKAGE: gcc-9,
CXX_COMPILER_PACKAGE: g++-9,
CC_COMPILER: gcc-9,
CXX_COMPILER: g++-9,
TOOLCHAIN_FILE: "",
ARCHITECTURE: amd64
}
- { os: windows-2022,
CC_COMPILER_PACKAGE: msvc,
CXX_COMPILER_PACKAGE: msvc,
CC_COMPILER: msvc,
CXX_COMPILER: msvc,
TOOLCHAIN_FILE: "",
ARCHITECTURE: amd64
}
# - { os: windows, architecture: x64, compiler: mingw }
# - { os: windows, architecture: x64, compiler: msys2 }
# - { os: windows, architecture: x64, compiler: clang }
# - { os: linux, architecture: x64, compiler: gcc }
# - { os: linux, architecture: x64, compiler: clang }
# - { os: linux, architecture: x64, compiler: mingw }
# - { os: linux, architecture: arm64, compiler: gcc }
# - { os: linux, architecture: arm64, compiler: clang }
# - { os: linux, architecture: arm64, compiler: mingw }
# - { os: android, architecture: arm64, compiler: gcc }
# - { os: android, architecture: arm64, compiler : clang }
# - { os: emscripten, architecture: emscripten, compiler: emscripten }
# - { os: macos, architecture: x64, compiler: gcc }
# - { os: macos, architecture: x64, compiler: clang }
# - { os: macos, architecture: arm64, compiler: gcc }
# - { os: macos, architecture: arm64, compiler: clang }
# - { os: tvos, architecture: x64, compiler: gcc }
# - { os: tvos, architecture: x64, compiler: clang }
# - { os: tvos, architecture: arm64, compiler: gcc }
# - { os: tvos, architecture: arm64, compiler: clang }
# - { os: ios, architecture: arm64, compiler: gcc }
# - { os: ios, architecture: arm64, compiler: clang }

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build package
uses: ./.github/actions/build-package

67 changes: 67 additions & 0 deletions .github/workflows/build-mbedtls.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build mbedtls

on:
push:
paths:
- .github/workflows/build-mbedtls.yml
- packages/mbedtls/**
- build.py
- scripts/tools.py

jobs:
build:
runs-on: ${{ matrix.cfg.os }}

env:
PACKAGE: mbedtls

strategy:
fail-fast: false
matrix:
cfg:
- { os: ubuntu-20.04,
CC_COMPILER_PACKAGE: gcc-9,
CXX_COMPILER_PACKAGE: g++-9,
CC_COMPILER: gcc-9,
CXX_COMPILER: g++-9,
TOOLCHAIN_FILE: "",
ARCHITECTURE: amd64
}
- { os: windows-2022,
CC_COMPILER_PACKAGE: msvc,
CXX_COMPILER_PACKAGE: msvc,
CC_COMPILER: msvc,
CXX_COMPILER: msvc,
TOOLCHAIN_FILE: "",
ARCHITECTURE: amd64
}
# - { os: windows, architecture: x64, compiler: mingw }
# - { os: windows, architecture: x64, compiler: msys2 }
# - { os: windows, architecture: x64, compiler: clang }
# - { os: linux, architecture: x64, compiler: gcc }
# - { os: linux, architecture: x64, compiler: clang }
# - { os: linux, architecture: x64, compiler: mingw }
# - { os: linux, architecture: arm64, compiler: gcc }
# - { os: linux, architecture: arm64, compiler: clang }
# - { os: linux, architecture: arm64, compiler: mingw }
# - { os: android, architecture: arm64, compiler: gcc }
# - { os: android, architecture: arm64, compiler : clang }
# - { os: emscripten, architecture: emscripten, compiler: emscripten }
# - { os: macos, architecture: x64, compiler: gcc }
# - { os: macos, architecture: x64, compiler: clang }
# - { os: macos, architecture: arm64, compiler: gcc }
# - { os: macos, architecture: arm64, compiler: clang }
# - { os: tvos, architecture: x64, compiler: gcc }
# - { os: tvos, architecture: x64, compiler: clang }
# - { os: tvos, architecture: arm64, compiler: gcc }
# - { os: tvos, architecture: arm64, compiler: clang }
# - { os: ios, architecture: arm64, compiler: gcc }
# - { os: ios, architecture: arm64, compiler: clang }

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build package
uses: ./.github/actions/build-package

18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@

This repository is the continuation of [apothecary](https://github.com/openframeworks/apothecary). It is the central place where all [openFrameworks](https://github.com/openframeworks/openframeworks) dependencies are built and managed, so they can be downloaded and linked into openFrameworks projects.

## Building manually locally
All packages are built and served completely automated with CI, so all you have to do is commit something and wait. The package is automatically built and uploaded into the latest Release.

You can build the dependencies locally by running the following command:
## Building a package locally

You can build a single package locally, using the compiler that is being picked up by CMake.

```bash
cd packages/<PACKAGE_NAME>
docker-compose up --build
python build.py <package_name>
# Example: python build.py freeimage
```

This should build the package and place all archive files into a `packages/<PACKAGE_NAME>/out` folder. [Docker](https://www.docker.com) and [Docker-Compose](https://docs.docker.com/compose/) are required to run this command. Most CI environments and Linux servers have Docker pre-installed.
The selected package will be built locally using the compiler chosen by CMake. Thus, you can only test packages for the compiler and architecture you are running on. See the workflow files to see what environment variables to set, if you are on Linux and want to test cross-compilation locally.

When the package finished building, an archive package consisting of all binaries, headers and CMake files will be generated in an `out/` directory.

You need a working Ninja backend.

Some packages also include a `requirements.txt` file which contains pip dependencies. You might need to manually install these too.
32 changes: 32 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import sys
import importlib

# Usage: python build.py <package_name>

def main():
if len(sys.argv) != 2:
print('Usage: python build.py <package_name>')
sys.exit(1)

package_name = sys.argv[1]
builder = getattr(importlib.import_module(f'packages.{package_name}.build'), 'Builder')()

builder.install_build_dependencies()

if hasattr(builder, 'source'):
builder.source()

if hasattr(builder, 'patch_sources'):
builder.patch_sources()

if hasattr(builder, 'depends'):
builder.depends()

if hasattr(builder, 'build'):
builder.build()

if hasattr(builder, 'package'):
builder.package()

if __name__ == '__main__':
main()
17 changes: 0 additions & 17 deletions cmake/generic/import.cmake

This file was deleted.

34 changes: 0 additions & 34 deletions docker/clang-cl/Dockerfile

This file was deleted.

22 changes: 0 additions & 22 deletions docker/generic/Dockerfile

This file was deleted.

Loading

0 comments on commit 70abbbe

Please sign in to comment.