Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
31 changes: 30 additions & 1 deletion .github/scripts/build-ports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ mkdir -p ci-logs ci-packages

status=0

show_errors() {
echo "--- errors from $1 ---"
grep -n -B2 -A20 -E 'CMake Error|Error at|error:' "$1" | tail -n 120 || true
echo "--- last 60 lines ---"
tail -n 60 "$1"
}

if [ -n "${1:-}" ]; then
ports="$1"
elif [ ! -f changed-ports.txt ] || grep -qx ALL changed-ports.txt; then
Expand Down Expand Up @@ -56,8 +63,30 @@ while IFS=$'\t' read -r port pkgs; do
fi
fi

fetched=0
if sudo make -C "$port" fetch >>"$log" 2>&1 \
&& sudo make -C "$port" checksum >>"$log" 2>&1 \
&& sudo make -C "$port" checksum >>"$log" 2>&1; then
fetched=1
fi

# Ports without a committed PLIST get one generated in the VM and
# published as an artifact, so it can be committed afterwards.
if [ "$fetched" = 1 ] && [ ! -s "${port}/pkg/PLIST" ]; then
if sudo make -C "$port" update-plist >>"$log" 2>&1; then
# update-plist keeps the previous packing list as a
# backup; portcheck would flag it as an extra file.
sudo rm -f "${port}/pkg/PLIST.orig"
mkdir -p "ci-packages/${name}"
sudo install -m 644 -o "$(id -u)" -g "$(id -g)" \
"${port}/pkg/PLIST" "ci-packages/${name}/PLIST"
echo "Generated PLIST for ${port}"
else
echo "FAIL: could not generate PLIST for ${port}"
show_errors "$log"
fi
fi

if [ "$fetched" = 1 ] \
&& sudo make -C "$port" package >>"$log" 2>&1; then
echo "PASS: ${port}"
tail -n 20 "$log"
Expand Down
9 changes: 7 additions & 2 deletions .github/scripts/setup-ports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,10 @@ echo "PORTSDIR_PATH=/usr/ports:${ROOT}" | sudo tee -a /etc/mk.conf
# tree (stable package updates), which makes the WANTLIB version cross-check
# in "make package" fail on version drift. Downgrade it to a warning.
echo "PKG_CREATE_NO_CHECKS=warn" | sudo tee -a /etc/mk.conf
sudo pkg_add -I curl
mkdir -p ci-logs ci-packages
# Reuse compiled objects between CI runs: the cache directory lives in the
# workspace so it is synced out of the VM and cached by the workflow.
echo "USE_CCACHE=Yes" | sudo tee -a /etc/mk.conf
echo "CCACHE_DIR=${ROOT}/ci-cache/ccache" | sudo tee -a /etc/mk.conf
echo "CCACHE_ENV=CCACHE_COMPRESS=true CCACHE_MAXSIZE=2G" | sudo tee -a /etc/mk.conf
sudo pkg_add -I curl ccache
mkdir -p ci-logs ci-packages ci-cache/ccache
20 changes: 19 additions & 1 deletion .github/workflows/openbsd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
# They are expanded into changed-ports.txt (port<TAB>packages) and installed
# by build-ports.sh right before that port is built, so unrelated ports do
# not pull in anything extra.
PORT_PACKAGES: '{"productivity/pimsync": "rust cargo-generate-vendor sqlite3"}'
PORT_PACKAGES: '{"productivity/pimsync": "rust cargo-generate-vendor sqlite3", "games/openage": "eigen3 qt6-qtbase qt6-qtdeclarative qt6-qtmultimedia harfbuzz opus opusfile libogg png py3-cython py3-setuptools py3-mako py3-pygments py3-numpy py3-Pillow py3-lz4 py3-toml py3-jinja2"}'

jobs:
changed:
Expand Down Expand Up @@ -78,6 +78,15 @@ jobs:
'.[] | [., ($pkgs[.] // "")] | @tsv' \
> changed-ports.txt

- if: matrix.version != ''
name: Restore ccache
uses: actions/cache@v6
with:
path: ci-cache
key: ccache-${{ matrix.version }}-${{ matrix.architecture }}-${{ github.run_id }}
restore-keys: |
ccache-${{ matrix.version }}-${{ matrix.architecture }}-

