From 41dee9150580041d2f3b9d2bc740bbe20272bb73 Mon Sep 17 00:00:00 2001 From: "B. Wilson" Date: Mon, 19 Aug 2019 10:44:33 +0900 Subject: [PATCH] New package: metamath-0.178 --- srcpkgs/metamath/files/mm.sh | 72 +++++++++++++++++++ .../patches/remove-missing-file-refs.patch | 17 +++++ srcpkgs/metamath/template | 25 +++++++ srcpkgs/metamath/update | 2 + 4 files changed, 116 insertions(+) create mode 100755 srcpkgs/metamath/files/mm.sh create mode 100644 srcpkgs/metamath/patches/remove-missing-file-refs.patch create mode 100644 srcpkgs/metamath/template create mode 100644 srcpkgs/metamath/update diff --git a/srcpkgs/metamath/files/mm.sh b/srcpkgs/metamath/files/mm.sh new file mode 100755 index 00000000000..4cb78a6fdfa --- /dev/null +++ b/srcpkgs/metamath/files/mm.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env sh +set -o errexit -o nounset -o noclobber + + +show_usage() { +>&2 cat <] [-r ] [] + +OPTIONS + -d Load + -r Submit commands on startup, defaults to ~/.metamathrc + -l List available databases + -u Update databases + -h Display this help message +USAGE +} + +error() { + errno=${1} + msg=${2} + + >&2 echo "${msg}" + show_usage + exit "${errno}" +} + +mm_update() { + url=${1} + dir=${2} + + command -v git >/dev/null || return 1 + [ -d "${dir}" ] || mkdir -p "${dir}" + + if [ -d "${dir}/.git" ]; then + git -C "${dir}" pull + else + git clone "${url}" "${dir}" + fi +} + + +mmdir="${METAMATH_DIR:-/var/lib/metamath}" +mmurl="${METAMATH_URL:-https://github.com/metamath/set.mm}" +rc="${rc:-${HOME}/.metamathrc}" + +[ -r "${rc}" ] || unset rc + +if command -v tput >/dev/null; then + width=$(tput cols) + height=$(tput lines) +fi + + +while getopts ':d:r:hlu' opt "${@}"; do + case "${opt}" in + d) db="${OPTARG}";; + r) rc="${OPTARG}";; + h) show_usage; exit 0;; + l) find "${mmdir}" -name '*.mm' -printf '%P\n'; exit;; + u) mm_update "${mmurl}" "${mmdir}"; exit $?;; + :) error 1 "Expected argument: -${OPTARG}";; + *) error 1 "Unknown argument: -${OPTARG}";; + esac +done +shift $((OPTIND - 1)) + +rlwrap --complete-filenames \ + metamath ${width+"set width ${width}"} \ + ${height+"set height ${height}"} \ + ${rc+"submit '${rc}'"} \ + ${db+"read '${mmdir}/${db}'"} \ + "${@}" diff --git a/srcpkgs/metamath/patches/remove-missing-file-refs.patch b/srcpkgs/metamath/patches/remove-missing-file-refs.patch new file mode 100644 index 00000000000..6f99100cfba --- /dev/null +++ b/srcpkgs/metamath/patches/remove-missing-file-refs.patch @@ -0,0 +1,17 @@ +--- Makefile.am 2020-01-27 20:43:55.650195602 +0900 ++++ Makefile.am 2020-01-27 20:44:18.876578014 +0900 +@@ -36,14 +36,6 @@ + mmwtex.c \ + $(noinst_HEADERS) + +-dist_pkgdata_DATA = \ +- big-unifier.mm \ +- demo0.mm \ +- miu.mm \ +- peano.mm \ +- ql.mm \ +- set.mm +- + + EXTRA_DIST = \ + LICENSE.TXT \ diff --git a/srcpkgs/metamath/template b/srcpkgs/metamath/template new file mode 100644 index 00000000000..637a0013dfd --- /dev/null +++ b/srcpkgs/metamath/template @@ -0,0 +1,25 @@ +# Template file for 'metamath' +pkgname=metamath +version=0.178 +revision=1 +wrksrc="${pkgname}" +build_style=gnu-configure +hostmakedepends="autoconf automake unzip" +short_desc="Proof verifier based on a minimalist metalogic" +maintainer="B. Wilson " +license="GPL-2.0-or-later" +homepage="http://us.metamath.org/" +distfiles="http://us.metamath.org/downloads/metamath-program.zip + http://us.metamath.org/downloads/metamath.pdf" +checksum="75fe8e83c4fde2104e24e38da8480b512df3dff40d46e5d40e038bd7a73557de + 245ebab16d148a9772f6c3751ba8f34ee15bed6bbb61a464f4c2a2f9c56f8059" +skip_extraction="metamath.pdf" + +pre_configure() { + autoreconf -i +} + +post_install() { + vbin "${FILESDIR}/mm.sh" mm + vdoc "${XBPS_SRCDISTDIR}/${pkgname}-${version}/metamath.pdf" +} diff --git a/srcpkgs/metamath/update b/srcpkgs/metamath/update new file mode 100644 index 00000000000..d968c96b084 --- /dev/null +++ b/srcpkgs/metamath/update @@ -0,0 +1,2 @@ +site=http://us.metamath.org/index.html +pattern="metamath program \(version \K[\d.]+"