cabal-appimage 0.3.0.5 → 0.4.0.0
raw patch · 3 files changed
+17/−6 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
- Distribution.AppImage: AppImage :: String -> FilePath -> [FilePath] -> [FilePath] -> Maybe AppDirCustomize -> AppImage
+ Distribution.AppImage: AppImage :: String -> FilePath -> [FilePath] -> [(FilePath, Maybe FilePath)] -> Maybe AppDirCustomize -> AppImage
- Distribution.AppImage: [appResources] :: AppImage -> [FilePath]
+ Distribution.AppImage: [appResources] :: AppImage -> [(FilePath, Maybe FilePath)]
Files
- CHANGELOG.md +5/−0
- cabal-appimage.cabal +1/−1
- src/Distribution/AppImage.hs +11/−5
CHANGELOG.md view
@@ -1,5 +1,10 @@ # Revision history for cabal-appimage +## 0.4.0.0 -- 2023-01-11++* Allow resources to have directory structure (thanks to Sandy Maguire).++ ## 0.3.0.5 -- 2022-09-11 * Build with GHC 9.4.
cabal-appimage.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.0 name: cabal-appimage-version: 0.3.0.5+version: 0.4.0.0 synopsis: Cabal support for creating AppImage applications description: This package provides a build hook automating the creation of AppImage bundles.
src/Distribution/AppImage.hs view
@@ -44,8 +44,11 @@ -- | Application icons. appIcons :: [FilePath], -- | Other resources to bundle. Stored in the @\usr\/share\//appName/@- -- directory inside the image.- appResources :: [FilePath],+ -- directory inside the image. The first 'FilePath' is on the local system.+ -- The @Maybe 'FilePath'@ is the desired file path relative to+ -- @\usr\/share\//appName/@, or the directoryless filename in the case of+ -- 'Nothing'.+ appResources :: [(FilePath, Maybe FilePath)], -- | Hook to customize the generated @AppDir@ before final packaging. appDirCustomize :: Maybe AppDirCustomize }@@ -100,12 +103,15 @@ , "--desktop-file=" ++ appDesktop ] ++ map ("--icon-file=" ++) appIcons -bundleFiles :: [FilePath] -> FilePath -> Verbosity -> IO ()-bundleFiles files dest verb = prepare >> mapM_ copy files+bundleFiles :: [(FilePath, Maybe FilePath)] -> FilePath -> Verbosity -> IO ()+bundleFiles files dest verb = prepare >> mapM_ (uncurry copy) files where prepare = createDirectoryIfMissingVerbose verb True dest - copy file = copyFileVerbose verb file (dest </> takeFileName file)+ copy file destfile = do+ let fp = dest </> fromMaybe (takeFileName file) destfile+ createDirectoryIfMissingVerbose verb True $ takeDirectory fp+ copyFileVerbose verb file fp bundleApp :: FilePath -> Verbosity -> IO () bundleApp appDir verb = do