diff --git a/.ci/ps4/make-toolchain.sh b/.ci/ps4/make-toolchain.sh index ca0f079d96..727596ae36 100644 --- a/.ci/ps4/make-toolchain.sh +++ b/.ci/ps4/make-toolchain.sh @@ -21,6 +21,7 @@ prepare_prefix() { [ -d create-fself ] || git clone --depth=1 https://github.com/OpenOrbis/create-fself [ -d create-gp4 ] || git clone --depth=1 https://github.com/OpenOrbis/create-gp4 [ -d readoelf ] || git clone --depth=1 https://github.com/OpenOrbis/readoelf + [ -d LibOrbisPkg ] || git clone --depth=1 https://github.com/maxton/LibOrbisPkg mkdir -p $PREFIX "$PREFIX/bin" "$PREFIX/include" [ -f "$PREFIX/include/orbis/libkernel.h" ] || cp -r OpenOrbis-PS4-Toolchain/include/* "$PREFIX/include/" @@ -101,31 +102,32 @@ build_llvm() { } build_tools() { + # Build create-fself cd create-fself/cmd/create-fself cp go-linux.mod go.mod - go build -o create-fself + go build -ldflags "-linkmode external -extldflags -static" -o create-fself mv ./create-fself $PREFIX/bin/create-fself cd ../../../ # Build create-gp4 cd create-gp4/cmd/create-gp4 - go build -o create-gp4 + go build -ldflags "-linkmode external -extldflags -static" -o create-gp4 mv ./create-gp4 $PREFIX/bin/create-gp4 cd ../../../ # Build readoelf cd readoelf/cmd/readoelf - go build -o readoelf + go build -ldflags "-linkmode external -extldflags -static" -o readoelf mv ./readoelf $PREFIX/bin/readoelf cd ../../../ - # Pull maxton's publishing tools (<3) - # Sadly maxton has passed on, we have forked the repository and will continue to update it in the future. RIP <3 - cd $PREFIX/bin - [ -f PkgTool.Core-linux-x64-0.2.231.zip ] || wget https://github.com/maxton/LibOrbisPkg/releases/download/v0.2/PkgTool.Core-linux-x64-0.2.231.zip - [ -f PkgTool.Core ] || unzip PkgTool.Core-linux-x64-0.2.231.zip - chmod +x PkgTool.Core + # # Pull maxton's publishing tools (<3) + # # Sadly maxton has passed on, we have forked the repository and will continue to update it in the future. RIP <3 + # cd $PREFIX/bin + # [ -f PkgTool.Core-linux-x64-0.2.231.zip ] || wget https://github.com/maxton/LibOrbisPkg/releases/download/v0.2/PkgTool.Core-linux-x64-0.2.231.zip + # [ -f PkgTool.Core ] || unzip PkgTool.Core-linux-x64-0.2.231.zip + # chmod +x PkgTool.Core } finish_prefix() { diff --git a/CMakeModules/OpenOrbis.cmake b/CMakeModules/OpenOrbis.cmake index 2ee8cb4942..4e76731f6a 100644 --- a/CMakeModules/OpenOrbis.cmake +++ b/CMakeModules/OpenOrbis.cmake @@ -1,43 +1,31 @@ # SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project # SPDX-License-Identifier: GPL-3.0-or-later -function(create_ps4_fself project target) - add_custom_command( - OUTPUT "${CMAKE_BINARY_DIR}/${target}.self" - COMMAND ${CMAKE_SYSROOT}/bin/create-fself - -in=${CMAKE_BINARY_DIR}/bin/${target} - -out=${CMAKE_BINARY_DIR}/bin/${target}.oelf - --eboot ${CMAKE_BINARY_DIR}/bin/eboot.bin - VERBATIM - DEPENDS "${project}" - ) - add_custom_target("${project}_self" ALL DEPENDS ${project}) -endfunction() - function(create_ps4_pkg project target content_id) - set(sce_sys_dir ./sce_sys) + set(sce_sys_dir sce_sys) set(sce_sys_param ${sce_sys_dir}/param.sfo) add_custom_command( - OUTPUT "${CMAKE_BINARY_DIR}/${target}.pkg" + OUTPUT "${target}.pkg" + COMMAND ${CMAKE_SYSROOT}/bin/create-fself -in=bin/${target} -out=${target}.oelf --eboot eboot.bin COMMAND mkdir -p ${sce_sys_dir} COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_new ${sce_sys_param} COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} APP_TYPE --type Integer --maxsize 4 --value 1 - COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} APP_VER --type Utf8 --maxsize 8 --value '1.03' + COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} APP_VER --type Utf8 --maxsize 8 --value 1.03 COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} ATTRIBUTE --type Integer --maxsize 4 --value 0 - COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} CATEGORY --type Utf8 --maxsize 4 --value 'E' - COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} CONTENT_ID --type Utf8 --maxsize 48 --value '${content_id}' + COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} CATEGORY --type Utf8 --maxsize 4 --value gd + COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} CONTENT_ID --type Utf8 --maxsize 48 --value ${content_id} COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} DOWNLOAD_DATA_SIZE --type Integer --maxsize 4 --value 0 COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} SYSTEM_VER --type Integer --maxsize 4 --value 0 COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} TITLE --type Utf8 --maxsize 128 --value ${target} - COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} TITLE_ID --type Utf8 --maxsize 12 --value 'BREW00090' - COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} VERSION --type Utf8 --maxsize 8 --value '1.03' - COMMAND ${CMAKE_SYSROOT}/bin/create-gp4 -out ${target}.gp4 --content-id='${content_id}' --files "bin/eboot.bin ${sce_sys_param}" - COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core pkg_build ${CMAKE_BINARY_DIR}/${target}.gp4 . + COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} TITLE_ID --type Utf8 --maxsize 12 --value BREW00090 + COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core sfo_setentry ${sce_sys_param} VERSION --type Utf8 --maxsize 8 --value 1.03 + COMMAND ${CMAKE_SYSROOT}/bin/create-gp4 -out ${target}.gp4 --content-id=${content_id} --files "eboot.bin ${sce_sys_param}" + COMMAND ${CMAKE_SYSROOT}/bin/PkgTool.Core pkg_build ${target}.gp4 . VERBATIM WORKING_DIRECTORY ${CMAKE_BINARY_DIR} - DEPENDS ${project}_self + DEPENDS ${project} ) - add_custom_target(${project}_pkg ALL DEPENDS "${CMAKE_BINARY_DIR}/${target}.pkg") + add_custom_target(${project}_pkg ALL DEPENDS "${target}.pkg") endfunction() if (NOT DEFINED ENV{OO_PS4_TOOLCHAIN}) diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index 8d8aec78c2..8e275bb1a0 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt @@ -69,6 +69,5 @@ if (NOT MSVC) endif() if (PLATFORM_PS4) - create_ps4_fself(yuzu-cmd eden-cli) - create_ps4_pkg(yuzu-cmd eden-cli "IV0000-BREW00090_00-EDENEMULAT000000") + create_ps4_pkg(yuzu-cmd eden-cli IV0000-BREW00090_00-EDENEMULAT000000) endif()