Skip to content

Commit

Permalink
games/colobot: improve port
Browse files Browse the repository at this point in the history
Install desktop files and manpage.
Remove extra flags to fix build on package cluster.
  • Loading branch information
MaxBrazhnikov committed Dec 3, 2021
1 parent 390db0e commit db2de49
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 13 deletions.
33 changes: 20 additions & 13 deletions games/colobot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PORTNAME= colobot
DISTVERSIONPREFIX= ${PORTNAME}-gold-
DISTVERSION= 0.1.12
DISTVERSIONSUFFIX= -alpha
PORTREVISION= 7
PORTREVISION= 8
CATEGORIES= games education
MASTER_SITES= https://colobot.info/files/music/:music
DISTFILES= colobot-music_ogg_0.1.12-alpha.tar.gz:music
Expand All @@ -13,6 +13,7 @@ COMMENT= Educational game aiming to teach programming to kids
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE.txt

BUILD_DEPENDS= ${LOCALBASE}/bin/xml:textproc/xmlstarlet
LIB_DEPENDS= libpng.so:graphics/png \
libsndfile.so:audio/libsndfile \
libvorbis.so:audio/libvorbis \
Expand All @@ -21,32 +22,38 @@ LIB_DEPENDS= libpng.so:graphics/png \
libphysfs.so:devel/physfs \
libboost_system.so:devel/boost-libs

USES= cmake compiler:c++11-lang gl gettext-runtime \
gettext-tools:build localbase:ldflags openal python:build \
sdl shebangfix
USE_SDL= image2 ttf2
USES= cmake compiler:c++11-lang gettext-runtime gettext-tools:build \
gl gnome localbase:ldflags openal perl5 python:build sdl \
shebangfix
USE_GL= gl glew glu
USE_GNOME= librsvg2:build
USE_PERL5= build
USE_SDL= image2 ttf2
USE_LDCONFIG= yes

USE_GITHUB= yes
GH_TUPLE= colobot:colobot-data:c467bd9:data

CMAKE_ON= PLATFORM_BSD
LDFLAGS_i386= -Wl,-znotext
SHEBANG_FILES= data/i18n-tools/scripts/process_translations.py

BINARY_ALIAS= xmlstarlet=${LOCALBASE}/bin/xml

