From 3970d180476787b9659d5e32fb371f66deafd4e4 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Wed, 12 Apr 2017 21:01:34 +0200 Subject: [PATCH] puri: use HaikuArchives, disable sound. * depends on stockfish. * communication with the engine seems rather unstable. * the 3d view is broken (at least on x86_64). --- .../puri/patches/puri-0.3.9.1.patchset | 182 ++++++++++++++++++ haiku-games/puri/puri-0.3.9.1.recipe | 32 +-- 2 files changed, 200 insertions(+), 14 deletions(-) create mode 100644 haiku-games/puri/patches/puri-0.3.9.1.patchset diff --git a/haiku-games/puri/patches/puri-0.3.9.1.patchset b/haiku-games/puri/patches/puri-0.3.9.1.patchset new file mode 100644 index 000000000..e1d4f9423 --- /dev/null +++ b/haiku-games/puri/patches/puri-0.3.9.1.patchset @@ -0,0 +1,182 @@ +From 0ee1acb63f6f114cc77cef327e9a77981c4d15b9 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Wed, 12 Apr 2017 20:07:28 +0200 +Subject: Fix build, disable sound. + + +diff --git a/Jamfile b/Jamfile +index 8f1350f..88d2e79 100644 +--- a/Jamfile ++++ b/Jamfile +@@ -1,4 +1,4 @@ + SubDir TOP ; + +-SubInclude TOP source ; ++SubInclude TOP src ; + SubInclude TOP libs ; +diff --git a/libs/columnlistview/ColumnListView.cpp b/libs/columnlistview/ColumnListView.cpp +index 91bf16a..c608989 100644 +--- a/libs/columnlistview/ColumnListView.cpp ++++ b/libs/columnlistview/ColumnListView.cpp +@@ -2376,7 +2376,7 @@ void + TitleView::DrawTitle(BView* view, BRect rect, BColumn* column, bool depressed) + { + BRect drawRect; +- rgb_color borderColor = mix_color( ++ rgb_color borderColor = ::mix_color( + fMasterView->Color(B_COLOR_HEADER_BACKGROUND), + make_color(0, 0, 0), 128); + rgb_color backgroundColor; +@@ -2389,19 +2389,19 @@ TitleView::DrawTitle(BView* view, BRect rect, BColumn* column, bool depressed) + drawRect = rect; + drawRect.InsetBy(2, 2); + if (depressed) { +- backgroundColor = mix_color( ++ backgroundColor = ::mix_color( + fMasterView->Color(B_COLOR_HEADER_BACKGROUND), + make_color(0, 0, 0), 64); +- bevelHigh = mix_color(backgroundColor, make_color(0, 0, 0), 64); +- bevelLow = mix_color(backgroundColor, make_color(255, 255, 255), ++ bevelHigh = ::mix_color(backgroundColor, make_color(0, 0, 0), 64); ++ bevelLow = ::mix_color(backgroundColor, make_color(255, 255, 255), + 128); + drawRect.left++; + drawRect.top++; + } else { + backgroundColor = fMasterView->Color(B_COLOR_HEADER_BACKGROUND); +- bevelHigh = mix_color(backgroundColor, make_color(255, 255, 255), ++ bevelHigh = ::mix_color(backgroundColor, make_color(255, 255, 255), + 192); +- bevelLow = mix_color(backgroundColor, make_color(0, 0, 0), 64); ++ bevelLow = ::mix_color(backgroundColor, make_color(0, 0, 0), 64); + drawRect.bottom--; + drawRect.right--; + } +diff --git a/src/BoardWindow.cpp b/src/BoardWindow.cpp +index f28930e..cfdd70d 100644 +--- a/src/BoardWindow.cpp ++++ b/src/BoardWindow.cpp +@@ -1096,9 +1096,9 @@ BoardWindow::_SaveSettings(void) + { + Settings settings("BoardWindow"); + settings +- << "Split10" << fSplitView->ItemWeight(0L) ++ << "Split10" << fSplitView->ItemWeight((int32)0) + << "Split11" << fSplitView->ItemWeight(1L) +- << "Split20" << fMaterialSV->ItemWeight(0L) ++ << "Split20" << fMaterialSV->ItemWeight((int32)0) + << "Split21" << fMaterialSV->ItemWeight(1L) + << "Split22" << fMaterialSV->ItemWeight(2L) + << "EngineSkill" << fSkillSlider->Value() +diff --git a/src/ChessBoardView.cpp b/src/ChessBoardView.cpp +index 158aa77..8fd0d86 100644 +--- a/src/ChessBoardView.cpp ++++ b/src/ChessBoardView.cpp +@@ -68,7 +68,7 @@ ChessBoardView::ChessBoardView(BRect const& frame) + + array sounds = {{"newgame.ogg", "move.ogg", "castle.ogg", + "capture.ogg", "illegal.ogg", "gong.ogg"}}; +- ++#if 0 + for (unsigned int i = 0; i < sounds.size(); ++i) { + fSound.push_back( new BSimpleGameSound( + BString(tempPath).Append(sounds[i]) ) ); +@@ -76,7 +76,9 @@ ChessBoardView::ChessBoardView(BRect const& frame) + if (fSound.back()->InitCheck() != B_OK) + fPlaySound = false; + } +- ++#else ++ fPlaySound = false; ++#endif + if (fPlaySound == false) + !out << "NO SOUND" << std::endl; + else +diff --git a/src/Debug.h b/src/Debug.h +index fdde1ed..bb6bb70 100644 +--- a/src/Debug.h ++++ b/src/Debug.h +@@ -90,7 +90,7 @@ public: + return( *this ); + } + +- Debug& operator<<(int32 number) ++ Debug& operator<<(long number) + { + fStr << number; + return *this; +diff --git a/src/Engine.cpp b/src/Engine.cpp +index 4457ca0..8468137 100644 +--- a/src/Engine.cpp ++++ b/src/Engine.cpp +@@ -36,7 +36,7 @@ Engine::Engine(BString name, uint32 replyCode, BLooper* targetLooper, + fTargetHandler = targetHandler; + + fEngineName = name; +- fEnginePath = Tools::AppPath().Append("/Engines/").Append( name ); ++ fEnginePath = name; + + !out << "ENGINE-PATH: " << fEnginePath << std::endl; + +diff --git a/src/ICSMainWindow.cpp b/src/ICSMainWindow.cpp +index 7a8f827..da4a95a 100644 +--- a/src/ICSMainWindow.cpp ++++ b/src/ICSMainWindow.cpp +@@ -265,7 +265,7 @@ ICSMainWindow::_ParseBlock(const char*& p1) + + if ((p2 = strchr(p1, BLOCK_END)) != NULL) { + strncpy(str.LockBuffer(65356), p1, p2 - p1); +- str[p2 - p1] = '\0'; ++ str.SetByteAt(p2 - p1, '\0'); + str.UnlockBuffer(); + p1 = p2; + } else { +@@ -615,13 +615,13 @@ ICSMainWindow::_SaveSettings(void) + { + Settings settings("ics_wnd"); + settings +- << "Split10" << (float)fSplitView1->ItemWeight(0L) ++ << "Split10" << (float)fSplitView1->ItemWeight((int32)0) + << "Split11" << (float)fSplitView1->ItemWeight(1L) +- << "Split20" << (float)fSplitView2->ItemWeight(0L) ++ << "Split20" << (float)fSplitView2->ItemWeight((int32)0) + << "Split21" << (float)fSplitView2->ItemWeight(1L) +- << "Split30" << (float)fSplitView3->ItemWeight(0L) ++ << "Split30" << (float)fSplitView3->ItemWeight((int32)0) + << "Split31" << (float)fSplitView3->ItemWeight(1L) +- << "Split40" << (float)fSplitView4->ItemWeight(0L) ++ << "Split40" << (float)fSplitView4->ItemWeight((int32)0) + << "Split41" << (float)fSplitView4->ItemWeight(1L) + << std::endl; + } +diff --git a/src/Jamfile b/src/Jamfile +index 86971b7..922e43f 100644 +--- a/src/Jamfile ++++ b/src/Jamfile +@@ -1,13 +1,9 @@ +-SubDir TOP source ; ++SubDir TOP src ; + + SEARCH_SOURCE += [ FDirName $(TOP) libs columnlistview ] ; +-SEARCH_SOURCE += [ FDirName $(TOP) source lib3ds ] ; + + DEFINES = DEBUG=0 VERSION=0.4 ; + C++FLAGS = -std=c++0x -fpermissive -Wfatal-errors -fmax-errors=1 ; +-LINKFLAGS = -lstdc++ ; +-LINKLIBS += -L`finddir B_COMMON_LIB_DIRECTORY` ; +-LINKLIBS += -L$(TOP)/source/lib3ds ; + + Application Puri : + BackBoard.cpp +@@ -46,7 +42,7 @@ Application Puri : + SidebarView.cpp + TimeView.cpp + ToolBar.cpp +- : be $(TARGET_LIBSTDC++) png GL GLU glut 3ds ++ : be stdc++ png GL GLU glut 3ds + translation tracker game network + libcolumnlistview.a + ; +-- +2.11.0 + diff --git a/haiku-games/puri/puri-0.3.9.1.recipe b/haiku-games/puri/puri-0.3.9.1.recipe index 0f14f716a..6c39918a1 100644 --- a/haiku-games/puri/puri-0.3.9.1.recipe +++ b/haiku-games/puri/puri-0.3.9.1.recipe @@ -1,16 +1,18 @@ SUMMARY="A 2D and 3D chess game" DESCRIPTION="Puri is a 2D and 3D chess game. You can play against a computer, or play \ online against other people." -HOMEPAGE="https://gitorious.org/puri-master-of-chess/puri/" +HOMEPAGE="https://github.com/HaikuArchives/Puri/" COPYRIGHT="2010-2012 Haiku Inc." LICENSE="MIT" -REVISION="1" -SOURCE_URI="https://gitorious.org/puri-master-of-chess/puri/archive/59b5db4b337fc432b64a7d099f7b7e0fc8ece3c7.tar.gz" -CHECKSUM_SHA256="9635f5af5c154855dfe6a1496caa3373dcabc4fe875039cd0f05c438576e83cd" -SOURCE_DIR="puri-master-of-chess-puri" -SOURCE_FILENAME="puri-$portVersion.tar.gz" +REVISION="2" +gitCommit="7f94abc9e8022b3e25eb4563b7fe45a4db360dfb" +SOURCE_URI="$HOMEPAGE/archive/$gitCommit.tar.gz" +CHECKSUM_SHA256="81956261b2e64ce26b481963b94d80c8512a73730d372669ee5a511309958121" +SOURCE_DIR="Puri-$gitCommit" +SOURCE_FILENAME="puri-$gitCommit.tar.gz" +PATCHES="puri-$portVersion.patchset" -ARCHITECTURES="?x86 ?x86_64" +ARCHITECTURES="?x86 x86_64" SECONDARY_ARCHITECTURES="!x86_gcc2 x86" PROVIDES=" @@ -20,14 +22,19 @@ PROVIDES=" REQUIRES=" haiku$secondaryArchSuffix - lib:libpng$secondaryArchSuffix + lib:lib3ds$secondaryArchSuffix + lib:libpng16$secondaryArchSuffix + lib:libgl$secondaryArchSuffix lib:libglu$secondaryArchSuffix + cmd:stockfish " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel + devel:lib3ds$secondaryArchSuffix + devel:libgl$secondaryArchSuffix devel:libglu$secondaryArchSuffix - devel:libpng$secondaryArchSuffix + devel:libpng16$secondaryArchSuffix " BUILD_PREREQUIRES=" gcc$secondaryArchSuffix @@ -40,19 +47,16 @@ BUILD_PREREQUIRES=" BUILD() { - jam + jam $jobArgs } INSTALL() { - cd source - + cd src mkdir -p $appsDir/Puri cp Puri $appsDir/Puri addAppDeskbarSymlink $appsDir/Puri/Puri cp -R data $appsDir/Puri/data - cp -R Engines $appsDir/Puri/Engines - chmod 755 $appsDir/Puri/Engines/stockfish }