Add package manager install instructions to README.

And small cleanup.
This commit is contained in:
Murilo Pereira 2020-05-31 21:57:08 +02:00
parent 0268d6df09
commit ca3acc8251
2 changed files with 65 additions and 27 deletions

View File

@ -4,7 +4,8 @@ CC ?= gcc
CFLAGS ?= -g CFLAGS ?= -g
CFLAGS += -W -Wall -pedantic -ansi -std=c99 -DVERSION=\"$(VERSION)\" CFLAGS += -W -Wall -pedantic -ansi -std=c99 -DVERSION=\"$(VERSION)\"
# OS X installs ncurses with wide character support, but not as "libncurses". # The Ncurses library with wide character support is available as "lncurses"
# under macOS.
ifeq ($(shell uname -s),Darwin) ifeq ($(shell uname -s),Darwin)
LDFLAGS += -lncurses LDFLAGS += -lncurses
else else
@ -48,15 +49,15 @@ ttysolitaire: $(SRC_OBJECTS)
$(CC) $(CFLAGS) $(SRC) -o $(EXECUTABLE) $(SRC_OBJECTS) $(LDFLAGS) $(CC) $(CFLAGS) $(SRC) -o $(EXECUTABLE) $(SRC_OBJECTS) $(LDFLAGS)
test: $(SRC_OBJECTS) $(TESTS_OBJECTS) test: $(SRC_OBJECTS) $(TESTS_OBJECTS)
@$(CC) $(CFLAGS) $(TESTS_SRC) -o $(TESTS_EXECUTABLE) $(TESTS_OBJECTS) $(SRC_OBJECTS) $(LDFLAGS) $(CC) $(CFLAGS) $(TESTS_SRC) -o $(TESTS_EXECUTABLE) $(TESTS_OBJECTS) $(SRC_OBJECTS) $(LDFLAGS)
@./$(TESTS_EXECUTABLE) ./$(TESTS_EXECUTABLE)
clean: clean:
@rm -rf $(SRC_DIR)/*.o $(TESTS_DIR)/*.o $(EXECUTABLE) $(TESTS_EXECUTABLE) rm -rf $(SRC_DIR)/*.o $(TESTS_DIR)/*.o $(EXECUTABLE) $(TESTS_EXECUTABLE)
install: install:
@install -d $(DESTDIR)$(PREFIX)/bin install -d $(DESTDIR)$(PREFIX)/bin
@install -m755 $(EXECUTABLE) $(DESTDIR)$(PREFIX)/bin/$(EXECUTABLE) install -m755 $(EXECUTABLE) $(DESTDIR)$(PREFIX)/bin/$(EXECUTABLE)
uninstall: uninstall:
@rm -f $(PREFIX)/bin/$(EXECUTABLE) rm -f $(PREFIX)/bin/$(EXECUTABLE)

77
README
View File

@ -12,53 +12,90 @@
- Ncurses with wide-char/UTF-8 support - Ncurses with wide-char/UTF-8 support
** Install ** Install
*** Using package managers
**** Arch Linux
#+begin_src bash
pacman -S tty-solitaire
#+end_src
**** macOS
#+begin_src bash
brew install tty-solitaire
#+end_src
**** Void Linux
#+begin_src bash
xbps-install -S tty-solitaire
#+end_src
**** FreeBSD
#+begin_src bash
pkg install tty-solitaire
#+end_src
**** Slackware
[[https://www.slackbuilds.org/repository/14.2/games/tty-solitaire/][Via Slackbuilds]].
**** ALT Linux
#+begin_src bash
apt-get install tty-solitaire
#+end_src
We still need help making tty-solitaire available on Ubuntu, Fedora, Gentoo,
and more. Please give us a hand at [[https://github.com/mpereira/tty-solitaire/issues/29][issue #29]] if you think you can help.
*** From source *** From source
**** Install Ncurses **** Install Ncurses
tty-solitaire depends on Ncurses. Some platforms provide it out of the box tty-solitaire depends on Ncurses. Some platforms provide it out of the box
and some don't, so you might need to install it yourself. and some don't, so you might need to install it yourself.
***** Ubuntu ***** Ubuntu
#+BEGIN_SRC bash #+begin_src bash
sudo apt-get install libncurses5-dev libncursesw5-dev sudo apt-get install libncurses5-dev libncursesw5-dev
#+END_SRC #+end_src
***** macOS ***** macOS
macOS has Ncurses with wide character support out of the box, so *there's macOS has Ncurses with wide character support out of the box, so *there's
nothing you need to do*. If you want to use other Ncurses libraries (from nothing you need to do*.
*If* for some reason you want to use other Ncurses libraries (from
Macports, Homebrew, etc.) you are able to do it by specifying =LDLAGS= in Macports, Homebrew, etc.) you are able to do it by specifying =LDLAGS= in
the make invocation. See [[https://github.com/mpereira/tty-solitaire/pull/8][this pull request]] for more information. the make invocation. See [[https://github.com/mpereira/tty-solitaire/pull/8][this pull request]] for more information.
**** Install tty-solitaire **** Install tty-solitaire
#+BEGIN_SRC text #+begin_src bash
$ wget -O tty-solitaire-v1.1.0.tar.gz https://github.com/mpereira/tty-solitaire/archive/v1.1.0.tar.gz wget -O tty-solitaire-v1.1.1.tar.gz https://github.com/mpereira/tty-solitaire/archive/v1.1.1.tar.gz
$ tar xvf tty-solitaire-v1.1.0.tar.gz tar xvf tty-solitaire-v1.1.1.tar.gz
$ cd tty-solitaire-1.1.0 cd tty-solitaire-1.1.1
$ make make
$ sudo make install sudo make install
#+END_SRC #+end_src
*** Via package managers
Check out https://github.com/mpereira/tty-solitaire/issues/29.
** Play ** Play
Run in your favorite shell: Run in your favorite shell:
#+BEGIN_SRC bash
#+begin_src bash
ttysolitaire ttysolitaire
#+END_SRC #+end_src
** Usage ** Usage
#+BEGIN_SRC text #+begin_src text
usage: ttysolitaire [-v|--version] [-h|--help] [-p|--passes=NUMBER] usage: ttysolitaire [-v|--version] [-h|--help] [-p|--passes=NUMBER]
-v, --version Show version -v, --version Show version
-h, --help Show this message -h, --help Show this message
-p, --passes Number of passes through the deck -p, --passes Number of passes through the deck
#+END_SRC #+end_src
** Development ** Development
*** Get the code *** Get the code
#+BEGIN_SRC bash #+begin_src bash
git clone https://github.com/mpereira/tty-solitaire.git git clone https://github.com/mpereira/tty-solitaire.git
#+END_SRC #+end_src
*** Run the unit tests *** Run the unit tests
#+BEGIN_SRC bash #+begin_src bash
make test make test
#+END_SRC #+end_src
** Author ** Author
[[http://murilopereira.com][Murilo Pereira]] [[http://murilopereira.com][Murilo Pereira]]