Parcourir la source

feat(build): add zlib package to bootstrap configuration

- Update bootstrap script to install zlib instead of Invercargill
- Add wget and fix pkg-config dependency in bootstrap packages
- Update documentation with refined package creation methodology
- Add zlib-1.3.1 package directory for bootstrap process
clanker il y a 1 mois
Parent
commit
cd0ddc5408

+ 4 - 4
mkbootstrap.sh

@@ -25,8 +25,8 @@ cat <<'EOF' > usr/bin/astrologue-package-bootstrap
 #!/bin/sh
 xbps-install -Sy
 xbps-install -uy xbps
-xbps-install libuuid libblkid
-xbps-install -y gcc vala make bash ninja meson libgee-devel glib-devel libglib-devel json-glib-devel gobject-introspection pkgconfig
+xbps-install -y libuuid libblkid
+xbps-install -y gcc vala make bash ninja meson libgee-devel glib-devel libglib-devel json-glib-devel gobject-introspection pkg-config wget
 ldconfig
 EOF
 chmod +x usr/bin/astrologue-package-bootstrap
@@ -34,8 +34,8 @@ chmod +x usr/bin/astrologue-package-bootstrap
 echo "Setting up chroot environment..."
 chroot . /usr/bin/astrologue-package-bootstrap
 
-echo "Installing Invercargill..."
-cd /home/bbarrow/Projects/Invercargill
+echo "Installing zlib..."
+cd ../zlib-1.3.1
 usm manifest install --root /home/bbarrow/Projects/astrologue-usm-repo/bootstrap-chroot/
 cd -
 

+ 13 - 10
prompt.md

@@ -45,7 +45,7 @@ Package Specific Resources:
 
 3. Manifest:
    - Include ALL required fields
-   - Set `simpleBuildEnvironment` flag for LFS packages
+   - Set `simpleBuildEnvironment` flag for script simplicity
    - Point `md` property to `PACKAGE.md`
    - Leave `provides` section empty
 
@@ -55,22 +55,25 @@ Package Specific Resources:
    - If there is a missing build dependency stop and notify the user (by asking a question)
    - Add any such dependencies `depends` section of the manifest.
 
-**VALIDATION:**
+**METHOD:**
 
-1. Create complete package structure
+1. Create folder structure, `MANIFEST.usm`, and an `acquire.sh` script
 2. Execute `usm manifest acquire` in package directory
-3. Fix any errors, investigating extracted source for possible documentation in files like `INSTALL` or `README`
-4. Execute `usm manifest autoprovides --replace --debug` in package directory
-5. Verify `provides` was populated correctly. Missing entries indicate a problem with the `install` script.
-6. Fix any errors
-7. Verify compliance with Astrologue standards
+3. Fix any errors with the acquire script
+4. Look in the extracted source archive for installation documentation in a file like `INSTALL` or `README`
+5. Update the `licences` section in `MANIFEST.usm` to point to the `text` files of the licences in the extracted archive.
+6. Create other required and optional scripts, and update `MANIFEST.usm`.
+7. Execute `usm manifest autoprovides --replace --debug` in package directory
+8. Verify `provides` was populated correctly. Missing entries indicate a problem with the `install` script.
+9. Fix any errors
+10. Write a friendly `PACKAGE.md`
+11. Verify compliance with Astrologue standards
 
 **PACKAGE SPECIFICATION:**
 
 **Name:** (package name)
 **Version:** (package version)
 **Homepage URL:** (url)
-**Homepage URL:** (url)
-**Homepage URL:** (url)
+**Source Archive URL:** (url)
 
 Create a production-ready package following all requirements precisely.

+ 44 - 0
zlib-1.3.1/MANIFEST.usm

