Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Alpine Linux build #28

Merged
merged 22 commits into from
Mar 23, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/alpine-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Alpine build

on:
push:
branches: [ master ]
paths-ignore:
- '.github/workflows/macos-build.yml'
- '.github/workflows/ubuntu-build.yml'
- '.github/workflows/ubuntu-aarch64.yml'
- '.github/workflows/windows-build.yml'
pull_request:
workflow_dispatch:

env:
BUILD_TYPE: Release

jobs:
Alpine-build:
runs-on: ubuntu-latest
container:
image: alpine:latest

steps:
- uses: actions/checkout@v2
with:
submodules: recursive

- name: Install packages
run: |
apk --no-cache --upgrade add build-base clang cmake libxml2-dev \
libxml2-utils libpng-dev freetype-dev fontconfig-dev git valgrind

- name: Configure CMake
env:
CC: gcc
CXX: g++
run: |
cmake -B ${{github.workspace}} \
-DVCPKG_TARGET_TRIPLET=x86_64-alpine-linux-musl
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}} --config ${{env.BUILD_TYPE}}

- name: Test well formed files
working-directory: ${{github.workspace}}
run: ./tests/resources/check_correctness.sh -r -s

- name: Test corrupted files
working-directory: ${{github.workspace}}
run: ./tests/resources/check_correctness.sh -r -s -e tests/resources/emf-corrupted/ -xN

- name: Test EA files
working-directory: ${{github.workspace}}
run: ./tests/resources/check_correctness.sh -r -s -e tests/resources/emf-ea/
1 change: 1 addition & 0 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [ master ]
paths-ignore:
- '.github/workflows/alpine-build.yml'
- '.github/workflows/ubuntu-build.yml'
- '.github/workflows/ubuntu-aarch64.yml'
- '.github/workflows/windows-build.yml'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ubuntu-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [ master ]
paths-ignore:
- '.github/workflows/alpine-build.yml'
- '.github/workflows/ubuntu-build.yml'
- '.github/workflows/macos-build.yml'
- '.github/workflows/windows-build.yml'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ubuntu-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [ master ]
paths-ignore:
- '.github/workflows/alpine-build.yml'
- '.github/workflows/macos-build.yml'
- '.github/workflows/ubuntu-aarch64.yml'
- '.github/workflows/windows-build.yml'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [ master ]
paths-ignore:
- '.github/workflows/alpine-build.yml'
- '.github/workflows/macos-build.yml'
- '.github/workflows/ubuntu-aarch64.yml'
- '.github/workflows/ubuntu-build.yml'
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "vcpkg"]
path = vcpkg
url = git@github.com:microsoft/vcpkg.git
url = https://github.com/microsoft/vcpkg.git
21 changes: 15 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ if(VCPKG_TARGET_TRIPLET)
endif(EXISTS ${PLATFORM_TOOLCHAIN})
endif(VCPKG_TARGET_TRIPLET)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")

if(${VCPKG_TARGET_TRIPLET} MATCHES "-alpine-linux-")
set(ALPINE "Alpine")
endif(${VCPKG_TARGET_TRIPLET} MATCHES "-alpine-linux-")
ronaldtse marked this conversation as resolved.
Show resolved Hide resolved

find_package(PNG REQUIRED)
find_package(Freetype REQUIRED)
Expand Down Expand Up @@ -137,11 +138,16 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
add_definitions(-DDARWIN)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

# Find/build external dependancies if it is Microsoft Visual Studio build
# Find/build external dependencies if it is Microsoft Visual Studio build
if(MSVC)
find_package(Iconv REQUIRED)
set(EXTERNAL_ICONV ${Iconv_LIBRARY})
endif(MSVC)

# Locate fontconfig, somehow the find_package call can't find it?
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindFontconfig.cmake)
maxirmx marked this conversation as resolved.
Show resolved Hide resolved

if(MSVC OR ALPINE)
set(ARGP_NAME argp${EXTERNAL_LIB_DIR_SUFFIX})
ExternalProject_Add(${ARGP_NAME}
PREFIX ${DEPS}
Expand All @@ -151,7 +157,9 @@ if(MSVC)
PATCH_COMMAND cd ${DEPS}/src/${ARGP_NAME} && git restore CMakeLists.txt && git apply ${PATCHES}/argp/CMakeLists.txt.patch
)
set(EXTERNAL_ARGP "argp-standalone")
endif(MSVC)
endif(MSVC OR ALPINE)

add_compile_options(-fPIC)

# headers & library directories
if(MSVC)
Expand Down Expand Up @@ -228,16 +236,17 @@ target_link_libraries(emf2svg
)

add_dependencies(emf2svg ${FMEM_NAME})
if(MSVC)
if(MSVC OR ALPINE)
add_dependencies(emf2svg ${ARGP_NAME})
endif(MSVC)
endif(MSVC OR ALPINE)

# Compile the executable
add_executable(emf2svg-conv src/conv/emf2svg.cpp)

target_link_libraries(emf2svg-conv
emf2svg
${EXTERNAL_ARGP}
"fontconfig"
)

if(GCOV)
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,22 @@ apt-get install cmake pkg-config
apt-get install libpng-dev libc6-dev libfontconfig1-dev libfreetype6-dev zlib1g-dev
```

Installing the dependencies on OS X:
Installing the dependencies on macOS:
```bash
$ brew install argp-standalone
$ brew install argp-standalone cmake libpng freetype fontconfig gcc
```

Installing the dependencies on RHEL/CentOS/Fedora:
```bash
yum install cmake libpng-devel freetype-devel fontconfig-devel gcc-c++ gcc
```

Installing the dependencies on Alpine Linux:
```bash
apk --no-cache --upgrade add build-base clang cmake libxml2-dev \
libxml2-utils libpng-dev freetype-dev fontconfig-dev git
```

Installing the dependencies on Windows for MSVC native builds
Dependencies are installed by vcpkg package manager. Installation is implemented as a step of CMake configuration procedure.

Expand Down Expand Up @@ -225,11 +231,11 @@ EMF+ RECORDS:
ChangeLogs
----------

1.3.1:
1.3.1:

* add MSVC 17 (2022) support

1.3.0:
1.3.0:

* add MSVC Windows native build

Expand Down