mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
documentviewer: Add patches for x86_64
* Enable x86_64 * Add checksums * Add patch to build on x86_64 (int32 is *not* for pointers!) * Remove object files before building (Yes, the source really included .o and .a files) * Call jam with -q to fail early
This commit is contained in:
@@ -6,9 +6,13 @@ LICENSE="MIT"
|
||||
COPYRIGHT="2010-2012 Haiku, Inc"
|
||||
HOMEPAGE="http://haiku.bplaced.net/"
|
||||
SRC_URI="http://haiku.bplaced.net/DocumentViewer/sources/documentviewer-0.3.2.zip"
|
||||
CHECKSUM_SIZE="300252"
|
||||
CHECKSUM_MD5="1fddc4292ecb14f343eb18b0bf723b13"
|
||||
CHECKSUM_RMD160="91389103af4c2448602580f321fa574bcd488948"
|
||||
CHECKSUM_SHA512="359dcb532f423df4c6ad612ebce9e5752928d8f45f6e9eec77d1bdcc9d054456badc837380759ad91d073038a5e33972b682527ef70190830cdffaec0619b533"
|
||||
REVISION="2"
|
||||
ARCHITECTURES="x86"
|
||||
PATCHES="documentviewer-0.3.2.patchset"
|
||||
ARCHITECTURES="x86 x86_64"
|
||||
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
|
||||
# x86_gcc2 is fine as primary target architecture as long as we're building
|
||||
# for a different secondary architecture.
|
||||
@@ -45,15 +49,18 @@ BUILD_REQUIRES="
|
||||
"
|
||||
|
||||
BUILD_PREREQUIRES="
|
||||
cmd:jam
|
||||
cmd:find
|
||||
cmd:g++$secondaryArchSuffix
|
||||
cmd:jam
|
||||
"
|
||||
|
||||
SOURCE_DIR="documentviewer-0.3.2"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
jam
|
||||
# Yes, the source package actually contains binaries...
|
||||
find . \( -name '*.o' -or -name '*.a' \) -delete
|
||||
jam -q
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
|
||||
139
haiku-apps/documentviewer/patches/documentviewer-0.3.2.patchset
Normal file
139
haiku-apps/documentviewer/patches/documentviewer-0.3.2.patchset
Normal file
@@ -0,0 +1,139 @@
|
||||
From 37a6e0dc8fa52531136c65ae8e0797bb1557fc89 Mon Sep 17 00:00:00 2001
|
||||
From: Jonathan Schleifer <js@webkeks.org>
|
||||
Date: Mon, 24 Mar 2014 22:12:11 +0100
|
||||
Subject: [PATCH] Fix compilation on x86_64
|
||||
|
||||
---
|
||||
application/Debug.h | 4 ++--
|
||||
application/ImageButton.cpp | 10 ++++++----
|
||||
application/MainWindow.cpp | 8 ++++----
|
||||
application/Tools.h | 10 ++++++----
|
||||
libs/columnlistview/ColumnListView.cpp | 4 ++--
|
||||
5 files changed, 20 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/application/Debug.h b/application/Debug.h
|
||||
index 0cdf14a..ee14cef 100644
|
||||
--- a/application/Debug.h
|
||||
+++ b/application/Debug.h
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
return( *this );
|
||||
}
|
||||
|
||||
- Debug& operator<<(int32 number)
|
||||
+ Debug& operator<<(long number)
|
||||
{
|
||||
fStr << number;
|
||||
return *this;
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
Debug& operator<<(int) { return *this; }
|
||||
Debug& operator<<(uint) { return *this; }
|
||||
Debug& operator<<(char) { return *this; }
|
||||
- Debug& operator<<(int32) { return *this; }
|
||||
+ Debug& operator<<(long) { return *this; }
|
||||
bool const& state(void) { return fState; }
|
||||
void Clear(void) { }
|
||||
|
||||
diff --git a/application/ImageButton.cpp b/application/ImageButton.cpp
|
||||
index fc1ed66..2609613 100644
|
||||
--- a/application/ImageButton.cpp
|
||||
+++ b/application/ImageButton.cpp
|
||||
@@ -8,6 +8,8 @@
|
||||
*/
|
||||
#include "ImageButton.h"
|
||||
|
||||
+#include <stdint.h>
|
||||
+
|
||||
#include <algorithm>
|
||||
|
||||
#include <Application.h>
|
||||
@@ -248,12 +250,12 @@ ImageButton::_RescaleBitmap(const BBitmap* src, int32 width, int32 height)
|
||||
void* srcData = src->Bits();
|
||||
|
||||
for (int32 y = 0; y <= height; y++) {
|
||||
- void* dstRow = (void*)((uint32)dstData + (uint32)(y * dstYOff));
|
||||
- void* srcRow = (void*)((uint32)srcData + ((uint32)(y * dy) * srcYOff));
|
||||
+ void* dstRow = (void*)((uintptr_t)dstData + (uintptr_t)(y * dstYOff));
|
||||
+ void* srcRow = (void*)((uintptr_t)srcData + ((uintptr_t)(y * dy) * srcYOff));
|
||||
|
||||
for (int32 x = 0; x <= width; x++)
|
||||
- memcpy((void*)((uint32)dstRow + (x * bpp)), (void*)((uint32)srcRow
|
||||
- + ((uint32)(x * dx) * bpp)), bpp);
|
||||
+ memcpy((void*)((uintptr_t)dstRow + (x * bpp)), (void*)((uintptr_t)srcRow
|
||||
+ + ((uintptr_t)(x * dx) * bpp)), bpp);
|
||||
}
|
||||
|
||||
return res;
|
||||
diff --git a/application/MainWindow.cpp b/application/MainWindow.cpp
|
||||
index e8002bd..af73601 100644
|
||||
--- a/application/MainWindow.cpp
|
||||
+++ b/application/MainWindow.cpp
|
||||
@@ -316,10 +316,10 @@ MainWindow::_SaveSettings(void)
|
||||
|
||||
if (fDocumentLayout != nullptr) {
|
||||
settings
|
||||
- << "Split10" << fSplitView1->ItemWeight(0L)
|
||||
- << "Split11" << fSplitView1->ItemWeight(1L)
|
||||
- << "Split20" << fSplitView2->ItemWeight(0L)
|
||||
- << "Split21" << fSplitView2->ItemWeight(1L)
|
||||
+ << "Split10" << fSplitView1->ItemWeight(0)
|
||||
+ << "Split11" << fSplitView1->ItemWeight(1)
|
||||
+ << "Split20" << fSplitView2->ItemWeight(0)
|
||||
+ << "Split21" << fSplitView2->ItemWeight(1)
|
||||
<< "RibbonTab" << fRibbon->ActiveTab()
|
||||
<< "SidebarTab" << fTabView1->Selection()
|
||||
<< "Fullscreen" << (int32)fFullscreenIsOn
|
||||
diff --git a/application/Tools.h b/application/Tools.h
|
||||
index 4941ac0..f994a6b 100644
|
||||
--- a/application/Tools.h
|
||||
+++ b/application/Tools.h
|
||||
@@ -9,6 +9,8 @@
|
||||
#ifndef TOOLS_H
|
||||
#define TOOLS_H
|
||||
|
||||
+#include <stdint.h>
|
||||
+
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
@@ -266,12 +268,12 @@ public:
|
||||
void* srcData = src->Bits();
|
||||
|
||||
for (int32 y = 0; y <= height; y++) {
|
||||
- void* dstRow = (void*)((uint32)dstData + (uint32)(y * dstYOff));
|
||||
- void* srcRow = (void*)((uint32)srcData + ((uint32)(y * dy) * srcYOff));
|
||||
+ void* dstRow = (void*)((uintptr_t)dstData + (uintptr_t)(y * dstYOff));
|
||||
+ void* srcRow = (void*)((uintptr_t)srcData + ((uintptr_t)(y * dy) * srcYOff));
|
||||
|
||||
for (int32 x = 0; x <= width; x++)
|
||||
- memcpy((void*)((uint32)dstRow + (x * bpp)), (void*)((uint32)srcRow
|
||||
- + ((uint32)(x * dx) * bpp)), bpp);
|
||||
+ memcpy((void*)((uintptr_t)dstRow + (x * bpp)), (void*)((uintptr_t)srcRow
|
||||
+ + ((uintptr_t)(x * dx) * bpp)), bpp);
|
||||
}
|
||||
|
||||
std::unique_ptr<BBitmap> bitmap(res);
|
||||
diff --git a/libs/columnlistview/ColumnListView.cpp b/libs/columnlistview/ColumnListView.cpp
|
||||
index baa05a2..fe3bbcb 100644
|
||||
--- a/libs/columnlistview/ColumnListView.cpp
|
||||
+++ b/libs/columnlistview/ColumnListView.cpp
|
||||
@@ -454,7 +454,7 @@ BRow::BRow(float height)
|
||||
BRow::~BRow()
|
||||
{
|
||||
while (true) {
|
||||
- BField* field = (BField*) fFields.RemoveItem(0L);
|
||||
+ BField* field = (BField*) fFields.RemoveItem(0);
|
||||
if (field == 0)
|
||||
break;
|
||||
|
||||
@@ -750,7 +750,7 @@ BColumnListView::BColumnListView(const char* name, uint32 flags,
|
||||
|
||||
BColumnListView::~BColumnListView()
|
||||
{
|
||||
- while (BColumn* column = (BColumn*)fColumns.RemoveItem(0L))
|
||||
+ while (BColumn* column = (BColumn*)fColumns.RemoveItem(0))
|
||||
delete column;
|
||||
}
|
||||
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
Reference in New Issue
Block a user