Commit graph

32 commits

Author SHA1 Message Date
Joey Hess
393275c105
Setup.hs: Stop installing man pages, desktop files, and the git-annex-shell and git-remote-tor-annex symlinks
Anything still relying on that, eg via cabal v1-install will need to
change to using make install-home. Which was added back in 2019 in
6491b62614 because cabal new-build
(now the default) already didn't use Setup in a way that let its
installation of those things work.

Notably this means Setup does not need to depend on unix-compat, which is
useful because in 0.7 it removed System.PosixCompat.User, which Setup
needed to determine where to install the desktop files. See
https://github.com/haskell-pkg-janitors/unix-compat/issues/3
2023-08-01 15:08:56 -04:00
Joey Hess
070fb9e624
Added git-remote-tor-annex, which allows git pull and push to the tor hidden service.
Almost working, but there's a bug in the relaying.

Also, made tor hidden service setup pick a random port, to make it harder
to port scan.

This commit was sponsored by Boyd Stephen Smith Jr. on Patreon.
2016-11-21 17:27:38 -04:00
Joey Hess
f4489cc415
Remove Makefile from cabal tarball; man page building is now handled by a small haskell program.
This actually runs faster than building the man pages from the makefile
did. But the main purpose is to let Setup.hs import Build.Mans and so not
need the makefile.
2016-05-31 13:58:13 -04:00
Joey Hess
f79875ef3b
Updated cabal file explictly lists source files.
The tarball on hackage will include only the files needed for cabal install;
it is NOT the full git-annex source tree. While it's totally obnoxious that
cabal files need every file listed out when basic wildcard support could
avoid hundreds of lines, and have to be maintained when files are added,
this does get the tarball size back down to 1 mb.

This also stops stack from complaining that it found modules not listed in
the cabal file.

debian/changelog, debian/NEWS, debian/copyright: Converted to symlinks
to CHANGELOG, NEWS, and COPYRIGHT, which used to symlink to these instead.
This avoids needing to include debian/ in the hackage tarball.

Setup.hs: Build man pages at install time using make and mdwn2man.
If it fails, which it probably will on windows, just skip installing
them.
2016-05-24 01:28:07 -04:00
Joey Hess
55eec1b72a
Setup: avoid trying to install man pages and desktop files on Windows 2016-05-05 16:05:27 -04:00
Joey Hess
b22409db38
avoid warnings about not exported System.Directory.isSymbolicLink 2016-04-28 15:18:11 -04:00
Joey Hess
5fe450514b
Fix build with directory-1.2.6.2.
It started exporting a isSymbolicLink which supports windows. But,
git-annex does no use symlinks on windows yet and this conflicts with the
function by the same name from unix-compat, so hide it.
2016-04-28 13:18:44 -04:00
Joey Hess
0dbe93477c
improve warning 2015-11-03 11:06:33 -04:00
Joey Hess
628429f1b0
When cabal install is run with the desktop file location not writable, display a warning, but continue successfully.
Installing the desktop file etc is a niceity of git-annex's cabal install,
but not a requirement.

closes https://github.com/fpco/stackage/issues/726
2015-11-03 10:47:33 -04:00
Joey Hess
0717ad4440
Avoid installing desktop file and program file if cabal install git-annex is run as root, since that is not a systemwide install, but to /root, and so generating a systemwide desktop file is not right. 2015-11-03 10:38:08 -04:00
Joey Hess
8167f6fb40 Improve Setup.hs file so that cabal copy --destdir works. Thanks, Magnus_Therning. 2015-08-09 10:30:35 -04:00
Joey Hess
dace1f3162 switch Setup file to use postCopy hook, since cabal has stopped running postInst
See https://github.com/haskell/cabal/issues/1805

Apparently, old versions of cabal don't run copyHook, but at the moment
I don't know who would be using a cabal as old as 1.18, and it seems a lot
of complication to run both hooks. Although I think my code is idempotent,
so they could both be used if necessary.
2015-07-31 12:03:19 -04:00
Joey Hess
14d15dcf0e response 2015-07-31 11:34:09 -04:00
Joey Hess
aea9d1d45a and anoher one.. 2015-05-10 16:40:24 -04:00
Joey Hess
b04f62a962 make configure -Wall clean 2014-03-10 16:59:38 -04:00
Joey Hess
e62de3f3b8 split out library 2013-04-17 12:02:44 -04:00
Joey Hess
2172cc586e where indenting 2012-11-11 00:51:07 -04:00
Joey Hess
3da78cc241 make the standalone OSX app automatically install itself when run 2012-09-26 16:50:04 -04:00
Joey Hess
87b9da70e6 avoid installing man pages when they do not exist
Man pages are shipped prebuilt in cabal tarball, but will not be available
when cloning git and running cabal install.
2012-09-01 15:20:45 -04:00
Joey Hess
23fe661d37 install autostart file too 2012-08-01 23:31:53 -04:00
Joey Hess
e78b13c428 hook desktop menu file installation into makefile and cabal 2012-08-01 21:05:27 -04:00
Joey Hess
5f5f7b1a9f tweak 2012-06-12 11:38:16 -04:00
Nathan Collins
000bbba3c0 Clean up Setup.hs.
Remove post-copy hook 'myPostCopy': it's easy to write one based on
'myPostInst', so just wait until someone complains that it's missing.

