]> git.draconx.ca Git - gentoo-fixes.git/commitdiff
sys-devel/heirloom-devtools: Build fix for modern glibc.
authorNick Bowler <nbowler@draconx.ca>
Tue, 13 Nov 2018 02:50:09 +0000 (21:50 -0500)
committerNick Bowler <nbowler@draconx.ca>
Tue, 13 Nov 2018 02:56:53 +0000 (21:56 -0500)
Just add libtirpc to the global build flags.

sys-devel/heirloom-devtools/Manifest [new file with mode: 0644]
sys-devel/heirloom-devtools/files/heirloom-devtools-070527-64-bit.patch [new file with mode: 0644]
sys-devel/heirloom-devtools/files/heirloom-devtools-070527-gcc6.patch [new file with mode: 0644]
sys-devel/heirloom-devtools/files/heirloom-devtools-070527-solaris.patch [new file with mode: 0644]
sys-devel/heirloom-devtools/heirloom-devtools-070527-r2.ebuild [new file with mode: 0644]

diff --git a/sys-devel/heirloom-devtools/Manifest b/sys-devel/heirloom-devtools/Manifest
new file mode 100644 (file)
index 0000000..c67c0e5
--- /dev/null
@@ -0,0 +1,5 @@
+AUX heirloom-devtools-070527-64-bit.patch 1175 BLAKE2B 71bb0ca3b44fe2e8b6c369d3142806b984389f0804be801e180a3004919a138bb2f74b3ca119de2dc76f599ee0223a846005a10ebadd9011d29431e162b36888 SHA512 5523e670c9c9d57f0415e30d1aab4dfcd7d8ad74e2535136afbbe4c6e407c713e7801cbcbf7ddbe798ab2790fc196a2fdbf9d5295fa8c475c73360f5e3a27066
+AUX heirloom-devtools-070527-gcc6.patch 414 BLAKE2B cdd02368c95a0af5ef2b16cc737e7783da9205ab27fc9c1bc660603a583ff9c3324a3656bc35c950f80677db0281d4f34fe7648f71c839c6463ce21f5e9a7e61 SHA512 59742ba2e802b66b547ae3255995724098153daf0896a484afed868a8795e3f36e38a54d33254f81d3fb0c91f57cf3a78322b2bb10673e4bdedb37b7ff33473f
+AUX heirloom-devtools-070527-solaris.patch 5636 BLAKE2B cb8ef619a415a45f96201515736573daad7e170ddb7fb70ab8f508cc611fcf5ad9d286b2bda02b869c28e85a72917a876f37fb1e6ee7b54c6490b8d8ab3fcdb4 SHA512 335fdabef9b9a8b93ffa6eab2b66d2db11af29b24989c4b64ea64695cfadd4471c31a865c2fcb823c1f4c11eebc1babb53ab83c9c2bdf83c05f497faf16e3f1c
+DIST heirloom-devtools-070527.tar.bz2 381054 BLAKE2B 074f410f1a584b8ec06dec8bfd31db29e80623e91bb806b635be2a761beb7a5f184769df634d9fb11435a7515e78aabd21423cf0eaa55b801cb32d1aaae6862e SHA512 1f1f10a7b49402053172cc028bbd939a46fcf933994cb867fa40e8c5bbd7b1291575b3bac254cd79dc4fce3e3a2c88fe0f890449888fda16169c8e6a2540f055
+EBUILD heirloom-devtools-070527-r2.ebuild 2047 BLAKE2B 56f47b2d5ff1464e768a7ede5318b19f518de18b22ed4f61338512c1076d7c54eec01e61651ed043730a01b06c9b7b2ea64cac3d34106dbca6cb8d85c54d1e38 SHA512 959c31a4bb5e972dcfc14301092cc0af696ae8a63353f55c070bdc6ce7906f4e51caca9c7e1dad88c7acb55a44a8ad010ed8061128cd45f8a886c2383aafd34f
diff --git a/sys-devel/heirloom-devtools/files/heirloom-devtools-070527-64-bit.patch b/sys-devel/heirloom-devtools/files/heirloom-devtools-070527-64-bit.patch
new file mode 100644 (file)
index 0000000..d6c3cd7
--- /dev/null
@@ -0,0 +1,39 @@
+--- a/make/vroot/lock.cc       2007/01/18 15:06:32     1.1
++++ b/make/vroot/lock.cc       2007/10/01 11:44:26     1.2
+@@ -31,7 +31,7 @@
+ /*
+  * Portions Copyright (c) 2007 Gunnar Ritter, Freiburg i. Br., Germany
+  *
+- * Sccsid @(#)lock.cc 1.4 (gritter) 01/13/07
++ * Sccsid @(#)lock.cc 1.5 (gritter) 10/1/07
+  */
+ #include <avo/intl.h> /* for NOCATGETS */
+@@ -53,7 +53,7 @@
+ extern        int             sys_nerr;
+ #endif
+-static        void            file_lock_error(char *msg, char *file, char *str, int arg1, int arg2);
++static        void            file_lock_error(char *msg, char *file, char *str, const char *arg1, const char *arg2);
+ #define BLOCK_INTERUPTS sigfillset(&newset) ; \
+       sigprocmask(SIG_SETMASK, &newset, &oldset)
+@@ -123,7 +123,7 @@
+               if (errno != EEXIST) {
+                       file_lock_error(msg, name, NOCATGETS("symlink(%s, %s)"),
+-                          (int) name, (int) lockname);
++                          name, lockname);
+                       fprintf(stderr, "%s", msg);
+                       return errno;
+               }
+@@ -171,7 +171,8 @@
+  * Format a message telling why the lock could not be created.
+  */
+ static        void
+-file_lock_error(char *msg, char *file, char *str, int arg1, int arg2)
++file_lock_error(char *msg, char *file, char *str,
++      const char *arg1, const char *arg2)
+ {
+       int             len;
diff --git a/sys-devel/heirloom-devtools/files/heirloom-devtools-070527-gcc6.patch b/sys-devel/heirloom-devtools/files/heirloom-devtools-070527-gcc6.patch
new file mode 100644 (file)
index 0000000..01d1ab2
--- /dev/null
@@ -0,0 +1,11 @@
+--- heirloom-devtools-070527/make/bsd/bsd.cc.old       2016-09-21 22:36:56.556036181 -0400
++++ heirloom-devtools-070527/make/bsd/bsd.cc   2016-09-21 22:52:09.819186461 -0400
+@@ -50,7 +50,7 @@
+ extern SIG_PF
+ bsdsignal (int Signal, SIG_PF Handler)
+ {
+-  auto SIG_PF                   previous_handler;
++  SIG_PF                   previous_handler;
+ #ifdef SUN5_0
+ #ifdef sun
+   previous_handler = sigset (Signal, Handler);
diff --git a/sys-devel/heirloom-devtools/files/heirloom-devtools-070527-solaris.patch b/sys-devel/heirloom-devtools/files/heirloom-devtools-070527-solaris.patch
new file mode 100644 (file)
index 0000000..c6b3942
--- /dev/null
@@ -0,0 +1,230 @@
+diff --git a/make/include/mksh/defs.h b/make/include/mksh/defs.h
+index 1992205..8065a77 100644
+--- a/make/include/mksh/defs.h
++++ b/make/include/mksh/defs.h
+@@ -63,7 +63,6 @@
+ #include <widec.h>
+ #endif
+-#ifndef __sun
+ /*
+  * Definition of wchar functions.
+  */
+@@ -90,7 +89,6 @@
+ #     define wscmp(x,y) wcscmp(x,y)
+ #     undef wsncmp
+ #     define wsncmp(x,y,z) wcsncmp(x,y,z)
+-#endif
+ #if defined (__FreeBSD__) || defined (__APPLE__) || defined (__hpux)
+ extern "C" { wchar_t  *wcsdup(const wchar_t *s); }
+diff --git a/make/makestate/lock.c b/make/makestate/lock.c
+index cdf7562..aa6083e 100644
+--- a/make/makestate/lock.c
++++ b/make/makestate/lock.c
+@@ -42,18 +42,6 @@
+ #include <sys/errno.h>
+ #include <errno.h>            /* errno */
+-#if defined(_LP64)
+-/*
+- * The symbols _sys_errlist and _sys_nerr are not visible in the
+- * LP64 libc.  Use strerror(3C) instead.
+- */
+-#else  /* #_LP64 */
+-#if defined (__sun) || defined (__hpux)
+-extern        char *          sys_errlist[];
+-extern        int             sys_nerr;
+-#endif
+-#endif /* #_LP64 */
+-
+ static        void            file_lock_error(char *, char *, const char *, char *, char *);
+ /*
+@@ -167,16 +155,7 @@ file_lock_error(char * msg, char * file, const char * str, char * arg1,
+       len = strlen(msg);
+       sprintf(&msg[len], str, arg1, arg2);
+       strcat(msg, " failed - ");
+-#if defined(_LP64)
+       /* Needs to be changed to use strerror(3C) instead. */
+       len = strlen(msg);
+       sprintf(&msg[len], "errno %d", errno);
+-#else  /* #_LP64 */
+-      if (errno < sys_nerr) {
+-              strcat(msg, sys_errlist[errno]);
+-      } else {
+-              len = strlen(msg);
+-              sprintf(&msg[len], "errno %d", errno);
+-      }
+-#endif /* #_LP64 */
+ }
+diff --git a/make/mksh/macro.cc b/make/mksh/macro.cc
+index 6ddb624..23b0315 100644
+--- a/make/mksh/macro.cc
++++ b/make/mksh/macro.cc
+@@ -43,6 +43,7 @@
+ /*
+  * Included files
+  */
++#include <alloca.h>
+ #include <wordexp.h>
+ #include <mksh/dosys.h>               /* sh_command2string() */
+ #include <mksh/i18n.h>                /* get_char_semantics_value() */
+@@ -1403,13 +1404,6 @@ found_it:;
+                       new_value = ALLOC_WC(length);
+                       new_value_allocated = true;
+                       WCSTOMBS(mbs_buffer, old_vr);
+-#ifdef __sun
+-                      wsprintf(new_value,
+-                                      NOCATGETS("/usr/arch/%s/%s:%s"),
+-                                      ha->string_mb + 1,
+-                                      ta->string_mb + 1,
+-                                      mbs_buffer);
+-#else
+                       char * mbs_new_value = (char *)getmem(length);
+                       sprintf(mbs_new_value,
+                                       NOCATGETS("/usr/arch/%s/%s:%s"),
+@@ -1418,7 +1412,6 @@ found_it:;
+                                       mbs_buffer);
+                       MBSTOWCS(new_value, mbs_new_value);
+                       retmem_mb(mbs_new_value);
+-#endif
+               }
+               if (new_value[0] != 0) {
+                       setvar_daemon(virtual_root,
+diff --git a/make/mksh/misc.cc b/make/mksh/misc.cc
+index 11122cf..d617591 100644
+--- a/make/mksh/misc.cc
++++ b/make/mksh/misc.cc
+@@ -382,30 +382,7 @@ setup_char_semantics(void)
+ char *
+ errmsg(int errnum)
+ {
+-#ifndef __sun
+       return strerror(errnum);
+-#else // __sun
+-
+-      extern int              sys_nerr;
+-#ifdef SUN4_x
+-      extern char             *sys_errlist[];
+-#endif
+-      char                    *errbuf;
+-
+-      if ((errnum < 0) || (errnum > sys_nerr)) {
+-              errbuf = getmem(6+1+11+1);
+-              sprintf(errbuf, "Error %d", errnum);
+-              return errbuf;
+-      } else {
+-#ifdef SUN4_x
+-              return(sys_errlist[errnum]);
+-#endif
+-#ifdef SUN5_0
+-              return strerror(errnum);
+-#endif
+-
+-      }
+-#endif // !__sun
+ }
+ extern const char     *progname;
+diff --git a/make/src/implicit.cc b/make/src/implicit.cc
+index 2d388cc..a1cee7e 100644
+--- a/make/src/implicit.cc
++++ b/make/src/implicit.cc
+@@ -43,10 +43,13 @@
+ /*
+  * Included files
+  */
++#include <cstdio>
+ #include <mk/defs.h>
+ #include <mksh/macro.h>               /* expand_value() */
+ #include <mksh/misc.h>                /* retmem() */
++using std::printf;
++
+ /*
+  * Defined macros
+  */
+@@ -97,8 +100,6 @@ extern      void            add_target_to_chain(Name target, Chain * query);
+  *            recursion_level Used for tracing
+  */
+-extern int printf (const char *, ...);
+-
+ static Boolean actual_doname = false;
+ /* /tolik/
+diff --git a/make/src/nse_printdep.cc b/make/src/nse_printdep.cc
+index 6201a18..38826d2 100644
+--- a/make/src/nse_printdep.cc
++++ b/make/src/nse_printdep.cc
+@@ -37,9 +37,12 @@
+ /*
+  * Included files
+  */
++#include <cstdio>
+ #include <mk/defs.h>
+ #include <mksh/misc.h>                /* get_prop() */
++using std::printf;
++
+ /*
+  * File table of contents
+  */
+@@ -59,7 +62,6 @@ static void  print_rule(register Name target);
+ static        void    print_rec_info(Name target);
+ static Boolean        is_out_of_date(Property line);
+ extern void depvar_print_results (void);
+-extern int printf (const char *, ...);
+ extern int _flsbuf (unsigned int, FILE *);
+ /*
+diff --git a/make/vroot/lock.cc b/make/vroot/lock.cc
+index 1d6239b..1a20bc0 100644
+--- a/make/vroot/lock.cc
++++ b/make/vroot/lock.cc
+@@ -48,11 +48,6 @@
+ #include <signal.h>
+ #include <errno.h>                    /* errno */
+-#if defined(sun) || defined(HP_UX)
+-extern        char            *sys_errlist[];
+-extern        int             sys_nerr;
+-#endif
+-
+ static        void            file_lock_error(char *msg, char *file, char *str, int arg1, int arg2);
+ #define BLOCK_INTERUPTS sigfillset(&newset) ; \
+@@ -179,20 +174,6 @@ file_lock_error(char *msg, char *file, char *str, int arg1, int arg2)
+       len = strlen(msg);
+       sprintf(&msg[len], str, arg1, arg2);
+       strcat(msg, " failed - ");
+-#ifdef __sun
+-      if (errno < sys_nerr) {
+-#ifdef SUN4_x
+-              strcat(msg, sys_errlist[errno]);
+-#endif
+-#ifdef SUN5_0
+-              strcat(msg, strerror(errno));
+-#endif
+-      } else {
+-              len = strlen(msg);
+-              sprintf(&msg[len], NOCATGETS("errno %d"), errno);
+-      }
+-#else
+       strcat(msg, strerror(errno));
+-#endif
+ }
+diff --git a/sccs/src/vc.c b/sccs/src/vc.c
+index d7f7187..1c0ffb1 100644
+--- a/sccs/src/vc.c
++++ b/sccs/src/vc.c
+@@ -37,6 +37,7 @@
+  */
+ /*    from OpenSolaris "sccs:cmd/vc.c"        */
+ # include     <defines.h>
++# include     <limits.h>
+ # include     <locale.h>
diff --git a/sys-devel/heirloom-devtools/heirloom-devtools-070527-r2.ebuild b/sys-devel/heirloom-devtools/heirloom-devtools-070527-r2.ebuild
new file mode 100644 (file)
index 0000000..55780b5
--- /dev/null
@@ -0,0 +1,75 @@
+# Copyright © 2018 Nick Bowler
+# License GPLv2+: GNU General Public License version 2 or any later version.
+# This is free software: you are free to change and distribute it.
+# There is NO WARRANTY, to the extent permitted by law.
+#
+# This a modified version of the original ebuild from Gentoo GNU/Linux,
+# covered by the following copyright and permission notice:
+#
+#   Copyright 1999-2017 Gentoo Foundation
+#   Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit flag-o-matic readme.gentoo-r1 toolchain-funcs
+
+DESCRIPTION="Original UNIX development tools"
+HOMEPAGE="http://heirloom.sourceforge.net/devtools.html"
+SRC_URI="http://downloads.sourceforge.net/project/heirloom/${PN}/${PV}/${P}.tar.bz2"
+
+LICENSE="BSD BSD-4 CDDL"
+SLOT="0"
+KEYWORDS="~amd64 ~x64-solaris"
+IUSE=""
+
+RDEPEND="app-shells/heirloom-sh
+       net-libs/libtirpc"
+DEPEND="$RDEPEND
+       virtual/pkgconfig"
+
+PATCHES=(
+       "$FILESDIR/$P-solaris.patch"
+       "$FILESDIR/$P-64-bit.patch"
+       "$FILESDIR/$P-gcc6.patch"
+)
+
+DOC_CONTENTS="
+       You may want to add /usr/5bin or /usr/ucb to \$PATH
+       to enable using the apps of heirloom toolchest by default.
+       Man pages are installed in /usr/share/man/5man/
+       You may need to set \$MANPATH to access them.
+"
+
+src_configure() {
+       pkgconfig=`tc-getPKG_CONFIG`
+       rpc_cppflags=`$pkgconfig --cflags libtirpc`
+       rpc_libs=`$pkgconfig --libs libtirpc`
+
+       sed -i \
+               -e 's:^\(SHELL =\) \(.*\):\1 /bin/jsh:' \
+               -e 's:^\(POSIX_SHELL =\) \(.*\):\1 /bin/sh:' \
+               -e "s:^\(PREFIX=\)\(.*\):\1${EPREFIX}\2:" \
+               -e "s:^\(SUSBIN=\)\(.*\):\1${EPREFIX}\2:" \
+               -e "s:^\(LDFLAGS=\):\1${LDFLAGS}:" \
+               -e "s:^\(CFLAGS=\)\(.*\):\1${CFLAGS}:" \
+               -e 's:^\(STRIP=\)\(.*\):\1true:' \
+               -e "s:^\(CXX = \)\(.*\):\1$(tc-getCXX):" \
+               -e "s:^\(INSTALL=\)\(.*\):\1$(which install):" \
+               -e "/^CPPFLAGS *=/s:$: $rpc_cppflags:" \
+               -e "/^LIBS *=/s:$: $rpc_libs:" \
+               ./mk.config
+
+       echo "CC=$(tc-getCC)" >> "./mk.config"
+}
+
+src_compile() {
+       emake -j1
+}
+
+src_install() {
+       emake ROOT="${D}" install
+       readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+       readme.gentoo_print_elog
+}