hook desktop menu file installation into makefile and cabal
This commit is contained in:
parent
ed07546288
commit
e78b13c428
3 changed files with 15 additions and 1 deletions
|
@ -5,7 +5,7 @@
|
||||||
- Licensed under the GNU GPL version 3 or higher.
|
- Licensed under the GNU GPL version 3 or higher.
|
||||||
-}
|
-}
|
||||||
|
|
||||||
module Build.Desktop where
|
module Build.InstallDesktopFile where
|
||||||
|
|
||||||
import Utility.Exception
|
import Utility.Exception
|
||||||
import Utility.FreeDesktop
|
import Utility.FreeDesktop
|
||||||
|
@ -32,3 +32,8 @@ writeDesktop d = do
|
||||||
then userDesktopMenuFilePath "git-annex"
|
then userDesktopMenuFilePath "git-annex"
|
||||||
else return $ systemDesktopMenuFilePath "git-annex"
|
else return $ systemDesktopMenuFilePath "git-annex"
|
||||||
writeDesktopMenuFile d dest
|
writeDesktopMenuFile d dest
|
||||||
|
|
||||||
|
main = getArgs >>= go
|
||||||
|
where
|
||||||
|
go [] = error "specify git-annex command"
|
||||||
|
go (command:_) = writeDesktop $ desktop command
|
1
Makefile
1
Makefile
|
@ -86,6 +86,7 @@ install: all install-docs
|
||||||
install -d $(DESTDIR)$(PREFIX)/bin
|
install -d $(DESTDIR)$(PREFIX)/bin
|
||||||
install $(bins) $(DESTDIR)$(PREFIX)/bin
|
install $(bins) $(DESTDIR)$(PREFIX)/bin
|
||||||
ln -sf git-annex $(DESTDIR)$(PREFIX)/bin/git-annex-shell
|
ln -sf git-annex $(DESTDIR)$(PREFIX)/bin/git-annex-shell
|
||||||
|
runghc Build/InstallDesktopFile.hs $(PREFIX)/bin/git-annex || true
|
||||||
|
|
||||||
test: $(sources) $(clibs)
|
test: $(sources) $(clibs)
|
||||||
@if ! $(GHCMAKE) -O0 test $(clibs); then \
|
@if ! $(GHCMAKE) -O0 test $(clibs); then \
|
||||||
|
|
8
Setup.hs
8
Setup.hs
|
@ -10,6 +10,7 @@ import Distribution.PackageDescription (PackageDescription(..))
|
||||||
import Distribution.Verbosity (Verbosity)
|
import Distribution.Verbosity (Verbosity)
|
||||||
import System.FilePath
|
import System.FilePath
|
||||||
|
|
||||||
|
import qualified Build.InstallDesktopFile as InstallDesktopFile
|
||||||
import qualified Build.Configure as Configure
|
import qualified Build.Configure as Configure
|
||||||
|
|
||||||
main = defaultMainWithHooks simpleUserHooks
|
main = defaultMainWithHooks simpleUserHooks
|
||||||
|
@ -25,6 +26,7 @@ myPostInst :: Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO
|
||||||
myPostInst _ (InstallFlags { installVerbosity }) pkg lbi = do
|
myPostInst _ (InstallFlags { installVerbosity }) pkg lbi = do
|
||||||
installGitAnnexShell dest verbosity pkg lbi
|
installGitAnnexShell dest verbosity pkg lbi
|
||||||
installManpages dest verbosity pkg lbi
|
installManpages dest verbosity pkg lbi
|
||||||
|
installDesktopFile dest verbosity pkg lbi
|
||||||
where
|
where
|
||||||
dest = NoCopyDest
|
dest = NoCopyDest
|
||||||
verbosity = fromFlag installVerbosity
|
verbosity = fromFlag installVerbosity
|
||||||
|
@ -47,3 +49,9 @@ installManpages copyDest verbosity pkg lbi =
|
||||||
srcManpages = zip (repeat srcManDir) manpages
|
srcManpages = zip (repeat srcManDir) manpages
|
||||||
srcManDir = ""
|
srcManDir = ""
|
||||||
manpages = ["git-annex.1", "git-annex-shell.1"]
|
manpages = ["git-annex.1", "git-annex-shell.1"]
|
||||||
|
|
||||||
|
installDesktopFile :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
|
||||||
|
installDesktopFile copyDest verbosity pkg lbi =
|
||||||
|
InstallDesktopFile.writeDesktop $ InstallDesktopFile.desktop $ dstBinDir </> "git-annex"
|
||||||
|
where
|
||||||
|
dstBinDir = bindir $ absoluteInstallDirs pkg lbi copyDest
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue