nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 autoreconfHook,
6 gettext,
7 guileSupport ? false,
8 guile,
9 texinfo,
10 # avoid guile depend on bootstrap to prevent dependency cycles
11 inBootstrap ? false,
12 pkg-config,
13 gnumake,
14}:
15
16let
17 guileEnabled = guileSupport && !inBootstrap;
18in
19
20stdenv.mkDerivation (finalAttrs: {
21 pname = "gnumake";
22 version = "4.4.1";
23
24 src = fetchurl {
25 url = "mirror://gnu/make/make-${finalAttrs.version}.tar.gz";
26 sha256 = "sha256-3Rb7HWe/q3mnL16DkHNcSePo5wtJRaFasfgd23hlj7M=";
27 };
28
29 # To update patches:
30 # $ version=4.4.1
31 # $ git clone https://git.savannah.gnu.org/git/make.git
32 # $ cd make && git checkout -b nixpkgs $version
33 # $ git am --directory=../patches
34 # $ # make changes, resolve conflicts, etc.
35 # $ git format-patch --output-directory ../patches --diff-algorithm=histogram $version
36 #
37 # TODO: stdenv’s setup.sh should be aware of patch directories. It’s very
38 # convenient to keep them in a separate directory but we can defer listing the
39 # directory until derivation realization to avoid unnecessary Nix evaluations.
40 patches = lib.filesystem.listFilesRecursive ./patches;
41
42 nativeBuildInputs = [
43 autoreconfHook
44 pkg-config
45 ]
46 ++ lib.optionals (!inBootstrap) [ texinfo ];
47
48 buildInputs =
49 lib.optionals guileEnabled [ guile ]
50 # gettext gets pulled in via autoreconfHook because strictDeps is not set,
51 # and is linked against. Without this, it doesn't end up in HOST_PATH.
52 # TODO: enable strictDeps, and either make this dependency explicit, or remove it
53 ++ lib.optional stdenv.isCygwin gettext;
54
55 configureFlags =
56 lib.optional guileEnabled "--with-guile"
57 # fnmatch.c:124:14: error: conflicting types for 'getenv'; have 'char *(void)'
58 ++ lib.optional stdenv.hostPlatform.isCygwin "CFLAGS=-std=gnu17";
59
60 outputs = [
61 "out"
62 "man"
63 "info"
64 ]
65 ++ lib.optionals (!inBootstrap) [ "doc" ];
66
67 postBuild = lib.optionalString (!inBootstrap) ''
68 makeinfo --html --no-split doc/make.texi
69 '';
70
71 postInstall = lib.optionalString (!inBootstrap) ''
72 mkdir -p $doc/share/doc/$pname-$version
73 cp ./make.html $doc/share/doc/$pname-$version/index.html
74 '';
75
76 separateDebugInfo = true;
77
78 passthru.tests = {
79 # make sure that the override doesn't break bootstrapping
80 gnumakeWithGuile = gnumake.override { guileSupport = true; };
81 };
82
83 meta = {
84 description = "Tool to control the generation of non-source files from sources";
85 longDescription = ''
86 Make is a tool which controls the generation of executables and
87 other non-source files of a program from the program's source files.
88
89 Make gets its knowledge of how to build your program from a file
90 called the makefile, which lists each of the non-source files and
91 how to compute it from other files. When you write a program, you
92 should write a makefile for it, so that it is possible to use Make
93 to build and install the program.
94 '';
95 homepage = "https://www.gnu.org/software/make/";
96 license = lib.licenses.gpl3Plus;
97 maintainers = [ lib.maintainers.mdaniels5757 ];
98 mainProgram = "make";
99 platforms = lib.platforms.all;
100 };
101})