Pybind11 does not build , no Python.h header!

app-id: com.opendungeons.plus
runtime: org.freedesktop.Platform
runtime-version: ‘22.08’
sdk: org.freedesktop.Sdk
command: opendungeons-plus

I solved previous problem , however here’s a bigger one :

pybind11 does not build properly, it keeps saying that Python.h is not avaiable , although the recepie for it is as follow:

pybind11 module (to fix missing pybind11)

  • name: pybind11
    buildsystem: cmake
    config-opts:
    • -DCMAKE_INSTALL_PREFIX=/app
    • -DPYTHON_EXECUTABLE=/usr/bin/python3
    • -DPYTHON_INCLUDE_DIR=/usr/include/python3.10 # Specify Python include path
    • -DPYTHON_LIBRARIES=/usr/lib/x86_64-linux-gnu/libpython3.10.so # Specify Python library path
      sources:
    • type: archive
      url: https://github.com/pybind/pybind11/archive/refs/tags/v2.10.4.tar.gz
      sha256: 832e2f309c57da9c1e6d4542dedd34b24e4192ecb4d62f6f4866a737454c9970
      build-options:
      build-order: 2

I have logged to that sdk and the include header is in that place , what else could be done ?

just reading it, this manifest is invalid.

Also what does build-order mean?

There are quite a few pacakges that build pybind11:
https://github.com/search?q=org%3Aflathub%20pybind11&type=code

just reading it, this manifest is invalid.

:slight_smile: I Know chatgpt helped me :slight_smile:

I now know that I should have used - -DPYBIND11_FINDPYTHON=ON from yoru examples, thank you !

app-id: com.opendungeons.plus
runtime: org.freedesktop.Platform
runtime-version: '22.08'
sdk: org.freedesktop.Sdk
command: /app/bin/opendungeons-plus

finish-args:
  - --socket=x11
  - --share=network
  - --device=dri
  - --env=CEGUI_MODULE_DIR=/app/lib/cegui-0.9999
  - --filesystem=host

