Skip to content

Instantly share code, notes, and snippets.

@mkhl
Created November 23, 2008 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkhl/28305 to your computer and use it in GitHub Desktop.
Save mkhl/28305 to your computer and use it in GitHub Desktop.
Patches to let a few programs work on OS X.
Patch to make vanilla a2x run on OS X
--- /usr/local/bin/a2x 2008-02-11 00:49:23.000000000 +0100
+++ a2x 2007-10-29 04:50:53.000000000 +0100
@@ -7,24 +7,13 @@
# under the terms of the GNU General Public License (GPL).
#
-# MK: `readlink -f' isn't available on OS X.
-function realpath()
-{
- python -c "import os; print os.path.realpath('$1')"
-}
-# MK: GNU getopt is available via MacPorts on OS X.
-function getopt()
-{
- command /opt/local/bin/getopt "$@"
-}
-
VERSION=1.0.0
BASENAME=$(basename "$0")
REALNAME="$0"
if [ ! -e "$REALNAME" ]; then
REALNAME=$(which "$REALNAME")
fi
-REALNAME="$(realpath "$REALNAME")"
+REALNAME="$(readlink -f "$REALNAME")"
CONF_DIR=/etc/asciidoc
#--------------------------------------------------------------------
@@ -448,7 +437,7 @@
quit "file not found: $xsl"
fi
to_docbook
- xml=$(realpath "$SRC_DIR/$SRC_NAME.xml")
+ xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml")
html="$SRC_NAME.html"
copy_stylesheet_and_icons "$DESTINATION_DIR"
execute_command_2 "cd \"$DESTINATION_DIR\""
@@ -481,7 +470,7 @@
quit "file not found: $xsl"
fi
to_docbook
- xml=$(realpath "$SRC_DIR/$SRC_NAME.xml")
+ xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml")
if [ ! -d "$chunkdir" ]; then
execute_command_2 "mkdir \"$chunkdir\""
fi
@@ -503,7 +492,7 @@
quit "file not found: $xsl"
fi
to_docbook "-d manpage"
- xml=$(realpath "$SRC_DIR/$SRC_NAME.xml")
+ xml=$(readlink -f "$SRC_DIR/$SRC_NAME.xml")
execute_command_2 "cd \"$DESTINATION_DIR\""
execute_command_2 "xsltproc $XSLTPROC_OPTS --nonet \
\"$xsl\" \"$xml\""
diff --git a/mr b/mr
index e96a3dc..2deb1c3 100755
--- a/mr
+++ b/mr
@@ -1367,7 +1367,7 @@ help =
tmp=$(mktemp -t mr.XXXXXXXXXX) || error "mktemp failed"
trap "rm -f $tmp" exit
pod2man -c mr "$MR_PATH" > "$tmp" || error "pod2man failed"
- man -l "$tmp" || error "man failed"
+ man "$tmp" || error "man failed"
list = true
config =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment