diff --git a/.travis.yml b/.travis.yml index 84e6f3b..1be2394 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,13 @@ install: make -C /tmp/cc65 bin apple2 apple2enh && /tmp/cc65/bin/cc65 --version + - git clone https://github.com/mach-kernel/cadius /tmp/cadius && + make -C /tmp/cadius + script: - - cd desktop && - MAKE_FLAGS="CC65=/tmp/cc65/bin" res/go.sh && - cd ../desk.acc && + - cd $TRAVIS_BUILD_DIR/desktop && MAKE_FLAGS="CC65=/tmp/cc65/bin" res/go.sh + + - cd $TRAVIS_BUILD_DIR/desk.acc && + MAKE_FLAGS="CC65=/tmp/cc65/bin" res/go.sh && + CADIUS="/tmp/cadius/bin/release/cadius" res/package.sh diff --git a/desk.acc/res/package.sh b/desk.acc/res/package.sh new file mode 100755 index 0000000..66b57f1 --- /dev/null +++ b/desk.acc/res/package.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# Use Cadius to create a disk image for distribution +# https://github.com/mach-kernel/cadius + +set -e + +CADIUS="${CADIUS:-$HOME/dev/cadius/bin/release/cadius}" + +DAS="calculator show.text.file date puzzle sort.directory \ + show.image.file this.apple eyes" + +PACKDIR="out/package" +FINFO="$PACKDIR/_FileInformation.txt" +IMGFILE="out/DeskAccessories.2mg" +VOLNAME="DESK.ACC" + +mkdir -p "$PACKDIR" +echo "" > "$FINFO" + +# Prepare _FileInformation.txt file with extra ProDOS file entry data +# and copy renamed files into package directory. + +for file in $DAS; do + ucfile=$(echo $file | tr a-z A-Z) + echo "$ucfile=Type(F1),AuxType(0640),VersionCreate(00),MinVersion(B9),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)" >> "$FINFO" + cp "out/$file.\$F1" "out/package/$ucfile" +done + +# Create a new disk image. + +# TODO: Make images 143KB once issue is fixed: +# https://github.com/mach-kernel/cadius/issues/22 +$CADIUS CREATEVOLUME $IMGFILE $VOLNAME 800KB + +# Add the files into the disk image. + +for file in $DAS; do + ucfile=$(echo $file | tr a-z A-Z) + $CADIUS ADDFILE $IMGFILE "/$VOLNAME" $PACKDIR/$ucfile +done