platformthemes.pro
changeset 8 02a1dd166f2b
parent 6 22214389caed
child 9 a03989fb355a
--- a/platformthemes.pro	Wed Jun 23 18:49:37 2010 +0300
+++ b/platformthemes.pro	Tue Jul 06 14:53:09 2010 +0300
@@ -18,6 +18,12 @@
 
 NAME = platformthemes
 TEMPLATE = subdirs
+EXCLUDE += --exclude \"*.orig\"
+EXCLUDE += --exclude \"*/distribution.policy.s60\"
+
+# ============================================================================
+# determine HB_THEMES_DIR
+# ============================================================================
 !symbian {
     HB_THEMES_DIR = $$(HB_THEMES_DIR)
     isEmpty(HB_THEMES_DIR) {
@@ -26,59 +32,137 @@
         error(HB_THEMES_DIR environment variable is not set. ($$ENV_HELP))
     }
 } else {
-    ARGS += --symbian
-    nvg:ARGS += --nvg
-    no_nvg:ARGS += --no-nvg
+    HB_THEMES_DIR = $${EPOCROOT}epoc32/data/z/resource/hb
 }
-ARGS += -v --input $$IN_PWD/src --output $$OUT_PWD/src --name $$NAME
-ARGS += --exclude \"*distribution.policy.s60\"
-ARGS += --exclude \"*.orig\"
-!system(python $$IN_PWD/bin/sync.py $$ARGS) {
-    error(*** bin/sync.py reported an error. Stop.)
+HB_THEMES_DIR = $$HB_THEMES_DIR/themes
+
+win32:!win32-g++ {
+    unixstyle = false
+} else:symbian:isEmpty(QMAKE_SH) {
+    unixstyle = false
+} else:win32-g++:isEmpty(QMAKE_SH) {
+    unixstyle = false
+} else {
+    unixstyle = true
 }
 
+# ============================================================================
+# extract archives
+# ============================================================================
+ARGS = --input src --output $$OUT_PWD/tmp/src $$EXCLUDE
+!system(python bin/extract.py $$ARGS) {
+    error(*** bin/extract.py reported an error. Stop.)
+}
+
+# ============================================================================
+# convert svg->nvg
+# ============================================================================
+symbian {
+    nvg|!no_nvg {
+        ARGS = --input $$OUT_PWD/tmp/src/icons
+        !system(python bin/svg2nvg.py $$ARGS) {
+            error(*** bin/svg2nvg.py reported an error. Stop.)
+        }
+    }
+}
+
+# ============================================================================
+# theme indexing target
+# ============================================================================
 THEMEINDEXER = hbthemeindexer
 !symbian {
-    win32:!win32-g++ {
-        unixstyle = false
-    } else:win32-g++:isEmpty(QMAKE_SH) {
-        unixstyle = false
-    } else:symbian {
-        unixstyle = false
-    } else {
-        unixstyle = true
-    }
-
     $$unixstyle {
         DEVNULL = /dev/null
     } else {
         DEVNULL = nul
     }
+    !system($$THEMEINDEXER > $$DEVNULL 2>&1) {
+        error(\'$$THEMEINDEXER\' must be in PATH.)
+    }
+}
+ARGS = -s $$OUT_PWD/tmp/src -t $$OUT_PWD/tmp
+!system($$THEMEINDEXER $$ARGS) {
+    error(*** $$THEMEINDEXER reported an error. Stop.)
+}
 
-    !system($$THEMEINDEXER > $$DEVNULL 2>&1) {
-        error('hbthemeindexer' must be in PATH.)
+index.path = $$(HB_THEMES_DIR)/themes
+index.files = $$OUT_PWD/tmp/*.themeindex
+INSTALLS += index
+QMAKE_CLEAN += $$OUT_PWD/tmp/*.themeindex
+
+# ============================================================================
+# generate installs.pri
+# ============================================================================
+ARGS = --input $$OUT_PWD/tmp/src --output $$OUT_PWD/tmp $$EXCLUDE
+!system(python bin/installs.py $$ARGS) {
+    error(*** bin/installs.py reported an error. Stop.)
+}
+isEmpty(QMAKE_UNZIP):QMAKE_UNZIP = unzip -u -o
+include($$OUT_PWD/tmp/installs.pri)
+QMAKE_DISTCLEAN += $$OUT_PWD/tmp/installs.pri
+
+# ============================================================================
+# generate rom files
+# ============================================================================
+symbian {
+    ARGS = --input $$OUT_PWD/tmp/src --output $$OUT_PWD/tmp $$EXCLUDE
+    !system(python bin/rom.py $$ARGS) {
+        error(*** bin/rom.py reported an error. Stop.)
+    }
+    QMAKE_CLEAN += $$OUT_PWD/tmp/*.iby
+}
+
+# ============================================================================
+# installs/exports
+# ============================================================================
+symbian {
+
+    # theme exports
+    exists(src/theme.theme) {
+        BLD_INF_RULES.prj_exports += "src/theme.theme $${EPOCROOT}epoc32/data/z/resource/hb/themes/"
+        BLD_INF_RULES.prj_exports += "src/theme.theme $${EPOCROOT}epoc32/winscw/c/resource/hb/themes/"
+    }
+    exists(rom/theme.theme.iby) {
+        BLD_INF_RULES.prj_exports += "rom/theme.theme.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(theme.theme.iby)"
+    }
+
+    # params: <files> <target>
+    defineTest(exportThemeFiles) {
+        files = $$1
+        target = $$2
+        for(file, files) {
+            # strip possible drive letter
+            file = $$split(file, :)
+            file = $$last(file)
+            BLD_INF_RULES.prj_exports += "$$file $$target"
+        }
+        export(BLD_INF_RULES.prj_exports)
+        return(true)
+    }
+    exportThemeFiles($$files($$OUT_PWD/tmp/*.iby), $$CORE_MW_LAYER_IBY_EXPORT_PATH())
+    exportThemeFiles($$files($$OUT_PWD/tmp/*.themeindex), $${EPOCROOT}epoc32/data/z/resource/hb/themes/)
+    exportThemeFiles($$files($$OUT_PWD/tmp/*.themeindex), $${EPOCROOT}epoc32/winscw/c/resource/hb/themes/)
+
+    # configuration files - exporting removed from platformthemes
+#    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/confml/confml/hbtheme.confml            MW_LAYER_CONFML(hbtheme.confml)
+#    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/confml/implml/hbtheme_20022e82.crml     MW_LAYER_CRML(hbtheme_20022e82.crml)
+#    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/confml/implml/hbtheme.implml            MW_LAYER_CRML(hbtheme.implml)
+
+} else {
+    exists(src/theme.theme) {
+        theme.theme.path = $$(HB_THEMES_DIR)/themes
+        theme.theme.files += src/theme.theme
+        INSTALLS += theme.theme
     }
 }
 
-*symbian* {
-    BLD_INF_RULES.prj_mmpfiles += "gnumakefile makeindex.mk"
-
-    install.depends = default
+# ============================================================================
+# NOTE: qmake/s60 does not support INSTALLS
+# ============================================================================
+symbian {
+    install.depends += export
     uninstall.depends = cleanexport
     QMAKE_EXTRA_TARGETS += install uninstall
-
-    # central repository - exporting removed from platformthemes
-#    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/centralrepository/20022E82.txt $${EPOCROOT}epoc32/data/z/private/10202BE9/20022E82.txt"
-#    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/centralrepository/20022E82.txt $${EPOCROOT}epoc32/release/winscw/udeb/z/private/10202BE9/20022E82.txt"
-#    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/centralrepository/20022E82.txt $${EPOCROOT}epoc32/release/winscw/urel/z/private/10202BE9/20022E82.txt"
 }
-index.path = .
-index.commands = $$THEMEINDEXER -f $$OUT_PWD/src/$${NAME}.txt
-QMAKE_EXTRA_TARGETS += index
 
 message(Run \'make install\')
-
-include($$OUT_PWD/src/$${NAME}.pri)
-
-# NOTE: must be after .pri include above!
-INSTALLS += index