trying to build the lisp server in nix
This commit is contained in:
		
							parent
							
								
									c204bd8d96
								
							
						
					
					
						commit
						54dab680d6
					
				
					 5 changed files with 38 additions and 8 deletions
				
			
		
							
								
								
									
										3
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										3
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
					@ -12,5 +12,8 @@ css:
 | 
				
			||||||
build-site:
 | 
					build-site:
 | 
				
			||||||
	rm -rf public && NODE_ENV=production ./themes/blowfish/node_modules/tailwindcss/lib/cli.js -c ./themes/blowfish/tailwind.config.js -i ./themes/blowfish/assets/css/main.css -o ./assets/css/compiled/main.css --jit && hugo --gc --minify
 | 
						rm -rf public && NODE_ENV=production ./themes/blowfish/node_modules/tailwindcss/lib/cli.js -c ./themes/blowfish/tailwind.config.js -i ./themes/blowfish/assets/css/main.css -o ./assets/css/compiled/main.css --jit && hugo --gc --minify
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					api:
 | 
				
			||||||
 | 
						sbcl --load build.lisp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
clean:
 | 
					clean:
 | 
				
			||||||
	rm -rf public
 | 
						rm -rf public
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										19
									
								
								build.lisp
									
										
									
									
									
								
							
							
						
						
									
										19
									
								
								build.lisp
									
										
									
									
									
								
							| 
						 | 
					@ -1,7 +1,24 @@
 | 
				
			||||||
(when (find-package :ql) (funcall (read-from-string "ql:quickload") :deploy))
 | 
					 | 
				
			||||||
(load (sb-ext:posix-getenv "ASDF"))
 | 
					(load (sb-ext:posix-getenv "ASDF"))
 | 
				
			||||||
(asdf:load-asd (pathname (truename "tfcserver.asd")))
 | 
					(asdf:load-asd (pathname (truename "tfcserver.asd")))
 | 
				
			||||||
(asdf:load-system "tfcserver")
 | 
					(asdf:load-system "tfcserver")
 | 
				
			||||||
 | 
					(require "cffi")
 | 
				
			||||||
 | 
					(when (find-package :ql) (funcall (read-from-string "ql:quickload") :cffi))
 | 
				
			||||||
 | 
					(when (find-package :ql) (funcall (read-from-string "ql:quickload") :deploy))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(defun pkg-config-add-lib (libname)
 | 
				
			||||||
 | 
					 (let ((process (sb-ext:run-program "pkg-config"
 | 
				
			||||||
 | 
					                                    (list 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
 | 
				
			||||||
 | 
					              ;; 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))))
 | 
				
			||||||
 | 
					;; Get libssl
 | 
				
			||||||
 | 
					(pkg-config-add-lib "libssl")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(when (find-package :ql) (funcall (read-from-string "ql:quickload") :tfcserver))
 | 
					(when (find-package :ql) (funcall (read-from-string "ql:quickload") :tfcserver))
 | 
				
			||||||
(push :deploy-console *features*)
 | 
					(push :deploy-console *features*)
 | 
				
			||||||
(asdf:make :tfcserver)
 | 
					(asdf:make :tfcserver)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										13
									
								
								default.nix
									
										
									
									
									
								
							
							
						
						
									
										13
									
								
								default.nix
									
										
									
									
									
								
							| 
						 | 
					@ -31,6 +31,7 @@ let
 | 
				
			||||||
    lass
 | 
					    lass
 | 
				
			||||||
    cl-smtp
 | 
					    cl-smtp
 | 
				
			||||||
    log4cl
 | 
					    log4cl
 | 
				
			||||||
 | 
					    cffi
 | 
				
			||||||
    pkgs.openssl
 | 
					    pkgs.openssl
 | 
				
			||||||
    pkgs.openssl.out
 | 
					    pkgs.openssl.out
 | 
				
			||||||
    pkgs.openssl.dev
 | 
					    pkgs.openssl.dev
 | 
				
			||||||
| 
						 | 
					@ -54,18 +55,18 @@ stdenv.mkDerivation {
 | 
				
			||||||
    gnumake
 | 
					    gnumake
 | 
				
			||||||
    pkg-config
 | 
					    pkg-config
 | 
				
			||||||
    makeWrapper
 | 
					    makeWrapper
 | 
				
			||||||
    # openssl
 | 
					    openssl
 | 
				
			||||||
    # openssl.out
 | 
					    openssl.out
 | 
				
			||||||
    # openssl.dev
 | 
					    openssl.dev
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  buildInputs = [
 | 
					  buildInputs = [
 | 
				
			||||||
    # rustPlatform
 | 
					    # rustPlatform
 | 
				
			||||||
    # clippy
 | 
					    # clippy
 | 
				
			||||||
    # rustfmt
 | 
					    # rustfmt
 | 
				
			||||||
    # openssl
 | 
					    openssl
 | 
				
			||||||
    # openssl.out
 | 
					    openssl.out
 | 
				
			||||||
    # openssl.dev
 | 
					    openssl.dev
 | 
				
			||||||
    sbcl'
 | 
					    sbcl'
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,7 +16,7 @@
 | 
				
			||||||
        in 
 | 
					        in 
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
          devShell = import ./shell.nix { inherit pkgs; };
 | 
					          devShell = import ./shell.nix { inherit pkgs; };
 | 
				
			||||||
          defaultPackage = pkgs.callPackage ./default.nix { };
 | 
					          packages.default = pkgs.callPackage ./default.nix { };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      );
 | 
					      );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -41,6 +41,15 @@ in mkShell rec {
 | 
				
			||||||
    rustfmt
 | 
					    rustfmt
 | 
				
			||||||
    rust-analyzer
 | 
					    rust-analyzer
 | 
				
			||||||
    just
 | 
					    just
 | 
				
			||||||
 | 
					    openssl
 | 
				
			||||||
 | 
					    openssl.out
 | 
				
			||||||
 | 
					    openssl.dev
 | 
				
			||||||
 | 
					  ];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  nativeLibs = [
 | 
				
			||||||
 | 
					    openssl
 | 
				
			||||||
 | 
					    openssl.out
 | 
				
			||||||
 | 
					    openssl.dev
 | 
				
			||||||
  ];
 | 
					  ];
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  shellHook = ''
 | 
					  shellHook = ''
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue