Compare commits

..

1 Commits

Author SHA1 Message Date
retropikzel eb56d8606b Add git-indexing into packaging 2026-08-28 12:22:24 +03:00
12 changed files with 42 additions and 171 deletions

1
.gitignore vendored
View File

@ -27,4 +27,3 @@ retropikzel/wasm/plus.sld
retropikzel/*.c
retropikzel/*.meta
test-program
!.snow-repo.scm

View File

@ -1,100 +0,0 @@
(repository
(package
(git
(hash "940def00921d4c8a8f8586308e51ca0f269f5ea6")
(url "https://codeberg.org/retropikzel/scheme-libraries.git"))
(maintainers "Retropikzel")
(authors "Retropikzel")
(version "1.0.0")
(license AGPL-3.0)
(library
(name
(retropikzel assert))
(path "retropikzel/assert.sld")
(foreign-depends)
(depends
(scheme base)))
(library
(name
(retropikzel assert warning))
(path "retropikzel/assert/warning.sld")
(foreign-depends)
(depends
(scheme base)))
(library
(name
(retropikzel assert ignore))
(path "retropikzel/assert/ignore.sld")
(foreign-depends)
(depends
(scheme base)))
(manual "retropikzel/assert.html" "retropikzel/assert/warning.html" "retropikzel/assert/ignore.html")
(description "Assert")
(test "retropikzel/assert/test.scm")
(test-depends
(scheme base)
(scheme write)
(scheme read)
(retropikzel tap)
(retropikzel debug)
(retropikzel assert)
(srfi 64))
(updated "2026-09-09T17:09:51+00:00"))
(package
(git
(hash "ba24a08e199b1ab22d1c2dcd6dbedaafa3f95a5b")
(url "https://codeberg.org/retropikzel/scheme-libraries.git"))
(maintainers "Retropikzel")
(authors "Retropikzel")
(version "1.2.1")
(license LGPL-3.0-or-later)
(library
(name
(retropikzel tap))
(path "retropikzel/tap.sld")
(foreign-depends)
(depends
(scheme base)
(scheme write)
(scheme file)
(scheme process-context)
(srfi 64)
(srfi 112)))
(manual "retropikzel/tap.html")
(description "Test Anything Protocol output for SRFI-64")
(test "retropikzel/tap/test.scm")
(test-depends
(scheme base)
(scheme write)
(retropikzel tap)
(srfi 64))
(updated "2026-09-02T17:12:42+00:00"))
(package
(git
(hash "90d0cc3d278da6cea41157c2c425533119b23add")
(url "https://codeberg.org/retropikzel/scheme-libraries.git"))
(maintainers "Retropikzel")
(authors "Retropikzel")
(version "1.2.0")
(license LGPL-3.0-or-later)
(library
(name
(retropikzel tap))
(path "retropikzel/tap.sld")
(foreign-depends)
(depends
(scheme base)
(scheme write)
(scheme file)
(scheme process-context)
(srfi 64)
(srfi 112)))
(manual "retropikzel/tap.html")
(description "Test Anything Protocol output for SRFI-64")
(test "retropikzel/tap/test.scm")
(test-depends
(scheme base)
(scheme write)
(retropikzel tap)
(srfi 64))
(updated "2026-08-28T12:33:17+00:00")))

View File

@ -1,53 +1,43 @@
.POSIX:
SCHEME=chibi
LIBRARY=tap
AUTHORS=Retropikzel
MAINTAINER=Retropikzel
VERSION=$$(cat retropikzel/${LIBRARY}/VERSION)
PKG=retropikzel-${LIBRARY}-${VERSION}.tgz
TESTFILE=retropikzel/${LIBRARY}/test.scm
DOCKER_TAG=latest
library_file=retropikzel/${LIBRARY}.sld
testfile=retropikzel/${LIBRARY}/test.scm
splitclean=awk -F ':' '{print($$2)}' | tr -d ' '
version=$$(grep "Version:" ${library_file} | ${splitclean})
license=$$(grep "SPDX-License-Identifier:" ${library_file} | awk -F ":" "{print(\$$2)}" | tr -d ' ')
description=$$(grep "Description:" ${library_file} | awk -F ':' '{print($$2)}' | tr -d ' ')
additional_libraries=$$(grep "Additional Libraries:" ${library_file} | awk -F ':' '{print($$2)}' || echo "")
pkg=retropikzel-${LIBRARY}-${version}.tgz
debug:
echo "${license}"
all: package
package:
package: retropikzel/${LIBRARY}/LICENSE retropikzel/${LIBRARY}/VERSION retropikzel/${LIBRARY}/DESCRIPTION
snow-chibi package \
--always-yes \
--version="${version}" \
--authors=Retropikzel \
--maintainers=Retropikzel \
--license="${license}" \
--version=${VERSION} \
--authors=${AUTHORS} \
--maintainers=${MAINTAINER} \
--license="$$(cat retropikzel/${LIBRARY}/LICENSE)" \
--doc-from-scribble=1 \
--test=${testfile} \
--description="${description}" \
${library_file} ${additional_libraries}
git-index:
snow-chibi git-index ${pkg}
--test=${TESTFILE} \
--description="$$(head -n1 retropikzel/${LIBRARY}/DESCRIPTION)" \
retropikzel/${LIBRARY}.sld
snow-chibi git-index ${PKG}
install:
snow-chibi install --impls=${SCHEME} --always-yes --verbose?=1 --skip-tests?=1 ${pkg}
snow-chibi install --impls=${SCHEME} --always-yes --verbose?=1 --skip-tests?=1 ${PKG}
test: package
snow-chibi --impls=${SCHEME} test-package ${pkg}
snow-chibi --impls=${SCHEME} test-package ${PKG}
test-compile-r7rs:
COMPILE_R7RS=${SCHEME} compile-r7rs -o test-program ${testfile}
COMPILE_R7RS=${SCHEME} compile-r7rs -o test-program ${TESTFILE}
./test-program
test-docker:
DOCKER_TAG=${DOCKER_TAG} \
SNOW_PACKAGES="retropikzel.tap ${pkg}" \
SNOW_PACKAGES="retropikzel.tap ${PKG}" \
COMPILE_R7RS=${SCHEME} \
test-r7rs -o test-program ${testfile}
test-r7rs -o test-program ${TESTFILE}
retropikzel/wasm/plus.wat: retropikzel/wasm/plus.c
emcc -o retropikzel/wasm/plus.js retropikzel/wasm/plus.c

View File

@ -1,4 +1,15 @@
(define-syntax assert
(syntax-rules ()
((_ check val err-msg)
(unless (check val) (error err-msg val)))))
((_ check body)
(let ((result body))
(when (not (check result))
(error "assertion error: " check body result))
result))))
(define-syntax asserts
(syntax-rules ()
((_ (check ...) body)
(let ((result body))
(when (not (check result)) (error "assertion error: " check body result)) ...
result))))

View File

@ -1,10 +1,7 @@
;; SPDX-License-Identifier: AGPL-3.0-or-later
;; Version: 1.0.1
;; Description: Assert
;; Additional Libraries: retropikzel/assert/warning.sld retropikzel/assert/ignore.sld
(define-library
(retropikzel assert)
(import (scheme base))
(export assert)
(import (scheme base)
(scheme write))
(export assert
asserts)
(include "assert.scm"))

View File

@ -1 +0,0 @@
LGPL

View File

@ -1,4 +0,0 @@
(define-syntax assert
(syntax-rules ()
((_ check val err-msg)
(cond-expand (else)))))

View File

@ -1,5 +0,0 @@
(define-library
(retropikzel assert ignore)
(import (scheme base))
(export assert)
(include "ignore.scm"))

View File

@ -2,6 +2,7 @@
(scheme write)
(scheme read)
(retropikzel tap)
(retropikzel debug)
(retropikzel assert)
(srfi 64))
@ -9,15 +10,12 @@
(test-begin "assert")
(define (plus a b)
(assert integer? a "a must be integer")
(assert integer? b "b must be integer")
(+ a b))
(test-equal 10 (plus 5 5))
(test-equal 1 (assert number? 1))
(test-equal 'error
(guard (condition (else 'error))
(plus 5 'a)))
(assert number? "string")))
(test-equal 1 (asserts (number? (lambda (i) (= i 1))) 1))
(test-end "assert")

View File

@ -1,9 +0,0 @@
(define-syntax assert
(syntax-rules ()
((_ check val err-msg)
(unless (check val)
(display "WARNING: " (current-error-port))
(display err-msg (current-error-port))
(display ", val: " (current-error-port))
(write val (current-error-port))
(newline (current-error-port))))))

View File

@ -1,5 +0,0 @@
(define-library
(retropikzel assert warning)
(import (scheme base))
(export assert)
(include "warning.scm"))

View File

@ -1 +1 @@
1.2.1
1.2.0