Remove most comments.

Put long type sigs on one line like in the other source files.
2012-06-12 02:50:09 -07:00
Nathan Collins
d76afc8152 Replace indentation spaces by tabs in Setup.hs. 2012-06-10 02:21:13 -07:00
Nathan Collins
6c8507ee1b Combine post install commands in 'postInst' and add 'postCopy' hook.
The creation of the 'git-annex-shell' symlink was in 'postInst' hook.
I combined it with the man-page installation in a 'postInst' hook and
a 'postCopy' hook.  I don't understand how to use the `cabal copy`
command, but the examples I looked at defined both hooks.

Relevant comments from the source:

* man-page installation:

  See http://www.haskell.org/haskellwiki/Cabal/Developer-FAQ#Installing_manpages.

  Based on pandoc's and lhs2tex's 'Setup.installManpages' and
  'postInst' hooks.

  My understanding: 'postCopy' is run for `cabal copy`, 'postInst' is
  run for `cabal inst`, and copy is not a generalized install, so you
  have to write two nearly identical hooks.

  Summary of hooks:
  http://www.haskell.org/cabal/release/cabal-latest/doc/API/Cabal/Distribution-Simple-UserHooks.htm--
  Other people are also confused:

  * Bug: 'postCopy' and 'postInst' are confusing:
  http://hackage.haskell.org/trac/hackage/ticket/718

  * A cabal maintainer suggests using 'postCopy' instead of
  'postInst', because `cabal install` is `cabal copy` followed by
  `cabal register`:
  http://www.haskell.org/pipermail/libraries/2008-March/009416.html
  Although that sounds desirable, it's not true, as the reply and
  experiments indicate.

* the `cabal copy` command:

  ???: Not sure how you're supposed to use this.  E.g., when I do

     cabal install --prefix=/tmp/git-annex-install
     cabal copy --deistdir=/tmp/git-annex-copy

  I get the copy under

    /tmp/git-annex-copy/tmp/git-annex-install

  Also, `cabal install` fails when given a relative --prefix.
2012-06-09 23:39:51 -07:00
Nathan Collins
817a42056b Add note about lhs2tex's man page installation. 2012-06-07 19:01:49 -07:00
Nathan Collins
6f17b2fb39 WIP: Add man page installation to Setup.hs
This works with `cabal-dev install .`, but `cabal sdist` does not yet
include the man pages (tried adding a `make $(mans)` before `cabal
sdist` in `make sdist`, but no luck).

XXX: Need to go back and replace spaces with tabs.
2012-06-06 02:35:32 -07:00
Joey Hess
1ca41044e8 cabal now installs git-annex-shell as a symlink to git-annex. 2012-04-14 14:01:14 -04:00
Joey Hess
ff62bc5151 fix use of Configure 2012-03-23 12:24:40 -04:00
Joey Hess
181d2ccd20 Improve detection of inability to check free disk space.
Don't check if configure indicated checks won't work. This should fix a
FTBFS on mipsel, where configure correctly detects the checks won't work,
while garbage is returned for disk space info at git-annex runtime. It also
means that, when built via cabal, disk space checks are not enabled,
unfortunatly.
2012-03-21 21:21:20 -04:00
Joey Hess
468fecc315 Setup.hs: import configure
Rather than running make, which runs configure, let Setup.hs just include
the configure code. The standalone configure is retained for use by the
Makefile.

This may work better with cabal-dev, since it avoids the Makefile running
ghc, and lets cabal handle all the compiler running, with whatever
flags it uses to expose dependencies.
2012-03-10 14:00:26 -04:00
Joey Hess
56aeeb4565 cabal can now be used to build git-annex.
This is substantially slower than using make, does not build or install
documentation, does not run the test suite, and is not particularly
recommended, but could be useful to some.
2011-06-30 14:55:03 -04:00