@@ -0,0 +1,44 @@
+{
+  "name": "zlib",
+  "version": "1.3.1",
+  "summary": "Massively spiffy yet delicately unobtrusive compression library",
+  "licences": [
+    {
+      "name": "zlib License",
+      "category": "open-source",
+      "text": "sources/zlib/LICENSE"
+    }
+  ],
+  "provides": {
+    "inc:zlib.h": "as-expected",
+    "pc:zlib.pc": "as-expected",
+    "man:man3/zlib.3": "as-expected",
+    "inc:zconf.h": "as-expected",
+    "lib:libz.a": "as-expected",
+    "lib:libz.so.1.3.1": "as-expected",
+    "lib:libz.so": {
+      "dest": "libz.so.1.3.1",
+      "type": "lnk",
+      "pathBase": "as-expected"
+    },
+    "lib:libz.so.1": {
+      "dest": "libz.so.1.3.1",
+      "type": "lnk",
+      "pathBase": "as-expected"
+    }
+  },
+  "depends": {
+    "runtime": [],
+    "build": ["bin:gcc", "bin:make"],
+    "manage": ["bin:bash"],
+    "acquire": ["bin:wget", "bin:tar"]
+  },
+  "execs": {
+    "acquire": "usm-scripts/acquire.sh",
+    "build": "usm-scripts/build.sh",
+    "install": "usm-scripts/install.sh"
+  },
+  "flags": ["simpleBuildEnvironment"],
+  "url": "https://zlib.net/",
+  "md": "PACKAGE.md"
+}

+ 41 - 0
zlib-1.3.1/PACKAGE.md

@@ -0,0 +1,41 @@
+# zlib
+
+zlib is a massively spiffy yet delicately unobtrusive compression library that provides in-memory compression and decompression functions, including integrity checks of the uncompressed data. This version of the zlib library is a production-ready implementation that is compatible with the zlib format described in RFC 1950.
+
+## Features
+
+- Patent-free implementation
+- Compatible with the gzip format (RFC 1952)
+- Portable across platforms
+- Thread-safe implementation
+- Optimized for both speed and compression ratio
+- Streaming API for handling large data streams
+- Comprehensive error handling
+
+## Applications
+
+zlib is designed to be a free, general-purpose, legally unencumbered lossless data-compression library for use on virtually any computer hardware and operating system. The library is widely used in:
+
+- File compression utilities
+- Network protocols
+- Database systems
+- Application data storage
+- Backup systems
+- Embedded systems
+
+## Installation
+
+This package provides:
+- Static library (libz.a)
+- Shared library (libz.so)
+- Development headers (zlib.h, zconf.h)
+- pkg-config file (zlib.pc)
+- Manual pages (zlib.3)
+
+## Documentation
+
+Complete API documentation is available in the zlib.h header file and the manual page (zlib.3). For more information, visit the official website at https://zlib.net/.
+
+## License
+
+This software is provided under the zlib License, which permits use in commercial applications and does not require attribution, though it is appreciated.

+ 20 - 0
zlib-1.3.1/usm-scripts/acquire.sh

@@ -0,0 +1,20 @@
+#!/bin/bash
+set -e
+
+ARCHIVE_URL="https://zlib.net/fossils/zlib-1.3.1.tar.gz"
+ARCHIVE_NAME="zlib-1.3.1.tar.gz"
+EXTRACT_DIR="sources/zlib"
+
+echo "Downloading zlib source..."
+wget -O ${ARCHIVE_NAME} ${ARCHIVE_URL}
+
+echo "Creating extraction directory..."
+mkdir -p ${EXTRACT_DIR}
+
+echo "Extracting archive..."
+tar -xzf ${ARCHIVE_NAME} -C ${EXTRACT_DIR} --strip-components=1
+
+echo "Cleaning up..."
+rm ${ARCHIVE_NAME}
+
+echo "Source acquisition complete."

+ 15 - 0
zlib-1.3.1/usm-scripts/build.sh

@@ -0,0 +1,15 @@
+#!/bin/bash
+set -e
+
+build_dir=$1
+
+# Change to source directory
+cd sources/zlib
+
+# Configure with prefix and libdir variables
+./configure --prefix=${PREFIX} --libdir=${LIBDIR}
+
+# Build with all available threads for parallel compilation
+make -j$(nproc)
+
+echo "Build completed successfully."

+ 14 - 0
zlib-1.3.1/usm-scripts/install.sh

@@ -0,0 +1,14 @@
+#!/bin/bash
+set -e
+
+build_dir=$1
+install_dir=$2
+install_type=$3
+
+# Change to source directory
+cd sources/zlib
+
+# Install with DESTDIR and other path variables
+make install DESTDIR=${install_dir}
+
+echo "Installation completed successfully."