Skip to content

Commit 70abbbe

Browse files
Remove Docker and upload Python build scripts for libcurl, mbedtls and freeimage
1 parent 1b164e8 commit 70abbbe

File tree

26 files changed

+511
-828
lines changed

26 files changed

+511
-828
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build Package
2+
3+
runs:
4+
using: composite
5+
6+
steps:
7+
- uses: seanmiddleditch/gha-setup-ninja@master
8+
9+
- uses: ilammy/msvc-dev-cmd@v1
10+
with:
11+
arch: ${{matrix.cfg.ARCHITECTURE}}
12+
13+
- uses: shogo82148/actions-setup-perl@v1
14+
with:
15+
perl-version: '5.32'
16+
17+
- name: Install Python deps
18+
shell: bash
19+
run: |
20+
python3 -m pip install --upgrade pip
21+
python3 -m pip install -r requirements.txt
22+
[ -f packages/$PACKAGE/requirements.txt ] && python3 -m pip install -r packages/$PACKAGE/requirements.txt || true
23+
24+
- name: Invoke Python build script
25+
shell: bash
26+
run: |
27+
FULL_PACKAGE_NAME=${{matrix.cfg.FULL_PACKAGE_NAME}} \
28+
CC_COMPILER=${{matrix.cfg.CC_COMPILER}} \
29+
CC_COMPILER_PACKAGE=${{matrix.cfg.CC_COMPILER_PACKAGE}} \
30+
CXX_COMPILER=${{matrix.cfg.CXX_COMPILER}} \
31+
CXX_COMPILER_PACKAGE=${{matrix.cfg.CXX_COMPILER_PACKAGE}} \
32+
TOOLCHAIN_FILE=${{matrix.cfg.TOOLCHAIN_FILE}} \
33+
python3 build.py $PACKAGE
34+
35+
- name: Upload files to a GitHub release
36+
uses: svenstaro/upload-release-action@2.6.1
37+
with:
38+
file: out/**.tar.gz
39+
file_glob: true
40+
tag: latest
41+
overwrite: true
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build freeimage
2+
3+
on:
4+
push:
5+
paths:
6+
- .github/workflows/build-freeimage.yml
7+
- packages/freeimage/**
8+
- build.py
9+
- scripts/tools.py
10+
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.cfg.os }}
14+
15+
env:
16+
PACKAGE: freeimage
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
cfg:
22+
- { os: ubuntu-20.04,
23+
CC_COMPILER_PACKAGE: gcc-9,
24+
CXX_COMPILER_PACKAGE: g++-9,
25+
CC_COMPILER: gcc-9,
26+
CXX_COMPILER: g++-9,
27+
TOOLCHAIN_FILE: "",
28+
ARCHITECTURE: amd64
29+
}
30+
- { os: windows-2022,
31+
CC_COMPILER_PACKAGE: msvc,
32+
CXX_COMPILER_PACKAGE: msvc,
33+
CC_COMPILER: msvc,
34+
CXX_COMPILER: msvc,
35+
TOOLCHAIN_FILE: "",
36+
ARCHITECTURE: amd64
37+
}
38+
# - { os: windows, architecture: x64, compiler: mingw }
39+
# - { os: windows, architecture: x64, compiler: msys2 }
40+
# - { os: windows, architecture: x64, compiler: clang }
41+
# - { os: linux, architecture: x64, compiler: gcc }
42+
# - { os: linux, architecture: x64, compiler: clang }
43+
# - { os: linux, architecture: x64, compiler: mingw }
44+
# - { os: linux, architecture: arm64, compiler: gcc }
45+
# - { os: linux, architecture: arm64, compiler: clang }
46+
# - { os: linux, architecture: arm64, compiler: mingw }
47+
# - { os: android, architecture: arm64, compiler: gcc }
48+
# - { os: android, architecture: arm64, compiler : clang }
49+
# - { os: emscripten, architecture: emscripten, compiler: emscripten }
50+
# - { os: macos, architecture: x64, compiler: gcc }
51+
# - { os: macos, architecture: x64, compiler: clang }
52+
# - { os: macos, architecture: arm64, compiler: gcc }
53+
# - { os: macos, architecture: arm64, compiler: clang }
54+
# - { os: tvos, architecture: x64, compiler: gcc }
55+
# - { os: tvos, architecture: x64, compiler: clang }
56+
# - { os: tvos, architecture: arm64, compiler: gcc }
57+
# - { os: tvos, architecture: arm64, compiler: clang }
58+
# - { os: ios, architecture: arm64, compiler: gcc }
59+
# - { os: ios, architecture: arm64, compiler: clang }
60+
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@v3
64+
65+
- name: Build package
66+
uses: ./.github/actions/build-package
67+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build libcurl
2+
3+
on:
4+
push:
5+
paths:
6+
- .github/workflows/build-libcurl.yml
7+
- packages/libcurl/**
8+
- build.py
9+
- scripts/tools.py
10+
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.cfg.os }}
14+
15+
env:
16+
PACKAGE: libcurl
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
cfg:
22+
- { os: ubuntu-20.04,
23+
CC_COMPILER_PACKAGE: gcc-9,
24+
CXX_COMPILER_PACKAGE: g++-9,
25+
CC_COMPILER: gcc-9,
26+
CXX_COMPILER: g++-9,
27+
TOOLCHAIN_FILE: "",
28+
ARCHITECTURE: amd64
29+
}
30+
- { os: windows-2022,
31+
CC_COMPILER_PACKAGE: msvc,
32+
CXX_COMPILER_PACKAGE: msvc,
33+
CC_COMPILER: msvc,
34+
CXX_COMPILER: msvc,
35+
TOOLCHAIN_FILE: "",
36+
ARCHITECTURE: amd64
37+
}
38+
# - { os: windows, architecture: x64, compiler: mingw }
39+
# - { os: windows, architecture: x64, compiler: msys2 }
40+
# - { os: windows, architecture: x64, compiler: clang }
41+
# - { os: linux, architecture: x64, compiler: gcc }
42+
# - { os: linux, architecture: x64, compiler: clang }
43+
# - { os: linux, architecture: x64, compiler: mingw }
44+
# - { os: linux, architecture: arm64, compiler: gcc }
45+
# - { os: linux, architecture: arm64, compiler: clang }
46+
# - { os: linux, architecture: arm64, compiler: mingw }
47+
# - { os: android, architecture: arm64, compiler: gcc }
48+
# - { os: android, architecture: arm64, compiler : clang }
49+
# - { os: emscripten, architecture: emscripten, compiler: emscripten }
50+
# - { os: macos, architecture: x64, compiler: gcc }
51+
# - { os: macos, architecture: x64, compiler: clang }
52+
# - { os: macos, architecture: arm64, compiler: gcc }
53+
# - { os: macos, architecture: arm64, compiler: clang }
54+
# - { os: tvos, architecture: x64, compiler: gcc }
55+
# - { os: tvos, architecture: x64, compiler: clang }
56+
# - { os: tvos, architecture: arm64, compiler: gcc }
57+
# - { os: tvos, architecture: arm64, compiler: clang }
58+
# - { os: ios, architecture: arm64, compiler: gcc }
59+
# - { os: ios, architecture: arm64, compiler: clang }
60+
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@v3
64+
65+
- name: Build package
66+
uses: ./.github/actions/build-package
67+
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build mbedtls
2+
3+
on:
4+
push:
5+
paths:
6+
- .github/workflows/build-mbedtls.yml
7+
- packages/mbedtls/**
8+
- build.py
9+
- scripts/tools.py
10+
11+
jobs:
12+
build:
13+
runs-on: ${{ matrix.cfg.os }}
14+
15+
env:
16+
PACKAGE: mbedtls
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
cfg:
22+
- { os: ubuntu-20.04,
23+
CC_COMPILER_PACKAGE: gcc-9,
24+
CXX_COMPILER_PACKAGE: g++-9,
25+
CC_COMPILER: gcc-9,
26+
CXX_COMPILER: g++-9,
27+
TOOLCHAIN_FILE: "",
28+
ARCHITECTURE: amd64
29+
}
30+
- { os: windows-2022,
31+
CC_COMPILER_PACKAGE: msvc,
32+
CXX_COMPILER_PACKAGE: msvc,
33+
CC_COMPILER: msvc,
34+
CXX_COMPILER: msvc,
35+
TOOLCHAIN_FILE: "",
36+
ARCHITECTURE: amd64
37+
}
38+
# - { os: windows, architecture: x64, compiler: mingw }
39+
# - { os: windows, architecture: x64, compiler: msys2 }
40+
# - { os: windows, architecture: x64, compiler: clang }
41+
# - { os: linux, architecture: x64, compiler: gcc }
42+
# - { os: linux, architecture: x64, compiler: clang }
43+
# - { os: linux, architecture: x64, compiler: mingw }
44+
# - { os: linux, architecture: arm64, compiler: gcc }
45+
# - { os: linux, architecture: arm64, compiler: clang }
46+
# - { os: linux, architecture: arm64, compiler: mingw }
47+
# - { os: android, architecture: arm64, compiler: gcc }
48+
# - { os: android, architecture: arm64, compiler : clang }
49+
# - { os: emscripten, architecture: emscripten, compiler: emscripten }
50+
# - { os: macos, architecture: x64, compiler: gcc }
51+
# - { os: macos, architecture: x64, compiler: clang }
52+
# - { os: macos, architecture: arm64, compiler: gcc }
53+
# - { os: macos, architecture: arm64, compiler: clang }
54+
# - { os: tvos, architecture: x64, compiler: gcc }
55+
# - { os: tvos, architecture: x64, compiler: clang }
56+
# - { os: tvos, architecture: arm64, compiler: gcc }
57+
# - { os: tvos, architecture: arm64, compiler: clang }
58+
# - { os: ios, architecture: arm64, compiler: gcc }
59+
# - { os: ios, architecture: arm64, compiler: clang }
60+
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@v3
64+
65+
- name: Build package
66+
uses: ./.github/actions/build-package
67+

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22

33
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.
44

5-
## Building manually locally
5+
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.
66

7-
You can build the dependencies locally by running the following command:
7+
## Building a package locally
8+
9+
You can build a single package locally, using the compiler that is being picked up by CMake.
810

911
```bash
10-
cd packages/<PACKAGE_NAME>
11-
docker-compose up --build
12+
python build.py <package_name>
13+
# Example: python build.py freeimage
1214
```
1315

14-
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.
16+
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.
17+
18+
When the package finished building, an archive package consisting of all binaries, headers and CMake files will be generated in an `out/` directory.
19+
20+
You need a working Ninja backend.
21+
22+
Some packages also include a `requirements.txt` file which contains pip dependencies. You might need to manually install these too.

build.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import sys
2+
import importlib
3+
4+
# Usage: python build.py <package_name>
5+
6+
def main():
7+
if len(sys.argv) != 2:
8+
print('Usage: python build.py <package_name>')
9+
sys.exit(1)
10+
11+
package_name = sys.argv[1]
12+
builder = getattr(importlib.import_module(f'packages.{package_name}.build'), 'Builder')()
13+
14+
builder.install_build_dependencies()
15+
16+
if hasattr(builder, 'source'):
17+
builder.source()
18+
19+
if hasattr(builder, 'patch_sources'):
20+
builder.patch_sources()
21+
22+
if hasattr(builder, 'depends'):
23+
builder.depends()
24+
25+
if hasattr(builder, 'build'):
26+
builder.build()
27+
28+
if hasattr(builder, 'package'):
29+
builder.package()
30+
31+
if __name__ == '__main__':
32+
main()

cmake/generic/import.cmake

Lines changed: 0 additions & 17 deletions
This file was deleted.

docker/clang-cl/Dockerfile

Lines changed: 0 additions & 34 deletions
This file was deleted.

docker/generic/Dockerfile

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)