diff --git a/pkgs/by-name/sa/sagittarius-scheme/fix-roundeven-declaration.patch b/pkgs/by-name/sa/sagittarius-scheme/fix-roundeven-declaration.patch new file mode 100644 index 000000000000..124cf1f3f744 --- /dev/null +++ b/pkgs/by-name/sa/sagittarius-scheme/fix-roundeven-declaration.patch @@ -0,0 +1,38 @@ +diff --git a/src/bignum.c b/src/bignum.c +index 1a5553d5a..6bcdb5b6b 100644 +--- a/src/bignum.c ++++ b/src/bignum.c +@@ -1949,6 +1949,7 @@ static SgObject small_bignum_to_string(SgBignum *b, int radix, int use_upper) + } + + /* FIXME this is also in number.c */ ++#if !defined(__GLIBC__) || !__GLIBC_PREREQ(2, 26) + static inline double roundeven(double v) + { + double r; +@@ -1966,6 +1967,7 @@ static inline double roundeven(double v) + } + return r; + } ++ #endif + /* this is used here */ + static SgBignum * bignum_expt(SgBignum *b, long exponent); + +diff --git a/src/roundeven.inc b/src/roundeven.inc +index 36d3c5535..1a29eefce 100644 +--- a/src/roundeven.inc ++++ b/src/roundeven.inc +@@ -31,6 +31,7 @@ + #include + #include + ++#if !defined(__GLIBC__) || !__GLIBC_PREREQ(2, 26) + static inline double roundeven(double v) + { + double r; +@@ -50,3 +51,5 @@ static inline double roundeven(double v) + } + + #endif ++ ++#endif diff --git a/pkgs/by-name/sa/sagittarius-scheme/package.nix b/pkgs/by-name/sa/sagittarius-scheme/package.nix index eadaffaf7c21..97541be796a3 100644 --- a/pkgs/by-name/sa/sagittarius-scheme/package.nix +++ b/pkgs/by-name/sa/sagittarius-scheme/package.nix @@ -23,17 +23,23 @@ let in stdenv.mkDerivation (finalAttrs: { pname = "sagittarius-scheme"; - version = "0.9.12"; + version = "0.9.14"; src = fetchurl { - url = "https://bitbucket.org/ktakashi/sagittarius-scheme/downloads/sagittarius-${finalAttrs.version}.tar.gz"; - hash = "sha256-w6aQkC7/vKO8exvDpsSsLyLXrm4FSKh8XYGJgseEII0="; + url = "https://github.com/ktakashi/sagittarius-scheme/releases/download/v${finalAttrs.version}/sagittarius-${finalAttrs.version}.tar.gz"; + hash = "sha256-L0ZKCiSbneWe1+czj83x+bCHPZw1uuYSdJwKHp4qTnk="; }; + + patches = [ + ./fix-roundeven-declaration.patch + ]; + preBuild = '' # since we lack rpath during build, need to explicitly add build path # to LD_LIBRARY_PATH so we can load libsagittarius.so as required to # build extensions export ${platformLdLibraryPath}="$(pwd)/build" ''; + nativeBuildInputs = [ pkg-config cmake @@ -76,9 +82,10 @@ stdenv.mkDerivation (finalAttrs: { - mostly works O(n) - Replaceable reader ''; - homepage = "https://bitbucket.org/ktakashi/sagittarius-scheme"; + homepage = "https://github.com/ktakashi/sagittarius-scheme"; license = lib.licenses.bsd2; platforms = lib.platforms.all; maintainers = with lib.maintainers; [ abbe ]; + broken = stdenv.hostPlatform.isDarwin; }; })