diff --git a/Makefile b/Makefile index 86a025ee73..7d1b32e3d9 100644 --- a/Makefile +++ b/Makefile @@ -373,11 +373,11 @@ PACK_NATIVE = --native --pack build/native/pkgs \ ++catalog build/native/catalog \ ++catalog build/local/catalog native-catalog: - $(RACKET) racket/src/pack-all.rkt $(PACK_NATIVE) native-pkgs + $(RACKET) racket/src/pack-all.rkt --mods $(PACK_NATIVE) native-pkgs # Create a catalog for all packages in this directory: local-source-catalog: - $(RACKET) racket/src/pack-all.rkt ++catalog build/local/catalog pkgs + $(RACKET) racket/src/pack-all.rkt --mods ++catalog build/local/catalog pkgs # Clear out a package build in "build/user", and then install # packages: @@ -399,6 +399,7 @@ set-server-config: packages-from-local: $(RACO) pkg install $(LOCAL_USER_AUTO) $(REQUIRED_PKGS) $(DISTRO_BUILD_PKGS) $(MAKE) set-server-config + $(RACKET) -l- distro-build/pkg-info -o build/pkgs.rktd build/local/catalog $(RACKET) -l distro-build/install-pkgs $(CONFIG_MODE_q) "$(PKGS)" $(LOCAL_USER_AUTO) $(RACO) setup --avoid-main $(JOB_OPTIONS) @@ -409,6 +410,7 @@ build-from-catalog: $(MAKE) fresh-user $(RACO) pkg install --all-platforms $(SOURCE_USER_AUTO_q) $(REQUIRED_PKGS) $(DISTRO_BUILD_PKGS) $(MAKE) set-server-config + $(RACKET) -l- distro-build/pkg-info -o build/pkgs.rktd $(SRC_CATALOG) $(RACKET) -l distro-build/install-pkgs $(CONFIG_MODE_q) "$(PKGS)" $(SOURCE_USER_AUTO_q) --all-platforms $(RACO) setup --avoid-main $(JOB_OPTIONS) @@ -422,7 +424,7 @@ origin-collects: # Now that we've built packages from local sources, create "built" # versions of the packages from the installation into "build/user": built-catalog: - $(RACKET) -l distro-build/pack-built + $(RACKET) -l distro-build/pack-built build/pkgs.rktd # Run a catalog server to provide pre-built packages, as well # as the copy of the server's "collects" tree: @@ -434,7 +436,7 @@ built-catalog-server: # which involves creating package archives in "binary" mode # instead of "built" mode: binary-catalog: - $(RACKET) -l- distro-build/pack-built --mode binary + $(RACKET) -l- distro-build/pack-built --mode binary build/pkgs.rktd binary-catalog-server: $(RACKET) -l- distro-build/serve-catalog --mode binary $(CONFIG_MODE_q) "$(SERVER_HOSTS)" $(SERVER_PORT) diff --git a/pkgs/distro-build-pkgs/distro-build-server/pack-built.rkt b/pkgs/distro-build-pkgs/distro-build-server/pack-built.rkt index e6a85cb6a4..1914ef50ba 100644 --- a/pkgs/distro-build-pkgs/distro-build-server/pack-built.rkt +++ b/pkgs/distro-build-pkgs/distro-build-server/pack-built.rkt @@ -13,12 +13,13 @@ (define create-mode 'built) -(command-line - #:once-each - [("--mode") mode "Create package archives for " - (set! create-mode (string->symbol mode))] - #:args () - (void)) +(define pkg-info-file + (command-line + #:once-each + [("--mode") mode "Create package archives for " + (set! create-mode (string->symbol mode))] + #:args (pkg-info-file) + pkg-info-file)) (define build-dir "build") (define dest-dir (build-path build-dir (~a create-mode))) @@ -29,9 +30,12 @@ (make-directory* pkg-dest-dir) (make-directory* catalog-pkg-dir) +(define pkg-details (call-with-input-file* pkg-info-file read)) + (for ([pkg (in-list (installed-pkg-names))]) (define native-zip (build-path native-dir (path-add-suffix pkg ".zip"))) (unless (file-exists? native-zip) + (define ht (hash-ref pkg-details pkg (hash))) (define dest-zip (build-path pkg-dest-dir (~a pkg ".zip"))) (pkg-create 'zip pkg #:source 'name @@ -46,10 +50,10 @@ (simple-form-path dest-zip))) 'checksum (call-with-input-file* dest-zip sha1) 'name pkg - 'author "plt@racket-lang.org" - 'description "library" - 'tags '() - 'dependencies '() - 'modules '()) + 'author (hash-ref ht 'author "plt@racket-lang.org") + 'description (hash-ref ht 'author "library") + 'tags (hash-ref ht 'tags '()) + 'dependencies (hash-ref ht 'dependencies '()) + 'modules (hash-ref ht 'modules '())) o) (newline o))))) diff --git a/pkgs/distro-build-pkgs/distro-build-server/pkg-info.rkt b/pkgs/distro-build-pkgs/distro-build-server/pkg-info.rkt new file mode 100644 index 0000000000..1075b1d28f --- /dev/null +++ b/pkgs/distro-build-pkgs/distro-build-server/pkg-info.rkt @@ -0,0 +1,34 @@ +#lang racket/base +(require pkg/lib + racket/cmdline + net/url) + +(define dest-file #f) + +(define catalog + (command-line + #:once-each + [("-o") file "Output file" + (set! dest-file file)] + #:args + (catalog) + catalog)) + +(define catalog-url + (if (regexp-match? #rx"^[a-z]+:" catalog) + (string->url catalog-url) + (path->url (path->complete-path catalog)))) + +(define details + (parameterize ([current-pkg-catalogs (list catalog-url)]) + (get-all-pkg-details-from-catalogs))) + +(define (write-out o) + (write details o) + (newline o)) + +(if dest-file + (call-with-output-file* dest-file + #:exists 'truncate/replace + write-out) + (write-out (current-output-port))) diff --git a/pkgs/plt-services/meta/pkg-push/Makefile b/pkgs/plt-services/meta/pkg-push/Makefile index b83291f4ed..93d300c0c0 100644 --- a/pkgs/plt-services/meta/pkg-push/Makefile +++ b/pkgs/plt-services/meta/pkg-push/Makefile @@ -1,8 +1,9 @@ # ------------------------------------------------------------ # Configuration -# This `racket' must have the the "distro-build" and "aws" packages -# installed, where "aws" depends on "html-lib": +# This `racket' must have the the "aws" package installed, +# where "aws" depends on "html-lib", and it must be consistent +# with "pack-all.rkt" in `PLT_TOP`. RACKET = racket # In `PLT_TOP', "build/latest" should be a git clone to update (and it @@ -43,8 +44,8 @@ PACK_ARCHIVE = --at-checksum $(PLT_TOP)/build/archive/pkgs \ --mods archive-catalog: rm -rf $(PLT_TOP)/build/archive/catalog - $(RACKET) -l- distro-build/pack-and-catalog --native $(PACK_ARCHIVE) $(PLT_TOP)/build/latest/native-pkgs - $(RACKET) -l- distro-build/pack-and-catalog $(PACK_ARCHIVE) $(PLT_TOP)/build/latest/pkgs + $(RACKET) $(PLT_TOP)/racket/src/pack-all.rkt --native $(PACK_ARCHIVE) $(PLT_TOP)/build/latest/native-pkgs + $(RACKET) $(PLT_TOP)/racket/src/pack-all.rkt $(PACK_ARCHIVE) $(PLT_TOP)/build/latest/pkgs # Copy files from "build/archive" to $(BUCKET), and update # $(DEST_CATALOG):