Solved Poudriere: Cannot build from a Makefile while trying to create a official port of eden for fresh ports.

eden the switch emulator works on FreeBSD, but not officially through fresh ports or a FreeBSD port in the traditional sense.
Instead it must be downloaded as source code and be build manually through cmake following a building guide which is not an ideal or preferred way of installing software on FreeBSD,

I am mostly done with the Makefile, and I think it could work, but I get a error that make cannot open the Makefile.
Maybe it is due to a syntax error inside the Makefile, but I couldn't find one.
I know that eden exists inside the www category, but renaming this port to eden-emu didn't work out, too so, it must be something else.
Here is the Makefile content:
Code:
PORTNAME=    eden
PORTVERSION=    0.0.2
PORTREVISION=    0
PKGNAMESUFFIX=    -emu
CATEGORIES=    emulators

MASTER_SITES=    https://git.eden-emu.dev/SDK-chan/eden/archive/
DISTFILES=    master.tar.gz

MAINTAINER=    sdk-chan@protonmail.com
COMMENT=    Nintendo Switch emulator/debugger
WWW=    https://eden-emu.dev

#LICENSE=    APACHE20 BSD3CLAUSE GPLv3+ ISCL MIT UNLICENSE
LICENSE=    APACHE20 BSD3CLAUSE GPLv3+ UNLICENSE
LICENSE_COMB=    multi
#LICENSE_FILE_BSD3CLAUSE=    ${WRKSRC}/externals/sirit/LICENSE.txt
LICENSE_FILE_BSD3CLAUSE=    ${WRKDIR}/eden/externals/sirit/LICENSE.txt
LICENSE_FILE_GPLv3+=    ${WRKDIR}/eden/LICENSE.txt
#LICENSE_FILE_ISCL=    ${WRKDIR}/eden/externals/cubeb/LICENSE
#LICENSE_FILE_MIT=    ${WRKDIR}/eden/externals/sirit/externals/SPIRV-Headers/LICENSE

ONLY_FOR_ARCHS=    aarch64 amd64
ONLY_FOR_ARCHS_REASON=    requires int128 and dynarmic backend

BUILD_DEPENDS=    boost-libs>0:devel/boost-libs \
        nlohmann-json>0:devel/nlohmann-json \
        simpleini>0:devel/simpleini \
        glslangValidator:graphics/glslang \
        vulkan-headers>0:graphics/vulkan-headers \
        vulkan-utility-libraries>0:graphics/vulkan-utility-libraries

LIB_DEPENDS=    liblz4.so:archivers/liblz4 \
        libzstd.so:archivers/zstd \
        libopus.so:audio/opus \
        libfmt.so:devel/libfmt \
        libavcodec.so:multimedia/ffmpeg \
        libenet.so:net/enet

#TEST_DEPENDS=    catch2>0:devel/catch2

USE_GITHUB=    nodefault
GH_TUPLE=    GPUOpen-LibrariesAndSDKs:VulkanMemoryAllocator:v3.0.1-114-g2f382df:VulkanMemoryAllocator/externals/VulkanMemoryAllocator \
        KhronosGroup:SPIRV-Headers:1.5.4.raytracing.fixed-201-gc214f6f:SPIRV_Headers/externals/sirit/externals/SPIRV-Headers \
        arun11299:cpp-jwt:v1.4-18-g10ef573:cpp_jwt/externals/cpp-jwt \
        arsenm:sanitizers-cmake:aab6948:sanitizers_cmake/externals/cubeb/cmake/sanitizers-cmake \
        herumi:xbyak:v6.68:xbyak/externals/xbyak \
        kinetiknz:cubeb:cubeb-0.2-1452-g48689ae:cubeb/externals/cubeb \
        yhirose:cpp-httplib:v0.14.1:cpp_httplib/externals/cpp-httplib

#USES=        cmake:testing localbase:ldflags pkgconfig sdl ssl qt:6
USES=        localbase:ldflags pkgconfig sdl ssl qt:6
USE_SDL=    sdl2
USE_QT=        base
WRKSRC=        ${WRKDIR}/${PORTNAME}
#CMAKE_TESTING_ON=    YUZU_TESTS

