learning to add quicklisp to flake
and non CL dependencies without which nix-store SBCL isn't able to install pakcages
This commit is contained in:
parent
89673df888
commit
0b3a788a13
|
@ -0,0 +1,83 @@
|
||||||
|
;; here's most up-to-date thing?
|
||||||
|
;; https://github.com/rabbibotton/clog
|
||||||
|
;;
|
||||||
|
;; welp currently can't load clog, libraries are not found
|
||||||
|
;; tried to add openssl to buildinputs, but not yet working
|
||||||
|
(defun pkg-config-add-lib (libname)
|
||||||
|
(let ((process (sb-ext:run-program "/usr/bin/env"
|
||||||
|
(list "pkg-config" libname "--libs-only-L")
|
||||||
|
:input t :output :stream :wait t)))
|
||||||
|
(let ((stream (sb-ext:process-output process)))
|
||||||
|
(loop for line = (read-line stream nil nil)
|
||||||
|
while line do
|
||||||
|
(format t "~&another lib ~S" line)
|
||||||
|
;; Drop "-L" part, and add '/' to the end '/' IS necessary!
|
||||||
|
;; (pushnew (pathname (concatenate 'string (subseq line 2) "/"))
|
||||||
|
;; cffi:*foreign-library-directories*))
|
||||||
|
(sb-ext:process-close process)))))
|
||||||
|
|
||||||
|
(pkg-config-add-lib "libcrypto")
|
||||||
|
|
||||||
|
;; nope, I don't understand it, and it doesn't work
|
||||||
|
|
||||||
|
(ql:quickload :clog)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(set-on-new-window (lambda (body) (create-div body :content "hello world.")))
|
||||||
|
(dotimes (n 10) (create-div *body* :content (format nil "Line ~A - Hello World" n)) (sleep .3))
|
||||||
|
|
||||||
|
(clog:is-running-p)
|
||||||
|
(clog:debug-mode)
|
||||||
|
|
||||||
|
(in-package clog-user)
|
||||||
|
|
||||||
|
(clog-install-dir)
|
||||||
|
;; #P"/home/efim/quicklisp/local-projects/clog/"
|
||||||
|
|
||||||
|
(ql:quickload :clog/tools) ; clog-terminal not found =C
|
||||||
|
(ql:quickload :clog-terminal/tools) ; well, my guess is that I'm not using latest? since I've what, downloaded to local projects
|
||||||
|
; instead of adding a repository?
|
||||||
|
;; yup, some repos weren't cloned
|
||||||
|
|
||||||
|
(clog-tools:clog-builder)
|
||||||
|
|
||||||
|
(clog:open-manual)
|
||||||
|
|
||||||
|
(ql:quickload :clog/terminal) ; yup after cloning more repos
|
||||||
|
|
||||||
|
(clog-tools:clog-db-admin)
|
||||||
|
|
||||||
|
;; (initialize)
|
||||||
|
;; well, now it's time to try to go through tutorials, i guess
|
||||||
|
|
||||||
|
(clog:run-tutorial 1)
|
||||||
|
;; #P"/home/efim/quicklisp/local-projects/clog/"
|
||||||
|
;; ~/quicklisp/local-projects/clog/tutorial/README.md
|
||||||
|
|
||||||
|
(defun my-setup (body)
|
||||||
|
(let ((header (create-child body "<h1>lalalla</h1>"))
|
||||||
|
(colors '(:black :blue :green)))
|
||||||
|
(setf (color header) :efim)
|
||||||
|
(set-on-click header
|
||||||
|
(lambda (obj)
|
||||||
|
(declare (ignore obj))
|
||||||
|
;; if set value in debugger, this is how to delete it
|
||||||
|
;; since it's just created in image
|
||||||
|
;; (boundp 'colors)
|
||||||
|
;; (makunbound 'colors)
|
||||||
|
(nth (random (length colors)) colors)
|
||||||
|
(setf (color header) (nth (random (length colors)) colors)))))
|
||||||
|
(create-child body "<p>lalalla</p>")) ; now, that doesn't work.
|
||||||
|
|
||||||
|
(initialize #'my-setup)
|
||||||
|
(open-browser)
|
||||||
|
|
||||||
|
;; and for each element, we can call #'set-on-click
|
||||||
|
|
||||||
|
;; next things I'd like to do is random colors, I guess
|
||||||
|
|
||||||
|
;; but how do I look which colors can be used?
|
||||||
|
;; it would seem that it just takes value of the keyword and puts it into html property
|
||||||
|
;; but
|
||||||
|
;; well, it's not that.
|
16
flake.nix
16
flake.nix
|
@ -7,10 +7,24 @@
|
||||||
let pkgs = nixpkgs.legacyPackages.${system}; in
|
let pkgs = nixpkgs.legacyPackages.${system}; in
|
||||||
{
|
{
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
buildInputs = [ pkgs.sbcl pkgs.inotify-tools ];
|
buildInputs = [
|
||||||
|
pkgs.sbcl
|
||||||
|
|
||||||
|
# for koans
|
||||||
|
pkgs.inotify-tools
|
||||||
|
|
||||||
|
# for CLOG
|
||||||
|
pkgs.openssl
|
||||||
|
pkgs.sqlite
|
||||||
|
];
|
||||||
|
shellHook = ''
|
||||||
|
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath([pkgs.openssl])}:${pkgs.lib.makeLibraryPath([pkgs.sqlite])}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
# see https://serokell.io/blog/practical-nix-flakes
|
# see https://serokell.io/blog/practical-nix-flakes
|
||||||
|
|
||||||
|
# welp, I would be able to reference store paths here, yup
|
||||||
|
# but what's the actual way to do that?
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue