From baed870448c01b07b2799401ce546ed80cc99693 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Sat, 9 Dec 2023 10:15:45 -0800 Subject: [PATCH] clisp: fix build Without this patch, the following build error occurs for me on NixOS: ``` $ nix-build -A clisp --check Running phase: buildPhase build flags: SHELL=/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash ln -s ../src/.gdbinit .gdbinit rm -f build-aux ln -s ../src/build-aux build-aux mkdir -p gllib test -f gllib/Makefile || sh config.status gllib/Makefile depfiles cd gllib && make CFLAGS="-g -O2 -no-integrated-cpp -W -Wswitch -Wcomment -Wpointer-arith -Wreturn-type -Wmissing-declarations -Wimplicit -Wno-sign-compare -Wno-format-nonliteral -Wno-shift-negative-value -O -fwrapv -pthread -fno-strict-aliasing -DNO_ASM -DENABLE_UNICODE -DMULTITHREAD -DPOSIX_THREADS -DDYNAMIC_FFI -DDYNAMIC_MODULES -fPIC -DPIC " top_srcdir="/build/source/src" make[1]: Entering directory '/build/source/builddir/gllib' cd /build/source/src && /nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash /build/source/src/build-aux/missing automake-1.16 --gnits gllib/Makefile /build/source/src/build-aux/missing: line 81: automake-1.16: command not found WARNING: 'automake-1.16' is missing on your system. You should only need it if you modified 'Makefile.am' or 'configure.ac' or m4 files included by 'configure.ac'. The 'automake' program is part of the GNU Automake package: It also requires GNU Autoconf, GNU m4 and Perl in order to run: make[1]: *** [Makefile:1333: ../../src/gllib/Makefile.in] Error 127 make[1]: Leaving directory '/build/source/builddir/gllib' make: *** [Makefile:648: gllib/libgnu.a] Error 2 ``` This message was also reproduced by @2xsaiko on their NAS machine. I don't know why this error sometimes occurs and sometimes does not. On my Ubuntu machines, this error does not occur, and instead it does this: ``` Running phase: buildPhase build flags: SHELL=/nix/store/q8qq40xg2grfh9ry1d9x4g7lq4ra7n81-bash-5.2-p21/bin/bash ln -s ../src/.gdbinit .gdbinit rm -f build-aux ln -s ../src/build-aux build-aux mkdir -p gllib test -f gllib/Makefile || sh config.status gllib/Makefile depfiles cd gllib && make CFLAGS="-g -O2 -no-integrated-cpp -W -Wswitch -Wcomment -Wpointer-arith -Wreturn-type -Wmissing-declarations -Wimplicit -Wno-sign-compare -Wno-format-nonliteral -Wno-shift-negative-value -O -fwrapv -pthread -fno-strict-aliasing -DNO_ASM -DENABLE_UNICODE -DMULTITHREAD -DPOSIX_THREADS -DDYNAMIC_FFI -DDYNAMIC_MODULES -fPIC -DPIC " top_srcdir="/build/source/src" make[1]: Entering directory '/build/source/builddir/gllib' make[2]: Entering directory '/build/source/builddir' make[2]: Nothing to be done for 'am--refresh'. make[2]: Leaving directory '/build/source/builddir' cd .. && make am--refresh make[2]: Entering directory '/build/source/builddir' make[2]: Nothing to be done for 'am--refresh'. make[2]: Leaving directory '/build/source/builddir' ``` In any case, these changes work successfully on all platforms I've tested them on: 1. NixOS 2. Ubuntu 22.04 3. MacOS x86_64 4. MacOS aarch64 --- pkgs/development/interpreters/clisp/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/clisp/default.nix b/pkgs/development/interpreters/clisp/default.nix index 127541c727ec..0ff0f6a49816 100644 --- a/pkgs/development/interpreters/clisp/default.nix +++ b/pkgs/development/interpreters/clisp/default.nix @@ -58,7 +58,7 @@ stdenv.mkDerivation { }; strictDeps = true; - nativeBuildInputs = lib.optionals stdenv.isDarwin [ autoconf269 automake libtool ]; + nativeBuildInputs = [ autoconf269 automake libtool ]; buildInputs = [libsigsegv] ++ lib.optional (gettext != null) gettext ++ lib.optional (ncurses != null) ncurses @@ -81,6 +81,7 @@ stdenv.mkDerivation { postPatch = '' sed -e 's@9090@64237@g' -i tests/socket.tst sed -i 's@/bin/pwd@${coreutils}&@' src/clisp-link.in + sed -i 's@1\.16\.2@${automake.version}@' src/aclocal.m4 find . -type f | xargs sed -e 's/-lICE/-lXau &/' -i '';