Skip to content

Commit

Permalink
configure: dropped getopt
Browse files Browse the repository at this point in the history
  • Loading branch information
noscript committed Mar 25, 2018
1 parent aae5310 commit 3296aac
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 60 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ install:

- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
brew update ;
brew install pkgconfig gnu-getopt cartr/qt4/qt gstreamer gst-plugins-base taglib ;
brew install pkgconfig cartr/qt4/qt gstreamer gst-plugins-base taglib ;
brew install gst-plugins-good ;
export PATH="/usr/local/opt/gnu-getopt/bin:$PATH" ;
fi

before_script:
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,15 @@ After installing MacPorts:

```sh
. ~/.profile
sudo port install pkgconfig getopt qt4-mac gstreamer1{,-gst-plugins-base} taglib
sudo port install pkgconfig qt4-mac gstreamer1{,-gst-plugins-base} taglib
```

#### HomeBrew

After installing HomeBrew:

```sh
brew install pkgconfig gnu-getopt cartr/qt4/qt gstreamer gst-plugins-base taglib
export PATH="/usr/local/opt/gnu-getopt/bin:$PATH"
brew install pkgconfig cartr/qt4/qt gstreamer gst-plugins-base taglib
```

### Build & Run Nulloy
Expand Down
92 changes: 38 additions & 54 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -40,61 +40,45 @@ echo_try()
echo "Try \`$BASENAME --help' for more information"
}

getopt -T > /dev/null
if [ ! $? -eq 4 ]; then
echo "$BASENAME: BSD version of 'getopt' is not supported."
echo "Install GNU getopt (enhanced) and check PATH environment variable."
echo
exit 1
fi

args=`getopt -n$BASENAME -o h --longoptions="force-version: no-update-check no-gstreamer gstreamer-tagreader vlc phonon no-taglib tests no-skins debug prefix: universal help" -- "$@"`

if test $? != 0; then
echo_try; exit 1
fi

eval set -- $args
while [ $# -gt 0 ]; do
if [ $1 == "--prefix" ]; then
shift
if (command -v realpath &> /dev/null) && [ -d "`dirname $1`" ]; then
PREFIX=`realpath "$1"`
else
PREFIX=`readlink -m "$1"`
fi
elif [ $1 == "--debug" ]; then
DEBUG=yes
elif [ $1 == "--force-version" ]; then
shift; FORCE_VERSION=$1
elif [ $1 == "--no-gstreamer" ]; then
BUILD_GSTREAMER=no
elif [ $1 == "--gstreamer-tagreader" ]; then
BUILD_GSTREAMER_TAGREADER=yes
elif [ $1 == "--vlc" ]; then
BUILD_VLC=yes
elif [ $1 == "--phonon" ]; then
BUILD_PHONON=yes
elif [ $1 == "--no-taglib" ]; then
BUILD_TAGLIB=no
elif [ $1 == "--tests" ]; then
BUILD_TESTS=yes
elif [ $1 == "--no-skins" ]; then
SUPPORT_SKINS=no
elif [ $1 == "--no-update-check" ]; then
UPDATE_CHECK=no
elif [ $1 == "--universal" ]; then
MAC_UNIVERSAL=yes
elif [[ $1 == "--help" || $1 == "-h" ]]; then
echo_help; exit 0
elif [ $1 == "--" ]; then
shift
if [ $# -ne 0 ]; then
echo "$BASENAME: invalid arguments"
while test $# -gt 0; do
case "$1" in
--prefix)
shift
if (command -v realpath &> /dev/null) && [ -d "`dirname $1`" ]; then
PREFIX=`realpath "$1"`
else
PREFIX=`readlink -m "$1"`
fi
;;
--debug)
DEBUG=yes ;;
--force-version)
shift; FORCE_VERSION=$1 ;;
--no-gstreamer)
BUILD_GSTREAMER=no ;;
--gstreamer-tagreader)
BUILD_GSTREAMER_TAGREADER=yes ;;
--vlc)
BUILD_VLC=yes ;;
--phonon)
BUILD_PHONON=yes ;;
--no-taglib)
BUILD_TAGLIB=no ;;
--tests)
BUILD_TESTS=yes ;;
--no-skins)
SUPPORT_SKINS=no ;;
--no-update-check)
UPDATE_CHECK=no ;;
--universal)
MAC_UNIVERSAL=yes ;;
--help|-h)
echo_help; exit 0 ;;
*)
echo "$BASENAME: invalid argument: $1"
echo_try; exit 1
fi
break
fi
;;
esac
shift
done

Expand Down
2 changes: 1 addition & 1 deletion configure.bat
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ set SUPPORT_SKINS=yes
if "%0" == "-h" goto help
if "%0" == "--help" goto help
if "%0" == "/?" goto help
echo %BASENAME%: invalid option '%0'
echo %BASENAME%: invalid argument '%0'
goto try_help

:try_help
Expand Down

0 comments on commit 3296aac

Please sign in to comment.