[packages/hfsplus-tools] - fix building on x32

baggins baggins at pld-linux.org
Tue Oct 23 00:03:35 CEST 2018


commit 597e32c46913d4f657c5344ce8d274b4089ccba0
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue Oct 23 00:03:22 2018 +0200

    - fix building on x32

 hfsplus-tools.spec |  7 ++++++-
 x32.patch          | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 54 insertions(+), 1 deletion(-)
---
diff --git a/hfsplus-tools.spec b/hfsplus-tools.spec
index abe9b02..57b490e 100644
--- a/hfsplus-tools.spec
+++ b/hfsplus-tools.spec
@@ -7,6 +7,7 @@ License:	APSL 2.0
 Group:		Base
 Source0:	http://cavan.codon.org.uk/~mjg59/diskdev_cmds/diskdev_cmds-%{version}.tar.gz
 # Source0-md5:	0435afc389b919027b69616ad1b05709
+Patch0:		x32.patch
 URL:		http://gentoo-wiki.com/HOWTO_hfsplus
 # note: it uses Clang "Blocks" extension
 BuildRequires:	clang
@@ -61,14 +62,18 @@ HFSX).
 
 %prep
 %setup -q -n diskdev_cmds-%{version}
+%patch0 -p1
 
 # remove errant execute bits
 find -type f -name '*.[ch]' -exec chmod -c a-x {} +
 
 %build
+%ifarch x32
+march="-mx32"
+%endif
 # note: keep CC=clang, not %{__cc}
 %{__make} \
-	CFLAGS="%{rpmcflags} -fblocks -Wall -I$(pwd)/BlocksRunTime -I$(pwd)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -DLINUX=1 -DBSD=1 -DVERSION=\\\"%{version}\\\"" \
+	CFLAGS="%{rpmcflags} -fblocks $march -Wall -I$(pwd)/BlocksRunTime -I$(pwd)/include -DDEBUG_BUILD=0 -D_FILE_OFFSET_BITS=64 -DLINUX=1 -DBSD=1 -DVERSION=\\\"%{version}\\\"" \
 	LDFLAGS="%{rpmldflags} -L$(pwd)/BlocksRunTime"
 
 %install
diff --git a/x32.patch b/x32.patch
new file mode 100644
index 0000000..6549dfd
--- /dev/null
+++ b/x32.patch
@@ -0,0 +1,48 @@
+--- diskdev_cmds-540.1.linux3/newfs_hfs.tproj/makehfs.c~	2012-02-02 23:36:59.000000000 +0100
++++ diskdev_cmds-540.1.linux3/newfs_hfs.tproj/makehfs.c	2018-10-23 00:01:04.652419886 +0200
+@@ -38,7 +38,9 @@
+ #endif
+ #include <sys/errno.h>
+ #include <sys/stat.h>
++#ifndef __ILP32__
+ #include <sys/sysctl.h>
++#endif
+ #if !LINUX
+ #include <sys/vmmeter.h>
+ #endif
+--- diskdev_cmds-540.1.linux3/fsck_hfs.tproj/fsck_hfs.c~	2012-02-16 20:59:54.000000000 +0100
++++ diskdev_cmds-540.1.linux3/fsck_hfs.tproj/fsck_hfs.c	2018-10-23 00:01:35.625938707 +0200
+@@ -30,7 +30,9 @@
+ #include <sys/ioctl.h>
+ #if !LINUX
+ #include <sys/disk.h>
++#ifndef __ILP32__
+ #include <sys/sysctl.h>
++#endif
+ #include <setjmp.h>
+ #endif
+ #include <hfs/hfs_mount.h>
+--- diskdev_cmds-540.1.linux3/fsck_hfs.tproj/utilities.c~	2012-02-01 18:17:19.000000000 +0100
++++ diskdev_cmds-540.1.linux3/fsck_hfs.tproj/utilities.c	2018-10-23 00:02:03.069484085 +0200
+@@ -70,7 +70,9 @@
+ #include <string.h>
+ #include <unistd.h> 
+ #include <stdlib.h>
++#ifndef __ILP32__
+ #include <sys/sysctl.h>
++#endif
+ 
+ #include "fsck_hfs.h"
+ 
+--- diskdev_cmds-540.1.linux3/fsck_hfs.tproj/dfalib/Scavenger.h~	2012-02-01 18:17:19.000000000 +0100
++++ diskdev_cmds-540.1.linux3/fsck_hfs.tproj/dfalib/Scavenger.h	2018-10-23 00:02:23.689671397 +0200
+@@ -48,7 +48,9 @@
+ #endif
+ #include <sys/errno.h>
+ #include <sys/param.h>
++#ifndef __ILP32__
+ #include <sys/sysctl.h>
++#endif
+ #include <sys/mount.h>
+ #include <hfs/hfs_mount.h>
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/hfsplus-tools.git/commitdiff/597e32c46913d4f657c5344ce8d274b4089ccba0



More information about the pld-cvs-commit mailing list