summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomasTuegel <>2015-04-01 23:20:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2015-04-01 23:20:00 (GMT)
commit2cea0bac218537bacd32d4d44a4f2500aa648712 (patch)
tree4300a17a62b32e215d0a4b8653663388d6cdfb40
parentd9ac28a8ec9506a420a4749c7212c52648d2625b (diff)
version 0.2.0.10.2.0.1
-rw-r--r--autonix-deps-kf5.cabal2
-rw-r--r--src/Autonix/KF5.hs22
2 files changed, 21 insertions, 3 deletions
diff --git a/autonix-deps-kf5.cabal b/autonix-deps-kf5.cabal
index e8887d4..08f415c 100644
--- a/autonix-deps-kf5.cabal
+++ b/autonix-deps-kf5.cabal
@@ -1,5 +1,5 @@
name: autonix-deps-kf5
-version: 0.2.0.0
+version: 0.2.0.1
synopsis: Generate dependencies for KDE 5 Nix expressions
license: BSD3
license-file: LICENSE
diff --git a/src/Autonix/KF5.hs b/src/Autonix/KF5.hs
index c621a37..c23bd37 100644
--- a/src/Autonix/KF5.hs
+++ b/src/Autonix/KF5.hs
@@ -63,6 +63,19 @@ findKF5Components pkg = awaitForever $ \(path, contents) ->
\[[:space:]]*([#\\.${}_[:alnum:][:space:]]+)\\)"
ix pkg . buildInputs %= S.union (S.fromList $ map ("KF5" <>) new)
+findQt5Components :: (MonadIO m, MonadState Deps m) => Analyzer m
+findQt5Components pkg = awaitForever $ \(path, contents) ->
+ when ("CMakeLists.txt" == takeFileName path) $ do
+ let new = filter (not . cmakeReserved)
+ $ filter (not . B.null)
+ $ concatMap B.words
+ $ concatMap (take 1 . drop 1)
+ $ match regex contents
+ regex = makeRegex
+ "find_package[[:space:]]*\\([[:space:]]*Qt5\
+ \[[:space:]]*([#\\.${}_[:alnum:][:space:]]+)\\)"
+ ix pkg . buildInputs %= S.union (S.fromList $ map ("Qt5" <>) new)
+
cmakeReserved :: ByteString -> Bool
cmakeReserved bs = or $ map ($ bs)
[ B.elem '$'
@@ -76,8 +89,13 @@ cmakeReserved bs = or $ map ($ bs)
]
kf5Analyzers :: (MonadIO m, MonadState Deps m) => [Analyzer m]
-kf5Analyzers = [findKF5Components, renameKF5Pkgs, propagateKF5Deps]
- ++ cmakeAnalyzers
+kf5Analyzers =
+ [ findKF5Components
+ , findQt5Components
+ , renameKF5Pkgs
+ , propagateKF5Deps
+ ]
+ ++ cmakeAnalyzers
kf5PostAnalyze :: MonadState Deps m => m ()
kf5PostAnalyze = do