lol

guile 2.0: rename and reformat

+105 -75
+101 -67
pkgs/development/interpreters/guile/2.0.nix
··· 1 - { lib, stdenv, pkgsBuildBuild, buildPackages 2 - , fetchpatch, fetchurl, makeWrapper, gawk, pkg-config 3 - , libffi, libtool, readline, gmp, boehmgc, libunistring 4 , coverageAnalysis ? null 5 }: 6 7 - # Do either a coverage analysis build or a standard build. 8 - (if coverageAnalysis != null 9 - then coverageAnalysis 10 - else stdenv.mkDerivation) 11 - 12 - (rec { 13 - name = "guile-2.0.13"; 14 15 src = fetchurl { 16 - url = "mirror://gnu/guile/${name}.tar.xz"; 17 sha256 = "12yqkr974y91ylgw6jnmci2v90i90s7h9vxa4zk0sai8vjnz4i1p"; 18 }; 19 20 outputs = [ "out" "dev" "info" ]; 21 setOutputFlags = false; # $dev gets into the library otherwise 22 23 - depsBuildBuild = [ buildPackages.stdenv.cc ] 24 - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) 25 - pkgsBuildBuild.guile_2_0; 26 - nativeBuildInputs = [ makeWrapper gawk pkg-config ]; 27 - buildInputs = [ readline libtool libunistring libffi ]; 28 29 propagatedBuildInputs = [ 30 - gmp boehmgc 31 32 - # XXX: These ones aren't normally needed here, but `libguile*.la' has '-l' 33 - # flags for them without corresponding '-L' flags. Adding them here will add 34 - # the needed `-L' flags. As for why the `.la' file lacks the `-L' flags, 35 - # see below. 36 - libtool libunistring 37 ]; 38 39 enableParallelBuilding = true; 40 41 - patches = [ ./disable-gc-sensitive-tests.patch ./eai_system.patch ./clang.patch 42 (fetchpatch { 43 - # Fixes stability issues with 00-repl-server.test 44 url = "https://git.savannah.gnu.org/cgit/guile.git/patch/?id=2fbde7f02adb8c6585e9baf6e293ee49cd23d4c4"; 45 sha256 = "0p6c1lmw1iniq03z7x5m65kg3lq543kgvdb4nrxsaxjqf3zhl77v"; 46 }) 47 - ./riscv.patch 48 - ] ++ 49 - (lib.optional (coverageAnalysis != null) ./gcov-file-name.patch) 50 - ++ lib.optionals stdenv.isDarwin [ 51 - (fetchpatch { 52 - url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch"; 53 - sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207"; 54 - }) 55 - ./filter-mkostemp-darwin.patch 56 - ]; 57 58 # Explicitly link against libgcc_s, to work around the infamous 59 # "libgcc_s.so.1 must be installed for pthread_cancel to work". 60 61 # don't have "libgcc_s.so.1" on darwin 62 - LDFLAGS = lib.optionalString (!stdenv.isDarwin && !stdenv.hostPlatform.isMusl) "-lgcc_s"; 63 64 - configureFlags = [ "--with-libreadline-prefix" ] 65 - ++ lib.optionals stdenv.isSunOS [ 66 - # Make sure the right <gmp.h> is found, and not the incompatible 67 - # /usr/include/mp.h from OpenSolaris. See 68 - # <https://lists.gnu.org/archive/html/hydra-users/2012-08/msg00000.html> 69 - # for details. 70 - "--with-libgmp-prefix=${gmp.dev}" 71 72 - # Same for these (?). 73 - "--with-libreadline-prefix=${readline.dev}" 74 - "--with-libunistring-prefix=${libunistring}" 75 76 - # See below. 77 - "--without-threads" 78 - ]; 79 80 postInstall = '' 81 wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" 82 '' 83 - # XXX: See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903 for 84 - # why `--with-libunistring-prefix' and similar options coming from 85 - # `AC_LIB_LINKFLAGS_BODY' don't work on NixOS/x86_64. 86 + '' 87 sed -i "$out/lib/pkgconfig/guile"-*.pc \ 88 -e "s|-lunistring|-L${libunistring}/lib -lunistring|g ; ··· 90 s|-lltdl|-L${libtool.lib}/lib -lltdl|g ; 91 s|includedir=$out|includedir=$dev|g 92 " 93 - ''; 94 95 # make check doesn't work on darwin 96 # On Linuxes+Hydra the tests are flaky; feel free to investigate deeper. ··· 99 100 setupHook = ./setup-hook-2.0.sh; 101 102 - meta = { 103 description = "Embeddable Scheme implementation"; 104 - homepage = "https://www.gnu.org/software/guile/"; 105 - license = lib.licenses.lgpl3Plus; 106 - maintainers = with lib.maintainers; [ ludo lovek323 ]; 107 - platforms = lib.platforms.all; 108 - 109 longDescription = '' 110 - GNU Guile is an implementation of the Scheme programming language, with 111 - support for many SRFIs, packaged for use in a wide variety of 112 - environments. In addition to implementing the R5RS Scheme standard 113 - and a large subset of R6RS, Guile includes a module system, full access 114 - to POSIX system calls, networking support, multiple threads, dynamic 115 - linking, a foreign function call interface, and powerful string 116 - processing. 117 - ''; 118 }; 119 - }) 120 121 // 122
··· 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 = "2.0.13"; 28 29 src = fetchurl { 30 + url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz"; 31 sha256 = "12yqkr974y91ylgw6jnmci2v90i90s7h9vxa4zk0sai8vjnz4i1p"; 32 }; 33 34 outputs = [ "out" "dev" "info" ]; 35 setOutputFlags = false; # $dev gets into the library otherwise 36 37 + depsBuildBuild = [ 38 + buildPackages.stdenv.cc 39 + ] 40 + ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) 41 + pkgsBuildBuild.guile_2_0; 42 43 + nativeBuildInputs = [ 44 + makeWrapper 45 + gawk 46 + pkg-config 47 + ]; 48 + buildInputs = [ 49 + readline 50 + libtool 51 + libunistring 52 + libffi 53 + ]; 54 propagatedBuildInputs = [ 55 + boehmgc 56 + gmp 57 58 + # These ones aren't normally needed here, but `libguile*.la' has '-l' 59 + # flags for them without corresponding '-L' flags. Adding them here will 60 + # add the needed `-L' flags. As for why the `.la' file lacks the `-L' 61 + # flags, see below. 62 + libtool 63 + libunistring 64 ]; 65 66 enableParallelBuilding = true; 67 68 + patches = [ 69 + # Small fixes to Clang compiler 70 + ./clang.patch 71 + # Self-explanatory 72 + ./disable-gc-sensitive-tests.patch 73 + # Read the header of the patch to more info 74 + ./eai_system.patch 75 + # RISC-V endianness 76 + ./riscv.patch 77 + # Fixes stability issues with 00-repl-server.test 78 (fetchpatch { 79 url = "https://git.savannah.gnu.org/cgit/guile.git/patch/?id=2fbde7f02adb8c6585e9baf6e293ee49cd23d4c4"; 80 sha256 = "0p6c1lmw1iniq03z7x5m65kg3lq543kgvdb4nrxsaxjqf3zhl77v"; 81 + })] ++ 82 + (lib.optional (coverageAnalysis != null) ./gcov-file-name.patch) 83 + ++ lib.optionals stdenv.isDarwin [ 84 + ./filter-mkostemp-darwin.patch 85 + (fetchpatch { 86 + url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch"; 87 + sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207"; 88 }) 89 + ]; 90 91 # Explicitly link against libgcc_s, to work around the infamous 92 # "libgcc_s.so.1 must be installed for pthread_cancel to work". 93 94 # don't have "libgcc_s.so.1" on darwin 95 + LDFLAGS = lib.optionalString 96 + (!stdenv.isDarwin && !stdenv.hostPlatform.isMusl) "-lgcc_s"; 97 98 + configureFlags = [ 99 + "--with-libreadline-prefix" 100 + ] ++ lib.optionals stdenv.isSunOS [ 101 + # Make sure the right <gmp.h> is found, and not the incompatible 102 + # /usr/include/mp.h from OpenSolaris. See 103 + # <https://lists.gnu.org/archive/html/hydra-users/2012-08/msg00000.html> 104 + # for details. 105 + "--with-libgmp-prefix=${lib.getDev gmp}" 106 107 + # Same for these (?). 108 + "--with-libreadline-prefix=${lib.getDev readline}" 109 + "--with-libunistring-prefix=${libunistring}" 110 111 + # See below. 112 + "--without-threads" 113 + ]; 114 115 postInstall = '' 116 wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin" 117 '' 118 + # XXX: See http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/18903 for 119 + # why `--with-libunistring-prefix' and similar options coming from 120 + # `AC_LIB_LINKFLAGS_BODY' don't work on NixOS/x86_64. 121 + '' 122 sed -i "$out/lib/pkgconfig/guile"-*.pc \ 123 -e "s|-lunistring|-L${libunistring}/lib -lunistring|g ; ··· 125 s|-lltdl|-L${libtool.lib}/lib -lltdl|g ; 126 s|includedir=$out|includedir=$dev|g 127 " 128 + ''; 129 130 # make check doesn't work on darwin 131 # On Linuxes+Hydra the tests are flaky; feel free to investigate deeper. ··· 134 135 setupHook = ./setup-hook-2.0.sh; 136 137 + meta = with lib; { 138 + homepage = "https://www.gnu.org/software/guile/"; 139 description = "Embeddable Scheme implementation"; 140 longDescription = '' 141 + GNU Guile is an implementation of the Scheme programming language, with 142 + support for many SRFIs, packaged for use in a wide variety of 143 + environments. In addition to implementing the R5RS Scheme standard and 144 + a large subset of R6RS, Guile includes a module system, full access to 145 + POSIX system calls, networking support, multiple threads, dynamic 146 + linking, a foreign function call interface, and powerful string 147 + processing. 148 + ''; 149 + license = licenses.lgpl3Plus; 150 + maintainers = with maintainers; [ ludo lovek323 vrthra ]; 151 + platforms = platforms.all; 152 }; 153 + } 154 155 // 156
+4 -8
pkgs/development/interpreters/guile/setup-hook-2.0.sh
··· 1 addGuileLibPath () { 2 - if test -d "$1/share/guile/site/2.0" 3 - then 4 export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site/2.0" 5 export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site/2.0" 6 - elif test -d "$1/share/guile/site" 7 - then 8 export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site" 9 export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site" 10 fi 11 12 - if test -d "$1/lib/guile/2.0/ccache" 13 - then 14 export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.0/ccache" 15 fi 16 17 - if test -d "$1/lib/guile/2.0/site-ccache" 18 - then 19 export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.0/site-ccache" 20 fi 21 }
··· 1 addGuileLibPath () { 2 + if test -d "$1/share/guile/site/2.0"; then 3 export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site/2.0" 4 export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site/2.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/2.0/ccache"; then 11 export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.0/ccache" 12 fi 13 14 + if test -d "$1/lib/guile/2.0/site-ccache"; then 15 export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.0/site-ccache" 16 fi 17 }