forked from purescript/purescript
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix purescript#624 - remove xdg-basedir dependency, simplify build.
- Loading branch information
Showing
4 changed files
with
11 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,6 @@ | ||
{-# LANGUAGE CPP #-} | ||
|
||
#ifndef POSIX_LIKE | ||
#define POSIX_LIKE !(defined(_WIN32_HOST_OS) || defined(_WIN64_HOST_OS)) && \ | ||
(defined(unix_HOST_OS) || defined(__unix___HOST_OS) || \ | ||
defined(__unix_HOST_OS) || defined(linux_HOST_OS) || \ | ||
defined(__linux___HOST_OS) || defined(__linux_HOST_OS) || \ | ||
(defined(__APPLE___HOST_OS) && defined(__MACH___HOST_OS))) | ||
#endif | ||
|
||
module Main where | ||
|
||
import Control.Monad | ||
|
||
import Distribution.PackageDescription | ||
import Distribution.Simple | ||
import Distribution.Simple.LocalBuildInfo | ||
import Distribution.Simple.Setup | ||
|
||
import System.Directory | ||
import System.Environment.XDG.BaseDir | ||
#if POSIX_LIKE | ||
import System.Posix.Files | ||
#endif | ||
|
||
main :: IO () | ||
main = defaultMainWithHooks $ simpleUserHooks {postInst = setupXDG} | ||
|
||
setupXDG :: Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO () | ||
setupXDG _ _ _ _ = do | ||
configDir <- getUserConfigDir "purescript" | ||
configExists <- doesDirectoryExist configDir | ||
unless configExists $ do | ||
createDirectoryIfMissing True configDir | ||
#if POSIX_LIKE | ||
setFileMode configDir ownerModes | ||
#endif | ||
#undef POSIX_LIKE | ||
main = defaultMain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters