diff options
author | B. Watson <urchlay@slackware.uk> | 2023-04-21 08:26:03 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-04-22 11:38:32 +0700 |
commit | fcaa8b841432e495bada4117b028e31ebea5bf92 (patch) | |
tree | cf8e9abcaa738bec683bfe26cc46d12fa9b186a0 /development/ophis | |
parent | f8ee1f69e2613e1c0dd0fa3645caef86053db4c5 (diff) |
development/ophis: Added (cross assembler for 6502)
Signed-off-by: bedlam <dave@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/ophis')
-rw-r--r-- | development/ophis/README | 17 | ||||
-rw-r--r-- | development/ophis/git2tarxz.sh | 66 | ||||
-rw-r--r-- | development/ophis/ophis.1 | 134 | ||||
-rw-r--r-- | development/ophis/ophis.SlackBuild | 86 | ||||
-rw-r--r-- | development/ophis/ophis.info | 10 | ||||
-rw-r--r-- | development/ophis/ophis.rst | 83 | ||||
-rw-r--r-- | development/ophis/slack-desc | 19 |
7 files changed, 415 insertions, 0 deletions
diff --git a/development/ophis/README b/development/ophis/README new file mode 100644 index 0000000000000..934931d7541a3 --- /dev/null +++ b/development/ophis/README @@ -0,0 +1,17 @@ +ophis (cross assembler for 6502) + +Ophis is a cross-assembler for the 65xx series of chips. It supports +the stock 6502 opcodes, the 65c02 extensions, experimental support +for the 4502/4510 used in the Commodore 65 prototypes, and syntax +for the "undocumented opcodes" in the 6510 chip used on the Commodore +64 (syntax for these opcodes matches those given in the VICE team's +documentation). + +Ophis is written in pure Python and should be highly portable. + +The package includes ophis itself, the platform +headers in /usr/share/ophis, and the PDF manual in +/usr/doc/ophis-$VERSION/ophismanual.pdf. +If you prefer the manual in HTML form, it's here: + +https://michaelcmartin.github.io/Ophis/book/book1.html diff --git a/development/ophis/git2tarxz.sh b/development/ophis/git2tarxz.sh new file mode 100644 index 0000000000000..3b9cc19cce0b8 --- /dev/null +++ b/development/ophis/git2tarxz.sh @@ -0,0 +1,66 @@ +#!/bin/sh + +# Create source tarball from git repo, with generated version number. + +# Special weirdness here, because of upstream's use of cmake's +# FetchContent. Dunno why they didn't just use a git submodule... + +# Takes one optional argument, which is the commit or tag to create a +# tarball of. With no arg, HEAD is used. + +# Version number example: 0.0.1+20200227_ad7ec17 + +# Notes: + +# Do not use this if you're packaging a release. + +# This script doesn't need to be run as root. It does need to be able +# to write to the current directory it's run from. + +# Running this script twice for the same commit will NOT give identical +# tarballs, even if the contents are identical. This is because tar +# includes the current time in a newly-created tarball (plus there may +# be other git-related reasons). + +# Once you've generated a tarball, you'll still need a place to host it. +# Ask on the mailing list, if you don't have your own web server to +# play with. + +## Config: +PRGNAM=ophis +CLONE_URL=https://github.com/michaelcmartin/Ophis +## End of config. + +set -e + +GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX ) +rm -rf $GITDIR +git clone $CLONE_URL $GITDIR + +CWD="$( pwd )" +cd $GITDIR + +if [ "$1" != "" ]; then + git reset --hard "$1" || exit 1 +fi + +GIT_SHA=$( git rev-parse --short HEAD ) + +DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 ) + +VERTAG=$( git tag -l | tail -1 | sed 's,^v,,' ) + +VERSION=${VERTAG}+${DATE}_${GIT_SHA} + +rm -rf .git +find . -name .gitignore -print0 | xargs -0 rm -f + +cd "$CWD" +rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz +mv $GITDIR $PRGNAM-$VERSION +tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION + +echo +echo "Created tarball: $PRGNAM-$VERSION.tar.xz" +echo "VERSION=\"$VERSION\"" +echo "MD5SUM=\"$( md5sum $PRGNAM-$VERSION.tar.xz | cut -d' ' -f1 )\"" diff --git a/development/ophis/ophis.1 b/development/ophis/ophis.1 new file mode 100644 index 0000000000000..3706106b8b2cf --- /dev/null +++ b/development/ophis/ophis.1 @@ -0,0 +1,134 @@ +.\" Man page generated from reStructuredText. +. +. +.nr rst2man-indent-level 0 +. +.de1 rstReportMargin +\\$1 \\n[an-margin] +level \\n[rst2man-indent-level] +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] +- +\\n[rst2man-indent0] +\\n[rst2man-indent1] +\\n[rst2man-indent2] +.. +.de1 INDENT +.\" .rstReportMargin pre: +. RS \\$1 +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] +. nr rst2man-indent-level +1 +.\" .rstReportMargin post: +.. +.de UNINDENT +. RE +.\" indent \\n[an-margin] +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] +.nr rst2man-indent-level -1 +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u +.. +.TH "OPHIS" 1 "2023-04-21" "2.1" "SlackBuilds.org" +.SH NAME +ophis \- cross assembler for the 6502 and related CPUs +.\" RST source for ophis(1) man page. Convert with: +. +.\" rst2man.py ophis.rst > ophis.1 +. +.SH SYNOPSIS +.sp +ophis [\fB\-o\fP \fIOUTFILE\fP] [\fB\-l\fP \fILISTFILE\fP] [\fB\-m\fP \fIMAPFILE\fP] [\fB\-u\fP | \fB\-\-undoc\fP] [\fB\-c\fP | \fB\-\-65c02\fP] [\fB\-4\fP | \fB\-\-4502\fP] [\fB\-v\fP | \fB\-\-verbose\fP] [\fB\-q\fP | \fB\-\-quiet\fP] [\fB\-\-no\-warn\fP] [\fB\-\-no\-branch\-extend\fP] \fIsourcefile\fP [\fIsourcefile ...\fP] +.SH DESCRIPTION +.sp +Ophis is a cross\-assembler for the 65xx series of chips. It supports +the stock 6502 opcodes, the 65c02 extensions, experimental support +for the 4502/4510 used in the Commodore 65 prototypes, and syntax for +the "undocumented opcodes" in the 6510 chip used on the Commodore +64. +.sp +The full \fBophis\fP manual is available at: +.INDENT 0.0 +.INDENT 3.5 +/usr/doc/ophis\-2.1/ophismanual.pdf +.UNINDENT +.UNINDENT +.sp +Or on the author\(aqs site at: +.INDENT 0.0 +.INDENT 3.5 +\fI\%https://michaelcmartin.github.io/Ophis/book/book1.html\fP +.UNINDENT +.UNINDENT +.sp +The platform headers and example code mentioned in the manual can be found +in \fB/usr/share/ophis/platform/\fP and \fB/usr/share/ophis/examples/\fP\&. +.SH OPTIONS +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 +.TP +.B \-\-version +show program\(aqs version number and exit +.TP +.B \-h\fP,\fB \-\-help +show this help message and exit +.TP +.BI \-o \ OUTFILE +Output filename (default \(aqophis.bin\(aq) +.TP +.BI \-l \ LISTFILE +Listing filename (not created by default) +.TP +.BI \-m \ MAPFILE +Label\-address map filename (not created by default) +.UNINDENT +.INDENT 0.0 +.TP +.B Input options: +.INDENT 7.0 +.TP +.B \-u\fP,\fB \-\-undoc +Enable 6502 undocumented opcodes +.TP +.B \-c\fP,\fB \-\-65c02 +Enable 65c02 extended instruction set +.TP +.B \-4\fP,\fB \-\-4502 +Enable 4502 extended instruction set +.UNINDENT +.TP +.B Console output options: +.INDENT 7.0 +.TP +.B \-v\fP,\fB \-\-verbose +Verbose mode +.TP +.B \-q\fP,\fB \-\-quiet +Quiet mode +.TP +.B \-\-no\-warn +Do not print warnings +.UNINDENT +.TP +.B Compilation options: +.INDENT 7.0 +.TP +.B \-\-no\-branch\-extend +Disable branch\-extension pass +.UNINDENT +.UNINDENT +.UNINDENT +.UNINDENT +.SH COPYRIGHT +.sp +See the file /usr/doc/ophis\-2.1/README for license information. +.SH AUTHORS +.sp +\fBophis\fP was written by Michael C. Martin. +.sp +This man page written for the SlackBuilds.org project +by B. Watson, and is licensed under the WTFPL. +.SH SEE ALSO +.sp +The ophis homepage: \fI\%https://michaelcmartin.github.io/Ophis/\fP +.\" Generated by docutils manpage writer. +. diff --git a/development/ophis/ophis.SlackBuild b/development/ophis/ophis.SlackBuild new file mode 100644 index 0000000000000..539bd2fd935f8 --- /dev/null +++ b/development/ophis/ophis.SlackBuild @@ -0,0 +1,86 @@ +#!/bin/bash + +# Slackware build script for ophis + +# Written by B. Watson (urchlay@slackware.uk) + +# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=ophis +VERSION=${VERSION:-2.1+20190412_99f074d} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.xz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ + +cd src +python3 setup.py install --root=$PKG +cd - + +# if any test fails, this script will exit. +cd tests +./test_ophis.py +cd - + +PKGSHARE=$PKG/usr/share/$PRGNAM +mkdir -p $PKGSHARE +cp -a platform/ examples/ $PKGSHARE + +# man page by SlackBuild author. +mkdir -p $PKG/usr/man/man1 +gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz + +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC +cp -a README doc/*.pdf $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/development/ophis/ophis.info b/development/ophis/ophis.info new file mode 100644 index 0000000000000..d73a05fc65f5a --- /dev/null +++ b/development/ophis/ophis.info @@ -0,0 +1,10 @@ +PRGNAM="ophis" +VERSION="2.1+20190412_99f074d" +HOMEPAGE="https://michaelcmartin.github.io/Ophis/" +DOWNLOAD="https://slackware.uk/~urchlay/src/ophis-2.1+20190412_99f074d.tar.xz" +MD5SUM="91257c97472eeaf5e96bc7d3b84e4cd0" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="B. Watson" +EMAIL="urchlay@slackware.uk" diff --git a/development/ophis/ophis.rst b/development/ophis/ophis.rst new file mode 100644 index 0000000000000..85b96d0c8f0f8 --- /dev/null +++ b/development/ophis/ophis.rst @@ -0,0 +1,83 @@ +.. RST source for ophis(1) man page. Convert with: +.. rst2man.py ophis.rst > ophis.1 + +.. |version| replace:: 2.1 +.. |date| date:: + +===== +ophis +===== + +--------------------------------------------- +cross assembler for the 6502 and related CPUs +--------------------------------------------- + +:Manual section: 1 +:Manual group: SlackBuilds.org +:Date: |date| +:Version: |version| + +SYNOPSIS +======== + +ophis [**-o** *OUTFILE*] [**-l** *LISTFILE*] [**-m** *MAPFILE*] [**-u** | **--undoc**] [**-c** | **--65c02**] [**-4** | **--4502**] [**-v** | **--verbose**] [**-q** | **--quiet**] [**--no-warn**] [**--no-branch-extend**] *sourcefile* [*sourcefile ...*] + +DESCRIPTION +=========== + +Ophis is a cross-assembler for the 65xx series of chips. It supports +the stock 6502 opcodes, the 65c02 extensions, experimental support +for the 4502/4510 used in the Commodore 65 prototypes, and syntax for +the "undocumented opcodes" in the 6510 chip used on the Commodore +64. + +The full **ophis** manual is available at: + + /usr/doc/ophis-|version|/ophismanual.pdf + +Or on the author's site at: + + https://michaelcmartin.github.io/Ophis/book/book1.html + +The platform headers and example code mentioned in the manual can be found +in **/usr/share/ophis/platform/** and **/usr/share/ophis/examples/**. + +OPTIONS +======= + + --version show program's version number and exit + -h, --help show this help message and exit + -o OUTFILE Output filename (default 'ophis.bin') + -l LISTFILE Listing filename (not created by default) + -m MAPFILE Label-address map filename (not created by default) + + Input options: + -u, --undoc Enable 6502 undocumented opcodes + -c, --65c02 Enable 65c02 extended instruction set + -4, --4502 Enable 4502 extended instruction set + + Console output options: + -v, --verbose Verbose mode + -q, --quiet Quiet mode + --no-warn Do not print warnings + + Compilation options: + --no-branch-extend Disable branch-extension pass + +COPYRIGHT +========= + +See the file /usr/doc/ophis-|version|/README for license information. + +AUTHORS +======= + +**ophis** was written by Michael C. Martin. + +This man page written for the SlackBuilds.org project +by B. Watson, and is licensed under the WTFPL. + +SEE ALSO +======== + +The ophis homepage: https://michaelcmartin.github.io/Ophis/ diff --git a/development/ophis/slack-desc b/development/ophis/slack-desc new file mode 100644 index 0000000000000..4b3e888b6670f --- /dev/null +++ b/development/ophis/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +ophis: ophis (cross assembler for 6502) +ophis: +ophis: Ophis is a cross-assembler for the 65xx series of chips. It supports +ophis: the stock 6502 opcodes, the 65c02 extensions, experimental support +ophis: for the 4502/4510 used in the Commodore 65 prototypes, and syntax +ophis: for the "undocumented opcodes" in the 6510 chip used on the Commodore +ophis: 64 (syntax for these opcodes matches those given in the VICE team's +ophis: documentation). +ophis: +ophis: Ophis is written in pure Python and should be highly portable. +ophis: |