Makefile: Added install-home target which installs git-annex into the HOME directory

This commit is contained in:
Joey Hess 2019-03-18 12:33:56 -04:00
parent 95e94b9d00
commit 6491b62614
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
7 changed files with 83 additions and 17 deletions

View file

@ -3,6 +3,9 @@ users with experience building code from source. But the build may
require some care and feeding. This page will start with the easy
methods and work up to the harder ones.
This page also covers installing git-annex from source, but in many
cases it's better to install it using your OS's package manager.
## downloading the source code
The easiest way is using git; see [[download]] or just run:
@ -18,8 +21,17 @@ First, install everything git-annex needs to build:
sudo apt-get build-dep git-annex
Now you can build git-annex by running either `make` or `cabal build`
inside the source tree.
Now you can build git-annex by running `make` inside the source tree.
Then, to install the program and associated files system-wide in `/usr/local`,
run:
sudo make install PREFIX=/usr/local
Or, to install the program into $HOME/.local/bin, and associated files
into other parts of your HOME directory, run:
make install-home
## building from source with stack
@ -34,21 +46,28 @@ On Debian:
Get the git-annex source code, and inside the source tree run:
stack setup
stack install
stack build
Move git-annex into some directory that is in your PATH:
To install the program and all associated files system-wide
in `/usr/local`, run:
mv ~/.local/bin/git-annex ~/bin # or /usr/local/bin/ or whatever
sudo make install BUILDER=stack PREFIX=/usr/local
Or, to install the program into $HOME/.local/bin, and associated files
into other parts of your HOME directory, run:
make install-home BUILDER=stack
(Why not run `stack install git-annex`? Because that causes stack to
[ignore git-annex's stack.yaml file](https://github.com/commercialhaskell/stack/issues/2371),
yielding a less reliable build.)
yielding a less reliable build. Stack also only installs the binary,
and not other files.)
Note that this build produces a git-annex without the build flags
XMPP, DBUS, and MagicMime.
These optional features require installing additional C libraries.
To try to build with these features
enabled, pass extra parameters when running stack install:
enabled, pass extra parameters when running `stack build`:
`--flag git-annex:XMPP --flag git-annex:DBUS --flag git-annex:MagicMime`
## minimal build from source with cabal
@ -67,8 +86,16 @@ Get the git-annex source code, and inside the source tree, run:
cabal install -j -f"-assistant -webapp -webdav -pairing -dbus -magicmime" --only-dependencies
cabal configure -f"-assistant -webapp -webdav -pairing -dbus -magicmime"
cabal build -j
PATH=$HOME/bin:$PATH
cabal install --bindir=$HOME/bin
To install the program and all associated files system-wide
in `/usr/local`, run:
sudo make install BUILDER=cabal PREFIX=/usr/local
Or, to install the program into $HOME/.local/bin, and associated files
into other parts of your HOME directory, run:
make install-home BUILDER=cabal
## full build from source with cabal
@ -82,5 +109,13 @@ Once the C libraries are installed, run inside the source tree:
cabal install -j --only-dependencies
cabal configure
cabal build -j
PATH=$HOME/bin:$PATH
cabal install --bindir=$HOME/bin
To install the program and all associated files system-wide
in `/usr/local`, run:
sudo make install BUILDER=cabal PREFIX=/usr/local
Or, to install the program into $HOME/.local/bin, and associated files
into other parts of your HOME directory, run:
make install-home BUILDER=cabal