modules:
modules:
  # Boost module (for various utilities)
  - name: boost
    buildsystem: simple
    build-commands:
      - ./bootstrap.sh --prefix=/app
      - ./b2 install
    sources:
      - type: archive
        url: https://boostorg.jfrog.io/artifactory/main/release/1.82.0/source/boost_1_82_0.tar.gz
        sha256: 66a469b6e608a51f8347236f4912e27dc5c60c60d7d53ae9bfe4683316c6f04c



  # OIS module (for input system)
  - name: OIS
    buildsystem: cmake
    config-opts:
      - -DCMAKE_BUILD_TYPE=Release
      - -DCMAKE_INSTALL_PREFIX=/app
    sources:
      - type: archive
        url: https://github.com/wgois/OIS/archive/refs/tags/v1.5.tar.gz
        sha256: aa3e6b840b1149bb06835e04365957f4659c08b3e3095a48b289050f1637a174



  # PugiXML module (added to fix the missing pugixml.hpp error)
  - name: pugixml
    buildsystem: cmake
    config-opts:
      - -DCMAKE_BUILD_TYPE=Release
    sources:
      - type: archive
        url: https://github.com/zeux/pugixml/archive/refs/tags/v1.13.tar.gz
        sha256: 5c5ad5d7caeb791420408042a7d88c2c6180781bf218feca259fd9d840a888e1  # Replace with actual checksum



  # pybind11 module (to fix missing pybind11)
  - name: pybind11
    buildsystem: cmake
    config-opts:
      - -DCMAKE_INSTALL_PREFIX=/app
      - -DPYBIND11_FINDPYTHON=ON
      - -DPYTHON_EXECUTABLE=/usr/bin/python3      
      - -DPYTHON_INCLUDE_DIR=/usr/include/python3.10  # Specify Python include path
      - -DPYTHON_LIBRARIES=/usr/lib/x86_64-linux-gnu/libpython3.10.so  # Specify Python library path
    sources:
      - type: archive
        url: https://github.com/pybind/pybind11/archive/refs/tags/v2.10.4.tar.gz
        sha256: 832e2f309c57da9c1e6d4542dedd34b24e4192ecb4d62f6f4866a737454c9970        # Replace with actual checksum

  # SFML module (Simple and Fast Multimedia Library)
  - name: sfml
    buildsystem: cmake
    config-opts:
      - -DCMAKE_BUILD_TYPE=Release
      - -DCMAKE_INSTALL_PREFIX=/app
    sources:
      - type: archive
        url: https://github.com/SFML/SFML/archive/refs/tags/2.5.1.tar.gz
        sha256: 438c91a917cc8aa19e82c6f59f8714da353c488584a007d401efac8368e1c785


  # OGRE module, which will include ImGui sources
  - name: ogre
    buildsystem: cmake
    config-opts:
      - -DCMAKE_BUILD_TYPE=Release
      - -DOGRE_CONFIG_THREAD_PROVIDER=std
      - -DOGRE_CONFIG_THREADS=3
      - -DOGRE_STATIC=FALSE
      - -DOGRE_BUILD_DEPENDENCIES=FALSE
      - -DOGRE_BUILD_COMPONENT_OVERLAY=ON  # Enable Overlay component (which depends on ImGui)
      - -DIMGUI_ROOT=/run/build/imgui  # Set ImGui root directory
      - -DCMAKE_INSTALL_PREFIX=/app  # Install to /app, not /usr

    sources:
      - type: archive
        url: https://github.com/OGRECave/ogre/archive/refs/tags/v13.6.5.tar.gz
        sha256: 857f74d18c4bb484f0e31c288b8d27837615a59c3da2b3d8304496c83ef669cd  # Replace with actual checksum

      # Download ImGui as an additional source to be used in the OGRE build
      - type: archive
        url: https://github.com/ocornut/imgui/archive/refs/tags/v1.87.tar.gz
        sha256: b54ceb35bda38766e36b87c25edf7a1cd8fd2cb8c485b245aedca6fb85645a20  # Replace with actual checksum
        dest: imgui-1.87  # This will extract ImGui to /run/build/imgui


  # CEGUI module
  - name: cegui
    buildsystem: cmake
    config-opts:
            - -DCMAKE_BUILD_TYPE=Release
            - -DCMAKE_INSTALL_PREFIX=/usr/
            - -DCMAKE_CXX_FLAGS=-std=c++11
            - -DCEGUI_BUILD_RENDERER_OPENGL=FALSE
            - -DCEGUI_BUILD_RENDERER_OPENGLES=FALSE
            - -DCEGUI_BUILD_RENDERER_OPENGL3=FALSE
            - -DCEGUI_BUILD_IMAGECODEC_FREEIMAGE=FALSE # we use ogre
            - -DCEGUI_OPTION_DEFAULT_IMAGECODEC=OgreRenderer-0
            - -DCEGUI_SAMPLES_ENABLED=FALSE
            - -DCEGUI_BUILD_PYTHON_MODULES=OFF
            - -DCMAKE_INSTALL_PREFIX=/app  # Install to /app, not /usr
    sources:
      - type: git
        url: https://github.com/cegui/cegui.git
        tag: v0

  # OpenDungeonsPlus module
  - name: opendungeons-plus
    buildsystem: cmake
    config-opts:
      - -DCMAKE_BUILD_TYPE=Release
      - -DCMAKE_INSTALL_PREFIX=/app
      - -DOD_TREAT_WARNINGS_AS_ERRORS=OFF
      - -DPYBIND11_FINDPYTHON=ON
    sources:
      - type: archive
        url: https://github.com/tomluchowski/OpenDungeonsPlus/archive/refs/tags/Texture_problems.tar.gz
        sha256: 9b01e89a5171691845bae238240f9f882752a822e50056c13d950345b56344df
    post-install:
      - ls /app/bin   # Check if the binary is placed in /app/bin after installatio

It looks like the opendungeons-plus executable was not correctly installed or is not being correctly referenced in the Flatpak manifest.
flatpak-builder --user --install --force-clean build-dir manifest.yml

Emptying app dir 'build-dir'
Downloading sources
Fetching git repo https://github.com/cegui/cegui.git, ref refs/heads/v0
remote: Total 0 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
Starting build of com.opendungeons.plus
Cache hit for boost, skipping build
Cache hit for OIS, skipping build
Cache hit for pugixml, skipping build
Cache hit for pybind11, skipping build
Cache hit for sfml, skipping build
Cache hit for ogre, skipping build
Cache hit for cegui, skipping build
Cache hit for opendungeons-plus, skipping build
Cache hit for cleanup, skipping
Cache miss, checking out last cache hit
Finishing app
Error: Command '/app/bin/opendungeons-plus' not found

This was in app/games/opendungeons-plus

With the help of chatgpt and this site : It’s almost DONE ! I am so happy !!! The application even starts ( only when the config files are present in ./) .The only missing thing is the lack of proper files: plugins.cfg and resources.cfg . The mentioned files should be in /etc/opendungeons-plus path file. That makes me confused : Does it mean the real path /etc/opendungeons-plus on my OS ( opensuse Tumblewed) OR /app/etc/opendungeons-plus inside the flatpack package bundle ?

Because I keep getting :

Error: Cannot open file: /etc/opendungeons-plus/plugins.cfg - skipping automatic plugin loading

NOTE: in similar situation on snapcraft I have ./snap/opendungeons-plus/150/etc/opendungeons-plus/plugins.cfg what I presume I need to have this file in analogous path as well.

The CmakeList.txt of Opendungeons-plus contains the file path OD_PLUGINS_CFG_PATH ,and it’s enough to set it as one desires.

This topic was automatically closed after 3 days. New replies are no longer allowed.