gnumake: Unconditionally fix build against glibc-2.27

+35 -129
+2
pkgs/development/tools/build-managers/gnumake/4.2/default.nix
··· 20 # included Makefiles, don't look in /usr/include and friends. 21 ./impure-dirs.patch 22 ./pselect.patch 23 ]; 24 25 nativeBuildInputs = stdenv.lib.optionals guileSupport [ pkgconfig ];
··· 20 # included Makefiles, don't look in /usr/include and friends. 21 ./impure-dirs.patch 22 ./pselect.patch 23 + # Fix support for glibc 2.27's glob, inspired by http://www.linuxfromscratch.org/lfs/view/8.2/chapter05/make.html 24 + ./glibc-2.27-glob.patch 25 ]; 26 27 nativeBuildInputs = stdenv.lib.optionals guileSupport [ pkgconfig ];
+32
pkgs/development/tools/build-managers/gnumake/4.2/glibc-2.27-glob.patch
···
··· 1 + diff -Naur glob/glob.c glob/glob.c 2 + --- glob/glob.c 2013-10-20 13:14:38.000000000 -0400 3 + +++ glob/glob.c 2018-03-16 14:32:38.483496170 -0400 4 + @@ -208,28 +208,9 @@ 5 + #endif /* __GNU_LIBRARY__ || __DJGPP__ */ 6 + 7 + 8 + -#if !defined __alloca && !defined __GNU_LIBRARY__ 9 + - 10 + -# ifdef __GNUC__ 11 + -# undef alloca 12 + -# define alloca(n) __builtin_alloca (n) 13 + -# else /* Not GCC. */ 14 + -# ifdef HAVE_ALLOCA_H 15 + # include <alloca.h> 16 + -# else /* Not HAVE_ALLOCA_H. */ 17 + -# ifndef _AIX 18 + -# ifdef WINDOWS32 19 + -# include <malloc.h> 20 + -# else 21 + -extern char *alloca (); 22 + -# endif /* WINDOWS32 */ 23 + -# endif /* Not _AIX. */ 24 + -# endif /* sparc or HAVE_ALLOCA_H. */ 25 + -# endif /* GCC. */ 26 + - 27 + # define __alloca alloca 28 + 29 + -#endif 30 + 31 + #ifndef __GNU_LIBRARY__ 32 + # define __stat stat
-24
pkgs/development/tools/build-managers/gnumake/4.2/glibc-2.27.patch
··· 1 - From 48c8a116a914a325a0497721f5d8b58d5bba34d4 Mon Sep 17 00:00:00 2001 2 - From: Paul Smith <psmith@gnu.org> 3 - Date: Sun, 19 Nov 2017 15:09:16 -0500 4 - Subject: * configure.ac: Support GLIBC glob interface version 2 5 - 6 - --- 7 - configure.ac | 3 +-- 8 - 1 file changed, 1 insertion(+), 2 deletions(-) 9 - 10 - diff -Naur a/configure b/configure 11 - --- configure 2016-06-10 19:03:21.000000000 -0400 12 - +++ configure 2018-02-18 04:40:32.971371555 -0500 13 - @@ -11481,10 +11481,9 @@ 14 - #include <glob.h> 15 - #include <fnmatch.h> 16 - 17 - -#define GLOB_INTERFACE_VERSION 1 18 - #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1 19 - # include <gnu-versions.h> 20 - -# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION 21 - +# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2 22 - gnu glob 23 - # endif 24 - #endif
···
-69
pkgs/development/tools/build-managers/gnumake/4.2/head.nix
··· 1 - { stdenv, fetchurl, texinfo, guileSupport ? false, pkgconfig , guile ? null, autoreconfHook }: 2 - 3 - assert guileSupport -> ( guile != null ); 4 - 5 - let 6 - version = "4.2.90"; 7 - revision = "48c8a116a914a325a0497721f5d8b58d5bba34d4"; 8 - revCount = "2491"; 9 - shortRev = "48c8a11"; 10 - 11 - baseVersion = "4.2.1"; 12 - baseTarball = fetchurl { 13 - url = "mirror://gnu/make/make-${baseVersion}.tar.bz2"; 14 - sha256 = "12f5zzyq2w56g95nni65hc0g5p7154033y2f3qmjvd016szn5qnn"; 15 - }; 16 - in 17 - stdenv.mkDerivation { 18 - name = "gnumake-${version}pre${revCount}_${shortRev}"; 19 - 20 - src = fetchurl { 21 - url = "http://git.savannah.gnu.org/cgit/make.git/snapshot/make-${revision}.tar.gz"; 22 - sha256 = "0k6yvhr2a5lh1qhflv02dyvq5p20ikgaakm8w6gr4xmkspljwpwx"; 23 - }; 24 - 25 - postUnpack = '' 26 - unpackFile ${baseTarball} 27 - cp make-${baseVersion}/po/*.po $sourceRoot/po 28 - cp make-${baseVersion}/doc/{fdl,make-stds}.texi $sourceRoot/doc 29 - ''; 30 - 31 - patches = [ 32 - # Purity: don't look for library dependencies (of the form `-lfoo') in /lib 33 - # and /usr/lib. It's a stupid feature anyway. Likewise, when searching for 34 - # included Makefiles, don't look in /usr/include and friends. 35 - ./impure-dirs-head.patch 36 - ]; 37 - 38 - postPatch = '' 39 - # These aren't in the 4.2.1 tarball yet. 40 - sed -i -e 's/sr//' -e 's/zh_TW//' po/LINGUAS 41 - ''; 42 - 43 - nativeBuildInputs = [ autoreconfHook pkgconfig texinfo ]; 44 - buildInputs = stdenv.lib.optional guileSupport guile; 45 - 46 - configureFlags = stdenv.lib.optional guileSupport "--with-guile"; 47 - 48 - outputs = [ "out" "man" "info" ]; 49 - 50 - meta = with stdenv.lib; { 51 - homepage = http://www.gnu.org/software/make/; 52 - description = "A tool to control the generation of non-source files from sources"; 53 - license = licenses.gpl3Plus; 54 - 55 - longDescription = '' 56 - Make is a tool which controls the generation of executables and 57 - other non-source files of a program from the program's source files. 58 - 59 - Make gets its knowledge of how to build your program from a file 60 - called the makefile, which lists each of the non-source files and 61 - how to compute it from other files. When you write a program, you 62 - should write a makefile for it, so that it is possible to use Make 63 - to build and install the program. 64 - ''; 65 - 66 - platforms = platforms.all; 67 - maintainers = [ maintainers.vrthra ]; 68 - }; 69 - }
···
-31
pkgs/development/tools/build-managers/gnumake/4.2/impure-dirs-head.patch
··· 1 - diff -Naur a/src/read.c b/src/read.c 2 - --- a/src/read.c 2017-11-19 15:17:47.000000000 -0500 3 - +++ b/src/read.c 2018-02-19 08:53:51.548755213 -0500 4 - @@ -109,10 +109,12 @@ 5 - #endif 6 - INCLUDEDIR, 7 - #ifndef _AMIGA 8 - +#if 0 9 - "/usr/gnu/include", 10 - "/usr/local/include", 11 - "/usr/include", 12 - #endif 13 - +#endif 14 - 0 15 - }; 16 - 17 - diff -Naur a/src/remake.c b/src/remake.c 18 - --- a/src/remake.c 2017-11-19 15:17:47.000000000 -0500 19 - +++ b/src/remake.c 2018-02-19 08:54:08.304101943 -0500 20 - @@ -1601,9 +1601,11 @@ 21 - static const char *dirs[] = 22 - { 23 - #ifndef _AMIGA 24 - +#if 0 25 - "/lib", 26 - "/usr/lib", 27 - #endif 28 - +#endif 29 - #if defined(WINDOWS32) && !defined(LIBDIR) 30 - /* 31 - * This is completely up to the user at product install time. Just define
···
+1 -5
pkgs/top-level/all-packages.nix
··· 7758 7759 gnumake382 = callPackage ../development/tools/build-managers/gnumake/3.82 { }; 7760 gnumake3 = gnumake382; 7761 - gnumake42 = callPackage ../development/tools/build-managers/gnumake/4.2 { }; 7762 - gnumake = if hostPlatform.isRiscV # Technically this check should be for glibc version. 7763 - then gnumake42HEAD 7764 - else gnumake42; 7765 - gnumake42HEAD = callPackage ../development/tools/build-managers/gnumake/4.2/head.nix { }; 7766 7767 gnustep = recurseIntoAttrs (callPackage ../desktops/gnustep {}); 7768
··· 7758 7759 gnumake382 = callPackage ../development/tools/build-managers/gnumake/3.82 { }; 7760 gnumake3 = gnumake382; 7761 + gnumake = callPackage ../development/tools/build-managers/gnumake/4.2 { }; 7762 7763 gnustep = recurseIntoAttrs (callPackage ../desktops/gnustep {}); 7764