7 , coverageAnalysis ? null
20 # Do either a coverage analysis build or a standard build.
21 builder = if coverageAnalysis != null
23 else stdenv.mkDerivation;
30 url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz";
31 sha256 = "013mydzhfswqci6xmyc1ajzd59pfbdak15i0b090nhr9bzm7dxyd";
34 outputs = [ "out" "dev" "info" ];
35 setOutputFlags = false; # $dev gets into the library otherwise
38 buildPackages.stdenv.cc
40 ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
41 pkgsBuildBuild.guile_2_2;
52 propagatedBuildInputs = [
56 # XXX: These ones aren't normally needed here, but `libguile*.la' has '-l'
57 # flags for them without corresponding '-L' flags. Adding them here will add
58 # the needed `-L' flags. As for why the `.la' file lacks the `-L' flags,
64 # According to Bernhard M. Wiedemann <bwiedemann suse de> on
65 # #reproducible-builds on irc.oftc.net, (2020-01-29): they had to
66 # build Guile without parallel builds to make it reproducible.
68 # re: https://issues.guix.gnu.org/issue/20272
69 # re: https://build.opensuse.org/request/show/732638
70 enableParallelBuilding = false;
73 # Read the header of the patch to more info
75 ] ++ lib.optional (coverageAnalysis != null) ./gcov-file-name.patch
76 ++ lib.optional stdenv.isDarwin
78 url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch";
79 sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207";
82 # Explicitly link against libgcc_s, to work around the infamous
83 # "libgcc_s.so.1 must be installed for pthread_cancel to work".
85 # don't have "libgcc_s.so.1" on clang
86 LDFLAGS = lib.optionalString
87 (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) "-lgcc_s";
90 "--with-libreadline-prefix=${lib.getDev readline}"
91 ] ++ lib.optionals stdenv.isSunOS [
92 # Make sure the right <gmp.h> is found, and not the incompatible
93 # /usr/include/mp.h from OpenSolaris. See
94 # <https://lists.gnu.org/archive/html/hydra-users/2012-08/msg00000.html>
96 "--with-libgmp-prefix=${lib.getDev gmp}"
99 "--with-libunistring-prefix=${libunistring}"
106 wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin"
108 # XXX: See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903 for
109 # why `--with-libunistring-prefix' and similar options coming from
110 # `AC_LIB_LINKFLAGS_BODY' don't work on NixOS/x86_64.
112 sed -i "$out/lib/pkgconfig/guile"-*.pc \
113 -e "s|-lunistring|-L${libunistring}/lib -lunistring|g ;
114 s|^Cflags:\(.*\)$|Cflags: -I${libunistring.dev}/include \1|g ;
115 s|-lltdl|-L${libtool.lib}/lib -lltdl|g ;
116 s|includedir=$out|includedir=$dev|g
120 # make check doesn't work on darwin
121 # On Linuxes+Hydra the tests are flaky; feel free to investigate deeper.
123 doInstallCheck = doCheck;
125 setupHook = ./setup-hook-2.2.sh;
128 effectiveVersion = lib.versions.majorMinor version;
129 siteCcacheDir = "lib/guile/${effectiveVersion}/site-ccache";
130 siteDir = "share/guile/site/${effectiveVersion}";
134 homepage = "https://www.gnu.org/software/guile/";
135 description = "Embeddable Scheme implementation";
137 GNU Guile is an implementation of the Scheme programming language, with
138 support for many SRFIs, packaged for use in a wide variety of
139 environments. In addition to implementing the R5RS Scheme standard and a
140 large subset of R6RS, Guile includes a module system, full access to POSIX
141 system calls, networking support, multiple threads, dynamic linking, a
142 foreign function call interface, and powerful string processing.
144 license = licenses.lgpl3Plus;
145 maintainers = with maintainers; [ ludo lovek323 vrthra ];
146 platforms = platforms.all;