Index: games/barony/Makefile =================================================================== --- games/barony/Makefile +++ games/barony/Makefile @@ -1,44 +1,47 @@ # $FreeBSD$ -PORTNAME= barony +PORTNAME= barony DISTVERSIONPREFIX= v DISTVERSION= 3.1.4 -CATEGORIES= games -MASTER_SITES= http://www.baronygame.com/ +CATEGORIES= games -MAINTAINER= David Carlier +MAINTAINER= devnexen@gmail.com COMMENT= 3D roguelike game LICENSE= GPLv3 LIB_DEPENDS= libvorbisfile.so:audio/libvorbis \ - libpng.so:graphics/png + libpng.so:graphics/png \ + libogg.so:audio/libogg -USES= cmake compiler:c++11-lib openal:al pkgconfig +USES= cmake compiler:c++11-lib openal:al localbase:ldflags pkgconfig USE_GL= gl glu -USE_SDL= sdl2 image2 mixer2 ttf2 +USE_SDL= sdl2 image2 net2 ttf2 + +LLD_UNSAFE= yes USE_GITHUB= yes GH_ACCOUNT= TurningWheel GH_PROJECT= Barony -LDFLAGS+= -L${LOCALBASE}/lib +CMAKE_ON= OPENAL_ENABLED DATA_DIR -CMAKE_ARGS= -DOPENAL_ENABLED=ON \ - -DEDITOR_EXE_NAME="barony-editor" \ - -DCMAKE_INSTALL_BINDIR="${LOCALBASE}/bin" \ - -DDATA_DIR=ON +CMAKE_ARGS= -DEDITOR_EXE_NAME:STRING="barony-editor" -post-install: - ${SED} -e 's:%%PREFIX%%:${PREFIX}:g' \ - ${FILESDIR}/barony.sh > ${STAGEDIR}${PREFIX}/bin/barony - ${CHMOD} +x ${STAGEDIR}${PREFIX}/bin/barony +LDFLAGS+= -Wl,--as-needed +SUB_FILES= barony.sh -PLIST_FILES= bin/barony \ - bin/barony-bin \ +PLIST_FILES= bin/${PORTNAME} \ bin/barony-editor \ - share/games/barony/lang/en.ttf \ - share/games/barony/lang/en.txt + libexec/${PORTNAME} \ + ${DATADIR}/lang/en.ttf \ + ${DATADIR}/lang/en.txt + +post-install: + ${MV} ${STAGEDIR}${PREFIX}/bin/${PORTNAME} \ + ${STAGEDIR}${PREFIX}/libexec/${PORTNAME} + ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME}.sh \ + ${STAGEDIR}${PREFIX}/bin/${PORTNAME} .include Index: games/barony/files/barony.sh.in =================================================================== --- games/barony/files/barony.sh.in +++ games/barony/files/barony.sh.in @@ -2,4 +2,4 @@ mkdir -p ~/.barony cd ~/.barony || { echo "Can't cd into ~/.barony" >&2; exit 1; } -exec %%PREFIX%%/bin/barony-bin $@ +exec %%PREFIX%%/libexec/barony "$@" Index: games/barony/files/patch-CMakeLists.txt =================================================================== --- games/barony/files/patch-CMakeLists.txt +++ /dev/null @@ -1,85 +0,0 @@ ---- CMakeLists.txt.orig 2018-04-17 03:51:23.000000000 +0100 -+++ CMakeLists.txt 2018-05-05 16:57:15.312350000 +0100 -@@ -290,7 +290,7 @@ SET_SOURCE_FILES_PROPERTIES(${MACOSX_BUN - set_source_files_properties(${GAME_SOURCES} PROPERTIES COMPILE_FLAGS "-x objective-c++") - #set_source_files_properties(${GAME_SOURCES} PROPERTIES COMPILE_FLAGS "-stdlib=libc++") - else() --add_executable(barony ${GAME_SOURCES}) -+add_executable(barony-bin ${GAME_SOURCES}) - endif() - - if(WIN32) -@@ -307,9 +307,9 @@ if(WIN32) - else() - if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") - # 64 bit -- target_link_libraries(barony -L/usr/lib64 -lstdc++) -+ target_link_libraries(barony-bin -L/usr/lib64 -lstdc++) - endif() -- target_link_libraries(barony ${SDL2_LIBRARIES} ${SDL2_LIBRARY} ${SDL2IMAGE_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${SDL2_NET_LIBRARIES} ${SDL2_TTF_LIBRARIES} ${SDL2TTF_LIBRARY}) -+ target_link_libraries(barony-bin ${SDL2_LIBRARIES} ${SDL2_LIBRARY} ${SDL2IMAGE_LIBRARIES} ${SDL2_IMAGE_LIBRARIES} ${SDL2_NET_LIBRARIES} ${SDL2_TTF_LIBRARIES} ${SDL2TTF_LIBRARY}) - if (STEAMWORKS_ENABLED) - target_link_libraries(barony ${STEAMWORKS_LIBRARY}) - #target_link_libraries(barony ${STEAMWORKS_CWRAPPER_LIBRARIES} -lstdc++) -@@ -322,17 +322,17 @@ else() - find_path(EXECINFO_INC NAMES execinfo.h) - find_library(EXECINFO_LIB NAMES execinfo) - include_directories(${EXECINFO_INC}) -- target_link_libraries(barony ${EXECINFO_LIB}) -+ target_link_libraries(barony-bin ${EXECINFO_LIB}) - endif() - endif() --target_link_libraries(barony ${OPENGL_LIBRARIES}) --target_link_libraries(barony ${THREADS_LIBRARIES}) --target_link_libraries(barony -lm) -+target_link_libraries(barony-bin ${OPENGL_LIBRARIES}) -+target_link_libraries(barony-bin ${THREADS_LIBRARIES}) -+target_link_libraries(barony-bin -lm) - if( NOT WIN32 AND NOT APPLE) - #Remember, Windows and Mac aren't using find_package for FMOD and PNG. -- target_link_libraries(barony ${PNG_LIBRARY}) -+ target_link_libraries(barony-bin ${PNG_LIBRARY}) - if (FMOD_FOUND) -- target_link_libraries(barony ${FMOD_LIBRARY}) -+ target_link_libraries(barony-bin ${FMOD_LIBRARY}) - endif() - endif() - # We need to link to Winsock if we're on Windows -@@ -348,11 +348,11 @@ endif() - target_link_libraries(barony ${EXTRA_LIBS}) #Apple needs this for OpenGL to work. - - if (OPENAL) -- target_link_libraries(barony ${OPENAL_LIBRARY}) -+ target_link_libraries(barony-bin ${OPENAL_LIBRARY}) - if(TREMOR_ENABLED) -- target_link_libraries(barony ${TREMOR_LIBRARY}) -+ target_link_libraries(barony-bin ${TREMOR_LIBRARY}) - else() -- target_link_libraries(barony ${VORBISFILE_LIBRARY} ${OGG_LIBRARY}) -+ target_link_libraries(barony-bin ${VORBISFILE_LIBRARY} ${OGG_LIBRARY}) - endif() - endif() - -@@ -361,11 +361,11 @@ set(BASE_DATA_DIR "./" CACHE INTERNAL "B - if (NOT APPLE AND UNIX) - include(GNUInstallDirs) - if (DATA_DIR) -- set(BASE_DATA_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/barony") -+ set(BASE_DATA_DIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/games/barony") - endif() - message(STATUS "Base data directory ${BASE_DATA_DIR}") - -- install(TARGETS barony -+ install(TARGETS barony-bin - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - COMPONENT Runtime - ) -@@ -445,7 +445,7 @@ if (NOT APPLE AND UNIX) - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Runtime - ) - -- install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lang DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/barony) -+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lang DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/games/barony) - - if (EXISTS books) - install(DIRECTORY Index: games/barony/pkg-message =================================================================== --- /dev/null +++ games/barony/pkg-message @@ -0,0 +1,19 @@ +Barony +====== +Barony requires the original game files from Barony: Blessed Edition +(e.g. 3.1.x) to work properly. These can come from the GOG.com or the +Steam versions of the game. + +If using the GOG.com version, you should download the Linux version +barony_cursed_edition_en_3_1_4_20342.sh and use the unzip package to +extract the data. + +The files will be in a directory named data/noarch/game. You can move +the contents of this directory to the ${DATADIR}/barony +directory for a global install. You will also need to fix the +permissions on the files. + +The easiest way to do this is to follow these steps: +$ unzip barony_cursed_edition_en_3_1_4_20342.sh +$ sudo cp -R data/noarch/game/* ${TRUEPREFIX}/share/barony +$ sudo find ${DATADIR}/barony -type d ! -perm 755 -exec chmod 755 {} \;