diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-lisp/clozurecl |
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-lisp/clozurecl')
-rw-r--r-- | dev-lisp/clozurecl/Manifest | 13 | ||||
-rw-r--r-- | dev-lisp/clozurecl/clozurecl-1.10.ebuild | 91 | ||||
-rw-r--r-- | dev-lisp/clozurecl/clozurecl-1.11-r1.ebuild | 93 | ||||
-rw-r--r-- | dev-lisp/clozurecl/clozurecl-1.11-r2.ebuild | 100 | ||||
-rw-r--r-- | dev-lisp/clozurecl/files/ccl-format.patch | 128 | ||||
-rw-r--r-- | dev-lisp/clozurecl/metadata.xml | 11 |
6 files changed, 436 insertions, 0 deletions
diff --git a/dev-lisp/clozurecl/Manifest b/dev-lisp/clozurecl/Manifest new file mode 100644 index 000000000000..599b53f4b3ca --- /dev/null +++ b/dev-lisp/clozurecl/Manifest @@ -0,0 +1,13 @@ +AUX ccl-format.patch 4281 SHA256 3b1c1d2cec58270c8286da7153e0d9710258aa657238a9e6e55b3f5ff317dde8 SHA512 61bc053d0b7bdfcb9d81fd472e2569bb3d2805f87afff57855ba5a86f745141190b1804067628d2e70ec399585a66289c10fdaf3ffdc81bd2b442b1873c75e1a WHIRLPOOL 046c7ddba6c09c10dddd0cfa96fda15bd21c97de951c0a52c7e41196897de2097f8b785e37b323afaf878de2f324241500687907ebc641ae23b39e9adebc1a03 +DIST ccl-1.10-linuxx86.tar.gz 43796090 SHA256 8ca272656214837b57746b9b84395987bc524329b38a1f42a605f45bf0282657 SHA512 10504e2569a99ba8b6fc4ac745312435c6be646c86ec3916a3750f823f79b3b8ec87fe53ba2410151feeaaed0609e1760ee3d37a77f01d815d1ec13c2394258e WHIRLPOOL 75c7516eba92ad0fc603301e958dc5ba8271b0819ab46af7f61e97edeb405098c4d84a8f8e8ed73ee85462b6ab7c4805bbcbf0a0f354fb62f077cf8cf10bffa4 +DIST ccl-1.11-darwinx86.tar.gz 14270464 SHA256 cf488651315638246ecdb9b7e8d58d78e0ce3222318044a115533e9b536fd94e SHA512 c2d320872c402405d2972898c77401b1c046685af95e75e0646be989fe91d2ff458a29eaa9c1475cb73531f30858c57a075a23bdf95b9bbf269d63399aea9ea1 WHIRLPOOL 9435cc26c854cd1044178c26e1f6836d4edbfd1763dfc6216017d892c999d8d46ca969c94bb3e7f3503cfad2edfc588ae45716c1c9c5fcd283669110633f45db +DIST ccl-1.11-linuxarm.tar.gz 23044178 SHA256 64a1911fbe516b73964b377df360c3a40695c6155e0730a6590c67f1953a88f4 SHA512 b8034569f0c47106107fee6bd859051052d43c3bcd625a1956eae467ef0225425d5429678e3584136adc929ccfbbe4b800bffa66ea758cd2b734aa3ed55a9dda WHIRLPOOL bdd4e01fbfb1a5e2ac8b1d2ba9b85dd5e01e94ea0b99718e757b1e1c0b1c5dbc6ffd988ca5d7a7ac494b8cdb8ff4ca36260d61a32e39b6314fc4aec3253f9ff7 +DIST ccl-1.11-linuxx86.tar.gz 42482877 SHA256 08e885e8c2bb6e4abd42b8e8e2b60f257c6929eb34b8ec87ca1ecf848fac6d70 SHA512 34008654fd3ceca55a33413a768c398395141e26b9ea09204739ca7e998fdbe94ab92507eda14cf9bcbb9f76e6c3cae3006d7f2c9f48749c66e1f1281febb409 WHIRLPOOL 4a0d1e6495be62f04f48d6923f95468ca1d1c8bafb3c00d4a5b1f705eb70fac52b7d8ed3b248b698707cd89f1eb4a0196b94d869e9bea52ea895fb8fae00bb41 +DIST ccl-1.11-solarisx86.tar.gz 46926817 SHA256 8b983ec3968e987bae6109dbb12d912ea8f050983dcd3eb9e8a5e91f45f683aa SHA512 f35df9e9c7644331a0f6b77e7b0a6f0b2e297f6249ef7a669932ab6685ca426f87423faf01c64cc1f7eb7fcd0dd4fb7c0d70d039bbcadca5d9201b0a348a36be WHIRLPOOL 11e37a489cf51bff1084cacb33c91aa952f3552b2dac0d23c744d5371f45b8bd41fdb39bfdb5fc40bfc2f2467e5aa6224067f8b8a0ecf01ad9eddbc0d3fded7b +DIST ccl.html 962003 SHA256 10fe7bf2818a2a029dcd53b274124f84713bed32b24170d09134feee470a5c6e SHA512 0cb9ee8f7eb6007e08241a0797519ff3bfc3d3adc0b5ac86e6a2e9e8b2e316fc421bea3b04159decc0a2b37ff7098147e25266946cc3c1ac367b93e4821a8b64 WHIRLPOOL ce93bb1537fd5c03050b5aa7f14414188a3cacf881ff0fcb87c532a43e51bd6139a11dd58c28397e7981ab120ce85e8303762c5f418f995b1c545f436b4d6abe +EBUILD clozurecl-1.10.ebuild 2603 SHA256 a154a1328c05771a6dd0a7b5d9ae81831688f803e274a6f4cbb3dd6b7434c825 SHA512 3e7ed98b174f93835bea922e0ce58b60027d6fb920d515b5e108933e64fedee1380524ce0abb30daa7468813eeaf75cb9c0fc47bbfb63ae0e311ccf4df0a66ab WHIRLPOOL fc8c20ae1b8bbd8e860e38d1741182a16c440b9391018c532be9a23ea8ee766a36684dc3a9d4dc0e376a35a80aa919abbad5ee67141593ac87a7f020d2d604bf +EBUILD clozurecl-1.11-r1.ebuild 2701 SHA256 069e1484a5758f6e461c184bc53184351f004fff80f0329525440c04aa870697 SHA512 91cbf704a82d5672fc9cd51f9b08e5df4eb4335b00f944d85cf60b60e8ddff9f4464cbe72f99d5dfebce237fcd2df1431fc78210a59ee33a6e6d36ee84766b2f WHIRLPOOL 858f61bae5e5421105c0d39bf6dc7415fc7ad2b55a30712db43802cbda3cfe53408d0432872b5836a8e195c5b7e05552424c7d9bb3158b1178862304b7e36a33 +EBUILD clozurecl-1.11-r2.ebuild 3291 SHA256 7d4bd970ea2b05118791f47b243675f25742673f5c594b5bc7639f17ac47fb38 SHA512 6d6b62b08c9a81a82a1c75ace997409eaa48644cac79b9eee90e117d22324594b3a0f57d842393085f4ef43969bac6032768a4f0ef20f98fbd10fe523f67b765 WHIRLPOOL 50f12c265d57d2f810c1c33095e9307bfd9aef0f78b9179019550dd0413ab4e284dd2860f320b9adee165117f422978e8a15d040df2bbaab8fa4cc769dadbaaf +MISC ChangeLog 4443 SHA256 a62600347c4f788a823892454849bc2fed43ed7db3bd36a9e879aeaa05ebeafb SHA512 75ebfbd69d80b756a72568839f4c6c7af191fb2c05b7711841661d06c7f7ee97709037b5d214cdac45ac445b60c9f3c5ffe43bdf6bbc14bebc484fcdf939fd24 WHIRLPOOL c8c8d54d01b9d7553518011a8b47cc2df26e19adf291fe38908c524c28ab295be3aeac0daf1954399e18a1264e33b1c33b9e89a8d56250d03b777f16780b0eb8 +MISC ChangeLog-2015 2253 SHA256 2dba678a269bac26f5381dc6243387186f10b9d39dde484819b6f3fd1f974182 SHA512 661f6c431698b744df57acf2ceb31857160ea0bdbfa8491d980bf38b8f7096ff94d965b315aaf395a70d733f39531743ff42ee7864b55eac35f0a9472cde0174 WHIRLPOOL 6da6c8de3b9cb271dc71037a5949ca18ae1bab5f840020c51135330e2d3b25955789300174b52761a3fdcfc99984dda3eb2f574d699574d8804df640b9a2613c +MISC metadata.xml 370 SHA256 6424b7e838c0fdba4696a99d70b302b461d946672d171ee62b334f15e7ef91ff SHA512 d961c24b6532aa9e5b8a2727b3ada479743434549a9aaf9ac9c7cdd4d2414a4ba078fd153537afd0daa940eb435fcfb7852bed594ad807f5bbc62a99b8503d12 WHIRLPOOL ec684d9a71539ac2ffe4f1af3bf6f4627fd103e46944c7564be5e805cd479b69dcfc5dd9ba074bae7a5c111c629869bb2ebcf6786d876f60bb6f1d76ea0a9a3b diff --git a/dev-lisp/clozurecl/clozurecl-1.10.ebuild b/dev-lisp/clozurecl/clozurecl-1.10.ebuild new file mode 100644 index 000000000000..a9b11fd14aa7 --- /dev/null +++ b/dev-lisp/clozurecl/clozurecl-1.10.ebuild @@ -0,0 +1,91 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit eutils multilib toolchain-funcs + +MY_PN=ccl +MY_P=${MY_PN}-${PV} + +DESCRIPTION="Common Lisp implementation, derived from Digitool's MCL product" +HOMEPAGE="http://ccl.clozure.com/" +SRC_URI=" + x86? ( ftp://ftp.clozure.com/pub/release/${PV}/${MY_P}-linuxx86.tar.gz ) + amd64? ( ftp://ftp.clozure.com/pub/release/${PV}/${MY_P}-linuxx86.tar.gz )" + # ppc? ( ftp://ftp.clozure.com/pub/release/${PV}/${MY_P}-linuxppc.tar.gz ) + # ppc64? ( ftp://ftp.clozure.com/pub/release/${PV}/${MY_P}-linuxppc.tar.gz )" + +LICENSE="LLGPL-2.1" +SLOT="0" +# KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" +KEYWORDS="~amd64 ~x86" +IUSE="doc" + +RDEPEND=">=dev-lisp/asdf-2.33-r3:=" +DEPEND="${RDEPEND} + !dev-lisp/openmcl" + +S="${WORKDIR}"/${MY_PN} + +ENVD="${T}"/50ccl + +src_configure() { + if use x86; then + CCL_RUNTIME=lx86cl; CCL_HEADERS=x86-headers; CCL_KERNEL=linuxx8632 + elif use amd64; then + CCL_RUNTIME=lx86cl64; CCL_HEADERS=x86-headers64; CCL_KERNEL=linuxx8664 + elif use ppc; then + CCL_RUNTIME=ppccl; CCL_HEADERS=headers; CCL_KERNEL=linuxppc + elif use ppc64; then + CCL_RUNTIME=ppccl64; CCL_HEADERS=headers64; CCL_KERNEL=linuxppc64 + fi +} + +src_prepare() { + cp /usr/share/common-lisp/source/asdf/build/asdf.lisp tools/ || die +} + +src_compile() { + emake -C lisp-kernel/${CCL_KERNEL} clean + emake -C lisp-kernel/${CCL_KERNEL} all CC="$(tc-getCC)" + + unset CCL_DEFAULT_DIRECTORY + ./${CCL_RUNTIME} -n -b -Q -e '(ccl:rebuild-ccl :full t)' -e '(ccl:quit)' || die "Compilation failed" + + # remove non-owner write permissions on the full-image + chmod go-w ${CCL_RUNTIME}{,.image} || die + + esvn_clean +} + +src_install() { + local install_dir=/usr/$(get_libdir)/${PN} + + exeinto ${install_dir} + # install executable + doexe ${CCL_RUNTIME} + # install core image + cp ${CCL_RUNTIME}.image "${D}"/${install_dir} || die + # install optional libraries + dodir ${install_dir}/tools + cp tools/*fsl "${D}"/${install_dir}/tools || die + + # until we figure out which source files are necessary for runtime + # optional features and which aren't, we install all sources + find . -type f -name '*fsl' -delete || die + rm -f lisp-kernel/${CCL_KERNEL}/*.o || die + cp -a compiler level-0 level-1 lib library \ + lisp-kernel scripts tools xdump contrib \ + "${D}"/${install_dir} || die + cp -a ${CCL_HEADERS} "${D}"/${install_dir} || die + + make_wrapper ccl "${install_dir}/${CCL_RUNTIME}" + + echo "CCL_DEFAULT_DIRECTORY=${install_dir}" > "${ENVD}" + doenvd "${ENVD}" + + dodoc doc/release-notes.txt + dohtml doc/ccl-documentation.html + use doc && dohtml -r examples +} diff --git a/dev-lisp/clozurecl/clozurecl-1.11-r1.ebuild b/dev-lisp/clozurecl/clozurecl-1.11-r1.ebuild new file mode 100644 index 000000000000..6c355750f542 --- /dev/null +++ b/dev-lisp/clozurecl/clozurecl-1.11-r1.ebuild @@ -0,0 +1,93 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils multilib toolchain-funcs + +MY_PN=ccl +MY_P=${MY_PN}-${PV} + +DESCRIPTION="Common Lisp implementation, derived from Digitool's MCL product" +HOMEPAGE="http://ccl.clozure.com/" +SRC_URI=" + x86? ( ftp://ftp.clozure.com/pub/release/${PV}/${MY_P}-linuxx86.tar.gz ) + amd64? ( ftp://ftp.clozure.com/pub/release/${PV}/${MY_P}-linuxx86.tar.gz ) + doc? ( http://ccl.clozure.com/docs/ccl.html )" + # ppc? ( ftp://ftp.clozure.com/pub/release/${PV}/${MY_P}-linuxppc.tar.gz ) + # ppc64? ( ftp://ftp.clozure.com/pub/release/${PV}/${MY_P}-linuxppc.tar.gz )" + +LICENSE="LLGPL-2.1" +SLOT="0" +# KEYWORDS="~amd64 ~ppc ~ppc64 ~x86" +KEYWORDS="~amd64 ~x86" +IUSE="doc" + +RDEPEND=">=dev-lisp/asdf-2.33-r3:=" +DEPEND="${RDEPEND} + !dev-lisp/openmcl" + +S="${WORKDIR}"/${MY_PN} +ENVD="${T}"/50ccl + +src_configure() { + if use x86; then + CCL_RUNTIME=lx86cl; CCL_HEADERS=x86-headers; CCL_KERNEL=linuxx8632 + elif use amd64; then + CCL_RUNTIME=lx86cl64; CCL_HEADERS=x86-headers64; CCL_KERNEL=linuxx8664 + elif use ppc; then + CCL_RUNTIME=ppccl; CCL_HEADERS=headers; CCL_KERNEL=linuxppc + elif use ppc64; then + CCL_RUNTIME=ppccl64; CCL_HEADERS=headers64; CCL_KERNEL=linuxppc64 + fi +} + +src_prepare() { + default + epatch "${FILESDIR}"/ccl-format.patch + cp /usr/share/common-lisp/source/asdf/build/asdf.lisp tools/ || die +} + +src_compile() { + emake -C lisp-kernel/${CCL_KERNEL} clean + emake -C lisp-kernel/${CCL_KERNEL} all CC="$(tc-getCC)" + + unset CCL_DEFAULT_DIRECTORY + ./${CCL_RUNTIME} -n -b -Q -e '(ccl:rebuild-ccl :full t)' -e '(ccl:quit)' || die "Compilation failed" + + # remove non-owner write permissions on the full-image + chmod go-w ${CCL_RUNTIME}{,.image} || die + + esvn_clean +} + +src_install() { + local install_dir=/usr/$(get_libdir)/${PN} + + exeinto ${install_dir} + # install executable + doexe ${CCL_RUNTIME} + # install core image + cp ${CCL_RUNTIME}.image "${D}"/${install_dir} || die + # install optional libraries + dodir ${install_dir}/tools + cp tools/*fsl "${D}"/${install_dir}/tools || die + + # until we figure out which source files are necessary for runtime + # optional features and which aren't, we install all sources + find . -type f -name '*fsl' -delete || die + rm -f lisp-kernel/${CCL_KERNEL}/*.o || die + cp -a compiler level-0 level-1 lib library \ + lisp-kernel scripts tools xdump contrib \ + "${D}"/${install_dir} || die + cp -a ${CCL_HEADERS} "${D}"/${install_dir} || die + + make_wrapper ccl "${install_dir}/${CCL_RUNTIME}" + + echo "CCL_DEFAULT_DIRECTORY=${install_dir}" > "${ENVD}" + doenvd "${ENVD}" + + dodoc doc/release-notes.txt + use doc && dodoc "${DISTDIR}"/ccl.html + use doc && dodoc -r examples +} diff --git a/dev-lisp/clozurecl/clozurecl-1.11-r2.ebuild b/dev-lisp/clozurecl/clozurecl-1.11-r2.ebuild new file mode 100644 index 000000000000..8c1c342d8706 --- /dev/null +++ b/dev-lisp/clozurecl/clozurecl-1.11-r2.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit eutils flag-o-matic multilib toolchain-funcs + +MY_PN=ccl +MY_P=${MY_PN}-${PV} + +DESCRIPTION="Common Lisp implementation, derived from Digitool's MCL product" +HOMEPAGE="https://ccl.clozure.com" +SRC_URI=" + x86? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-linuxx86.tar.gz ) + amd64? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-linuxx86.tar.gz ) + arm? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-linuxarm.tar.gz ) + x86-macos? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-darwinx86.tar.gz ) + x64-macos? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-darwinx86.tar.gz ) + x86-solaris? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-solarisx86.tar.gz ) + x64-solaris? ( ${HOMEPAGE}/ftp/pub/release/${PV}/${MY_P}-solarisx86.tar.gz ) + doc? ( ${HOMEPAGE}/docs/ccl.html )" + +LICENSE="LLGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~x64-macos" +IUSE="doc" + +RDEPEND=">=dev-lisp/asdf-2.33-r3:=" +DEPEND="${RDEPEND}" + +S="${WORKDIR}"/${MY_PN} +ENVD="${T}/50ccl" + +src_configure() { + if use x86-macos; then + CCL_RUNTIME=dx86cl; CCL_HEADERS=darwin-x86-headers; CCL_KERNEL=darwinx8632 + elif use x64-macos; then + CCL_RUNTIME=dx86cl64; CCL_HEADERS=darwin-x86-headers64; CCL_KERNEL=darwinx8664 + elif use x86-solaris; then + CCL_RUNTIME=sx86cl; CCL_HEADERS=solarisx86-headers; CCL_KERNEL=solarisx86 + elif use x64-solaris; then + CCL_RUNTIME=sx86cl64; CCL_HEADERS=solarisx64-headers; CCL_KERNEL=solarisx64 + elif use x86; then + CCL_RUNTIME=lx86cl; CCL_HEADERS=x86-headers; CCL_KERNEL=linuxx8632 + elif use amd64; then + CCL_RUNTIME=lx86cl64; CCL_HEADERS=x86-headers64; CCL_KERNEL=linuxx8664 + elif use arm; then + CCL_RUNTIME=armcl; CCL_HEADERS=arm-headers; CCL_KERNEL=linuxarm + elif use ppc; then + CCL_RUNTIME=ppccl; CCL_HEADERS=headers; CCL_KERNEL=linuxppc + elif use ppc64; then + CCL_RUNTIME=ppccl64; CCL_HEADERS=headers64; CCL_KERNEL=linuxppc64 + fi +} + +src_prepare() { + default + eapply "${FILESDIR}/${MY_PN}-format.patch" + # https://lists.clozure.com/pipermail/openmcl-devel/2016-September/011399.html + sed -i "s/-dynamic/-no_pie/" "${S}/lisp-kernel/darwinx8664/Makefile" || die + cp "${EPREFIX}/usr/share/common-lisp/source/asdf/build/asdf.lisp" tools/ || die +} + +src_compile() { + emake -C lisp-kernel/${CCL_KERNEL} clean + emake -C lisp-kernel/${CCL_KERNEL} all CC="$(tc-getCC)" + + unset CCL_DEFAULT_DIRECTORY + ./${CCL_RUNTIME} -n -b -Q -e '(ccl:rebuild-ccl :full t)' -e '(ccl:quit)' || die "Compilation failed" + + # remove non-owner write permissions on the full-image + chmod go-w ${CCL_RUNTIME}{,.image} || die + + esvn_clean +} + +src_install() { + local target_dir="/usr/$(get_libdir)/${PN}" + local prefix_dir="${EPREFIX}/${target_dir#/}" + + mkdir -p "${D}/${prefix_dir#/}" + + find . -type f -name '*fsl' -delete || die + rm -f lisp-kernel/${CCL_KERNEL}/*.o || die + cp -a compiler contrib level-0 level-1 lib library lisp-kernel scripts \ + tools xdump ${CCL_HEADERS} ${CCL_RUNTIME} ${CCL_RUNTIME}.image \ + "${D}/${prefix_dir#/}" || die + + echo "CCL_DEFAULT_DIRECTORY=${prefix_dir}" > "${ENVD}" + doenvd "${ENVD}" + + dosym "${target_dir}/${CCL_RUNTIME}" /usr/bin/ccl + dodoc doc/release-notes.txt + + if use doc ; then + dodoc "${DISTDIR}/ccl.html" + dodoc -r doc/manual + dodoc -r examples + fi +} diff --git a/dev-lisp/clozurecl/files/ccl-format.patch b/dev-lisp/clozurecl/files/ccl-format.patch new file mode 100644 index 000000000000..c2df37c2b870 --- /dev/null +++ b/dev-lisp/clozurecl/files/ccl-format.patch @@ -0,0 +1,128 @@ +diff -r -U1 ccl.orig/lib/format.lisp ccl/lib/format.lisp +--- ccl.orig/lib/format.lisp 2015-11-07 02:10:10.000000000 +0600 ++++ ccl/lib/format.lisp 2015-11-20 22:51:51.736191995 +0600 +@@ -1296,5 +1296,2 @@ + +- +- +- + ;;; Given a non-negative floating point number, SCALE-EXPONENT returns a +@@ -1305,41 +1302,74 @@ + +- +-(defconstant long-log10-of-2 0.30103d0) +- +-#| +-(defun scale-exponent (x) +- (if (floatp x ) +- (scale-expt-aux (abs x) 0.0d0 1.0d0 1.0d1 1.0d-1 long-log10-of-2) +- (report-bad-arg x 'float))) +- +-#|this is the slisp code that was in the place of the error call above. +- before floatp was put in place of shortfloatp. +- ;(scale-expt-aux x (%sp-l-float 0) (%sp-l-float 1) %long-float-ten +- ; %long-float-one-tenth long-log10-of-2))) +-|# +- +-; this dies with floating point overflow (?) if fed least-positive-double-float +- +-(defun scale-expt-aux (x zero one ten one-tenth log10-of-2) +- (let ((exponent (nth-value 1 (decode-float x)))) +- (if (= x zero) +- (values zero 1) +- (let* ((e (round (* exponent log10-of-2))) +- (x (if (minusp e) ;For the end ranges. +- (* x ten (expt ten (- -1 e))) +- (/ x ten (expt ten (1- e)))))) +- (do ((d ten (* d ten)) +- (y x (/ x d)) +- (e e (1+ e))) +- ((< y one) +- (do ((m ten (* m ten)) +- (z y (* z m)) +- (e e (1- e))) +- ((>= z one-tenth) (values x e))))))))) +-|# +- +-(defun scale-exponent (n) +- (let ((exp (nth-value 1 (decode-float n)))) +- (values (round (* exp long-log10-of-2))))) +- ++(defconstant single-float-min-e ++ (nth-value 1 (decode-float least-positive-single-float))) ++(defconstant double-float-min-e ++ (nth-value 1 (decode-float least-positive-double-float))) ++ ++;;; Adapted from CMUCL. ++ ++;; This is a modified version of the scale computation from Burger and ++;; Dybvig's paper "Printing floating-point quickly and accurately." ++;; We only want the exponent, so most things not needed for the ++;; computation of the exponent have been removed. We also implemented ++;; the floating-point log approximation given in Burger and Dybvig. ++;; This is very noticeably faster for large and small numbers. It is ++;; slower for intermediate sized numbers. ++(defun accurate-scale-exponent (v) ++ (declare (type float v)) ++ (if (zerop v) ++ 1 ++ (let ((float-radix 2) ; b ++ (float-digits (float-digits v)) ; p ++ (min-e ++ (etypecase v ++ (single-float single-float-min-e) ++ (double-float double-float-min-e)))) ++ (multiple-value-bind (f e) ++ (integer-decode-float v) ++ (let ( ;; FIXME: these even tests assume normal IEEE rounding ++ ;; mode. I wonder if we should cater for non-normal? ++ (high-ok (evenp f))) ++ ;; We only want the exponent here. ++ (labels ((flog (x) ++ (declare (type (float (0.0)) x)) ++ (let ((xd (etypecase x ++ (single-float ++ (float x 1d0)) ++ (double-float ++ x)))) ++ (ceiling (- (the (double-float -400d0 400d0) ++ (log xd 10d0)) ++ 1d-10)))) ++ (fixup (r s m+ k) ++ (if (if high-ok ++ (>= (+ r m+) s) ++ (> (+ r m+) s)) ++ (+ k 1) ++ k)) ++ (scale (r s m+) ++ (let* ((est (flog v)) ++ (scale (the integer (10-to-e (abs est))))) ++ (if (>= est 0) ++ (fixup r (* s scale) m+ est) ++ (fixup (* r scale) s (* m+ scale) est))))) ++ (let (r s m+) ++ (if (>= e 0) ++ (let* ((be (expt float-radix e)) ++ (be1 (* be float-radix))) ++ (if (/= f (expt float-radix (1- float-digits))) ++ (setf r (* f be 2) ++ s 2 ++ m+ be) ++ (setf r (* f be1 2) ++ s (* float-radix 2) ++ m+ be1))) ++ (if (or (= e min-e) ++ (/= f (expt float-radix (1- float-digits)))) ++ (setf r (* f 2) ++ s (* (expt float-radix (- e)) 2) ++ m+ 1) ++ (setf r (* f float-radix 2) ++ s (* (expt float-radix (- 1 e)) 2) ++ m+ float-radix))) ++ (scale r s m+)))))))) + +@@ -1922,3 +1952,3 @@ + (format-error "incompatible values for k and d"))) +- (when (not exp) (setq exp (scale-exponent number))) ++ (when (not exp) (setq exp (accurate-scale-exponent (abs number)))) + AGAIN diff --git a/dev-lisp/clozurecl/metadata.xml b/dev-lisp/clozurecl/metadata.xml new file mode 100644 index 000000000000..ee9b0de2aad2 --- /dev/null +++ b/dev-lisp/clozurecl/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<maintainer type="project"> + <email>common-lisp@gentoo.org</email> + <name>Gentoo Common Lisp Project</name> +</maintainer> +<longdescription> +Clozure Common Lisp (formerly OpenMCL) is a Common Lisp implementation. +</longdescription> +</pkgmetadata> |