- if: matrix.version != ''
name: Start OpenBSD VM
uses: cross-platform-actions/action@v1.6.0
Expand All @@ -91,12 +100,21 @@ jobs:

- if: matrix.version != ''
name: Set up ports tree
shell: cpa.sh {0} --sync-files runner-to-vm
run: bash .github/scripts/setup-ports.sh "${{ matrix.version }}"

- if: matrix.version != ''
name: Build ports
shell: cpa.sh {0} --sync-files runner-to-vm
run: bash .github/scripts/build-ports.sh

# The build steps sync into the VM only, so pull the results (packages,
# logs and the updated ccache) back before they are used or cached.
- if: always() && matrix.version != ''
name: Sync VM files back
shell: bash
run: cpa.sh --sync-files vm-to-runner

- if: always() && matrix.version != ''
name: Upload packages
uses: actions/upload-artifact@v7
Expand Down
29 changes: 29 additions & 0 deletions devel/toml11/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
PKG_ARCH = *

COMMENT = C++11 header-only TOML parser and encoder

V = 4.4.0
DISTNAME = toml11-${V}
CATEGORIES = devel

HOMEPAGE = https://github.com/ToruNiina/toml11

# MIT
PERMIT_PACKAGE = Yes

GH_ACCOUNT = ToruNiina
GH_PROJECT = toml11
GH_TAGNAME = v${V}

MODULES = devel/cmake

CONFIGURE_ARGS = -DTOML11_INSTALL=ON \
-DTOML11_BUILD_EXAMPLES=OFF \
-DTOML11_BUILD_TESTS=OFF \
-DTOML11_BUILD_TOML_TESTS=OFF \
-DTOML11_PRECOMPILE=OFF \
-DTOML11_ENABLE_ACCESS_CHECK=OFF

NO_TEST = Yes

