As it turns out, some of the load/compile time set up the package does
doesn't work in ECL for unknown reasons at the moment. Executables using
closure-* will crash after starting up:
    ;;; Checking for wide character support... WARNING: Lisp implementation doesn't use UTF-16, but accepts surrogate code points.
     yes, using code points.
    ;;; Building Closure with CHARACTER RUNES
    Condition of type: SIMPLE-ERROR
    Invalid relative pathname #P"package.lisp" for component ("closure-common" "package")
Change-Id: I4b4bf96835a39696884ec6fea9c249fdeb53c853
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12863
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
		
	
			
		
			
				
	
	
		
			69 lines
		
	
	
	
		
			1.9 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			69 lines
		
	
	
	
		
			1.9 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
{ depot, pkgs, ... }:
 | 
						|
 | 
						|
let
 | 
						|
  src = pkgs.applyPatches {
 | 
						|
    name = "closure-html-source";
 | 
						|
    src = pkgs.lispPackages.closure-html.src;
 | 
						|
 | 
						|
    patches = [
 | 
						|
      # delete unexported and unused double defun in sgml-dtd.lisp
 | 
						|
      # which reference undefined CL-USER:*HTML-DTD* (!) which
 | 
						|
      # unlike CLOSURE-HTML:*HTML-DTD* is not involved in the
 | 
						|
      # package's operation.
 | 
						|
      ./no-double-defun.patch
 | 
						|
      # Patches html-parser.lisp to look for the distributed
 | 
						|
      # dtd files and catalog in this source derivations out
 | 
						|
      # path in the nix store instead of the same directory
 | 
						|
      # relatively to the (built) system.
 | 
						|
      ./dtds-from-store.patch
 | 
						|
    ];
 | 
						|
 | 
						|
    postPatch = ''
 | 
						|
      # Inject file which defines CLOSURE-HTML:*HTML-DTD*
 | 
						|
      # early in the package's build since SBCL otherwise
 | 
						|
      # fails due to the undefined variable. Need to inject
 | 
						|
      # this via postPatch since using a nix file results
 | 
						|
      # in failure to look up the file's true name which
 | 
						|
      # is done for … reasons, apparently.
 | 
						|
      cat > src/define-html-dtd.lisp << EOF
 | 
						|
      (in-package :closure-html)
 | 
						|
      (defvar *html-dtd*)
 | 
						|
      EOF
 | 
						|
 | 
						|
      # Substitute reference to @out@ of this source
 | 
						|
      # directory in this patched file.
 | 
						|
      substituteAllInPlace src/parse/html-parser.lisp
 | 
						|
    '';
 | 
						|
  };
 | 
						|
 | 
						|
  getSrcs = builtins.map (p: "${src}/${p}");
 | 
						|
in
 | 
						|
 | 
						|
depot.nix.buildLisp.library {
 | 
						|
  name = "closure-html";
 | 
						|
 | 
						|
  srcs = getSrcs [
 | 
						|
    "src/defpack.lisp"
 | 
						|
    "src/define-html-dtd.lisp"
 | 
						|
    "src/glisp/util.lisp"
 | 
						|
    "src/util/clex.lisp"
 | 
						|
    "src/util/lalr.lisp"
 | 
						|
    "src/net/mime.lisp"
 | 
						|
    "src/parse/pt.lisp"
 | 
						|
    "src/parse/sgml-dtd.lisp"
 | 
						|
    "src/parse/sgml-parse.lisp"
 | 
						|
    "src/parse/html-parser.lisp"
 | 
						|
    "src/parse/lhtml.lisp"
 | 
						|
    "src/parse/unparse.lisp"
 | 
						|
    "src/parse/documentation.lisp"
 | 
						|
  ];
 | 
						|
 | 
						|
  deps = [
 | 
						|
    depot.third_party.lisp.flexi-streams
 | 
						|
    depot.third_party.lisp.closure-common
 | 
						|
  ];
 | 
						|
 | 
						|
  brokenOn = [
 | 
						|
    "ecl" # see closure-common
 | 
						|
  ];
 | 
						|
}
 |