pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/42850: Haiku OS support for devel/bmake



>Number:         42850
>Category:       pkg
>Synopsis:       Haiku OS support for devel/bmake
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 20 07:00:00 +0000 2010
>Originator:     OBATA Akio
>Release:        Haiku R1/alpha1
>Organization:
>Environment:
System: Haiku shredder 1 r33109 Sep 12 2009 17:45:45 BePC Haiku
Architecture: x86-32
Machine: BePC
>Description:
        Failed to build devel/bmake on Haiku R1/alpha1.
        This issue is the last stopper of bootstrap pkgsrc on Haiku OS.

        1) arch.c
           Haiku does not have "ar.h", so need to define struct ar_hdr, ARMAG
           and SARMAG with standard values if not exists.
           (for struct ar_hdr, maybe better to detect in configure).

        2) os.h
           Need to detect MACHINE_ARCH for Haiku
           (neither uname -m nor -p return suitable variables).

        3) unit-tests
           In unit-tests/modmisc, it is expected that /usr/bin and /usr/sbin
           exists, but Haiku OS does not have those directories. 
           So function correctly, but not as expected, then failed to unit test.

>How-To-Repeat:
        bootstrap pkgsrc on Haiku OS.
>Fix:
        Following patch fixes 1 and 2.
        for 3, need to change test patterns, or disable unit-tests on Haiku.
        (I already sent to sjg@ about a month ago, but no response)

Index: arch.c
===================================================================
RCS file: /cvsroot/pkgsrc/devel/bmake/files/arch.c,v
retrieving revision 1.4
diff -u -r1.4 arch.c
--- arch.c      18 Sep 2009 21:27:25 -0000      1.4
+++ arch.c      22 Jan 2010 13:02:26 -0000
@@ -139,6 +139,19 @@
 #include    <ctype.h>
 #ifdef HAVE_AR_H
 #include    <ar.h>
+#else
+struct ar_hdr {
+        char ar_name[16];               /* name */
+        char ar_date[12];               /* modification time */
+        char ar_uid[6];                 /* user id */
+        char ar_gid[6];                 /* group id */
+        char ar_mode[8];                /* octal file permissions */
+        char ar_size[10];               /* size in bytes */
+#ifndef ARFMAG
+#define ARFMAG  "`\n"
+#endif
+        char ar_fmag[2];                /* consistency check */
+};
 #endif
 #if defined(HAVE_RANLIB_H) && !(defined(__ELF__) || defined(NO_RANLIB))
 #include    <ranlib.h>
@@ -204,6 +217,12 @@
 #ifndef  AR_FMAG
 # define AR_FMAG ar_fmag
 #endif
+#ifndef ARMAG
+# define ARMAG "!<arch>\n"
+#endif
+#ifndef SARMAG
+# define SARMAG        8
+#endif
 
 #define AR_MAX_NAME_LEN            (sizeof(arh.AR_NAME)-1)
 
Index: os.sh
===================================================================
RCS file: /cvsroot/pkgsrc/devel/bmake/files/os.sh,v
retrieving revision 1.3
diff -u -r1.3 os.sh
--- os.sh       9 Mar 2008 19:54:29 -0000       1.3
+++ os.sh       22 Jan 2010 13:02:26 -0000
@@ -177,6 +177,13 @@
        x86pc)  MACHINE_ARCH=i386;;
        esac
        ;;
+Haiku)
+       case $MACHINE in
+       BeBox)  MACHINE_ARCH=powerpc;;
+       BeMac)  MACHINE_ARCH=powerpc;;
+       BePC)   MACHINE_ARCH=i386;;
+       esac
+       ;;
 esac
 
 HOSTNAME=${HOSTNAME:-`( hostname ) 2>/dev/null`}



Home | Main Index | Thread Index | Old Index