include libmagic in windows installer
This is from https://raw.githubusercontent.com/datalad/datalad-extensions/master/resources/git-annex-magicBundle.patch which was written by John Thorvald Wodder II. I have converted line endings from windows, and fixed indentation to use tabs.
This commit is contained in:
parent
f3070d2d7d
commit
a7d11aa3ab
2 changed files with 20 additions and 3 deletions
|
@ -87,3 +87,17 @@ preferredBundledPrograms = catMaybes
|
||||||
ifset True s = Just s
|
ifset True s = Just s
|
||||||
ifset False _ = Nothing
|
ifset False _ = Nothing
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
magicDLLs :: [FilePath]
|
||||||
|
#ifdef mingw32_HOST_OS
|
||||||
|
magicDLLs = ["libmagic-1.dll", "libgnurx-0.dll"]
|
||||||
|
#else
|
||||||
|
magicDLLs = []
|
||||||
|
#endif
|
||||||
|
|
||||||
|
magicShare :: [FilePath]
|
||||||
|
#ifdef mingw32_HOST_OS
|
||||||
|
magicShare = ["magic.mgc"]
|
||||||
|
#else
|
||||||
|
magicShare = []
|
||||||
|
#endif
|
||||||
|
|
|
@ -42,6 +42,7 @@ main = do
|
||||||
withTmpDir "nsis-build" $ \tmpdir -> do
|
withTmpDir "nsis-build" $ \tmpdir -> do
|
||||||
let gitannex = tmpdir </> gitannexprogram
|
let gitannex = tmpdir </> gitannexprogram
|
||||||
mustSucceed "ln" [File "git-annex.exe", File gitannex]
|
mustSucceed "ln" [File "git-annex.exe", File gitannex]
|
||||||
|
mapM_ (\f -> mustSucceed "ln" [File f, File (tmpdir </> f)]) (magicDLLs ++ magicShare)
|
||||||
let license = tmpdir </> licensefile
|
let license = tmpdir </> licensefile
|
||||||
mustSucceed "sh" [Param "-c", Param $ "zcat standalone/licences.gz > '" ++ license ++ "'"]
|
mustSucceed "sh" [Param "-c", Param $ "zcat standalone/licences.gz > '" ++ license ++ "'"]
|
||||||
webappscript <- vbsLauncher tmpdir "git-annex-webapp" "git annex webapp"
|
webappscript <- vbsLauncher tmpdir "git-annex-webapp" "git annex webapp"
|
||||||
|
@ -51,7 +52,7 @@ main = do
|
||||||
let gitannexcmd = tmpdir </> "git-annex.cmd"
|
let gitannexcmd = tmpdir </> "git-annex.cmd"
|
||||||
writeFile gitannexcmd "git annex %*"
|
writeFile gitannexcmd "git annex %*"
|
||||||
writeFile nsifile $ makeInstaller
|
writeFile nsifile $ makeInstaller
|
||||||
gitannex gitannexcmd license htmlhelp winPrograms
|
gitannex gitannexcmd license htmlhelp (winPrograms ++ magicDLLs) magicShare
|
||||||
[ webappscript, autostartscript ]
|
[ webappscript, autostartscript ]
|
||||||
mustSucceed "makensis" [File nsifile]
|
mustSucceed "makensis" [File nsifile]
|
||||||
removeFile nsifile -- left behind if makensis fails
|
removeFile nsifile -- left behind if makensis fails
|
||||||
|
@ -117,8 +118,8 @@ needGit = strConcat
|
||||||
, fromString "You can install git from http:////git-scm.com//"
|
, fromString "You can install git from http:////git-scm.com//"
|
||||||
]
|
]
|
||||||
|
|
||||||
makeInstaller :: FilePath -> FilePath -> FilePath -> FilePath -> [FilePath] -> [FilePath] -> String
|
makeInstaller :: FilePath -> FilePath -> FilePath -> FilePath -> [FilePath] -> [FilePath] -> [FilePath] -> String
|
||||||
makeInstaller gitannex gitannexcmd license htmlhelp extrabins launchers = nsis $ do
|
makeInstaller gitannex gitannexcmd license htmlhelp extrabins sharefiles launchers = nsis $ do
|
||||||
name "git-annex"
|
name "git-annex"
|
||||||
outFile $ str installer
|
outFile $ str installer
|
||||||
{- Installing into the same directory as git avoids needing to modify
|
{- Installing into the same directory as git avoids needing to modify
|
||||||
|
@ -163,6 +164,8 @@ makeInstaller gitannex gitannexcmd license htmlhelp extrabins launchers = nsis $
|
||||||
-- there.
|
-- there.
|
||||||
setOutPath "$INSTDIR\\usr\\bin"
|
setOutPath "$INSTDIR\\usr\\bin"
|
||||||
mapM_ addfile (gitannex:extrabins)
|
mapM_ addfile (gitannex:extrabins)
|
||||||
|
setOutPath "$INSTDIR\\usr\\share\\misc"
|
||||||
|
mapM_ addfile sharefiles
|
||||||
-- This little wrapper is installed in the cmd directory,
|
-- This little wrapper is installed in the cmd directory,
|
||||||
-- so that "git-annex" works (as well as "git annex"),
|
-- so that "git-annex" works (as well as "git annex"),
|
||||||
-- when only that directory is in PATH (ie, in a ms-dos
|
-- when only that directory is in PATH (ie, in a ms-dos
|
||||||
|
|
Loading…
Add table
Reference in a new issue