Bug 218883 - games/OpenTomb: Open-source Tomb Raider 1-5 engine remake
Summary: games/OpenTomb: Open-source Tomb Raider 1-5 engine remake
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Tobias Kortkamp
URL: https://reviews.freebsd.org/D10664
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-26 10:22 UTC by Piotr Kubaj
Modified: 2017-06-09 13:45 UTC (History)
1 user (show)

See Also:


Attachments
shar (2.79 KB, text/plain)
2017-04-26 10:22 UTC, Piotr Kubaj
no flags Details
shar (2.72 KB, text/plain)
2017-04-27 13:48 UTC, Piotr Kubaj
no flags Details
opentomb.diff (5.56 KB, patch)
2017-04-28 14:41 UTC, Tobias Kortkamp
no flags Details | Diff
shar (14.22 KB, text/plain)
2017-05-08 13:12 UTC, Piotr Kubaj
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2017-04-26 10:22:17 UTC
Created attachment 182093 [details]
shar

This shar contains the new port for OpenTomb - open-source Tomb Raider 1-5 engine remake. As all other open-source implementations of proprietary games, it requires licensed files from original games.

Builds fine on Poudriere on 10.3-RELEASE.
Comment 1 Piotr Kubaj freebsd_committer 2017-04-26 10:23:54 UTC
portlint -AC says "looks fine".
Comment 2 Tobias Kortkamp freebsd_committer 2017-04-26 11:42:00 UTC
XPORTVERSION=	20170424
XGH_TAGNAME=	win32-2017-04-24_alpha

This could be replaced by

DISTVERSION=	2017-04-24_alpha
DISTVERSIONPREFIX=	win32-

XPLIST_FILES=	bin/OpenTomb

What about all the scripts/shaders and resource files in the source
tree?  They are surely needed to run any games with it? 

XUSE_GCC=	any

Why? What errors are you getting without it?

Xpre-install:
X	${STRIP_CMD} ${WRKSRC}/${PORTNAME}

INSTALL_PROGRAM will strip the binary already.
Comment 3 Piotr Kubaj freebsd_committer 2017-04-27 13:48:47 UTC
Created attachment 182127 [details]
shar

I need GCC because of:
[ 75%] Building CXX object CMakeFiles/OpenTomb.dir/src/world.cpp.o
/usr/bin/c++    -I/usr/local/include -I/usr/local/include/lua52 -I/usr/local/include/SDL2 -I/usr/local/include/AL -I/usr/local/poudriere/ports/default/games/OpenTomb/work/OpenTomb-win32-2017-04-24_alpha -I/usr/local/poudriere/ports/default/games/OpenTomb/work/OpenTomb-win32-2017-04-24_alpha/extern/bullet -I/usr/local/poudriere/ports/default/games/OpenTomb/work/OpenTomb-win32-2017-04-24_alpha/extern/freetype2/include -I/usr/local/poudriere/ports/default/games/OpenTomb/work/OpenTomb-win32-2017-04-24_alpha/extern/ogg -O2 -pipe -fstack-protector -fno-strict-aliasing -O2 -pipe -fstack-protector -fno-strict-aliasing   -std=gnu++11 -o CMakeFiles/OpenTomb.dir/src/world.cpp.o -c /usr/local/poudriere/ports/default/games/OpenTomb/work/OpenTomb-win32-2017-04-24_alpha/src/world.cpp
/usr/local/poudriere/ports/default/games/OpenTomb/work/OpenTomb-win32-2017-04-24_alpha/src/world.cpp:689:53: error: no viable conversion from '__map_iterator<__tree_iterator<__value_type<unsigned int, [...]>, class std::__1::__tree_node<union
      std::__1::__value_type<unsigned int, struct base_item_s *>, void *> *, [...]>>' to '__map_iterator<__tree_iterator<__value_type<const unsigned int, [...]>, class std::__1::__tree_node<union std::__1::__value_type<const unsigned int, struct base_item_s *>, void
      *> *, [...]>>'
    std::map<const uint32_t, base_item_p>::iterator it = global_world.items_tree.find(item_id);
                                                    ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/map:648:29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'iterator' (aka '__map_iterator<typename __base::iterator>') to 'const
      std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<const unsigned int, base_item_s *>, std::__1::__tree_node<std::__1::__value_type<const unsigned int, base_item_s *>, void *> *, long> > &' for 1st argument
