From 338d86069e801b5c5d7f19ad195de282e1fe68d4 Mon Sep 17 00:00:00 2001 From: Raymond Toy <toy.raymond@gmail.com> Date: Tue, 18 Feb 2020 06:25:47 +0000 Subject: [PATCH] Fix #80: Convert contribs to use ASDF to load As it says, convert contribs to use ASDF to load them if possible. Many contribs already had an asd file so we basically just had to rename foo.asd to contrib-foo.asd to keep backward compatibility with the old contrib names. (And update the defsystem name to match.) Added an asd file for packed-sse2. Unix doesn't work, so it's left alone for now. --- src/code/module.lisp | 14 ------- src/contrib/contrib.lisp | 38 ++----------------- .../demos/{demos.asd => contrib-demos.asd} | 2 +- ...{embedded-c.asd => contrib-embedded-c.asd} | 2 +- ...low-mouse.asd => contrib-follow-mouse.asd} | 4 +- src/contrib/games/feebs/brains.lisp | 4 +- .../{feebs.asd => contrib-games-feebs.asd} | 4 +- .../hist/{hist.asd => contrib-hist.asd} | 2 +- src/contrib/hist/hist.lisp | 3 ++ src/contrib/ops/{ops.asd => contrib-ops.asd} | 2 +- src/contrib/ops/ops-util.lisp | 3 +- .../packed-sse2/contrib-packed-sse2.asd | 11 ++++++ .../{psgraph.asd => contrib-psgraph.asd} | 2 +- .../sprof/{sprof.asd => contrib-sprof.asd} | 2 +- src/contrib/unix/unix.asd | 13 +++++++ tests/run-tests.lisp | 1 + 16 files changed, 46 insertions(+), 61 deletions(-) rename src/contrib/demos/{demos.asd => contrib-demos.asd} (95%) rename src/contrib/embedded-c/{embedded-c.asd => contrib-embedded-c.asd} (91%) rename src/contrib/follow-mouse/{follow-mouse.asd => contrib-follow-mouse.asd} (76%) rename src/contrib/games/feebs/{feebs.asd => contrib-games-feebs.asd} (73%) rename src/contrib/hist/{hist.asd => contrib-hist.asd} (91%) rename src/contrib/ops/{ops.asd => contrib-ops.asd} (94%) create mode 100644 src/contrib/packed-sse2/contrib-packed-sse2.asd rename src/contrib/psgraph/{psgraph.asd => contrib-psgraph.asd} (93%) rename src/contrib/sprof/{sprof.asd => contrib-sprof.asd} (89%) create mode 100644 src/contrib/unix/unix.asd diff --git a/src/code/module.lisp b/src/code/module.lisp index e2fb2f176..78c8bdffd 100644 --- a/src/code/module.lisp +++ b/src/code/module.lisp @@ -163,19 +163,5 @@ (defmodule "asdf" "modules:asdf/asdf") -;; Lisp-unit -(defmodule :lisp-unit - "modules:load-lisp-unit") - -(defmodule "lisp-unit" - "modules:load-lisp-unit") - -;; Allow user to specify "cmu-contribs" or :cmu-contribs. -(defmodule "cmu-contribs" - "modules:contrib") - -(defmodule :cmu-contribs - "modules:contrib") - (defmodule :unix "modules:load-unix") diff --git a/src/contrib/contrib.lisp b/src/contrib/contrib.lisp index 1c9fd69c8..bf01dec77 100644 --- a/src/contrib/contrib.lisp +++ b/src/contrib/contrib.lisp @@ -7,41 +7,9 @@ (ext:file-comment "$Header: src/contrib/contrib.lisp $") -;;; Define the various contrib modules. We use defmodule for now -;;; because it's easy for the contribs. +;;; Empty for backward compatibility for users who require'd +;;; cmu-contribs to get the CMU contribs. The contribs all use asdf +;;; now, so we don't need this file to do anything. -(in-package "EXT") -(defmodule "contrib-demos" - "modules:demos/demos" "modules:demos/menu") -(defmodule "contrib-follow-mouse" - "modules:follow-mouse/follow-mouse") - -(defmodule "contrib-games-feebs" - "modules:games/feebs/feebs") - -(defmodule "contrib-hist" - "modules:hist/hist") - -(defmodule "contrib-psgraph" - "modules:psgraph/psgraph") - -;; This actually consists of several files, but compile-ops will -;; compile and load them all, so this module appears to have just the -;; one file. -(defmodule "contrib-ops" - "modules:ops/compile-ops") - -(defmodule "contrib-embedded-c" - "modules:embedded-c/embedded-c") - -;; Sprof really needs to be compiled, so make this module compile sprof. -(defmodule "contrib-sprof" - "modules:sprof/compile-sprof") - -;; packed sse2 needs to be compiled to work. -(defmodule "contrib-packed-sse2" - "modules:packed-sse2/compile-packed-sse2") - -(provide "cmu-contribs") diff --git a/src/contrib/demos/demos.asd b/src/contrib/demos/contrib-demos.asd similarity index 95% rename from src/contrib/demos/demos.asd rename to src/contrib/demos/contrib-demos.asd index 26b0dd4e6..24b032ed0 100644 --- a/src/contrib/demos/demos.asd +++ b/src/contrib/demos/contrib-demos.asd @@ -7,7 +7,7 @@ (require :clx) -(defsystem :demos +(defsystem :contrib-demos :name "demos" :maintainer "CMU Common Lisp Group" :licence "Public Domain" diff --git a/src/contrib/embedded-c/embedded-c.asd b/src/contrib/embedded-c/contrib-embedded-c.asd similarity index 91% rename from src/contrib/embedded-c/embedded-c.asd rename to src/contrib/embedded-c/contrib-embedded-c.asd index 2f474e750..9bbb00b03 100644 --- a/src/contrib/embedded-c/embedded-c.asd +++ b/src/contrib/embedded-c/contrib-embedded-c.asd @@ -2,7 +2,7 @@ (in-package :asdf) -(defsystem :embedded-c +(defsystem :contrib-embedded-c :name "embedded-c" :author "Helmut Eller" :license "Public Domain" diff --git a/src/contrib/follow-mouse/follow-mouse.asd b/src/contrib/follow-mouse/contrib-follow-mouse.asd similarity index 76% rename from src/contrib/follow-mouse/follow-mouse.asd rename to src/contrib/follow-mouse/contrib-follow-mouse.asd index 8571c427e..3da0fd7b9 100644 --- a/src/contrib/follow-mouse/follow-mouse.asd +++ b/src/contrib/follow-mouse/contrib-follow-mouse.asd @@ -2,12 +2,12 @@ (in-package :asdf) -(defsystem :follows-mouse +(defsystem :contrib-follows-mouse :name "follows-mouse" :maintainer "Todd Kaufman" :licence "Public Domain" :long-description "This Hemlock customization causes Hemlock's current window to be set to -whatever Hemlock window the mouse enters, except the echo area." +whatever Hemlock window the mouse enters, except the echo area. of the X Window System." :components ((:file "follow-mouse"))) diff --git a/src/contrib/games/feebs/brains.lisp b/src/contrib/games/feebs/brains.lisp index a5c953bc5..a22671de3 100644 --- a/src/contrib/games/feebs/brains.lisp +++ b/src/contrib/games/feebs/brains.lisp @@ -9,8 +9,10 @@ ;;; feebs. ;;; -(in-package "SAMPLE-BRAINS" :use '("LISP" "FEEBS")) +(defpackage "SAMPLE-BRAINS" + (:use "LISP" "FEEBS")) +(in-package "SAMPLE-BRAINS") ;;; Experimental brain. Like the built-in conservative brain, but without the ;;; range limitation. diff --git a/src/contrib/games/feebs/feebs.asd b/src/contrib/games/feebs/contrib-games-feebs.asd similarity index 73% rename from src/contrib/games/feebs/feebs.asd rename to src/contrib/games/feebs/contrib-games-feebs.asd index 12525b31d..4dc913dde 100644 --- a/src/contrib/games/feebs/feebs.asd +++ b/src/contrib/games/feebs/contrib-games-feebs.asd @@ -2,9 +2,9 @@ (in-package :asdf) -(defsystem :feebs +(defsystem :contrib-games-feebs :name "feebs" :description "Planet of the Feebs. A somewhat educational simulation game." :components ((:file "feebs") - (:file "brains"))) \ No newline at end of file + (:file "brains" :depends-on ("feebs")))) diff --git a/src/contrib/hist/hist.asd b/src/contrib/hist/contrib-hist.asd similarity index 91% rename from src/contrib/hist/hist.asd rename to src/contrib/hist/contrib-hist.asd index a1c8825dd..79f262dfa 100644 --- a/src/contrib/hist/hist.asd +++ b/src/contrib/hist/contrib-hist.asd @@ -2,7 +2,7 @@ (in-package :asdf) -(defsystem :hist +(defsystem :contrib-hist :name "hist" :maintainer "Scott E. Fahlman" :licence "Public Domain" diff --git a/src/contrib/hist/hist.lisp b/src/contrib/hist/hist.lisp index d2388cadb..cd9baac62 100644 --- a/src/contrib/hist/hist.lisp +++ b/src/contrib/hist/hist.lisp @@ -23,6 +23,9 @@ ;;; Dependencies: Depends only on standard Common Lisp facilities. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defpackage "HIST" + (:use "COMMON-LISP") + (in-package "HIST") (export '(hist hist-record)) diff --git a/src/contrib/ops/ops.asd b/src/contrib/ops/contrib-ops.asd similarity index 94% rename from src/contrib/ops/ops.asd rename to src/contrib/ops/contrib-ops.asd index 9b8661757..9f29222c8 100644 --- a/src/contrib/ops/ops.asd +++ b/src/contrib/ops/contrib-ops.asd @@ -2,7 +2,7 @@ (in-package :asdf) -(defsystem :ops +(defsystem :contrib-ops :name "ops" :licence "Public Domain" :description "MIT Regression Tester" diff --git a/src/contrib/ops/ops-util.lisp b/src/contrib/ops/ops-util.lisp index 58eabfba1..0b6774d0e 100644 --- a/src/contrib/ops/ops-util.lisp +++ b/src/contrib/ops/ops-util.lisp @@ -20,7 +20,8 @@ ;;;; modules. This must be loaded first so commonlisp systems that ;;;; expand macros early have them available. -(unless (find-package "OPS") (make-package "OPS")) +(defpackage "OPS" + (:use "COMMON-LISP")) (in-package "OPS") diff --git a/src/contrib/packed-sse2/contrib-packed-sse2.asd b/src/contrib/packed-sse2/contrib-packed-sse2.asd new file mode 100644 index 000000000..18db26295 --- /dev/null +++ b/src/contrib/packed-sse2/contrib-packed-sse2.asd @@ -0,0 +1,11 @@ +;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- + +(in-package :asdf) + +(defsystem :contrib-packed-sse2 + :name "cmu-packed-sse2" + :maintainer "Cmucl project" + :licence "Public Domain" + :long-description "Functions to work with packed SSE2 objects" + :components + ((:file "packed-sse2"))) diff --git a/src/contrib/psgraph/psgraph.asd b/src/contrib/psgraph/contrib-psgraph.asd similarity index 93% rename from src/contrib/psgraph/psgraph.asd rename to src/contrib/psgraph/contrib-psgraph.asd index 9aaee0746..888cdaf1a 100644 --- a/src/contrib/psgraph/psgraph.asd +++ b/src/contrib/psgraph/contrib-psgraph.asd @@ -2,7 +2,7 @@ (in-package :asdf) -(defsystem :psgraph +(defsystem :contrib-psgraph :name "PSGrapher" :author "Joseph Bates et al." :licence "Public Domain" diff --git a/src/contrib/sprof/sprof.asd b/src/contrib/sprof/contrib-sprof.asd similarity index 89% rename from src/contrib/sprof/sprof.asd rename to src/contrib/sprof/contrib-sprof.asd index e100e0560..711bd7bac 100644 --- a/src/contrib/sprof/sprof.asd +++ b/src/contrib/sprof/contrib-sprof.asd @@ -2,7 +2,7 @@ (in-package :asdf) -(defsystem :sprof +(defsystem :contrib-sprof :name "demos" :author "Gerd Moellmann" :license "BSD-like" diff --git a/src/contrib/unix/unix.asd b/src/contrib/unix/unix.asd new file mode 100644 index 000000000..7c464cf36 --- /dev/null +++ b/src/contrib/unix/unix.asd @@ -0,0 +1,13 @@ +;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- + +(in-package :asdf) + +(defsystem :unix + :name "cmu-unix" + :maintainer "Cmucl project" + :licence "Public Domain" + :long-description "Interface to other Unix functions" + :components + ((:file + #-linux "unix" + #+linux "unix-glibc2"))) diff --git a/tests/run-tests.lisp b/tests/run-tests.lisp index c3c84ddd9..8aa6a0982 100644 --- a/tests/run-tests.lisp +++ b/tests/run-tests.lisp @@ -39,6 +39,7 @@ (in-package :cmucl-test-runner) +(require :asdf) (require :lisp-unit) ;; Be rather verbose in printing the tests -- GitLab