2014-09-16 19:05:12 +00:00
|
|
|
So you want to build git-annex from source. This is encouraged for
|
|
|
|
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.
|
|
|
|
|
2019-03-18 16:33:56 +00:00
|
|
|
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.
|
|
|
|
|
2014-09-16 19:05:12 +00:00
|
|
|
## downloading the source code
|
|
|
|
|
2016-07-19 18:40:30 +00:00
|
|
|
The easiest way is using git; see [[download]] or just run:
|
2014-09-16 19:05:12 +00:00
|
|
|
|
|
|
|
git clone git://git-annex.branchable.com/ git-annex
|
|
|
|
|
|
|
|
## building from source on Debian
|
|
|
|
|
|
|
|
This is the method used by git-annex's author, and so it's the one most
|
|
|
|
likely to work without problems.
|
|
|
|
|
|
|
|
First, install everything git-annex needs to build:
|
|
|
|
|
|
|
|
sudo apt-get build-dep git-annex
|
|
|
|
|
2019-03-18 16:33:56 +00:00
|
|
|
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
|
2014-09-16 19:05:12 +00:00
|
|
|
|
2015-09-26 10:16:01 +00:00
|
|
|
## building from source with stack
|
|
|
|
|
|
|
|
Using stack automates nearly everything, will work on many systems,
|
|
|
|
and avoids build failures due to fast-changing haskell libraries.
|
|
|
|
|
2023-08-28 16:52:53 +00:00
|
|
|
First, [install stack](https://docs.haskellstack.org/en/stable/install_and_upgrade/)
|
2018-11-20 16:14:23 +00:00
|
|
|
On Debian:
|
2015-09-26 10:16:01 +00:00
|
|
|
|
2022-07-29 20:12:00 +00:00
|
|
|
sudo apt-get install haskell-stack zlib1g-dev
|
2015-09-26 10:16:01 +00:00
|
|
|
|
2016-07-19 18:40:30 +00:00
|
|
|
Get the git-annex source code, and inside the source tree run:
|
2015-09-26 10:16:01 +00:00
|
|
|
|
|
|
|
stack setup
|
2019-03-18 16:33:56 +00:00
|
|
|
stack build
|
|
|
|
|
|
|
|
To install the program and all associated files system-wide
|
|
|
|
in `/usr/local`, run:
|
2015-09-26 10:16:01 +00:00
|
|
|
|
2019-03-18 16:33:56 +00:00
|
|
|
sudo make install BUILDER=stack PREFIX=/usr/local
|
2015-09-26 10:16:01 +00:00
|
|
|
|
2019-03-18 16:33:56 +00:00
|
|
|
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
|
2015-09-26 10:16:01 +00:00
|
|
|
|
2016-07-19 18:40:30 +00:00
|
|
|
(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),
|
2019-03-18 16:33:56 +00:00
|
|
|
yielding a less reliable build. Stack also only installs the binary,
|
|
|
|
and not other files.)
|
2016-07-19 18:40:30 +00:00
|
|
|
|
2016-02-05 18:34:12 +00:00
|
|
|
Note that this build produces a git-annex without the build flags
|
2021-10-19 16:26:22 +00:00
|
|
|
DBUS and MagicMime.
|
2016-02-05 18:34:12 +00:00
|
|
|
These optional features require installing additional C libraries.
|
|
|
|
To try to build with these features
|
2019-03-18 16:33:56 +00:00
|
|
|
enabled, pass extra parameters when running `stack build`:
|
2021-10-19 16:26:22 +00:00
|
|
|
`--flag git-annex:DBUS --flag git-annex:MagicMime`
|
2015-09-26 10:16:01 +00:00
|
|
|
|
|
|
|
## minimal build from source with cabal
|
2014-09-16 19:05:12 +00:00
|
|
|
|
2016-02-05 18:34:12 +00:00
|
|
|
This can be done anywhere, and builds git-annex without some optional
|
|
|
|
features that require harder-to-install C libraries. This is plenty to let
|
|
|
|
you get started with git-annex, but it does not include the assistant or
|
|
|
|
webapp.
|
2014-09-16 19:05:12 +00:00
|
|
|
|
2015-05-19 19:50:42 +00:00
|
|
|
Be warned that this involves building a lot of Haskell libraries from
|
|
|
|
source, and so it has a lot of moving parts, and it's not uncommon for it
|
2015-09-26 10:16:01 +00:00
|
|
|
to be broken from time to time.
|
2015-05-19 19:50:42 +00:00
|
|
|
|
2016-07-19 18:40:30 +00:00
|
|
|
Get the git-annex source code, and inside the source tree, run:
|
2014-09-16 19:05:12 +00:00
|
|
|
|
2022-06-29 18:19:56 +00:00
|
|
|
cabal install -j -f"-assistant -webapp -pairing -dbus -magicmime" --only-dependencies
|
|
|
|
cabal configure -f"-assistant -webapp -pairing -dbus -magicmime"
|
2015-03-28 19:28:28 +00:00
|
|
|
cabal build -j
|
2019-03-18 16:33:56 +00:00
|
|
|
|
|
|
|
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
|
2014-09-16 19:05:12 +00:00
|
|
|
|
2015-09-26 10:16:01 +00:00
|
|
|
## full build from source with cabal
|
2014-09-16 19:05:12 +00:00
|
|
|
|
|
|
|
To build with all features enabled, including the assistant and webapp,
|
|
|
|
you will need to install several C libraries and their headers,
|
2018-11-20 16:14:23 +00:00
|
|
|
including libmagic, and zlib. How to do that for your OS is beyond
|
|
|
|
the scope of this page.
|
2014-09-16 19:12:09 +00:00
|
|
|
|
|
|
|
Once the C libraries are installed, run inside the source tree:
|
2014-09-16 19:05:12 +00:00
|
|
|
|
2015-03-28 19:28:28 +00:00
|
|
|
cabal install -j --only-dependencies
|
2015-07-21 23:16:46 +00:00
|
|
|
cabal configure
|
2015-03-28 19:28:28 +00:00
|
|
|
cabal build -j
|
2019-03-18 16:33:56 +00:00
|
|
|
|
|
|
|
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
|