msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.25k stars 1.21k forks source link

cegui problems #2662

Closed revelator closed 2 years ago

revelator commented 7 years ago

Finally got around building it, sadly its not quite working since there are a few pitfalls. Ogre render does not work it relies on an older version which code has been changed rather extensively so i had to disable that, also the SDL2 framework produces link errors with the current SDL2 package so that one had to go as well. Now it builds but i had to modify the build script cause it was using windows paths for the CMAKE_INSTALL_PREFIX which caused problems with pacman because the path to the pkg directory ended up being a mile long windows path :( so i changed it to use posix paths, but the samples do not work because it looks for the datadir in the source folder ?!? and again uses windows paths even if explicitly told not to. So i removed building samples as well since there is no easy workaround, and fixing it would probably require hacking the build system to use the linux setup ad some hackery with locating the datadir folder correctly. it also seems to be a rather old version of cegui since the latest upstream version allready has support for the current ogre version.

revelator commented 7 years ago

Disabled ogre and Irrlicht renderers none of them work without patching. Disabled SDL2 framework (needs library reordering). Fixed path handling to follow same procedure as the linux version. Ugly hack used to coerce the package build script to put the resulting builds in the correct folder for installation (windows paths and pacman = disaster).

diff -urN cegui-0.8.7.old/samples/common/include/CEGUISamplesConfig.h.in cegui-0.8.7/samples/common/include/CEGUISamplesConfig.h.in
--- cegui-0.8.7.old/samples/common/include/CEGUISamplesConfig.h.in  2016-04-23 20:19:40.000000000 +0200
+++ cegui-0.8.7/samples/common/include/CEGUISamplesConfig.h.in  2017-07-21 03:45:12.088659500 +0200
@@ -45,11 +45,7 @@
 #ifndef CEGUI_SAMPLE_DATAPATH

 // Define the default place where samples will look for datafiles
-#if defined(_WIN32) || defined(__WIN32__)
-#   define CEGUI_SAMPLE_DATAPATH "${PROJECT_SOURCE_DIR}/datafiles"
-#else
-#   define CEGUI_SAMPLE_DATAPATH "${CMAKE_INSTALL_PREFIX}/${CEGUI_DATA_INSTALL_DIR}"
-#endif
+#define CEGUI_SAMPLE_DATAPATH "${CMAKE_INSTALL_PREFIX}/${CEGUI_DATA_INSTALL_DIR}"

 #endif
# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=cegui
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.8.7
pkgrel=1
pkgdesc="A free library providing windowing and widgets for graphics APIs/engines (mingw-w64)"
arch=('any')
url="http://cegui.org.uk"
license=("MIT")
#makedepends=('doxygen' 'gtk2' 'graphviz' 'irrlicht' 'glm' 'tolua++')
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
             "${MINGW_PACKAGE_PREFIX}-pkg-config"
             "${MINGW_PACKAGE_PREFIX}-cmake"
             "${MINGW_PACKAGE_PREFIX}-doxygen"
             "${MINGW_PACKAGE_PREFIX}-python2"
             "mercurial")
depends=("${MINGW_PACKAGE_PREFIX}-tinyxml"
         "${MINGW_PACKAGE_PREFIX}-boost"
         "${MINGW_PACKAGE_PREFIX}-devil"
         "${MINGW_PACKAGE_PREFIX}-expat"
         "${MINGW_PACKAGE_PREFIX}-FreeImage"
         "${MINGW_PACKAGE_PREFIX}-freetype"
         "${MINGW_PACKAGE_PREFIX}-fribidi"
         "${MINGW_PACKAGE_PREFIX}-glew"
         "${MINGW_PACKAGE_PREFIX}-glfw"
         "${MINGW_PACKAGE_PREFIX}-glm"
         "${MINGW_PACKAGE_PREFIX}-irrlicht"
         "${MINGW_PACKAGE_PREFIX}-libxml2"
         "${MINGW_PACKAGE_PREFIX}-libiconv"
         "${MINGW_PACKAGE_PREFIX}-lua51"
         "${MINGW_PACKAGE_PREFIX}-ogre3d"
         "${MINGW_PACKAGE_PREFIX}-ois"
         "${MINGW_PACKAGE_PREFIX}-pcre"
         "${MINGW_PACKAGE_PREFIX}-SDL2"
         "${MINGW_PACKAGE_PREFIX}-tinyxml"
         #"${MINGW_PACKAGE_PREFIX}-tolua"
         "${MINGW_PACKAGE_PREFIX}-xerces-c"
         "${MINGW_PACKAGE_PREFIX}-zlib")
options=('staticlibs' 'strip')
source=("https://downloads.sourceforge.net/crayzedsgui/cegui-${pkgver}.tar.bz2"
        freetype.patch
        mingw-w64-fix.patch
        fix-finding-glew.patch
        fix-finding-directx.patch
        fix-finding-glfw3.patch
        fix-dxerr-libname.patch
        fix-mingw-samples.patch)
sha256sums=('b351e8957716d9c170612c13559e49530ef911ae4bac2feeb2dacd70b430e518'
            '83e84d862a195c61901b0dd53a1c47434b812fff15fb977f390a45f19dcc4a64'
            '31e666ea015b30b9ee939b69994255eacb2e75fa9dec86538715e4b9a026863a'
            '3aa712304267353afe103cd8efa5f6f7b87fa98423d77610716d15a425194f2e'
            '1ae821516efaeecce5b27579d5236b11b3eb8075d3e173d1b3b973e81c1ee22e'
            '181385b172f952265a0be6a96eccd0ab9d4cb8846f7e07cd5d5e5095a0a591a0'
            '4c22f176f0fa430eeaf2ac6b21d587c7e1f3c04d8d3c03e957a35a95f077531b'
            'ee29f5160b5af42c1b7a8c7c1ea29da52bccea27ec0991281581b98d4eb731a7')

