hsinstall 2.0 → 2.1
raw patch · 5 files changed
+32/−25 lines, 5 filesdep +heredocdep −herePVP ok
version bump matches the API change (PVP)
Dependencies added: heredoc
Dependencies removed: here
API changes (from Hackage documentation)
Files
- changelog.md +6/−0
- hsinstall.cabal +3/−3
- package.yaml +2/−2
- src/app/HSInstall/Opts.hs +5/−6
- src/lib/HSInstall/Resources.hs +16/−14
changelog.md view
@@ -1,3 +1,9 @@+2.1 (2018-10-22)++ * Switched to a a lighter-weight here-document library+ * Updated API documentation++ 2.0 (2018-10-22) * Redesigned as a binary utility to be installed on a system, not a script
hsinstall.cabal view
@@ -2,10 +2,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: f60a6fb3e6b02783f5b070298486b94b6e837860bb3ed714828023ecbe1fdaa8+-- hash: a681e9c6bebfdb69f5381c614da7b4914226a5b02e54964d30b3bd8ed648caa7 name: hsinstall-version: 2.0+version: 2.1 synopsis: Install Haskell software description: This is a tool for deploying software projects into directory structures suitable for installation on a system. It builds upon the `stack install` command and adds more features. It's also a tool for easier AppImage creation. category: Utility@@ -60,7 +60,7 @@ , base >=4.8 && <5.0 , directory , filepath- , here+ , heredoc , hsinstall , process default-language: Haskell2010
package.yaml view
@@ -1,5 +1,5 @@ name: hsinstall-version: '2.0'+version: '2.1' synopsis: Install Haskell software description: This is a tool for deploying software projects into directory structures suitable for installation on a system. It builds upon the `stack install` command and adds more features. It's also a tool for easier AppImage creation. license: ISC@@ -45,6 +45,6 @@ - Cabal - directory - filepath- - here+ - heredoc - hsinstall - process
src/app/HSInstall/Opts.hs view
@@ -10,11 +10,11 @@ where import Data.Maybe ( listToMaybe )-import Data.String.Here.Interpolated ( iTrim ) import Data.Version ( showVersion ) import Paths_hsinstall ( version ) import System.Console.GetOpt import System.Environment ( getProgName )+import Text.Heredoc ( here ) import Text.Printf ( printf ) @@ -84,7 +84,8 @@ usageText :: IO String usageText = do progName <- getProgName- return $ (usageInfo (header progName) options) ++ "\n" ++ body+ return $ (usageInfo (header progName) options) ++ "\n" +++ (printf body $ showVersion version) where header progName = init $ unlines@@ -93,8 +94,7 @@ , "" , "options:" ]- body = [iTrim|-OVERVIEW+ body = [here|OVERVIEW hsinstall is a tool for deploying software projects into directory structures suitable for installation on a system. It builds upon the `stack install` command and adds more features. Those are: @@ -141,8 +141,7 @@ If present, hsinstall will deploy a `resources` directory to `<PREFIX>/share/PROJECT-VERSION/resources`. In order to locate these files at runtime, the hsinstall project includes a library to build filesystem-portable relative paths. See this source code for help on integrating this into your app: https://github.com/dino-/hsinstall/blob/master/src/lib/HSInstall/Resources.hs -Version ${showVersion version} Dino Morelli <dino@ui3.info>-|]+Version %s Dino Morelli <dino@ui3.info>|] formattedVersion :: IO String
src/lib/HSInstall/Resources.hs view
@@ -1,8 +1,7 @@ {- |- Support library for users of the installation script in- hsinstall. When your project has data files in a @resources@- directory, this library can be used to locate those files- at runtime.+ Resource location support library for software deployed with the hsinstall+ utility. Or, really, anything that roughly follows an FHS-like deployment+ structure. -} module HSInstall.Resources ( getRsrcDir )@@ -14,19 +13,22 @@ {- |- Get the path to the resources, relative to where the binary was- installed and executed from. The argument passed here is expected- to be the @getDataDir@ generated by Cabal at compile time in the- @Paths_YOUR_PROJECT@ module.+ Get a path to the application resources directory relative to the binary+ location. The argument passed here is expected to be the output of+ @getDataDir@ generated by Cabal at compile time in the @Paths_YOUR_PROJECT@+ module. - Usage:+ Usage: - @- import HSInstall ( getRsrcDir )- import Paths_YOUR_PROJECT ( getDataDir )+ @+ import HSInstall.Resources ( getRsrcDir )+ import Paths_PROJECTNAME ( getDataDir ) - resourcesDir <- getRsrcDir getDataDir- @+ resourcesDir <- getRsrcDir getDataDir+ @++ If your binary is at @\/foo\/bar\/usr\/bin\/BINARY@, this library will generate+ this path: @\/foo\/bar\/usr\/share\/PROJECTNAME-VERSION\/resources@ -} getRsrcDir :: IO FilePath -> IO FilePath getRsrcDir cabalDataDir = do