OPTIONS_DEFINE=    ALSA QT6 PULSEAUDIO JACK LTO NLS SNDIO VAAPI VULKAN WEBENGINE
OPTIONS_DEFAULT=    PULSEAUDIO JACK LTO QT6 SNDIO VAAPI VULKAN WEBENGINE


ALSA_BUILD_DEPENDS=    alsa-lib>0:audio/alsa-lib
ALSA_CMAKE_BOOL=    USE_ALSA

JACK_BUILD_DEPENDS=    jackit>0:audio/jack
JACK_CMAKE_BOOL=    USE_JACK

LTO_CMAKE_BOOL=        YUZU_ENABLE_LTO

NLS_DESC=        UI translations (implies ${NLS_IMPLIES})
#NLS_USE=        QT=${"${PORT_OPTIONS:MQT5}":?linguist:}tools:build
NLS_USE=        QT=tools:build
NLS_CMAKE_BOOL=        ENABLE_QT_TRANSLATION
NLS_IMPLIES=        QT6

PULSEAUDIO_BUILD_DEPENDS=    pulseaudio>0:audio/pulseaudio
PULSEAUDIO_CMAKE_BOOL=    USE_PULSE

SNDIO_BUILD_DEPENDS=    sndio>0:audio/sndio
SNDIO_CMAKE_BOOL=    USE_SNDIO

VAAPI_LIB_DEPENDS=    libva.so:multimedia/libva

VULKAN_DESC=        Vulkan renderer
VULKAN_RUN_DEPENDS=    ${LOCALBASE}/lib/libvulkan.so:graphics/vulkan-loader

WEBENGINE_DESC=        Web applet support (implies ${WEBENGINE_IMPLIES})
WEBENGINE_USE=        QT=webengine
WEBENGINE_CMAKE_BOOL=    YUZU_USE_QT_WEB_ENGINE
WEBENGINE_IMPLIES=    QT6

post-patch:
    @${REINPLACE_CMD} -e 's/@GIT_BRANCH@/master/' \
        -e 's/@GIT_DESC@/${GH_TAGNAME}/' \
        ${WRKDIR}/eden/src/common/scm_rev.cpp.in

post-patch-VAAPI-off:
    @${REINPLACE_CMD} -i .nova '/pkg_check.*libva/d' \
        ${WRKDIR}/eden/CMakeLists.txt

