这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions disabled-packages/sbcl/build.sh

This file was deleted.

15 changes: 0 additions & 15 deletions disabled-packages/sbcl/make-config.sh.patch

This file was deleted.

19 changes: 16 additions & 3 deletions packages/ecl/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,29 @@ TERMUX_PKG_HOMEPAGE=https://common-lisp.net/project/ecl/
TERMUX_PKG_DESCRIPTION="ECL (Embeddable Common Lisp) is an interpreter of the Common Lisp language"
TERMUX_PKG_LICENSE="LGPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="21.2.1"
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL=https://common-lisp.net/project/ecl/static/files/release/ecl-${TERMUX_PKG_VERSION}.tgz
TERMUX_PKG_VERSION=2023.01.02
TERMUX_PKG_SRCURL=git+https://gitlab.com/embeddable-common-lisp/ecl
_COMMIT=fc30c62ea09b0eb2e99280d05554ce99e0bd83e5
TERMUX_PKG_GIT_BRANCH=develop
TERMUX_PKG_SHA256=b15a75dcf84b8f62e68720ccab1393f9611c078fcd3afdd639a1086cad010900
TERMUX_PKG_DEPENDS="libandroid-support, libgmp, libgc, libffi"
TERMUX_PKG_HOSTBUILD=true
TERMUX_PKG_NO_STATICSPLIT=true
TERMUX_PKG_BLACKLISTED_ARCHES="i686, x86_64"
TERMUX_PKG_HAS_DEBUG=false

termux_step_post_get_source() {
git fetch --unshallow
git checkout $_COMMIT

local version="$(git log -1 --format=%cs | sed 's/-/./g')"
if [ "$version" != "$TERMUX_PKG_VERSION" ]; then
echo -n "ERROR: The specified version \"$TERMUX_PKG_VERSION\""
echo " is different from what is expected to be: \"$version\""
return 1
fi
}

# See https://gitlab.com/embeddable-common-lisp/ecl/-/blob/develop/INSTALL
# for upstream cross build guide.

Expand Down
23 changes: 23 additions & 0 deletions packages/sbcl/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
TERMUX_PKG_HOMEPAGE=https://www.sbcl.org/
TERMUX_PKG_DESCRIPTION="Steel Bank Common Lisp"
TERMUX_PKG_LICENSE="BSD"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=2.3.0
TERMUX_PKG_SRCURL=https://prdownloads.sourceforge.net/sbcl/sbcl-${TERMUX_PKG_VERSION}-source.tar.bz2
TERMUX_PKG_BUILD_DEPENDS="ecl"
TERMUX_PKG_SHA256=bf743949712ae02cb7493f3b8b57ce241948bf61131e36860ddb334da1439c97

termux_step_make() {
cd $TERMUX_PKG_SRCDIR
XC_HOST="$TERMUX_PREFIX/bin/ecl --norc --c-stack 16777217"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work for cross-compilation, can't run $TERMUX_PREFIX/bin/ecl in the ubuntu docker image. Instead /usr/bin/ecl from ubuntu, or some ecl compiled in termux_step_host_build, needs to be used.

Add ecl to setup-ubuntu.sh to install ubuntu's ecl in the docker image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose ubuntu 22.04's ecl will be too old as well, so we might need to compile a newer ecl in a termux_step_host_build step for this to work

Copy link
Author

@aadcg aadcg Jan 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might need to compile a newer ecl in a termux_step_host_build step for this to work

In that case, it would be better to use SBCL as the host. I will try to do it!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation is different on this line compared to rest of the script (use tabs everywhere)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

./make.sh --prefix=$TERMUX_PREFIX \
--xc-host="$XC_HOST" \
--with-android \
--fancy \
--without-gcc-tls
}

termux_step_make_install() {
cd $TERMUX_PKG_SRCDIR
./install.sh
}
27 changes: 27 additions & 0 deletions packages/sbcl/src-code-android-os.lisp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- a/src/code/android-os.lisp
+++ b/src/code/android-os.lisp
@@ -19,24 +19,6 @@
"Return a string describing the supporting software."
"Android")

-;;; FIXME: More duplicated logic here vrt. other oses. Abstract into
-;;; uname-software-version?
-(defun software-version ()
- "Return a string describing version of the supporting software, or NIL
- if not available."
- (or *software-version*
- (setf *software-version*
- (sb-alien:with-alien
- ((ptr (* char)
- (sb-alien:alien-funcall
- (sb-alien:extern-alien "software_version"
- (function (* sb-alien:char))))))
- (and (not (sb-alien:null-alien ptr))
- (unwind-protect
- (sb-alien:with-alien ((c-string sb-alien:c-string ptr))
- c-string)
- (sb-alien:free-alien ptr)))))))
-
;;; Return user time, system time, and number of page faults.
(defun get-system-info ()
(multiple-value-bind
19 changes: 19 additions & 0 deletions packages/sbcl/src-code-run-program.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--- a/src/code/run-program.lisp
+++ b/src/code/run-program.lisp
@@ -1329,14 +1329,7 @@ Users Manual for details about the PROCESS structure.
(or sb-sys::*software-version*
(setf sb-sys::*software-version*
(possibly-base-stringize
- #+linux
- (with-open-file (f "/proc/sys/kernel/osrelease") (read-line f))
- #-linux
(string-trim '(#\newline)
(%with-output-to-string (stream)
- (run-program "/bin/uname"
- ;; "-r" on haiku just prints "1"
- ;; but "-v" prints some detail.
- #+haiku '("-v")
- #-haiku '("-r")
- :output stream)))))))
+ (run-program "/data/data/com.termux/files/usr/bin/uname"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use @TERMUX_PREFIX@ instead of /data/data/com.termux/files/usr in patches, it is automatically sed'ed when patch is applied

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

+ '("-r") :output stream)))))))
9 changes: 9 additions & 0 deletions packages/sbcl/src-cold-build-order.lisp-expr.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--- a/src/cold/build-order.lisp-expr
+++ b/src/cold/build-order.lisp-expr
@@ -490,7 +490,6 @@
#+android ("src/code/android-os" :not-host)
#+sunos ("src/code/sunos-os" :not-host)
#+bsd ("src/code/bsd-os" :not-host)
- #+linux ("src/code/linux-os" :not-host)
#+haiku ("src/code/haiku-os" :not-host)
#+win32 ("src/code/win32-os" :not-host)
11 changes: 11 additions & 0 deletions packages/sbcl/src-runtime-run-program.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/src/runtime/run-program.c
+++ b/src/runtime/run-program.c
@@ -144,7 +144,7 @@ void closefds_range(unsigned int first, unsigned int last)
unsigned int close_fd;
if (last == ~0U)
{
-#ifdef SVR4
+#if defined(SVR4) || defined(LISP_FEATURE_ANDROID)
last = sysconf(_SC_OPEN_MAX)-1;
#else
last = getdtablesize()-1;