Files
haikuports/sys-apps/gptfdisk/patches/gptfdisk-1.0.1.patchset
fbrosson b6b2d09d3e gptfdisk: bump to version 1.0.1.
* Bump version.
* Add {lib,devel}:libpopt to {,BUILD_}REQUIRES.
* Set ARCHITECTURES to "x86_gcc2 x86 x86_64" instead of "!x86_gcc2".
* Add cmd:{cgdisk,fixparts,gdisk,sgdisk} to PROVIDES.
* Do not "make install" in INSTALL() because there is no such target
  in the makefile and, instead, call cmd:install.
* Fix patch to avoid including a missing sys/disk.h in support.h.
* Add patch to make diskio-unix.cc accept character devices on Haiku.
* Add patch to use the correct CRC32 polynom on big-endian machines
  in case someone wants to build and try Haiku on ppc.
2016-04-09 03:13:25 +00:00

112 lines
2.8 KiB
Plaintext

From 67b231749b7fdd10bfb4cd7ff6244e4848bfb6a1 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Wed, 22 Oct 2014 21:47:40 +0200
Subject: Preliminary Haiku support.
diff --git a/diskio.h b/diskio.h
index 631a43a..e343cb9 100644
--- a/diskio.h
+++ b/diskio.h
@@ -29,7 +29,7 @@
#include <sys/dkio.h>
#endif
-#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__)
+#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__) || defined (__APPLE__) || defined(__HAIKU__)
#define fstat64 fstat
#define stat64 stat
#endif
diff --git a/gptcurses.cc b/gptcurses.cc
index 6002077..4eb8aee 100644
--- a/gptcurses.cc
+++ b/gptcurses.cc
@@ -22,6 +22,7 @@
#include <iostream>
#include <string>
#include <sstream>
+#include <clocale>
#include <ncurses.h>
#include "gptcurses.h"
#include "support.h"
diff --git a/support.h b/support.h
index 7f691c3..b64cb16 100644
--- a/support.h
+++ b/support.h
@@ -16,6 +16,10 @@
#define lseek64 lseek
#endif
+#if defined(__HAIKU__)
+#define lseek64 lseek
+#endif
+
#if defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
#define DEFAULT_GPT_TYPE 0xA503
#endif
--
1.8.3.4
From 43151ba0e882e40163086578d5b6fbda1ec543f5 Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Fri, 8 Apr 2016 21:24:56 +0000
Subject: Accept character devices on Haiku.
diff --git a/diskio-unix.cc b/diskio-unix.cc
index af71cdb..38568ed 100644
--- a/diskio-unix.cc
+++ b/diskio-unix.cc
@@ -75,6 +75,7 @@ int DiskIO::OpenForRead(void) {
if (S_ISDIR(st.st_mode))
cerr << "The specified path is a directory!\n";
#if !(defined(__FreeBSD__) || defined(__FreeBSD_kernel__)) \
+ && !defined(__HAIKU__) \
&& !defined(__APPLE__)
else if (S_ISCHR(st.st_mode))
cerr << "The specified path is a character device!\n";
--
2.7.0
From ce3cdab4d24c693a97912c2550a6ace6a068836f Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Fri, 8 Apr 2016 21:24:56 +0000
Subject: Use the correct CRC32 polynom on big-endian architectures.
diff --git a/crc32.cc b/crc32.cc
index d253dd9..8da42ed 100644
--- a/crc32.cc
+++ b/crc32.cc
@@ -16,6 +16,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
+#include <posix/endian.h>
#include "crc32.h"
/* crc_tab[] -- this crcTable is being build by chksum_crc32GenTab().
@@ -52,7 +53,17 @@ void chksum_crc32gentab ()
unsigned long crc, poly;
int i, j;
+#if defined( BYTE_ORDER )
+# if defined( LITTLE_ENDIAN ) && (BYTE_ORDER == LITTLE_ENDIAN)
poly = 0xEDB88320L;
+# elif defined( BIG_ENDIAN ) && (BYTE_ORDER == BIG_ENDIAN)
+ poly = 0x04C11DB7L;
+# else
+# error Unknown byte-order
+# endif
+#else
+#error Undefined byte-order
+#endif
for (i = 0; i < 256; i++)
{
crc = i;
--
2.7.0