diff --git a/games-engines/openmw/additional-files/haikuicons.zip b/games-engines/openmw/additional-files/haikuicons.zip new file mode 100644 index 000000000..9df62bf41 Binary files /dev/null and b/games-engines/openmw/additional-files/haikuicons.zip differ diff --git a/games-engines/openmw/additional-files/openmw.rdef.in b/games-engines/openmw/additional-files/openmw.rdef.in new file mode 100644 index 000000000..a740a3a04 --- /dev/null +++ b/games-engines/openmw/additional-files/openmw.rdef.in @@ -0,0 +1,105 @@ +resource app_flags B_SINGLE_LAUNCH; + +resource app_version { + major = @MAJOR@, + middle = @MIDDLE@, + minor = @MINOR@, + + variety = B_APPV_FINAL, + internal = 0, + + short_info = "OpenMW", + long_info = "@LONG_INFO@" +}; + +resource app_signature "@APP_SIGNATURE@"; + +resource vector_icon array { + $"6E636966060401FA020106043D9931BC82773CA5B13DCBB44A005E48DBC900FF" + $"FFFF75F0DFD6D1B2917EFF7D503302000602BCF5E4BC9A093C08D4BC50A84A14" + $"E44B0AC400A59C93FF492201020006023D20563B570BBA1B353BF16A45EF0E4A" + $"2D2900A48C5DFF695541020006023C1D7F3C9313BCE9DB3C64CB4AD6E947CF1B" + $"00E4E4E4FF73654A04017C13001ABB70B49ABB70B49A3D22C253B4E03E22C26C" + $"B4E4C253B503C266B4FC4328C079B623C07AB61D3D29BDE6B746BE33B702BC73" + $"B8A1BB72BC87BBA0BA91BBE9BC3DBCDDBBB1BC56BBDEBD98BB6DBF26BBA1BE67" + $"BB72BEE8BA8FBDE1B8A0BE6AB993BE8BB834BFE4B761BF3CB7D2C138B7BBC340" + $"B99EC25CB8974D36C51DBDFAC50BBD86513CC8FABB32C89BBB9BC908BB23C929" + $"BB0AC919BB18C964BBB6C922BFAB5A395644C719C282C778C20CC7DCC325CB7D" + $"C4DD574ACB14C58DCA46C6EFCAAFC640C96AC78EC749C7CBC856C7D0C660C7CB" + $"C4A4C73BC57BC793C4CDC7A1C53AC861C50AC7FDC4BCC90DC3C9CA6AC444C9BC" + $"C2DAC9F5C146C898C201C955C0CBC932BFD3CA66C049C9C8BEC0C9FFB5BBBEE3" + $"2C532529BB70B49A2D29BB70B49A000AC7ABBCB1C7ABBCB1C7EEBD65C821BEE2" + $"C81BBE22C82EBF48C81BC011C81ABFACC81BC011C811C018C811C018C801C0A0" + $"C7A2C1A2C7D3C122C7EBC14DC872C09CC82C43C8E9C003C959BE8DC93CBF4CC9" + $"7BBE09C974BCF7C974BD7FC96FBC5CC918BB30C94736C89DBBAEC7ABBCB1C825" + $"BC30C7ABBCB10009BD8FBBA1BD8FBBA1BD4DBBAEBCCBBBDABD06BBB7BC79BBEC" + $"BBF4BC50BC39BC24BBA4BC8ABB00BCFABB4DBCBBBB21BCF4BB63BCE0BB45BCF2" + $"BBBABCD7BC69BCD5BC11BCC6BD7FBCEDBF65BE03BE7EBD6EBF6CBD41BF2EBBC1" + $"BF56BC7FBEA8BB99BD8FBBA1BE1ABB90BD8FBBA10006C52BBE11C52BBE11C509" + $"BE15C4DCBE48C4F3BE32C46FBEBAC38FBF9BC3FABF26C49CBF62C6663CC5A0BE" + $"EAC6A1BDE0C716BD4DC6E4BD9DC67DBDA5C52BBE11C5D9BDEFC52BBE110007C5" + $"28C3E7C528C3E7C5F6C4B0C7DDC5E7C6DFC560C89EC64DCA40C6C9C96FC68ECA" + $"A2C61ECB69C4C8CB09C575CAC5C4A1C987C42FCA21C475C89EC3CAC709C296C7" + $"C9C33BC688C32DC528C3E7C5DEC39BC528C3E70006BDD5C4C6BDD5C4C6BE9AC5" + $"E7C092C7CEBF89C6EBBFF8C706BF37C531BF7FC624BF22C4F0BF04C46BBF18C4" + $"AC3EC45CBEC9C46ABEDCC46BBE75C47DBDD5C4C6BE15C486BDD5C4C60004BD04" + $"C54EBD04C54EBCDFC56DBCB4C5C4BCC8C599BD07C573BDABC4CFBD5BC524BD6B" + $"4DBD04C54EBD38C520BD04C54E0206BBBCB49ABB46B4CCBCE6B425BF6AB433BE" + $"2EB40AC063B453C23FB4F7C155B49DC1A8B554C072B601C10BB5A7BF4EB590BC" + $"E9B50FBE22B52BBC0FB4F7BA5DB538BB32B508BAD0B4FF0209BFCEB790BF3EB7" + $"EBBFECB776C032B794C012B78AC18EB80EC38EBA2DC2B6B904C45EBB48C500BD" + $"F9C4D8BC9DC502BE1EC4C5BE4AC4D9BE30C458BEB6C37FBF8FC3EDBF24C35EBE" + $"BEC2D4BD2CC329BDEFC255BC02C09FBA1EC190BAF7BFE4B976BE1BB89DBF09B8" + $"F0BEA9B83F0206BD8FBBA1BD4DBBAEBE1ABB90BF2EBBC1BEA8BB99BF56BC7FBF" + $"65BE03BF6CBD41BE7EBD6EBC69BCD5BD7FBCEDBC11BCC6BB63BCE0BBBABCD7BB" + $"D1BC7BBCCBBBDABC5BBC3CBD06BBB7020AB9B9C0A0BA42C368BA50C037BB75BF" + $"56BADCBFBEBB97C033BC26C1DBBBD8C10ABBCA47BBD2C419BBBFC357BBEAC4CF" + $"BC72C625BC1DC582BCE1C5B6BDC1C4DCBD51C549BE4CC5A0BF8FC705BEE6C659" + $"C012C78DC133C883C0AAC800C0BCC916BFCDCA3BC045C9A9BF04C98CBD8BC813" + $"BE3AC8DDBBA8C5FB0206C528C3E7C5F6C4B0C5DEC39BC709C296C688C32DC7C9" + $"C33BC987C42FC89EC3CACA21C475CB69C4C8CAC5C4A1CB09C575CA40C6C9CAA2" + $"C61EC96FC68EC7DDC5E7C89EC64DC6DFC5600207C2AF50C298C694C339C680C4" + $"62C71DC3C9C6D7C484C729C49DC76CC48FC74FC4C1C7BEC519C85AC4F1C80AC4" + $"A9C8FAC3C8CA38C439C99AC3A0C9EAC34BC94FC370C99FC304C8BCC2B9C77DC2" + $"D255C2AEC7090211BB32B524BA82B53BBB89B51EBC36B513BBDFB50CBCBDB51C" + $"BDC8B540BD44B521BEB0B56BC06AB60FBF8EB5BBBF54B657BD41B73BBE34B69B" + $"BC3EB7D7BABFB9B0BB5FB8AFB9D5BB27B97ABEA1B965BCE8B973BF54B9ACC0B5" + $"B98CC006BA32C35FBD48C7E1BB85C5D5BDAFC85ABE92C939BE21C8C9BEEDC992" + $"BFABCA3ABF54C9DEBEA0C9D6BCAEC8BCBD9DC95ABBB9C819BA08C687BAD6C75A" + $"B89BC508B6A1C162B76EC34AB5CEBF68B5A0BB18B55EBD3BB5C3BA08B6A5B80F" + $"B6152FB740B70FB936B5BBB826B639B9D3B5660208BC8FB7CEBBA5B881BD04B7" + $"6DBE18B6EDBD8CB727BD8BB770BCA2B8A3BD08B7FFBBE1B9D3BB56BC99BB74BB" + $"34BAF4BCE032BD67BA8DBD20B9EABD97B987BE19B9B6BDD7B984BDDBB991BD60" + $"B987BD9DB9AEBC5DBA65BA74B9F5BB5FBAE7B96C0204B985BE60B983BF21BA2B" + $"BE83BB62BF0FBAD2BEB3BB78BF1FBB75BF56BB6FBF3EBADCBFBEB9B9C0A0BA50" + $"C037B990BFE30228BE05B8A9BE54B93EBF2CB905C105BA95C02EB9BBC1AABB43" + $"C2A0BCE0C237BC08C30D3BC371BFB0C34EBEB7C3FCBF96C502BF30C482BF6BC5" + $"A3BEE5C6B1BDFCC633BE79C70EBD9AC79FBCB6C755BD26C7D5BD5FC80CBEBDC8" + $"07BE0B55BFCCC772C1D5C7F5C0E5C722C25FC633C334C6B3C2D5C5D2C37CC4F8" + $"C3E2C562C3AAC50DC3EEC537C40AC524C3FAC5FFC4CCC7DAC5F6C6E3C573C897" + $"C65ACA31C6D7C964C69CC97BC763C7B2C7AFC894C79EC654C7C3C3C8C6AFC4F7" + $"C75BC358C673C286C5E6C2F3C626C29CC615C295C67AC29AC648C292C793C362" + $"C9A1C2DEC8AAC37EC9D5C3B7CA3EC39DCA08C2EDC9DDC194C8BDC236C957C079" + $"C7B5BF3EC4E9BF9EC662BF2FC4B7BF24C450BF24C484BF1EC44CBF0DC43FBF13" + $"C443BEE2C44BBE8BC45CBEB7C454BDF7C47BBCFFC530BD66C4BEBCC8C56DBC7C" + $"C5FFBCA84FBC03C501BBF4C2C8BBC6C3E0BC17C1F4BD50C0C1BC9CC135BD65C0" + $"BABD92C0B5BD7BC0B8BD82C08FBD45C05BBD60C078BC7BBF9BBA91BE8DBB97BE" + $"F1BA3EBE6CB98FBE45B9E5BE5EB9D2BDCDBAB4BD2FBA3CBD6FBB18BD00BBF3BC" + $"DCBB86BCEABC77BCE3BD79BD1DBCFBBCF5BE1EBD56BF4ABE09BEBBBDA4BF5EBE" + $"15BF7EBE38BF6BBE2ABF7EBDC7BF77BCE7BF85BD57BF63BC0FBEE3BA71BF31BB" + $"3BBEA7B9D20205C52BBE11C509BE15C5D9BDEFC716BD4DC67DBDA5C6E4BD9DC6" + $"663CC6A1BDE0C5A0BEEAC38FBF9BC49CBF62C3FABF26C4DCBE48C46FBEBAC4F3" + $"BE3202044030C34530BC3A30304030BC3A30C3454050BC3A50C34550504050C3" + $"4550BC3A0F0A0501120241050C0000000000003FD384C61E4A4833340A000D01" + $"040605000D0C070803020A10124019C5000000000000400844C338BAB260D301" + $"178402040A040107024019C5000000000000400844C338BAB260D30A04010802" + $"4019C5000000000000400844C338BAB260D30A020101024019C5000000000000" + $"400844C338BAB260D30A030109024019C5000000000000400844C338BAB260D3" + $"0A02010A024019C5000000000000400844C338BAB260D30A03010B024019C500" + $"0000000000400844C338BAB260D30A02010C024019C5000000000000400844C3" + $"38BAB260D30A02010E024019C5000000000000400844C338BAB260D30A02010F" + $"024019C5000000000000400844C338BAB260D30A00010D124019C50000000000" + $"00400844C338BAB260D301178422040A01010D024019C5000000000000400844" + $"C338BAB260D30A000110124019C5000000000000400844C338BAB260D3011784" + $"22040A010110024019C5000000000000400844C338BAB260D3" +}; diff --git a/games-engines/openmw/openmw-0.44.0~git.recipe b/games-engines/openmw/openmw-0.44.0~git.recipe new file mode 100644 index 000000000..2a50d8eab --- /dev/null +++ b/games-engines/openmw/openmw-0.44.0~git.recipe @@ -0,0 +1,191 @@ +SUMMARY="Open source reimplementation of TES III: Morrowind" +DESCRIPTION="OpenMW is a new and modern engine based on the one that runs the \ +2002 open-world RPG Morrowind. The engine (OpenMW) will come with its own editor \ +(OpenCS) which will allow the user to edit or create their own games. Both OpenCS \ +and OpenMW are written from scratch and aren’t made to support any third party \ +programs the original Morrowind engine uses to improve its functionality." +HOMEPAGE="https://openmw.org/" +COPYRIGHT="2008-2018 OpenMW" +LICENSE=" + GNU GPL v3 + MIT + Zlib + " +REVISION="1" +srcGitRev="503352e8405d0a3930a9416ab00a972a1f41b8a9" +SOURCE_URI="https://github.com/OpenMW/openmw/archive/$srcGitRev.tar.gz" +SOURCE_FILENAME="openmw-$srcGitRev.tar.gz" +CHECKSUM_SHA256="8c9c9a5184210bbab338bbdd91de0acbb4397db8f4ce5fab85b988f3cd88f88e" +SOURCE_DIR="openmw-$srcGitRev" +PATCHES="openmw-$portVersion.patchset" +ADDITIONAL_FILES=" + openmw.rdef.in + haikuicons.zip + " + +ARCHITECTURES="!x86_gcc2 x86_64" +if [ "$targetArchitecture" = x86_gcc2 ]; then +SECONDARY_ARCHITECTURES="x86" +fi + +PROVIDES=" + openmw$secondaryArchSuffix = $portVersion + app:OpenMW$secondaryArchSuffix = $portVersion + app:OpenMW_Launcher$secondaryArchSuffix = $portVersion + app:OpenMW_Wizard$secondaryArchSuffix = $portVersion + app:OpenMW_CS$secondaryArchSuffix = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libavcodec$secondaryArchSuffix + lib:libavformat$secondaryArchSuffix + lib:libavutil$secondaryArchSuffix + lib:libboost_filesystem$secondaryArchSuffix + lib:libboost_system$secondaryArchSuffix + lib:libboost_program_options$secondaryArchSuffix + lib:libBulletCollision$secondaryArchSuffix + lib:libGL$secondaryArchSuffix + lib:libGLU$secondaryArchSuffix + lib:libLinearMath$secondaryArchSuffix + lib:libMyGUIEngine$secondaryArchSuffix + lib:libopenal$secondaryArchSuffix + lib:libosg$secondaryArchSuffix + lib:libosgDB$secondaryArchSuffix + lib:libosgFX$secondaryArchSuffix + lib:libosgGA$secondaryArchSuffix + lib:libosgParticle$secondaryArchSuffix + lib:libosgText$secondaryArchSuffix + lib:libosgUtil$secondaryArchSuffix + lib:libosgViewer$secondaryArchSuffix + lib:libQt5Gui$secondaryArchSuffix + lib:libQt5Widgets$secondaryArchSuffix + lib:libSDL2_2.0$secondaryArchSuffix + lib:libSDL2_image_2.0$secondaryArchSuffix + lib:libunshield$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libavcodec$secondaryArchSuffix + devel:libavformat$secondaryArchSuffix + devel:libavutil$secondaryArchSuffix + devel:libboost_filesystem$secondaryArchSuffix + devel:libboost_system$secondaryArchSuffix + devel:libboost_program_options$secondaryArchSuffix + devel:libBulletCollision$secondaryArchSuffix + devel:libGL$secondaryArchSuffix + devel:libGLU$secondaryArchSuffix + devel:libLinearMath$secondaryArchSuffix + devel:libMyGUIEngine$secondaryArchSuffix + devel:libopenal$secondaryArchSuffix + devel:libosg$secondaryArchSuffix + devel:libQt5Gui$secondaryArchSuffix + devel:libQt5Widgets$secondaryArchSuffix + devel:libSDL2_2.0$secondaryArchSuffix + devel:libSDL2_image_2.0$secondaryArchSuffix + devel:libunshield$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:cmake + cmd:gcc$secondaryArchSuffix + cmd:git + cmd:make + cmd:zip + " + +PATCH() +{ + unzip -o $sourceDir/../../additional-files/haikuicons.zip -d $sourceDir +} + +BUILD() +{ + mkdir -p build + cd build + cmake .. \ + -DCMAKE_INSTALL_PREFIX=$appsDir/OpenMW \ + -DCMAKE_BUILD_TYPE=Release \ + -DBullet_INCLUDE_DIR=/system/$relativeIncludeDir/bullet \ + -DDESIRED_QT_VERSION=5 \ + -DBUILD_BSATOOL=ON \ + -DBUILD_DOCS=OFF \ + -DBUILD_ESMTOOL=OFF \ + -DBUILD_LAUNCHER=ON \ + -DBUILD_NIFTEST=OFF \ + -DBUILD_OPENCS=ON \ + -DBUILD_UNITTESTS=OFF \ + -DBUILD_WIZARD=ON + make $jobArgs +} + +INSTALL() +{ + cd build + make install + + mv -f $appsDir/OpenMW/games/openmw/* $appsDir/OpenMW + rm -rf $appsDir/OpenMW/{games,applications,licenses,metainfo,pixmaps} + + # capitalize application names + mv $appsDir/OpenMW/openmw $appsDir/OpenMW/OpenMW + mv $appsDir/OpenMW/openmw-launcher $appsDir/OpenMW/OpenMW-Launcher + mv $appsDir/OpenMW/openmw-wizard $appsDir/OpenMW/OpenMW-Wizard + mv $appsDir/OpenMW/openmw-cs $appsDir/OpenMW/OpenMW-CS + + # tune default settings + sed -i "s|crosshair = .*|crosshair = false|" \ + $appsDir/OpenMW/config/openmw/settings-default.cfg + sed -i "s|viewing distance = .*|viewing distance = 4500.0|" \ + $appsDir/OpenMW/config/openmw/settings-default.cfg + sed -i "s|anisotropy = .*|anisotropy = 0|" \ + $appsDir/OpenMW/config/openmw/settings-default.cfg + sed -i "s|minimize on focus loss = .*|minimize on focus loss = false|" \ + $appsDir/OpenMW/config/openmw/settings-default.cfg + + local APP_SIGNATURE="application/x-vnd.openmw" + local MAJOR="`echo "$portVersion" | cut -d. -f1`" + local MIDDLE="`echo "$portVersion" | cut -d. -f2`" + local MINOR="`echo "$portVersion" | cut -d. -f3 | cut -d~ -f1`" + local LONG_INFO="$SUMMARY" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + $portDir/additional-files/openmw.rdef.in > $sourceDir/build/openmw.rdef + addResourcesToBinaries $sourceDir/build/openmw.rdef $appsDir/OpenMW/OpenMW + + local APP_SIGNATURE="application/x-vnd.openmw-launcher" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + $portDir/additional-files/openmw.rdef.in > $sourceDir/build/openmw-launcher.rdef + addResourcesToBinaries $sourceDir/build/openmw-launcher.rdef $appsDir/OpenMW/OpenMW-Launcher + + local APP_SIGNATURE="application/x-vnd.openmw-cs" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + $portDir/additional-files/openmw.rdef.in > $sourceDir/build/openmw-cs.rdef + addResourcesToBinaries $sourceDir/build/openmw-cs.rdef $appsDir/OpenMW/OpenMW-CS + + local APP_SIGNATURE="application/x-vnd.openmw-wizard" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + $portDir/additional-files/openmw.rdef.in > $sourceDir/build/openmw-wizard.rdef + addResourcesToBinaries $sourceDir/build/openmw-wizard.rdef $appsDir/OpenMW/OpenMW-Wizard + mimeset -f $appsDir/OpenMW/OpenMW-Launcher + + addAppDeskbarSymlink $appsDir/OpenMW/OpenMW-Launcher Morrowind +} diff --git a/games-engines/openmw/patches/openmw-0.44.0~git.patchset b/games-engines/openmw/patches/openmw-0.44.0~git.patchset new file mode 100644 index 000000000..cb6008ea3 --- /dev/null +++ b/games-engines/openmw/patches/openmw-0.44.0~git.patchset @@ -0,0 +1,367 @@ +From e0b3395787c4ccaef239856f5768d8e8728fa977 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sat, 6 Oct 2018 20:54:27 +1000 +Subject: Fix build for Haiku + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 34e1a8f..40610ba 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -107,6 +107,19 @@ endif() + if (APPLE) + set(MORROWIND_DATA_FILES "./data" CACHE PATH "location of Morrowind data files") + set(OPENMW_RESOURCE_FILES "../Resources/resources" CACHE PATH "location of OpenMW resources files") ++elseif(HAIKU) ++ # Paths ++ SET(BINDIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Where to install binaries") ++ SET(LIBDIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "Where to install libraries") ++ SET(DATAROOTDIR "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Sets the root of data directories to a non-default location") ++ SET(GLOBAL_DATA_PATH "${DATAROOTDIR}/games/" CACHE PATH "Set data path prefix") ++ SET(DATADIR "${GLOBAL_DATA_PATH}/openmw" CACHE PATH "Sets the openmw data directories to a non-default location") ++ SET(ICONDIR "${DATAROOTDIR}/pixmaps" CACHE PATH "Set icon dir") ++ SET(LICDIR "${DATAROOTDIR}/licenses/openmw" CACHE PATH "Sets the openmw license directory to a non-default location.") ++ SET(GLOBAL_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/config/" CACHE PATH "Set config dir prefix") ++ SET(SYSCONFDIR "${GLOBAL_CONFIG_PATH}/openmw" CACHE PATH "Set config dir") ++ set(MORROWIND_DATA_FILES "${CMAKE_INSTALL_PREFIX}/data" CACHE PATH "location of Morrowind data files") ++ set(OPENMW_RESOURCE_FILES "${CMAKE_INSTALL_PREFIX}/resources" CACHE PATH "location of OpenMW resources files") + elseif(UNIX) + # Paths + SET(BINDIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Where to install binaries") +diff --git a/apps/launcher/CMakeLists.txt b/apps/launcher/CMakeLists.txt +index bfc08a7..a0a908a 100644 +--- a/apps/launcher/CMakeLists.txt ++++ b/apps/launcher/CMakeLists.txt +@@ -105,6 +105,10 @@ target_link_libraries(openmw-launcher + components + ) + ++if (HAIKU) ++ target_link_libraries(openmw-launcher be) ++endif (HAIKU) ++ + if (DESIRED_QT_VERSION MATCHES 4) + target_link_libraries(openmw-launcher ${QT_QTGUI_LIBRARY} ${QT_QTCORE_LIBRARY}) + if(WIN32) +diff --git a/apps/launcher/graphicspage.cpp b/apps/launcher/graphicspage.cpp +index 072f1f3..7ef82be 100644 +--- a/apps/launcher/graphicspage.cpp ++++ b/apps/launcher/graphicspage.cpp +@@ -12,7 +12,11 @@ + #define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ + #endif // MAC_OS_X_VERSION_MIN_REQUIRED + ++#ifdef __HAIKU__ ++#include ++#else + #include ++#endif + + #include + +@@ -57,6 +61,9 @@ bool Launcher::GraphicsPage::setupSDL() + } + #endif + ++#ifdef __HAIKU__ ++ int displays = 1; ++#else + int displays = SDL_GetNumVideoDisplays(); + + if (displays < 0) +@@ -69,7 +76,7 @@ bool Launcher::GraphicsPage::setupSDL() + msgBox.exec(); + return false; + } +- ++#endif + screenComboBox->clear(); + for (int i = 0; i < displays; i++) + { +@@ -168,9 +175,30 @@ void Launcher::GraphicsPage::saveSettings() + mEngineSettings.setInt("screen", "Video", cScreen); + } + ++#ifdef __HAIKU__ ++static QString makeModeString(int w, int h) ++{ ++ QString aspect = getAspect(w, h); ++ QString resolution = QString::number(w) + QString(" x ") + QString::number(h); ++ if (aspect == QLatin1String("16:9") || aspect == QLatin1String("16:10")) { ++ resolution.append(" (Wide " + aspect + ")"); ++ } else if (aspect == QLatin1String("4:3")) { ++ resolution.append(" (Standard 4:3)"); ++ } ++ return resolution; ++} ++#endif ++ + QStringList Launcher::GraphicsPage::getAvailableResolutions(int screen) + { + QStringList result; ++#ifdef __HAIKU__ ++ BScreen mainScreen(B_MAIN_SCREEN_ID); ++ result.append(makeModeString(640, 480)); ++ result.append(makeModeString(800, 600)); ++ result.append(makeModeString(1024, 768)); ++ result.append(makeModeString(mainScreen.Frame().Width() + 1, mainScreen.Frame().Height() + 1)); ++#else + SDL_DisplayMode mode; + int modeIndex, modes = SDL_GetNumDisplayModes(screen); + +@@ -210,7 +238,7 @@ QStringList Launcher::GraphicsPage::getAvailableResolutions(int screen) + + result.append(resolution); + } +- ++#endif + result.removeDuplicates(); + return result; + } +diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp +index 2982a30..358380c 100644 +--- a/apps/launcher/maindialog.cpp ++++ b/apps/launcher/maindialog.cpp +@@ -171,7 +171,11 @@ Launcher::FirstRunDialogResult Launcher::MainDialog::showFirstRunDialog() + + if (msgBox.clickedButton() == wizardButton) + { ++#ifdef __HAIKU__ ++ if (!mWizardInvoker->startProcess(QLatin1String("OpenMW-Wizard"), false)) { ++#else + if (!mWizardInvoker->startProcess(QLatin1String("openmw-wizard"), false)) { ++#endif + return FirstRunDialogResultFailure; + } else { + return FirstRunDialogResultWizard; +@@ -390,7 +394,11 @@ bool Launcher::MainDialog::setupGameData() + + if (msgBox.clickedButton() == wizardButton) + { ++#ifdef __HAIKU__ ++ if (!mWizardInvoker->startProcess(QLatin1String("OpenMW-Wizard"), false)) { ++#else + if (!mWizardInvoker->startProcess(QLatin1String("openmw-wizard"), false)) { ++#endif + return false; + } else { + return true; +@@ -599,6 +607,10 @@ void Launcher::MainDialog::play() + + // Launch the game detached + ++#ifdef __HAIKU__ ++ if (mGameInvoker->startProcess(QLatin1String("OpenMW"), true)) ++#else + if (mGameInvoker->startProcess(QLatin1String("openmw"), true)) ++#endif + return qApp->quit(); + } +diff --git a/apps/launcher/sdlinit.cpp b/apps/launcher/sdlinit.cpp +index 1fe1fd4..22e816f 100644 +--- a/apps/launcher/sdlinit.cpp ++++ b/apps/launcher/sdlinit.cpp +@@ -5,6 +5,7 @@ + + bool initSDL() + { ++#ifndef __HAIKU__ + SDL_SetHint(SDL_HINT_RENDER_DRIVER, "software"); + SDL_SetMainReady(); + // Required for determining screen resolution and such on the Graphics tab +@@ -14,12 +15,14 @@ bool initSDL() + } + signal(SIGINT, SIG_DFL); // We don't want to use the SDL event loop in the launcher, + // so reset SIGINT which SDL wants to redirect to an SDL_Quit event. +- ++#endif + return true; + } + + void quitSDL() + { ++#ifndef __HAIKU__ + // Disconnect from SDL processes + SDL_Quit(); ++#endif + } +diff --git a/apps/launcher/settingspage.cpp b/apps/launcher/settingspage.cpp +index 843b513..59afde7 100644 +--- a/apps/launcher/settingspage.cpp ++++ b/apps/launcher/settingspage.cpp +@@ -96,8 +96,11 @@ Launcher::SettingsPage::~SettingsPage() + void Launcher::SettingsPage::on_wizardButton_clicked() + { + mMain->writeSettings(); +- ++#ifdef __HAIKU__ ++ if (!mWizardInvoker->startProcess(QLatin1String("OpenMW-Wizard"), false)) ++#else + if (!mWizardInvoker->startProcess(QLatin1String("openmw-wizard"), false)) ++#endif + return; + } + +diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp +index 176adfa..2c69d45 100644 +--- a/apps/openmw/main.cpp ++++ b/apps/openmw/main.cpp +@@ -243,6 +243,11 @@ int runApplication(int argc, char *argv[]) + boost::filesystem::current_path(binary_path.parent_path()); + setenv("OSG_GL_TEXTURE_STORAGE", "OFF", 0); + #endif ++#ifdef __HAIKU__ ++ boost::filesystem::path binary_path = boost::filesystem::system_complete(boost::filesystem::path(argv[0])); ++ boost::filesystem::current_path(binary_path.parent_path()); ++ setenv("OPENMW_DECOMPRESS_TEXTURES", "1", 1); ++#endif + + Files::ConfigurationManager cfgMgr; + std::unique_ptr engine; +diff --git a/components/crashcatcher/crashcatcher.cpp b/components/crashcatcher/crashcatcher.cpp +index 64824b6..11caea9 100644 +--- a/components/crashcatcher/crashcatcher.cpp ++++ b/components/crashcatcher/crashcatcher.cpp +@@ -12,7 +12,9 @@ + + #include + #include ++#ifndef __HAIKU__ + #include ++#endif + + #include + +diff --git a/components/crashcatcher/crashcatcher.hpp b/components/crashcatcher/crashcatcher.hpp +index fd8f0d1..5b1bc71 100644 +--- a/components/crashcatcher/crashcatcher.hpp ++++ b/components/crashcatcher/crashcatcher.hpp +@@ -3,7 +3,7 @@ + + #include + +-#if (defined(__APPLE__) || (defined(__linux) && !defined(ANDROID)) || (defined(__unix) && !defined(ANDROID)) || defined(__posix)) ++#if (defined(__APPLE__) || (defined(__linux) && !defined(ANDROID) && !defined(__HAIKU__)) || (defined(__unix) && !defined(ANDROID) && !defined(__HAIKU__)) || defined(__posix)) + #define USE_CRASH_CATCHER 1 + #else + #define USE_CRASH_CATCHER 0 +diff --git a/components/debug/debugging.cpp b/components/debug/debugging.cpp +index a4c59c2..17d3e29 100644 +--- a/components/debug/debugging.cpp ++++ b/components/debug/debugging.cpp +@@ -52,6 +52,9 @@ namespace Debug + + int wrapApplication(int (*innerApplication)(int argc, char *argv[]), int argc, char *argv[], const std::string& appName) + { ++#ifdef __HAIKU ++ return innerApplication(argc, argv); ++#else + // Some objects used to redirect cout and cerr + // Scope must be here, so this still works inside the catch block for logging exceptions + std::streambuf* cout_rdbuf = std::cout.rdbuf (); +@@ -113,4 +116,5 @@ int wrapApplication(int (*innerApplication)(int argc, char *argv[]), int argc, c + std::cerr.rdbuf(cerr_rdbuf); + + return ret; ++#endif + } +diff --git a/components/files/fixedpath.hpp b/components/files/fixedpath.hpp +index 2e72b81..97c43f0 100644 +--- a/components/files/fixedpath.hpp ++++ b/components/files/fixedpath.hpp +@@ -4,7 +4,7 @@ + #include + #include + +-#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) ++#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__HAIKU__) + #ifndef ANDROID + #include + namespace Files { typedef LinuxPath TargetPathType; } +diff --git a/components/files/linuxpath.cpp b/components/files/linuxpath.cpp +index 1f6a3d9..d8cc728 100644 +--- a/components/files/linuxpath.cpp ++++ b/components/files/linuxpath.cpp +@@ -1,6 +1,6 @@ + #include "linuxpath.hpp" + +-#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) ++#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__HAIKU__) + + #include + #include +@@ -54,17 +54,32 @@ LinuxPath::LinuxPath(const std::string& application_name) + + boost::filesystem::path LinuxPath::getUserConfigPath() const + { ++#ifdef __HAIKU__ ++ boost::filesystem::path path("/boot/home/config/settings"); ++ return path / mName; ++#else + return getEnv("XDG_CONFIG_HOME", getUserHome() / ".config") / mName; ++#endif + } + + boost::filesystem::path LinuxPath::getUserDataPath() const + { ++#ifdef __HAIKU__ ++ boost::filesystem::path path("/boot/home/config/settings"); ++ return path / mName; ++#else + return getEnv("XDG_DATA_HOME", getUserHome() / ".local/share") / mName; ++#endif + } + + boost::filesystem::path LinuxPath::getCachePath() const + { ++#ifdef __HAIKU__ ++ boost::filesystem::path path("/boot/home/config/cache"); ++ return path / mName; ++#else + return getEnv("XDG_CACHE_HOME", getUserHome() / ".cache") / mName; ++#endif + } + + boost::filesystem::path LinuxPath::getGlobalConfigPath() const +diff --git a/components/files/linuxpath.hpp b/components/files/linuxpath.hpp +index 7950157..32ff3d8 100644 +--- a/components/files/linuxpath.hpp ++++ b/components/files/linuxpath.hpp +@@ -1,7 +1,7 @@ + #ifndef COMPONENTS_FILES_LINUXPATH_H + #define COMPONENTS_FILES_LINUXPATH_H + +-#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) ++#if defined(__linux__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__HAIKU__) + + #include + +-- +2.19.1 + + +From c7b68b8fbf130e80548a5ff348113dfd86277810 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sun, 7 Oct 2018 16:49:50 +1000 +Subject: Remove SDL_WINDOW_RESIZABLE flag for haiku + + +diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp +index 057113b..f517a24 100644 +--- a/apps/openmw/engine.cpp ++++ b/apps/openmw/engine.cpp +@@ -336,7 +336,11 @@ void OMW::Engine::createWindow(Settings::Manager& settings) + pos_y = SDL_WINDOWPOS_UNDEFINED_DISPLAY(screen); + } + ++#ifdef __HAIKU__ ++ Uint32 flags = SDL_WINDOW_OPENGL|SDL_WINDOW_SHOWN; ++#else + Uint32 flags = SDL_WINDOW_OPENGL|SDL_WINDOW_SHOWN|SDL_WINDOW_RESIZABLE; ++#endif + if(fullscreen) + flags |= SDL_WINDOW_FULLSCREEN; + +-- +2.19.1 +