prepare() {
  cd "${srcdir}/${_realname}-${pkgver}"
  #patch -p1 -i ${srcdir}/freetype.patch
  #patch -p1 -i ${srcdir}/mingw-w64-fix.patch
  patch -p1 -i ${srcdir}/fix-finding-glew.patch
  patch -p1 -i ${srcdir}/fix-finding-directx.patch
  #patch -p1 -i ${srcdir}/fix-finding-glfw3.patch
  patch -p1 -i ${srcdir}/fix-dxerr-libname.patch
  patch -p1 -i ${srcdir}/fix-mingw-samples.patch
}

build() {
  [[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf ${srcdir}/build-${CARCH}
  mkdir "${srcdir}"/build-${CARCH}  && cd "${srcdir}"/build-${CARCH}

  export DXSDK_DIR=${MINGW_PREFIX}/${MINGW_CHOST}
  export CFLAGS="-I${MINGW_PREFIX}/include"
  export CXXFLAGS="-I${MINGW_PREFIX}/include"
  MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
  ${MINGW_PREFIX}/bin/cmake.exe \
    ../${_realname}-${pkgver} \
    -G"MSYS Makefiles" \
    -DCMAKE_INSTALL_PREFIX=$(cygpath -am ${MINGW_PREFIX}) \
    -DCEGUI_LIB_INSTALL_DIR=lib \
    -DCEGUI_BUILD_RENDERER_OGRE=FALSE \
    -DCEGUI_BUILD_RENDERER_IRRLICHT=FALSE \
    -DCEGUI_BUILD_PYTHON_MODULES=OFF \
    -DCEGUI_INSTALL_WITH_RPATH=TRUE \
    -DCEGUI_BUILD_APPLICATION_TEMPLATE_SDL2=FALSE
    make
}

package() {
  cd ${srcdir}/build-${CARCH}
  make DESTDIR=${pkgdir} install
  cp -rf ${pkgdir}/Msys64${MINGW_PREFIX} ${pkgdir}${MINGW_PREFIX}/
  rm -rf ${pkgdir}/Msys64
}

Changes posted above since i cannot push it to this repository.

peterbud commented 7 years ago

Could you open a PR? It would be easier to review.

revelator commented 7 years ago

A public repository ? sure ill set one up.

Den 23-07-2017 kl. 10:49 skrev Peter Budai:

Could you open a PR? It would be easier to review.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Alexpux/MINGW-packages/issues/2662#issuecomment-317238547, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1zkJdRf2i6OVprWjcmTcxkuAnnW-JFks5sQwkVgaJpZM4ONA-D.

revelator commented 7 years ago

PR opened here https://github.com/revelator/MINGW-packages.

peterbud commented 7 years ago

@revelator : Please read how to make PRs on github. There are extensive documentations, for example you can start here And please make sure you are creating a separate feature branch in your repo for the newly developed stuff, don't work on the master branch.

revelator commented 7 years ago

Allthough it would have been easier to push a commit to alexey's repo im not allowed to do so, so i was asked to make a fork for the changes. But i will read a bit more into it if time permits, since im due to have major surgery performed on my back, so i cannot promise to do so in the near future since i will be bedridden for atleast several months after that. Atleast i hope the two small commits are usefull.

Den 30-07-2017 kl. 07:34 skrev Peter Budai:

@revelator https://github.com/revelator : Please read how to make PRs on github. There are extensive documentations, for example you can start here https://gist.github.com/Chaser324/ce0505fbed06b947d962 And please make sure you are creating a separate feature branch in your repo for the newly developed stuff, don't work on the |master| branch.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Alexpux/MINGW-packages/issues/2662#issuecomment-318879968, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1zkMM5ptkxaISiThDy8xzZ8yA5e94lks5sTBX6gaJpZM4ONA-D.

lazka commented 6 years ago

Is this still a problem?

revelator commented 6 years ago

it will build with ogre and irrlicht now but it still crashes if using those to render the gui. All render paths excepth ogre and irrlicht work fine.

revelator commented 6 years ago

CEGUI::FileIOException in function 'virtual CEGUI::Texture CEGUI::IrrlichtImageCodec::load(const CEGUI::RawDataContainer&, CEGUI::Texture)' (C:/mingw-w64-cegui/src/cegui-0.8.7/cegui/src/RendererModules/Irrlicht/ImageCodec.cpp:58) : Irrlicht failed to create irr::video::IImage from file data.

ogre just outright crashes :/ before even loading anything, so it seems a session with the debugger is in order.

revelator commented 6 years ago

Ok i scoured the net for info on the irrlicht error, and it seems irrlicht does not handle jpeg data correctly, hence the error. Trunk has patch applied to fix this error, so ill see if i can backport it.

No news on ogre yet.

revelator commented 6 years ago

the ogre bug happens because ogre cannot find its data. Ogre still thinks we use the same locations as the official build, might have to patch that. Same goes for cegui, but that atleast is an easy fix, about 3 lines need to be changed in a header. Irrlicht having a hard time finding the commit but ill keep looking.

lazka commented 2 years ago

cegui is gone: 0cbc5ff1254d7fd0f8eb67691b