testing/lem: new aport

https://lem-project.github.io/
Common Lisp editor/IDE with high expansibility
This commit is contained in:
Celeste 2024-04-29 06:11:22 +00:00
parent 73f8129517
commit 653d114fcf
6 changed files with 264 additions and 0 deletions

143
testing/lem/APKBUILD Normal file
View File

@ -0,0 +1,143 @@
# Based on AUR's lem-editor-git & qlot
# Contributor: Celeste <cielesti@protonmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=lem
pkgver=2.2.0
pkgrel=0
pkgdesc="Common Lisp editor/IDE with high expansibility"
url="https://lem-project.github.io/"
arch="aarch64 x86_64"
license="MIT"
makedepends="
libdecor-dev
ncurses-dev
sbcl
sdl2-dev
sdl2_image-dev
sdl2_ttf-dev
"
checkdepends="roswell"
subpackages="
$pkgname-common
$pkgname-gui
"
_qlotver=1.5.1
source="https://github.com/lem-project/lem/archive/refs/tags/v$pkgver/lem-$pkgver.tar.gz
https://github.com/fukamachi/qlot/releases/download/$_qlotver/qlot-$_qlotver.tar.gz
aarch64-disable-timer-tests_patch
build-ncurses.lisp
build-sdl2.lisp
general.lisp
lem.desktop
"
options="!strip"
prepare() {
default_prepare
cd "$srcdir"/qlot
sbcl --noinform --no-sysinit --no-userinit --non-interactive \
--load .bundle-libs/bundle.lisp \
--eval "(asdf:load-asd #P\"$srcdir/qlot/qlot.asd\")" \
--eval '(let ((*standard-output* (make-broadcast-stream))
(*trace-output* (make-broadcast-stream)))
(mapc (function asdf:load-system)
(list :qlot :qlot/subcommands :qlot/cli :qlot/fetch)))'
cd "$builddir"
"$srcdir"/qlot/scripts/run.sh install
case "$CARCH" in
aarch64)
patch lem-tests.asd \
"$srcdir"/aarch64-disable-timer-tests_patch
;;
esac
}
build() {
msg "Building lem"
sbcl --noinform --no-sysinit --no-userinit \
--load .qlot/setup.lisp \
--load "$srcdir"/build-ncurses.lisp
msg "Building lem-gui"
sbcl --noinform --no-sysinit --no-userinit \
--load .qlot/setup.lisp \
--load "$srcdir"/build-sdl2.lisp
}
check() {
.qlot/bin/rove lem-tests.asd
}
package() {
depends="
$pkgname-common=$pkgver-r$pkgrel
libcrypto3
libssl3
so:libncursesw.so.6
"
install -dvm755 "$pkgdir"/usr/share/lem
cp -vr frontends/sdl2/resources "$pkgdir"/usr/share/lem/
# Devendor Noto fonts
rm -v "$pkgdir"/usr/share/lem/resources/fonts/NotoColorEmoji.ttf \
"$pkgdir"/usr/share/lem/resources/fonts/NotoSansCJK-Bold.ttc \
"$pkgdir"/usr/share/lem/resources/fonts/NotoSansCJK-Regular.ttc
ln -sv /usr/share/fonts/noto/NotoColorEmoji.ttf \
"$pkgdir"/usr/share/lem/resources/fonts/
ln -sv /usr/share/fonts/noto/NotoSansCJK-Bold.ttc \
"$pkgdir"/usr/share/lem/resources/fonts/
ln -sv /usr/share/fonts/noto/NotoSansCJK-Regular.ttc \
"$pkgdir"/usr/share/lem/resources/fonts/
install -Dvm755 lem lem-gui -t "$pkgdir"/usr/bin/
install -Dvm755 "$srcdir"/libasyncprocess.so \
-t "$pkgdir"/usr/share/lem/
install -Dvm644 "$srcdir"/lem.desktop \
-t "$pkgdir"/usr/share/applications/
install -Dvm644 LICENCE \
"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
common() {
pkgdesc="$pkgdesc (common files)"
depends=
amove usr/share/lem/libasyncprocess.so
amove usr/share/licenses/$pkgname
}
gui() {
pkgdesc="$pkgdesc (graphical variant)"
depends="
$pkgname-common=$pkgver-r$pkgrel
font-noto-cjk
font-noto-emoji
libcrypto3
libssl3
so:libdecor-0.so.0
so:libffi.so.8
so:libsamplerate.so.0
so:libtiff.so.6
so:libSDL2-2.0.so.0
so:libSDL2_image-2.0.so.0
so:libSDL2_ttf-2.0.so.0
"
amove usr/bin/lem-gui
amove usr/share/applications/lem.desktop
amove usr/share/lem/resources
}
sha512sums="
db4ea4bf1f4cf5dbc6f29c8e528bf05214e58d520dd11c9eab032e2e478b9612f2378827796e56133e6d58bf2297c8f1a8f693ae77bb4d85bb63369480573301 lem-2.2.0.tar.gz
6bc3b1f0f3e4e745af08f47249aa8693539ae441478db46c95140caa757561e161f06492a73b0fff366fffab3c2e5303c74dc2d3a8686a2450106bd27ce50c6e qlot-1.5.1.tar.gz
7f7f3a2d5d6fd4fab567e9c07284e6b9919857802ecdeffa4dd1e42078ba7b51133c8db7c8efcf2c33448c2d741f734c96b3ed8f68059489b2c32de1ccc2060c aarch64-disable-timer-tests_patch
44ad20459851217cf5c5cc9d1a75583b5ebf1de1de6cece44f0073042420c4d6533838ae5f785d40c25cfd7d71b589d39be076f3ad7c6ef2e53e9a574e134d91 build-ncurses.lisp
b4f4786cd9ae1e122d142f9957b758b0c2a5bb4ef444570a682298c22b58c92f8966684c1aeb306ee13e834539daadfa13a84663adab3fb1604681b8a66d82bf build-sdl2.lisp
07094800689a2cba48c21de6c9086961eebab8a47f21f153041d76f3d6a85ea98653fb21ef6a81a2e4aa07a25f1f36736e50ca858614135ba07586062b0d5364 general.lisp
e78665b79229caf77b432fff89241de7fab1746ba6e5a27de9fafbe8ffebc8fae858e0653d29ff47db205b7e07b64526efb21fae416ef83913ac0fd804a78916 lem.desktop
"

View File

@ -0,0 +1,12 @@
--- a/lem-tests.asd
+++ b/lem-tests.asd
@@ -11,8 +11,7 @@
(:module "common"
:components ((:file "ring")
(:file "killring")
- (:file "history")
- (:file "timer")))
+ (:file "history")))
#+sbcl
(:module "language-server"
:components ((:file "utils")

View File

@ -0,0 +1,18 @@
(ql:quickload :lem-ncurses)
(cffi:close-foreign-library 'async-process::async-process)
(defun setup-foreign-library-directories ()
(setf cffi:*foreign-library-directories* '())
(cffi:load-foreign-library "/usr/share/lem/libasyncprocess.so"))
(load (merge-pathnames "general.lisp" *load-pathname*))
(apply #'sb-ext:save-lisp-and-die
"lem"
:toplevel 'launch
:executable t
#+sb-core-compression
'(:compression -1)
#-sb-core-compression
'())

View File

@ -0,0 +1,29 @@
(ql:quickload :lem-sdl2)
(cffi:close-foreign-library 'async-process::async-process)
(cffi:close-foreign-library 'sdl2::libsdl2)
(cffi:close-foreign-library 'sdl2-ttf::libsdl2-ttf)
(cffi:close-foreign-library 'sdl2-image::libsdl2-image)
(defun setup-foreign-library-directories ()
(setf cffi:*foreign-library-directories* '())
(cffi:load-foreign-library "/usr/share/lem/libasyncprocess.so")
(cffi:load-foreign-library "libdecor-0.so.0")
(cffi:load-foreign-library "libtiff.so.6")
(cffi:load-foreign-library "libsamplerate.so.0")
(cffi:load-foreign-library "libSDL2-2.0.so.0")
(cffi:load-foreign-library "libSDL2_image-2.0.so.0")
(cffi:load-foreign-library "libSDL2_ttf-2.0.so.0"))
(load (merge-pathnames "general.lisp" *load-pathname*))
(setf lem-sdl2/resource::*resource-directory* #p"/usr/share/lem/")
(apply #'sb-ext:save-lisp-and-die
"lem-gui"
:toplevel 'launch
:executable t
#+sb-core-compression
'(:compression -1)
#-sb-core-compression
'())

53
testing/lem/general.lisp Normal file
View File

@ -0,0 +1,53 @@
(in-package :cl-user)
(setq lem-core::*deployed* t)
(dolist (module sb-impl::*modules*)
(require module))
(setq asdf:*output-translations-parameter* nil
asdf/output-translations:*output-translations* nil)
;; XXX:
;; (ql:quickload :drakma) causes sb-bsd-sockets require to fail.
;; Override this method to work around it.
(defmethod asdf:perform ((o asdf:load-op) (s asdf:require-system))
nil)
(defmethod asdf:output-files :around ((operation t) (component t))
(call-next-method)
;; XXX:
;; Disable the following code defined in asdf
;; because the target environment may refer to directories in the host environment
#+(or)
(do-asdf-cache `(output-files ,operation ,component)
(values
(multiple-value-bind (pathnames fixedp) (call-next-method)
;; 1- Make sure we have absolute pathnames
(let* ((directory (pathname-directory-pathname
(component-pathname (find-component () component))))
(absolute-pathnames
(loop
:for pathname :in pathnames
:collect (ensure-absolute-pathname pathname directory))))
;; 2- Translate those pathnames as required
(if fixedp
absolute-pathnames
(mapcar *output-translation-function* absolute-pathnames))))
t)))
(uiop:copy-file (cffi:foreign-library-pathname (cffi::get-foreign-library 'async-process::async-process))
(merge-pathnames #p"libasyncprocess.so" *load-pathname*))
(maphash (lambda (key value)
(declare (ignore value))
(unless (or (equal key "asdf")
(equal key "asdf-package-system")
(equal key "uiop")
(uiop:string-prefix-p "sb-" key))
(remhash key asdf::*registered-systems*)))
asdf::*registered-systems*)
(defun launch (&optional (args (uiop:command-line-arguments)))
(setup-foreign-library-directories)
(apply #'lem:lem args))

9
testing/lem/lem.desktop Normal file
View File

@ -0,0 +1,9 @@
[Desktop Entry]
Name=Lem
GenericName=Text Editor
Exec=/usr/bin/lem-gui %F
Comment=An extensible editor written in Common Lisp
Terminal=false
Icon=/usr/share/lem/resources/icon.png
Type=Application
Category=Development;TextEditor;