.include <bsd.port.mk>
2 changes: 2 additions & 0 deletions devel/toml11/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SHA256 (toml11-4.4.0.tar.gz) = 815bfe6792aa11a13a133b86e7f0f45edc5d71eb78f5fb6686c49c7f792b9049
SIZE (toml11-4.4.0.tar.gz) = 357442
6 changes: 6 additions & 0 deletions devel/toml11/pkg/DESCR
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
toml11 is a C++11 header-only library for parsing and encoding TOML
(Tom's Obvious, Minimal Language) configuration files.

It provides an API for reading and writing TOML documents, a parser with
detailed error messages and support for the TOML v1.0.0 specification.
Only a C++11 compiler is required.
66 changes: 66 additions & 0 deletions devel/toml11/pkg/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
include/toml.hpp
include/toml11/
include/toml11/color.hpp
include/toml11/comments.hpp
include/toml11/compat.hpp
include/toml11/context.hpp
include/toml11/conversion.hpp
include/toml11/datetime.hpp
include/toml11/error_info.hpp
include/toml11/exception.hpp
include/toml11/find.hpp
include/toml11/format.hpp
include/toml11/from.hpp
include/toml11/fwd/
include/toml11/fwd/color_fwd.hpp
include/toml11/fwd/comments_fwd.hpp
include/toml11/fwd/datetime_fwd.hpp
include/toml11/fwd/error_info_fwd.hpp
include/toml11/fwd/format_fwd.hpp
include/toml11/fwd/literal_fwd.hpp
include/toml11/fwd/location_fwd.hpp
include/toml11/fwd/region_fwd.hpp
include/toml11/fwd/scanner_fwd.hpp
include/toml11/fwd/source_location_fwd.hpp
include/toml11/fwd/syntax_fwd.hpp
include/toml11/fwd/value_t_fwd.hpp
include/toml11/get.hpp
include/toml11/impl/
include/toml11/impl/color_impl.hpp
include/toml11/impl/comments_impl.hpp
include/toml11/impl/datetime_impl.hpp
include/toml11/impl/error_info_impl.hpp
include/toml11/impl/format_impl.hpp
include/toml11/impl/literal_impl.hpp
include/toml11/impl/location_impl.hpp
include/toml11/impl/region_impl.hpp
include/toml11/impl/scanner_impl.hpp
include/toml11/impl/source_location_impl.hpp
include/toml11/impl/syntax_impl.hpp
include/toml11/impl/value_t_impl.hpp
include/toml11/into.hpp
include/toml11/literal.hpp
include/toml11/location.hpp
include/toml11/ordered_map.hpp
include/toml11/parser.hpp
include/toml11/region.hpp
include/toml11/result.hpp
include/toml11/scanner.hpp
include/toml11/serializer.hpp
include/toml11/skip.hpp
include/toml11/source_location.hpp
include/toml11/spec.hpp
include/toml11/storage.hpp
include/toml11/syntax.hpp
include/toml11/traits.hpp
include/toml11/types.hpp
include/toml11/utility.hpp
include/toml11/value.hpp
include/toml11/value_t.hpp
include/toml11/version.hpp
include/toml11/visit.hpp
lib/cmake/
lib/cmake/toml11/
lib/cmake/toml11/toml11Config.cmake
lib/cmake/toml11/toml11ConfigVersion.cmake
lib/cmake/toml11/toml11Targets.cmake
99 changes: 61 additions & 38 deletions games/openage/Makefile
Original file line number Diff line number Diff line change
@@ -1,52 +1,75 @@
# $OpenBSD $
COMMENT = free engine clone of the Genie Engine (Age of Empires II)

COMMENT = free open source clone of the Age of Empires II engine
V = 0.6.0
DISTNAME = openage-${V}
CATEGORIES = games

DISTNAME = master
PKGNAME = openage-${DISTNAME}-1
HOMEPAGE = https://openage.dev/

CATEGORIES = games
HOMEPAGE = http://openage.sft.mx/
MAINTAINER = Sergey Bronnikov <estetus@gmail.com>

# GNU GPLv3
PERMIT_PACKAGE_CDROM = Yes

WANTLIB += GL GLEW GLU ICE SDL2 SM X11 Xext c m pthread
# GPLv3
PERMIT_PACKAGE = Yes

MASTER_SITES = https://github.com/SFTtech/openage/archive/
GH_ACCOUNT = SFTtech
GH_PROJECT = openage
GH_TAGNAME = v${V}

MODGCC4_ARCHS= amd64
MODGCC4_LANGS= c++
COMPILER = base-clang ports-gcc
COMPILER_LANGS = c++

MODULES = devel/cmake \
gcc4
BUILD_DEPENDS = audio/opus \
lang/python

MODPY_RUNDEP = No

MODCMAKE_LDFLAGS = -L${LOCALBASE}/lib

SHARED_LIBS += openage 0.0

WANTLIB += ${COMPILER_LIBCXX} GL Qt6Core Qt6Gui Qt6Multimedia
WANTLIB += Qt6Network Qt6OpenGL Qt6Qml Qt6Quick epoxy execinfo
WANTLIB += fontconfig freetype harfbuzz m nyan ogg opus opusfile
WANTLIB += png pthread util z

LIB_DEPENDS = audio/libogg \
audio/opus \
audio/opusfile \
devel/doxygen,-main \
devel/glib \
devel/ninja \
devel/sdl2 \
devel/sdl2-image \
graphics/freeglut \
graphics/ftgl \
graphics/glew \
lang/gcc/4.8,-main \
lang/python/3.4

#RUN_DEPENDS = graphics/py-Imaging,-main
LIB_DEPENDS = graphics/glew \
devel/sdl2

CONFIGURE_ENV += -DCMAKE_INCLUDE_PATH=${X11BASE}/include \
-DCMAKE_LIBRARY_PATH=${X11BASE}/lib \
-DOPUSFILE_INCLUDE_DIR=${LOCALBASE}/include/opus
CONFIGURE_ARGS += -DCMAKE_INCLUDE_PATH=${X11BASE}/include \
devel/harfbuzz \
graphics/png \
lang/nyan \
x11/qt6/qtbase \
x11/qt6/qtdeclarative \
x11/qt6/qtmultimedia

BUILD_DEPENDS = archivers/py-lz4 \
devel/gettext,-runtime \
devel/py-setuptools \
devel/toml11 \
graphics/py-Pillow \
lang/cython \
math/eigen3 \
math/py-numpy \
textproc/py-pygments \
textproc/py-toml \
www/py-jinja2 \
www/py-mako

RUN_DEPENDS = graphics/py-Pillow \
math/py-numpy \
textproc/py-pygments \
www/py-jinja2

CONFIGURE_ARGS = -DCMAKE_INCLUDE_PATH=${X11BASE}/include \
-DCMAKE_LIBRARY_PATH=${X11BASE}/lib \
-DOPUSFILE_INCLUDE_DIR=${LOCALBASE}/include/opus \
-DFREETYPE_INCLUDE_DIR=${X11BASE}/include/freetype2
-DPython3_EXECUTABLE=${MODPY_BIN} \
-DWANT_BACKTRACE=false \
-DWANT_INOTIFY=false \
-DWANT_GPERFTOOLS_PROFILER=false \
-DWANT_IWYU=false \
-DWANT_VULKAN=false \
-DGLOBAL_CONFIG_DIR=${PREFIX}/share/openage

WRKDIST = ${WRKDIR}/openage-master/
WRKSRC = ${WRKDIR}/openage-master/
NO_TEST = Yes

.include <bsd.port.mk>
4 changes: 0 additions & 4 deletions games/openage/TODO

This file was deleted.

4 changes: 2 additions & 2 deletions games/openage/distinfo
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SHA256 (master.tar.gz) = nNVLRtF44u6Nu+B08ayiPg9JRYhsy06pf8JHZSfufTA=
SIZE (master.tar.gz) = 940296
SHA256 (openage-0.6.0.tar.gz) = 74472c6df4361dbedecadb10608f3fea983c7ca05fa5667f00f8b775e215886f
SIZE (openage-0.6.0.tar.gz) = 4912564
11 changes: 11 additions & 0 deletions games/openage/patches/patch-buildsystem_codegen_cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- buildsystem/codegen.cmake.orig
+++ buildsystem/codegen.cmake
@@ -52,7 +52,7 @@
COMMENT "openage.codegen: generating c++ code"
)

