lol

Guile: Fix cross-compilation

(cherry picked from commit f79fa7794176c11530a3be3f05ffbc10f1e53003)

authored by

Shea Levy and committed by
John Ericson
0fcad047 f2004e62

+23 -10
+5 -5
pkgs/development/interpreters/guile/2.0.nix
··· 1 1 { fetchurl, stdenv, libtool, readline, gmp, pkgconfig, boehmgc, libunistring 2 2 , libffi, gawk, makeWrapper, fetchpatch, coverageAnalysis ? null, gnu ? null 3 - , hostPlatform 3 + , hostPlatform, buildPackages 4 4 }: 5 5 6 6 # Do either a coverage analysis build or a standard build. ··· 19 19 outputs = [ "out" "dev" "info" ]; 20 20 setOutputFlags = false; # $dev gets into the library otherwise 21 21 22 - nativeBuildInputs = [ makeWrapper gawk pkgconfig ]; 22 + depsBuildBuild = [ buildPackages.stdenv.cc ]; 23 + nativeBuildInputs = [ makeWrapper gawk pkgconfig ] ++ 24 + stdenv.lib.optional stdenv.isCross buildPackages.buildPackages.guile_2_0; 23 25 buildInputs = [ readline libtool libunistring libffi ]; 24 26 propagatedBuildInputs = [ gmp boehmgc ] 25 27 ··· 29 31 # see below. 30 32 ++ [ libtool libunistring ]; 31 33 32 - # A native Guile 2.0 is needed to cross-build Guile. 33 - selfNativeBuildInput = true; 34 - 35 34 enableParallelBuilding = true; 36 35 37 36 patches = [ ./disable-gc-sensitive-tests.patch ./eai_system.patch ./clang.patch ··· 40 39 url = "http://git.savannah.gnu.org/cgit/guile.git/patch/?id=2fbde7f02adb8c6585e9baf6e293ee49cd23d4c4"; 41 40 sha256 = "0p6c1lmw1iniq03z7x5m65kg3lq543kgvdb4nrxsaxjqf3zhl77v"; 42 41 }) 42 + ./riscv.patch 43 43 ] ++ 44 44 (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch); 45 45
+5 -5
pkgs/development/interpreters/guile/default.nix
··· 1 1 { fetchurl, stdenv, libtool, readline, gmp, pkgconfig, boehmgc, libunistring 2 2 , libffi, gawk, makeWrapper, fetchpatch, coverageAnalysis ? null, gnu ? null 3 - , hostPlatform 3 + , hostPlatform, buildPackages 4 4 }: 5 5 6 6 # Do either a coverage analysis build or a standard build. ··· 20 20 outputs = [ "out" "dev" "info" ]; 21 21 setOutputFlags = false; # $dev gets into the library otherwise 22 22 23 - nativeBuildInputs = [ makeWrapper gawk pkgconfig ]; 23 + depsBuildBuild = [ buildPackages.stdenv.cc ]; 24 + nativeBuildInputs = [ makeWrapper gawk pkgconfig ] ++ 25 + stdenv.lib.optional stdenv.isCross buildPackages.buildPackages.guile; 24 26 buildInputs = [ readline libtool libunistring libffi ]; 25 27 26 28 propagatedBuildInputs = [ gmp boehmgc ] ··· 30 32 # see below. 31 33 ++ [ libtool libunistring ]; 32 34 33 - # A native Guile 2.0 is needed to cross-build Guile. 34 - selfNativeBuildInput = true; 35 - 36 35 enableParallelBuilding = true; 37 36 38 37 patches = [ 39 38 ./eai_system.patch 39 + ./riscv.patch 40 40 ] ++ 41 41 (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch); 42 42
+13
pkgs/development/interpreters/guile/riscv.patch
··· 1 + diff --git a/module/system/base/target.scm b/module/system/base/target.scm 2 + index 95ab8d8c9..93616f4a3 100644 3 + --- a/module/system/base/target.scm 4 + +++ b/module/system/base/target.scm 5 + @@ -86,6 +86,8 @@ 6 + (endianness big)) 7 + ((string=? "aarch64" cpu) 8 + (endianness little)) 9 + + ((string-match "riscv[1-9][0-9]*" cpu) 10 + + (endianness little)) 11 + (else 12 + (error "unknown CPU endianness" cpu))))) 13 +