post-extract:
@${MV} ${WRKDIR}/colobot-data-c467bd9/* ${WRKSRC}/data
@${MV} ${WRKDIR}/*.ogg ${WRKDIR}/LICENSE.txt ${WRKSRC}/data/music/
@${REINPLACE_CMD} 's|$${CMAKE_INSTALL_PREFIX}/games|$${CMAKE_INSTALL_PREFIX}/bin|g' ${WRKSRC}/CMakeLists.txt
@${REINPLACE_CMD} 's|PLATFORM_MACOSX|PLATFORM_MACOSX OR PLATFORM_OTHER|g' ${WRKSRC}/src/CMakeLists.txt

post-patch:
@${REINPLACE_CMD} 's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/cmake/FindGLEW.cmake
@${REINPLACE_CMD} 's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/cmake/FindPhysFS.cmake
@${REINPLACE_CMD} 's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/cmake/FindSDL2.cmake
@${REINPLACE_CMD} 's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/cmake/FindSDL2_image.cmake
@${REINPLACE_CMD} 's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/cmake/FindSDL2_ttf.cmake
@${REINPLACE_CMD} 's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/tools/check-levels.sh
${REINPLACE_CMD} '/COLOBOT_INSTALL_BIN_DIR/s|games|bin|' \
${WRKSRC}/CMakeLists.txt
${REINPLACE_CMD} 's|PLATFORM_GNU|PLATFORM_GNU OR PLATFORM_BSD|g' \
${WRKSRC}/desktop/CMakeLists.txt
${REINPLACE_CMD} 's|PLATFORM_MACOSX|PLATFORM_MACOSX OR PLATFORM_BSD|g' \
${WRKSRC}/src/CMakeLists.txt
${REINPLACE_CMD} 's|/usr/local|${LOCALBASE}|g' \
${WRKSRC}/cmake/Find*.cmake \
${WRKSRC}/tools/check-levels.sh
${REINPLACE_CMD} 's|python|${PYTHON_CMD}|' ${WRKSRC}/data/tools/*.sh

.include <bsd.port.mk>
31 changes: 31 additions & 0 deletions games/colobot/files/patch-CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--- CMakeLists.txt.orig 2021-12-03 18:38:49 UTC
+++ CMakeLists.txt
@@ -135,15 +135,8 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")

message(STATUS "Detected GCC version 4.7+")

- set(NORMAL_CXX_FLAGS "-std=gnu++11 -Wall -Werror -Wold-style-cast -pedantic-errors -Wmissing-declarations")
- set(NORMAL_CXX_FLAGS "${NORMAL_CXX_FLAGS} -Wno-error=deprecated-declarations") # updated version of physfs is not available on some platforms so we keep using deprecated functions, see #958
+ set(NORMAL_CXX_FLAGS "-std=gnu++11 -Wno-error=deprecated-declarations") # updated version of physfs is not available on some platforms so we keep using deprecated functions, see #958

- if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
- set(NORMAL_CXX_FLAGS "${NORMAL_CXX_FLAGS} -Wsuggest-override")
- endif()
-
- set(RELEASE_CXX_FLAGS "-O2")
- set(DEBUG_CXX_FLAGS "-g -O0")
set(TEST_CXX_FLAGS "-pthread")
add_definitions(-DNOEXCEPT=noexcept -DHAVE_DEMANGLE)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
@@ -153,10 +146,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")

message(STATUS "Detected Clang version 3.1+")

- set(NORMAL_CXX_FLAGS "-std=c++11 -Wall -Werror -Wold-style-cast -pedantic-errors -Wmissing-prototypes")
- set(NORMAL_CXX_FLAGS "${NORMAL_CXX_FLAGS} -Wno-error=deprecated-declarations") # updated version of physfs is not available on some platforms so we keep using deprecated functions, see #958
- set(RELEASE_CXX_FLAGS "-O2")
- set(DEBUG_CXX_FLAGS "-g -O0")
+ set(NORMAL_CXX_FLAGS "-std=c++11 -Wno-error=deprecated-declarations") # updated version of physfs is not available on some platforms so we keep using deprecated functions, see #958
set(TEST_CXX_FLAGS "-pthread")
add_definitions(-DNOEXCEPT=noexcept -DHAVE_DEMANGLE)
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
10 changes: 10 additions & 0 deletions games/colobot/pkg-plist
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
bin/colobot
lib/colobot/libCBot.so
share/applications/colobot.desktop
share/games/colobot/ai/ant01.txt
share/games/colobot/ai/ant02.txt
share/games/colobot/ai/ant03.txt
Expand Down Expand Up @@ -3664,10 +3665,19 @@ share/games/colobot/textures/rocb2.png
share/games/colobot/textures/terra002.png
share/games/colobot/textures/water12.png
share/games/colobot/textures/water16.png
share/icons/hicolor/128x128/apps/colobot.png
share/icons/hicolor/16x16/apps/colobot.png
share/icons/hicolor/256x256/apps/colobot.png
share/icons/hicolor/32x32/apps/colobot.png
share/icons/hicolor/48x48/apps/colobot.png
share/icons/hicolor/512x512/apps/colobot.png
share/icons/hicolor/scalable/apps/colobot.svg
share/locale/cs/LC_MESSAGES/colobot.mo
share/locale/de/LC_MESSAGES/colobot.mo
share/locale/fr/LC_MESSAGES/colobot.mo
share/locale/pl/LC_MESSAGES/colobot.mo
share/locale/pt/LC_MESSAGES/colobot.mo
share/locale/ru/LC_MESSAGES/colobot.mo
share/man/man6/colobot.6.gz
share/metainfo/info.colobot.Colobot.appdata.xml
@dir share/games/colobot/mods

0 comments on commit db2de49

Please sign in to comment.