- add_custom_target(codegen
+ add_custom_target(cppgen
DEPENDS "${CODEGEN_TIMEFILE}"
)

23 changes: 23 additions & 0 deletions games/openage/patches/patch-buildsystem_cpp_cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
--- buildsystem/cpp.cmake.orig
+++ buildsystem/cpp.cmake
@@ -23,15 +23,14 @@
endif()

if(NOT "${CMAKE_CXX_FLAGS}" MATCHES "-fsanitize" AND NOT MSVC)
- if(APPLE)
- set(link_flag "-undefined,error")
- else()
- set(link_flag "--no-undefined")
- endif()
set_target_properties("${target_name}" PROPERTIES
COMPILE_FLAGS "${EXTRA_FLAGS}"
- LINK_FLAGS "-Wl,${link_flag}"
)
+ if(APPLE)
+ set_target_properties("${target_name}" PROPERTIES LINK_FLAGS "-Wl,-undefined,error")
+ elseif(NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
+ set_target_properties("${target_name}" PROPERTIES LINK_FLAGS "-Wl,--no-undefined")
+ endif()
endif()
else()
message(FATAL_ERROR "declare_binary encountered unknown flag: ${flag}")
22 changes: 22 additions & 0 deletions games/openage/patches/patch-libopenage_CMakeLists_txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- libopenage/CMakeLists.txt.orig
+++ libopenage/CMakeLists.txt
@@ -13,7 +13,7 @@
set_target_properties(libopenage PROPERTIES
VERSION 0
AUTOMOC ON
- AUTOGEN_TARGET_DEPENDS "codegen"
+ AUTOGEN_TARGET_DEPENDS "cppgen"
)

##################################################
@@ -42,7 +42,9 @@
target_link_libraries(libopenage PRIVATE DbgHelp)
endif()
if(NOT APPLE AND NOT WIN32)
- find_library(RT_LIB rt)
+ if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
+ find_library(RT_LIB rt)
+ endif()
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
find_library(EXECINFO_LIB execinfo)
endif()
Loading
Loading