# Copyright 1999-2016 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=6 PYTHON_COMPAT=( python{2_7,3_3,3_4,3_5} ) inherit git-r3 python-r1 DESCRIPTION="Unreal Engine 4 is a suite of game development tools" HOMEPAGE="https://www.unrealengine.com/" EGIT_REPO_URI="https://github.com/EpicGames/UnrealEngine.git" if use promoted ; then EGIT_BRANCH="promoted" else EGIT_BRANCH="master" fi EGIT_CHECKOUT_DIR="${WORKDIR}/unrealengine" LICENSE="unrealengine-4-license" SLOT="0" KEYWORDS="~amd64 -x86" IUSE="+promoted" #UE4Client UE4Editor UE4Game UE4Server BlankProgram BuildPatchTool CrashReportClient MinidumpDiagnostics CrossCompilerTool UnrealLaunchDaemon DsymExporter ShaderCacheTool UE4EditorServices UnrealAtoS ParallelExecutor ShaderCompileWorker SlateViewer SymbolDebugger TestPAL UnrealCEFSubProcess UnrealCodeAnalyzer UnrealFileServer UnrealFrontend UnrealHeaderTool UnrealLightmass UnrealPak UnrealSync UnrealVersionSelector BootstrapPackagedGame #Debug DebugGame Shipping Test #TODO: add make tagets as USE? DEPEND=">=dev-lang/mono-3.1.0 || ( ~sys-devel/clang-3.3 >=sys-devel/clang-3.5 ) app-text/dos2unix dev-util/cmake >=sys-libs/zlib-1.2.5[static-libs] >=dev-libs/jemalloc-3.6.0[static-libs] >=dev-cpp/libmcpp-2.7.2[static-libs] >=dev-libs/icu-53.1[static-libs]" RDEPEND="x11-base/xorg-server media-libs/libsdl2 || ( ( >=x11-libs/gtk+-2.0 ) ( dev-qt/qtcore:4 dev-qt/qtgui:4 ) ( dev-qt/qtcore:5 dev-qt/qtgui:5 ) ) >=media-libs/opus-1.1[static-libs] >=media-libs/libogg-1.2.2[static-libs] >=media-libs/libvorbis-1.3.2[static-libs] >=media-libs/freetype-2.4.12[static-libs] x11-misc/xdg-user-dirs" S="${EGIT_CHECKOUT_DIR}" create_link_if_not_exists() { WrongName=$1 CorrectName=$2 pushd `dirname $CorrectName` > /dev/null || die if [[ ! -f `basename $CorrectName` ]] && [[ -f $WrongName ]]; then echo "$WrongName -> $CorrectName" ln -sf $WrongName `basename $CorrectName` || die fi popd > /dev/null || die } src_unpack() { elog "You have to register at unrealengine.com and in this profile you have to enter your github account name, so that epicgames grants you access to the repository" elog "Please follow instructions on https://www.unrealengine.com/ue4-on-github" git-r3_fetch git-r3_checkout } src_prepare() { #./Setup.sh while : ; do mono Engine/Binaries/DotNET/GitDependencies.exe RESULT=$? echo "Result: $RESULT" # quit if not crashed [[ $RESULT -lt 129 ]] && break ewarn "mono GitDependencies.exe crashed with return code ${RESULT}. It will be restarted automatically." done # Fixes for case sensitive filesystem. einfo "Fixing inconsistent case in filenames." for BASE in Engine/Content/Editor/Slate Engine/Content/Slate Engine/Documentation/Source/Shared/Icons; do find $BASE -name "*.PNG" | while read PNG_UPPER; do png_lower="$(echo "$PNG_UPPER" | sed 's/.PNG$/.png/')" if [[ ! -f $png_lower ]]; then PNG_UPPER=$(basename $PNG_UPPER) echo "$png_lower -> $PNG_UPPER" # link, and not move, to make it usable with Perforce workspaces ln -sf `basename "$PNG_UPPER"` "$png_lower" || die fi done done create_link_if_not_exists ../engine/shaders/Fxaa3_11.usf Engine/Shaders/Fxaa3_11.usf create_link_if_not_exists ../Engine/shaders/Fxaa3_11.usf Engine/Shaders/Fxaa3_11.usf rm -f ../Engine/Binaries/Linux/libLND.so || die Engine/Build/BatchFiles/Linux/BuildThirdParty.sh -b HLSLCC || die #TODO patch for march #./GenerateProjectFiles.sh xbuild Engine/Source/Programs/UnrealBuildTool/UnrealBuildTool.csproj \ /verbosity:quiet /nologo \ /p:TargetFrameworkVersion=v4.5 \ /p:Configuration="Development" || die # pass all parameters to UBT mono Engine/Binaries/DotNET/UnrealBuildTool.exe -makefile || die } src_compile() { einfo "Starting a compilation. That may take much time." emake StandardSet UE4Game einfo "Compilation finished." } src_install() { INSPATH="/opt/${PN}" DINSPATH="${ED}""${INSPATH#/}"/ rm -rf "Engine/Intermediate" || die rm -rf "Engine/DerivedDataCache" || die mkdir -p "Engine/Intermediate" || die mkdir -p "Engine/DerivedDataCache" || die mkdir -p "${DINSPATH}" || die fperms +x /Engine/Binaries/Linux/UE4Editor cp -pPR Engine FeaturePacks Templates "${DINSPATH}" || die dodoc README.md newicon Engine/Source/Programs/UnrealVS/Resources/Preview.png "${PN}.png" make_desktop_entry "${INSPATH}/Engine/Binaries/Linux/UE4Editor -opengl4" "Unreal Engine 4 Editor" "${PN}.png" "Application" "Version=9999\nPath=${INSPATH}/Engine/Binaries/Linux \nTerminal=false" }