class _LIBCPP_TYPE_VIS_ONLY __map_iterator
                            ^
/usr/include/c++/v1/map:648:29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'iterator' (aka '__map_iterator<typename __base::iterator>') to
      'std::__1::__map_iterator<std::__1::__tree_iterator<std::__1::__value_type<const unsigned int, base_item_s *>, std::__1::__tree_node<std::__1::__value_type<const unsigned int, base_item_s *>, void *> *, long> > &&' for 1st argument
class _LIBCPP_TYPE_VIS_ONLY __map_iterator
                            ^
/usr/include/c++/v1/map:672:5: note: candidate constructor not viable: no known conversion from 'iterator' (aka '__map_iterator<typename __base::iterator>') to 'std::__1::__tree_iterator<std::__1::__value_type<const unsigned int, base_item_s *>,
      std::__1::__tree_node<std::__1::__value_type<const unsigned int, base_item_s *>, void *> *, long>' for 1st argument
    __map_iterator(_TreeIterator __i) _NOEXCEPT : __i_(__i) {}
    ^
1 error generated.
*** Error code 1

bin/OpenTomb is actually enough, look at games/eduke32, it also installs just 2 binaries if you disable relevant options.

Please review the new shar.
Comment 4 Tobias Kortkamp freebsd_committer 2017-04-28 14:41:11 UTC
Created attachment 182160 [details]
opentomb.diff

Here is an updated version of the port that doesn't USE_GCC.  I had a similar
error when porting OpenMW.  It's easy to fix with a small patch.

It test builds fine in Poudriere FreeBSD 10.3/i386.  Can you runtime test it?
Comment 5 Piotr Kubaj freebsd_committer 2017-05-08 13:12:04 UTC
Created attachment 182407 [details]
shar

Turns out, you were right! Attaching corrected shar (tested for compilation on 10.3-RELEASE and 11.0-STABLE and running on 11.0-STABLE).
Comment 6 Tobias Kortkamp freebsd_committer 2017-05-10 16:43:21 UTC
(In reply to Piotr Kubaj from comment #5)

${PREFIX}/share/${PORTNAME} can be replaced by ${DATADIR}.

X	${FIND} ${WRKSRC} -name "*.bak" -delete

Looking at the COPYTREE_SHARE example in bsd.port.mk you can do this
instead in do-install to not copy the .bak files:

cd ${WRKSRC}/scripts && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR}/scripts "! -name *\.bak"

Otherwise LGTM :)
Comment 7 Tobias Kortkamp freebsd_committer 2017-05-10 17:07:39 UTC
Ok, I submitted it for mentor review with the previous changes applied.
Comment 8 commit-hook freebsd_committer 2017-06-09 13:45:32 UTC
A commit references this bug:

Author: tobik
Date: Fri Jun  9 13:45:21 UTC 2017
New revision: 442987
URL: https://svnweb.freebsd.org/changeset/ports/442987

Log:
  New port: games/OpenTomb

  OpenTomb is an open-source engine reimplementation project intended to
  play levels from all classic-era Tomb Raider games (TR 1-5) and custom
  TRLE levels.  The project does not use any old Tomb Raider source
  code, because all attempts to retrieve sources from Eidos / Core were
  in vain.

  WWW: https://opentomb.github.io/

  PR:		218883
  Submitted by:	Piotr Kubaj <pkubaj@anongoth.pl>
  Approved by:	lme (mentor)
  Differential Revision:	https://reviews.freebsd.org/D10664

Changes:
  head/games/Makefile
  head/games/OpenTomb/
  head/games/OpenTomb/Makefile
  head/games/OpenTomb/distinfo
  head/games/OpenTomb/files/
  head/games/OpenTomb/files/OpenTomb.in
  head/games/OpenTomb/files/patch-src_world.cpp
  head/games/OpenTomb/pkg-descr
  head/games/OpenTomb/pkg-message
  head/games/OpenTomb/pkg-plist