post-install:
.if exists(/usr/bin/elfctl)
    ${ELFCTL} -e +wxneeded ${STAGEDIR}${PREFIX}/bin/*
.endif

.include <bsd.port.mk>
It fails at the building process so.
 
If the port uses cmake to get build, you need to add cmake to uses knob. You did so but commented out. Port looks for a Makefile by default.
I commented that out, because the initial source is now adjusted so, I thought I don't need any extra cmake handling in the Makefile anymore.

After retrying I found something strange.
Code:
-- Could NOT find xbyak (missing: xbyak_DIR)
-- Could NOT find dynarmic (missing: dynarmic_DIR)
-- Could NOT find cubeb (missing: cubeb_DIR)
-- Could NOT find cpp-jwt (missing: cpp-jwt_DIR)
-- Could NOT find httplib: (Required is at least version "0.12") (found , )

CMake Error at CMakeLists.txt:398 (find_package):
  By not providing "FindCatch2.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Catch2", but
  CMake did not find one.

  Could not find a package configuration file provided by "Catch2" (requested
  version 3.0.1) with any of the following names:

    Catch2Config.cmake
    catch2-config.cmake

  Add the installation prefix of "Catch2" to CMAKE_PREFIX_PATH or set
  "Catch2_DIR" to a directory containing one of the above files.  If "Catch2"
  provides a separate development package or SDK, be sure it has been
  installed.

I created a catch2 patch to be applied on the cmake file.
Code:
 if (YUZU_TESTS)
-    find_package(Catch2 3.0.1 REQUIRED)
+    find_package(Catch2 REQUIRED)
 endif()
But with the patch the same error occurs.
 
I update my make file:
Code:
PORTNAME=    eden
PORTVERSION=    0.0.2
#PORTREVISION=    0
PKGNAMESUFFIX=    -emu
CATEGORIES=    emulators

MASTER_SITES=    https://git.eden-emu.dev/SDK-chan/eden/archive/
#DISTFILES=    ${DISTNAME}${EXTRACT_SUFX}
DISTFILES=    master.tar.gz

MAINTAINER=    sdk-chan@protonmail.com
COMMENT=    Nintendo Switch emulator/debugger
WWW=    https://eden-emu.dev

LICENSE=    APACHE20 BSD3CLAUSE GPLv3+ ISCL MIT UNLICENSE
LICENSE_COMB=    multi
LICENSE_FILE_BSD3CLAUSE=    ${WRKSRC}/externals/sirit/LICENSE.txt
LICENSE_FILE_GPLv3+ =    ${WRKSRC}/LICENSE.txt
LICENSE_FILE_ISCL=    ${WRKSRC}/externals/cubeb/LICENSE
LICENSE_FILE_MIT=    ${WRKSRC}/externals/sirit/externals/SPIRV-Headers/LICENSE

ONLY_FOR_ARCHS=    aarch64 amd64
ONLY_FOR_ARCHS_REASON=    requires int128 and dynarmic backend

BUILD_DEPENDS=    boost-libs>0:devel/boost-libs \
        nlohmann-json>0:devel/nlohmann-json \
        simpleini>0:devel/simpleini \
        glslangValidator:graphics/glslang \
        vulkan-headers>0:graphics/vulkan-headers \
        vulkan-utility-libraries>0:graphics/vulkan-utility-libraries

LIB_DEPENDS=    liblz4.so:archivers/liblz4 \
        libzstd.so:archivers/zstd \
        libopus.so:audio/opus \
        libfmt.so:devel/libfmt \
        libavcodec.so:multimedia/ffmpeg \
        libenet.so:net/enet

TEST_DEPENDS=    catch2>0:devel/catch2

USE_GITHUB=    nodefault
GH_ACCOUNT=    yuzu-mirror
GH_TAGNAME=    15e6e48bef
GH_TUPLE=    GPUOpen-LibrariesAndSDKs:VulkanMemoryAllocator:v3.0.1-114-g2f382df:VulkanMemoryAllocator/externals/VulkanMemoryAllocator \
        KhronosGroup:SPIRV-Headers:1.5.4.raytracing.fixed-201-gc214f6f:SPIRV_Headers/externals/sirit/externals/SPIRV-Headers \
        arun11299:cpp-jwt:v1.4-18-g10ef573:cpp_jwt/externals/cpp-jwt \
        arsenm:sanitizers-cmake:aab6948:sanitizers_cmake/externals/cubeb/cmake/sanitizers-cmake \
        herumi:xbyak:v6.68:xbyak/externals/xbyak \
        kinetiknz:cubeb:cubeb-0.2-1452-g48689ae:cubeb/externals/cubeb \
        yhirose:cpp-httplib:v0.14.1:cpp_httplib/externals/cpp-httplib

USES=        cmake:testing localbase:ldflags pkgconfig sdl ssl qt:6
USE_SDL=    sdl2
USE_QT=        base
WRKSRC=        ${WRKDIR}/${PORTNAME}
CMAKE_TESTING_ON=    YUZU_TESTS

OPTIONS_DEFINE=    ALSA QT6 PULSEAUDIO JACK LTO NLS SNDIO VAAPI VULKAN WEBENGINE
OPTIONS_DEFAULT=    PULSEAUDIO JACK LTO QT6 SNDIO VAAPI VULKAN WEBENGINE


ALSA_BUILD_DEPENDS=    alsa-lib>0:audio/alsa-lib
ALSA_CMAKE_BOOL=    USE_ALSA

JACK_BUILD_DEPENDS=    jackit>0:audio/jack
JACK_CMAKE_BOOL=    USE_JACK

LTO_CMAKE_BOOL=        YUZU_ENABLE_LTO

NLS_DESC=        UI translations (implies ${NLS_IMPLIES})
#NLS_USE=        QT=${"${PORT_OPTIONS:MQT5}":?linguist:}tools:build
NLS_USE=        QT=tools:build
NLS_CMAKE_BOOL=        ENABLE_QT_TRANSLATION
NLS_IMPLIES=        QT6

PULSEAUDIO_BUILD_DEPENDS=    pulseaudio>0:audio/pulseaudio
PULSEAUDIO_CMAKE_BOOL=    USE_PULSE

SNDIO_BUILD_DEPENDS=    sndio>0:audio/sndio
SNDIO_CMAKE_BOOL=    USE_SNDIO

VAAPI_LIB_DEPENDS=    libva.so:multimedia/libva

VULKAN_DESC=        Vulkan renderer
VULKAN_RUN_DEPENDS=    ${LOCALBASE}/lib/libvulkan.so:graphics/vulkan-loader

WEBENGINE_DESC=        Web applet support (implies ${WEBENGINE_IMPLIES})
WEBENGINE_USE=        QT=webengine
WEBENGINE_CMAKE_BOOL=    YUZU_USE_QT_WEB_ENGINE
WEBENGINE_IMPLIES=    QT6

post-patch:
    @${REINPLACE_CMD} -e 's/@GIT_BRANCH@/master/' \
        -e 's/@GIT_DESC@/${GH_TAGNAME}/' \
        ${WRKDIR}/eden/src/common/scm_rev.cpp.in

post-patch-VAAPI-off:
    @${REINPLACE_CMD} -i .nova '/pkg_check.*libva/d' \
        ${WRKDIR}/eden/CMakeLists.txt

post-install:
.if exists(/usr/bin/elfctl)
    ${ELFCTL} -e +wxneeded ${STAGEDIR}${PREFIX}/bin/*
.endif

.include <bsd.port.mk>
The same cmake error occurs.
 
I think I am mostly done.
The only problem left is an external which wants to download a zip file from the internet.
However poudriere limits internet access to the minimum while building.

This error comes out all the time:
Code:
CMake Error at /wrkdirs/usr/ports/emulators/eden/work/eden/externals/nx_tzdb/NxTzdbCreateHeader.cmake:15 (message):
  No timezone files found in directory
  /wrkdirs/usr/ports/emulators/eden/work/.build/externals/nx_tzdb/nx_tzdb/zoneinfo,
  did the download fail?

I supressed the downloading part in the coressponding cmake file, but it didn't help.
Is there some way to specify the coressponding .zip file inside the Makefile so it will be included automatically during build ?

EDIT:
It seems that this is the root cause:
Code:
-- Downloading time zone data from https://github.com/lat9nq/tzdb_to_nx/releases/download/221202/221202.zip...
CMake Error at externals/nx_tzdb/CMakeLists.txt:45 (message):
  Time zone data download failed (status code 6)
I wonder how to solve this.
 
I think I am mostly done.
The only problem left is an external which wants to download a zip file from the internet.
However poudriere limits internet access to the minimum while building.

This error comes out all the time:
Code:
CMake Error at /wrkdirs/usr/ports/emulators/eden/work/eden/externals/nx_tzdb/NxTzdbCreateHeader.cmake:15 (message):
  No timezone files found in directory
  /wrkdirs/usr/ports/emulators/eden/work/.build/externals/nx_tzdb/nx_tzdb/zoneinfo,
  did the download fail?

I supressed the downloading part in the coressponding cmake file, but it didn't help.
Is there some way to specify the coressponding .zip file inside the Makefile so it will be included automatically during build ?

EDIT:
It seems that this is the root cause:
Code:
-- Downloading time zone data from https://github.com/lat9nq/tzdb_to_nx/releases/download/221202/221202.zip...
CMake Error at externals/nx_tzdb/CMakeLists.txt:45 (message):
  Time zone data download failed (status code 6)
I wonder how to solve this.
You should download it as another distfile either with GitHub or master_sites. You may need to extract it to somewhere where the package needs it look for.
 
You should download it as another distfile either with GitHub or master_sites. You may need to extract it to somewhere where the package needs it look for.
I thought that, too.
According to the port creator and maintainer of the deprecated yuzu-emu, he already addressed that through a no-git patch, I can find in his patch directory.
I will try that out, eventually needs adjustments, but that should be doable.
The problem is the yuzu-emu, and eden-emu of course have some broken options in their CmakeList.txt file so, even if setting, unsetting them, it won't work.

The problem in this case is due to poudriere and internet access after all.
Hopefully I am going to fix that today. :)
 
Great news.
I now finished the official eden-emu port, and it installed correctly.
Now, I will polish things up, and then submit it to fresh ports :-)
Once ready, I will leave a message or a link so that FreeBSD users can enjoy current switch-emus, too.
 

Attachments

  • eden-emu.png
    eden-emu.png
    892.6 KB · Views: 159
Back
Top