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

Cannot compile stuntrally #33

Open
realroot2185 opened this issue Sep 29, 2024 · 11 comments
Open

Cannot compile stuntrally #33

realroot2185 opened this issue Sep 29, 2024 · 11 comments

Comments

@realroot2185
Copy link

[ 13%] Building CXX object source/shiny/CMakeFiles/shiny.dir/Main/ShaderSet.cpp.o
/path/stuntrally-git/src/stuntrally/source/shiny/Main/ShaderSet.cpp: In constructor ‘sh::ShaderSet::ShaderSet(const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, sh::PropertySetGet*)’:
/path/stuntrally-git/src/stuntrally/source/shiny/Main/ShaderSet.cpp:32:23: error: ‘class boost::filesystem::path’ has no member named ‘branch_path’
   32 |                 p = p.branch_path();
      |                       ^~~~~~~~~~~
make[2]: *** [source/shiny/CMakeFiles/shiny.dir/build.make:202: source/shiny/CMakeFiles/shiny.dir/Main/ShaderSet.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:428: source/shiny/CMakeFiles/shiny.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
==> ERROR: A failure occurred in build().

I am trying to package 3.2 version using extra/ogre-next and aur/mygui-ogre.
And I have that error.
OS: Artix Linux x86_64

@AnotherFoxGuy
Copy link
Contributor

It seems like you are trying to build stuntrally 2 (This version https://github.com/stuntrally/stuntrally)
There inst an AUR package for stuntrally3 yet, I will look into creating that someday when I have time

@realroot2185
Copy link
Author

realroot2185 commented Sep 29, 2024

I am trying the version for 3.2, made using that:

# Maintainer: Edgar <Edgar{at}AnotherFoxGuy.com>

pkgname=stuntrally
pkgver=3.2
pkgrel=1
pkgdesc="A 3D racing game based on VDrift and OGRE with track editor"
arch=('i686' 'x86_64')
url="https://stuntrally.tuxfamily.org/"
license=('GPL')
depends=('boost' 'ogre-next' 'mygui-ogre' 'sdl2' 'libvorbis' 'enet' 'bullet' 'openal' 'tinyxml' 'tinyxml2')
makedepends=('gcc' 'cmake>=2.8' 'git')
conflicts=('stuntrally-bin' 'stuntrally-git')
provides=('stuntrally')
source=("$pkgname-$pkgver.tar.gz::https://github.com/stuntrally/stuntrally3/archive/refs/tags/$pkgver.tar.gz")

prepare(){
    cd "$srcdir/stuntrally"
    git submodule update --init --recursive
}

build() {
    cd "$srcdir/stuntrally"
    
    # get a clean build dir
    #[[ -d build ]] && rm -rf build
    #mkdir build && cd build
    [[ -e build/CMakeCache.txt ]] && rm -rf build/CMakeCache.txt
    [[ ! -d build ]] && mkdir build
	cd build
    
    cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=Release
    make
}

package() {
    cd "$srcdir/stuntrally/build"

    make DESTDIR="$pkgdir" install
}
sha256sums=('0f3a8006e6fae9a9b5cfb7cb0df57970b3263096493c20d493e5a24c8f07006c')

@cryham
Copy link
Member

cryham commented Sep 29, 2024

Well IDK packaging or this script but the error from 1st post is indeed from compiling old stuntrally, new stuntrally3 doesn't use shiny.

@cryham cryham changed the title Cannot compile stuntrally Cannot compile stuntrally (AUR package) Sep 29, 2024
@realroot2185
Copy link
Author

It was using the old source that was in the folder.
I changed the dir now:

prepare(){
    cd "$srcdir/stuntrally3-$pkgver"

Now I do not have the correct mygui:

-- Added inteface enet::enet /usr/include /usr/lib/libenet.so
CMake Error at CMake/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find MyGUI (missing: MyGUI_LIBRARIES)
Call Stack (most recent call first):
  CMake/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  CMake/FindMyGUI.cmake:60 (find_package_handle_standard_args)
  CMake/DependenciesConfig.cmake:8 (find_package)
  CMakeLists.txt:77 (include)


-- Configuring incomplete, errors occurred!
==> ERROR: A failure occurred in build().

Do I need compile this https://github.com/cryham/mygui-next/releases/tag/MyGUI3.2.2?
I have some error.
Is ogre-next fine for the ogre part?

@realroot2185 realroot2185 changed the title Cannot compile stuntrally (AUR package) Cannot compile stuntrally Sep 29, 2024
@realroot2185
Copy link
Author

-- Build files have been written to: /path/to/mygui-next/src/mygui-next-MyGUI3.2.2/build
[  0%] Building CXX object MyGUIEngine/CMakeFiles/MyGUIEngine.dir/src/MyGUI_ActionController.cpp.o
In file included from /usr/include/c++/14.2.1/string_view:50,
                 from /usr/include/c++/14.2.1/bits/basic_string.h:47,
                 from /usr/include/c++/14.2.1/string:54,
                 from /path/to/mygui-next/src/mygui-next-MyGUI3.2.2/MyGUIEngine/include/MyGUI_Common.h:12,
                 from /path/to/mygui-next/src/mygui-next-MyGUI3.2.2/MyGUIEngine/include/MyGUI_Precompiled.h:11,
                 from /path/to/mygui-next/src/mygui-next-MyGUI3.2.2/MyGUIEngine/src/MyGUI_ActionController.cpp:7:
/usr/include/c++/14.2.1/bits/functional_hash.h:273:12: error: redefinition of ‘struct std::hash<int>’
  273 |     struct hash<nullptr_t> : public __hash_base<size_t, nullptr_t>
      |            ^~~~~~~~~~~~~~~
/usr/include/c++/14.2.1/bits/functional_hash.h:154:3: note: previous definition of ‘struct std::hash<int>’
  154 |   _Cxx_hashtable_define_trivial_hash(int)
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14.2.1/istream:41,
                 from /usr/include/c++/14.2.1/sstream:40,
                 from /path/to/mygui-next/src/mygui-next-MyGUI3.2.2/MyGUIEngine/include/MyGUI_LogStream.h:12,
                 from /path/to/mygui-next/src/mygui-next-MyGUI3.2.2/MyGUIEngine/include/MyGUI_LogManager.h:11,
                 from /path/to/mygui-next/src/mygui-next-MyGUI3.2.2/MyGUIEngine/include/MyGUI_Diagnostic.h:12,
                 from /path/to/mygui-next/src/mygui-next-MyGUI3.2.2/MyGUIEngine/include/MyGUI_Common.h:36:
/usr/include/c++/14.2.1/ostream:303:7: error: ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t)’ cannot be overloaded with ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(int)’
  303 |       operator<<(nullptr_t)
      |       ^~~~~~~~
/usr/include/c++/14.2.1/ostream:197:7: note: previous declaration ‘std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(int)’
  197 |       operator<<(int __n);
      |       ^~~~~~~~
make[2]: *** [MyGUIEngine/CMakeFiles/MyGUIEngine.dir/build.make:76: MyGUIEngine/CMakeFiles/MyGUIEngine.dir/src/MyGUI_ActionController.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:203: MyGUIEngine/CMakeFiles/MyGUIEngine.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

PKGBUILD:


build() {
  cd mygui-next-MyGUI${pkgver}

  # change CMake config so demos install to /opt
  sed -i 's:"bin:"../opt/MYGUI:' CMake/Utils/MyGUIConfigTargets.cmake
  sed -i -e 's:../share:/usr/share:' \
         -e 's:"bin":"../opt/MYGUI":' \
         CMake/InstallResources.cmake
  sed -i '71 i set(MYGUI_GCC_VISIBILITY_FLAGS "")' CMakeLists.txt
  sed -i 's/\${OIS_LIBRARIES}/${OIS_LIBRARIES} boost_system/g' Common/CMakeLists.txt

  # get a clean build dir
  [[ -d build ]] && rm -rf build
  mkdir build && cd build

  # generate CMake Makefile
  cmake .. \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DMYGUI_INSTALL_SAMPLES=TRUE \
    -DMYGUI_INSTALL_TOOLS=TRUE \
    -DMYGUI_INSTALL_DOCS=TRUE \
    -DMYGUI_INSTALL_MEDIA=TRUE \
    -DFREETYPE_INCLUDE_DIR=/usr/include/freetype2/ \
    -DMYGUI_BUILD_DEMOS=FALSE \
    -DMYGUI_BUILD_TOOLS=FALSE \
    -DCMAKE_BUILD_TYPE=Release \
    -DMYGUI_RENDERSYSTEM=7 \
    -DBUILD_SHARED_LIBS=TRUE

  make
  make api-docs
}

package() {
  cd mygui-next-MyGUI${pkgver}

  make DESTDIR="$pkgdir" install

@cryham
Copy link
Member

cryham commented Sep 29, 2024

To build you would need:
ogre-next - latest from v3-0 branch
mygui-next - latest from ogre3 branch
Just like my script has https://github.com/stuntrally/stuntrally3/blob/main/build-sr3-Linux.py
I think those errors are because of wrong branches used.

@realroot2185
Copy link
Author

mygui-next - latest from ogre3 branch
make install has error Nothing to be done for install, instructions do not explain what to do after building.

@cryham
Copy link
Member

cryham commented Sep 30, 2024

Ah. I didn't really install it ever. Not sure what it should do, I got no experience.
what should make install do? Do you need it?
copy mygui-next headers somewhere then .a and .so too?
Can we compare this to mygui, maybe it works there and we could adjust?

@realroot2185
Copy link
Author

While I am building it I am also packaging it some make install will help installing the right files.
I made a package and I have these files:

mygui-next-ogre3 /opt/
mygui-next-ogre3 /opt/MYGUI/
mygui-next-ogre3 /opt/MYGUI/plugins.cfg
mygui-next-ogre3 /opt/MYGUI/resources.xml
mygui-next-ogre3 /usr/
mygui-next-ogre3 /usr/lib/
mygui-next-ogre3 /usr/lib/libMyGUI.OpenGL3Platform.so
mygui-next-ogre3 /usr/lib/libMyGUIEngine.so
mygui-next-ogre3 /usr/lib/libMyGUIEngine.so.3.2.3

Did I miss something?

If I try to compile SR3 I miss mygui files:

-- Added inteface enet::enet /usr/include /usr/lib/libenet.so
CMake Error at CMake/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
  Could NOT find MyGUI (missing: MyGUI_LIBRARIES)
Call Stack (most recent call first):
  CMake/FindPackageHandleStandardArgs.cmake:252 (_FPHSA_FAILURE_MESSAGE)
  CMake/FindMyGUI.cmake:60 (find_package_handle_standard_args)
  CMake/DependenciesConfig.cmake:8 (find_package)
  CMakeLists.txt:77 (include)

That is with extra/mygui installed and mygui-next-ogre3 (that overwrites some files).
Without extra/mygui:
Could NOT find MyGUI (missing: MyGUI_INCLUDE_DIRS MyGUI_LIBRARIES)

I do not know how make make install.

@cryham
Copy link
Member

cryham commented Oct 1, 2024

I think MyGUI_INCLUDE_DIRS would have locations where all used MyGUI*.h are, so:

/dev/mygui-next/MyGUIEngine/include
/dev/mygui-next/Platforms/Ogre2/Ogre2Platform/include

/dev/ is what I call root with all sources to build deps of SR3 and then SR3
I assume these would be copied to /usr/include when doing make install but I never did that command so I'm not sure.
I don't think you need these:

mygui-next-ogre3 /opt/MYGUI/plugins.cfg
mygui-next-ogre3 /opt/MYGUI/resources.xml

SR has own config and files in /dev/sr3/data/gui

@realroot2185
Copy link
Author

When using the repo package MyGUI_INCLUDE_DIRS is fine, I guess cause of files in /usr/include/MYGUI/ but I am not sure.
I guess I'll wait for @AnotherFoxGuy package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants