lol

guile: init at 3.0

+162
+141
pkgs/development/interpreters/guile/3.0.nix
··· 1 + { lib 2 + , stdenv 3 + , fetchurl 4 + , fetchpatch 5 + , boehmgc 6 + , buildPackages 7 + , coverageAnalysis ? null 8 + , gawk 9 + , gmp 10 + , libffi 11 + , libtool 12 + , libunistring 13 + , makeWrapper 14 + , pkg-config 15 + , pkgsBuildBuild 16 + , readline 17 + }: 18 + 19 + let 20 + # Do either a coverage analysis build or a standard build. 21 + builder = if coverageAnalysis != null 22 + then coverageAnalysis 23 + else stdenv.mkDerivation; 24 + in 25 + builder rec { 26 + pname = "guile"; 27 + version = "3.0.7"; 28 + 29 + src = fetchurl { 30 + url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz"; 31 + sha256 = "sha256-9X2GxwYgJxv863qb4MgXRKAz8IrcfOuoMsmRerPmkbc="; 32 + }; 33 + 34 + outputs = [ "out" "dev" "info" ]; 35 + setOutputFlags = false; # $dev gets into the library otherwise 36 + 37 + depsBuildBuild = [ 38 + buildPackages.stdenv.cc 39 + ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) 40 + pkgsBuildBuild.guile; 41 + nativeBuildInputs = [ 42 + gawk 43 + makeWrapper 44 + pkg-config 45 + ]; 46 + buildInputs = [ 47 + libffi 48 + libtool 49 + libunistring 50 + readline 51 + ]; 52 + propagatedBuildInputs = [ 53 + boehmgc 54 + gmp 55 + 56 + # These ones aren't normally needed here, but `libguile*.la' has '-l' 57 + # flags for them without corresponding '-L' flags. Adding them here will 58 + # add the needed `-L' flags. As for why the `.la' file lacks the `-L' 59 + # flags, see below. 60 + libtool 61 + libunistring 62 + ]; 63 + 64 + # According to Bernhard M. Wiedemann <bwiedemann suse de> on 65 + # #reproducible-builds on irc.oftc.net, (2020-01-29): they had to build 66 + # Guile without parallel builds to make it reproducible. 67 + # 68 + # re: https://issues.guix.gnu.org/issue/20272 69 + # re: https://build.opensuse.org/request/show/732638 70 + enableParallelBuilding = false; 71 + 72 + patches = [ 73 + ./eai_system.patch 74 + ] ++ lib.optional (coverageAnalysis != null) ./gcov-file-name.patch 75 + ++ lib.optional stdenv.isDarwin 76 + (fetchpatch { 77 + url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch"; 78 + sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207"; 79 + }); 80 + 81 + # Explicitly link against libgcc_s, to work around the infamous 82 + # "libgcc_s.so.1 must be installed for pthread_cancel to work". 83 + 84 + # don't have "libgcc_s.so.1" on darwin 85 + LDFLAGS = lib.optionalString 86 + (!stdenv.isDarwin && !stdenv.hostPlatform.isStatic) "-lgcc_s"; 87 + 88 + configureFlags = [ 89 + "--with-libreadline-prefix=${lib.getDev readline}" 90 + ] ++ lib.optionals stdenv.isSunOS [ 91 + # Make sure the right <gmp.h> is found, and not the incompatible 92 + # /usr/include/mp.h from OpenSolaris. See 93 + # <https://lists.gnu.org/archive/html/hydra-users/2012-08/msg00000.html> 94 + # for details. 95 + "--with-libgmp-prefix=${lib.getDev gmp}" 96 + 97 + # Same for these (?). 98 + "--with-libunistring-prefix=${libunistring}" 99 + 100 + # See below. 101 + "--without-threads" 102 + ]; 103 + 104 + postInstall = '' 105 + wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" 106 + '' 107 + # XXX: See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903 for 108 + # why `--with-libunistring-prefix' and similar options coming from 109 + # `AC_LIB_LINKFLAGS_BODY' don't work on NixOS/x86_64. 110 + + '' 111 + sed -i "$out/lib/pkgconfig/guile"-*.pc \ 112 + -e "s|-lunistring|-L${libunistring}/lib -lunistring|g ; 113 + s|^Cflags:\(.*\)$|Cflags: -I${libunistring}/include \1|g ; 114 + s|-lltdl|-L${libtool.lib}/lib -lltdl|g ; 115 + s|includedir=$out|includedir=$dev|g 116 + " 117 + ''; 118 + 119 + # make check doesn't work on darwin 120 + # On Linuxes+Hydra the tests are flaky; feel free to investigate deeper. 121 + doCheck = false; 122 + doInstallCheck = doCheck; 123 + 124 + setupHook = ./setup-hook-3.0.sh; 125 + 126 + meta = with lib; { 127 + homepage = "https://www.gnu.org/software/guile/"; 128 + description = "Embeddable Scheme implementation"; 129 + longDescription = '' 130 + GNU Guile is an implementation of the Scheme programming language, with 131 + support for many SRFIs, packaged for use in a wide variety of 132 + environments. In addition to implementing the R5RS Scheme standard and a 133 + large subset of R6RS, Guile includes a module system, full access to POSIX 134 + system calls, networking support, multiple threads, dynamic linking, a 135 + foreign function call interface, and powerful string processing. 136 + ''; 137 + license = licenses.lgpl3Plus; 138 + maintainers = with maintainers; [ ludo lovek323 vrthra ]; 139 + platforms = platforms.all; 140 + }; 141 + }
+19
pkgs/development/interpreters/guile/setup-hook-3.0.sh
··· 1 + addGuileLibPath () { 2 + if test -d "$1/share/guile/site/3.0"; then 3 + export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site/3.0" 4 + export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site/3.0" 5 + elif test -d "$1/share/guile/site"; then 6 + export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site" 7 + export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site" 8 + fi 9 + 10 + if test -d "$1/lib/guile/3.0/ccache"; then 11 + export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/3.0/ccache" 12 + fi 13 + 14 + if test -d "$1/lib/guile/3.0/site-ccache"; then 15 + export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/3.0/site-ccache" 16 + fi 17 + } 18 + 19 + addEnvHooks "$hostOffset" addGuileLibPath
+2
pkgs/top-level/all-packages.nix
··· 13298 13298 13299 13299 guile_2_2 = callPackage ../development/interpreters/guile/2.2.nix { }; 13300 13300 13301 + guile_3_0 = callPackage ../development/interpreters/guile/3.0.nix { }; 13302 + 13301 13303 guile = guile_2_2; 13302 13304 13303 13305 guile-cairo = callPackage ../development/guile-modules/guile-cairo { };