platformthemes.pro
changeset 8 02a1dd166f2b
parent 6 22214389caed
child 9 a03989fb355a
equal deleted inserted replaced
7:2c88b93869a6 8:02a1dd166f2b
    16 # ============================================================================
    16 # ============================================================================
    17 #
    17 #
    18 
    18 
    19 NAME = platformthemes
    19 NAME = platformthemes
    20 TEMPLATE = subdirs
    20 TEMPLATE = subdirs
       
    21 EXCLUDE += --exclude \"*.orig\"
       
    22 EXCLUDE += --exclude \"*/distribution.policy.s60\"
       
    23 
       
    24 # ============================================================================
       
    25 # determine HB_THEMES_DIR
       
    26 # ============================================================================
    21 !symbian {
    27 !symbian {
    22     HB_THEMES_DIR = $$(HB_THEMES_DIR)
    28     HB_THEMES_DIR = $$(HB_THEMES_DIR)
    23     isEmpty(HB_THEMES_DIR) {
    29     isEmpty(HB_THEMES_DIR) {
    24         win32:ENV_HELP = eg. set HB_THEMES_DIR=C:\hb\themes
    30         win32:ENV_HELP = eg. set HB_THEMES_DIR=C:\hb\themes
    25         else:ENV_HELP = eg. export HB_THEMES_DIR=/usr/local/hb/themes
    31         else:ENV_HELP = eg. export HB_THEMES_DIR=/usr/local/hb/themes
    26         error(HB_THEMES_DIR environment variable is not set. ($$ENV_HELP))
    32         error(HB_THEMES_DIR environment variable is not set. ($$ENV_HELP))
    27     }
    33     }
    28 } else {
    34 } else {
    29     ARGS += --symbian
    35     HB_THEMES_DIR = $${EPOCROOT}epoc32/data/z/resource/hb
    30     nvg:ARGS += --nvg
       
    31     no_nvg:ARGS += --no-nvg
       
    32 }
    36 }
    33 ARGS += -v --input $$IN_PWD/src --output $$OUT_PWD/src --name $$NAME
    37 HB_THEMES_DIR = $$HB_THEMES_DIR/themes
    34 ARGS += --exclude \"*distribution.policy.s60\"
    38 
    35 ARGS += --exclude \"*.orig\"
    39 win32:!win32-g++ {
    36 !system(python $$IN_PWD/bin/sync.py $$ARGS) {
    40     unixstyle = false
    37     error(*** bin/sync.py reported an error. Stop.)
    41 } else:symbian:isEmpty(QMAKE_SH) {
       
    42     unixstyle = false
       
    43 } else:win32-g++:isEmpty(QMAKE_SH) {
       
    44     unixstyle = false
       
    45 } else {
       
    46     unixstyle = true
    38 }
    47 }
    39 
    48 
       
    49 # ============================================================================
       
    50 # extract archives
       
    51 # ============================================================================
       
    52 ARGS = --input src --output $$OUT_PWD/tmp/src $$EXCLUDE
       
    53 !system(python bin/extract.py $$ARGS) {
       
    54     error(*** bin/extract.py reported an error. Stop.)
       
    55 }
       
    56 
       
    57 # ============================================================================
       
    58 # convert svg->nvg
       
    59 # ============================================================================
       
    60 symbian {
       
    61     nvg|!no_nvg {
       
    62         ARGS = --input $$OUT_PWD/tmp/src/icons
       
    63         !system(python bin/svg2nvg.py $$ARGS) {
       
    64             error(*** bin/svg2nvg.py reported an error. Stop.)
       
    65         }
       
    66     }
       
    67 }
       
    68 
       
    69 # ============================================================================
       
    70 # theme indexing target
       
    71 # ============================================================================
    40 THEMEINDEXER = hbthemeindexer
    72 THEMEINDEXER = hbthemeindexer
    41 !symbian {
    73 !symbian {
    42     win32:!win32-g++ {
       
    43         unixstyle = false
       
    44     } else:win32-g++:isEmpty(QMAKE_SH) {
       
    45         unixstyle = false
       
    46     } else:symbian {
       
    47         unixstyle = false
       
    48     } else {
       
    49         unixstyle = true
       
    50     }
       
    51 
       
    52     $$unixstyle {
    74     $$unixstyle {
    53         DEVNULL = /dev/null
    75         DEVNULL = /dev/null
    54     } else {
    76     } else {
    55         DEVNULL = nul
    77         DEVNULL = nul
    56     }
    78     }
       
    79     !system($$THEMEINDEXER > $$DEVNULL 2>&1) {
       
    80         error(\'$$THEMEINDEXER\' must be in PATH.)
       
    81     }
       
    82 }
       
    83 ARGS = -s $$OUT_PWD/tmp/src -t $$OUT_PWD/tmp
       
    84 !system($$THEMEINDEXER $$ARGS) {
       
    85     error(*** $$THEMEINDEXER reported an error. Stop.)
       
    86 }
    57 
    87 
    58     !system($$THEMEINDEXER > $$DEVNULL 2>&1) {
    88 index.path = $$(HB_THEMES_DIR)/themes
    59         error('hbthemeindexer' must be in PATH.)
    89 index.files = $$OUT_PWD/tmp/*.themeindex
       
    90 INSTALLS += index
       
    91 QMAKE_CLEAN += $$OUT_PWD/tmp/*.themeindex
       
    92 
       
    93 # ============================================================================
       
    94 # generate installs.pri
       
    95 # ============================================================================
       
    96 ARGS = --input $$OUT_PWD/tmp/src --output $$OUT_PWD/tmp $$EXCLUDE
       
    97 !system(python bin/installs.py $$ARGS) {
       
    98     error(*** bin/installs.py reported an error. Stop.)
       
    99 }
       
   100 isEmpty(QMAKE_UNZIP):QMAKE_UNZIP = unzip -u -o
       
   101 include($$OUT_PWD/tmp/installs.pri)
       
   102 QMAKE_DISTCLEAN += $$OUT_PWD/tmp/installs.pri
       
   103 
       
   104 # ============================================================================
       
   105 # generate rom files
       
   106 # ============================================================================
       
   107 symbian {
       
   108     ARGS = --input $$OUT_PWD/tmp/src --output $$OUT_PWD/tmp $$EXCLUDE
       
   109     !system(python bin/rom.py $$ARGS) {
       
   110         error(*** bin/rom.py reported an error. Stop.)
       
   111     }
       
   112     QMAKE_CLEAN += $$OUT_PWD/tmp/*.iby
       
   113 }
       
   114 
       
   115 # ============================================================================
       
   116 # installs/exports
       
   117 # ============================================================================
       
   118 symbian {
       
   119 
       
   120     # theme exports
       
   121     exists(src/theme.theme) {
       
   122         BLD_INF_RULES.prj_exports += "src/theme.theme $${EPOCROOT}epoc32/data/z/resource/hb/themes/"
       
   123         BLD_INF_RULES.prj_exports += "src/theme.theme $${EPOCROOT}epoc32/winscw/c/resource/hb/themes/"
       
   124     }
       
   125     exists(rom/theme.theme.iby) {
       
   126         BLD_INF_RULES.prj_exports += "rom/theme.theme.iby $$CORE_MW_LAYER_IBY_EXPORT_PATH(theme.theme.iby)"
       
   127     }
       
   128 
       
   129     # params: <files> <target>
       
   130     defineTest(exportThemeFiles) {
       
   131         files = $$1
       
   132         target = $$2
       
   133         for(file, files) {
       
   134             # strip possible drive letter
       
   135             file = $$split(file, :)
       
   136             file = $$last(file)
       
   137             BLD_INF_RULES.prj_exports += "$$file $$target"
       
   138         }
       
   139         export(BLD_INF_RULES.prj_exports)
       
   140         return(true)
       
   141     }
       
   142     exportThemeFiles($$files($$OUT_PWD/tmp/*.iby), $$CORE_MW_LAYER_IBY_EXPORT_PATH())
       
   143     exportThemeFiles($$files($$OUT_PWD/tmp/*.themeindex), $${EPOCROOT}epoc32/data/z/resource/hb/themes/)
       
   144     exportThemeFiles($$files($$OUT_PWD/tmp/*.themeindex), $${EPOCROOT}epoc32/winscw/c/resource/hb/themes/)
       
   145 
       
   146     # configuration files - exporting removed from platformthemes
       
   147 #    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/confml/confml/hbtheme.confml            MW_LAYER_CONFML(hbtheme.confml)
       
   148 #    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/confml/implml/hbtheme_20022e82.crml     MW_LAYER_CRML(hbtheme_20022e82.crml)
       
   149 #    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/confml/implml/hbtheme.implml            MW_LAYER_CRML(hbtheme.implml)
       
   150 
       
   151 } else {
       
   152     exists(src/theme.theme) {
       
   153         theme.theme.path = $$(HB_THEMES_DIR)/themes
       
   154         theme.theme.files += src/theme.theme
       
   155         INSTALLS += theme.theme
    60     }
   156     }
    61 }
   157 }
    62 
   158 
    63 *symbian* {
   159 # ============================================================================
    64     BLD_INF_RULES.prj_mmpfiles += "gnumakefile makeindex.mk"
   160 # NOTE: qmake/s60 does not support INSTALLS
    65 
   161 # ============================================================================
    66     install.depends = default
   162 symbian {
       
   163     install.depends += export
    67     uninstall.depends = cleanexport
   164     uninstall.depends = cleanexport
    68     QMAKE_EXTRA_TARGETS += install uninstall
   165     QMAKE_EXTRA_TARGETS += install uninstall
    69 
       
    70     # central repository - exporting removed from platformthemes
       
    71 #    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/centralrepository/20022E82.txt $${EPOCROOT}epoc32/data/z/private/10202BE9/20022E82.txt"
       
    72 #    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/centralrepository/20022E82.txt $${EPOCROOT}epoc32/release/winscw/udeb/z/private/10202BE9/20022E82.txt"
       
    73 #    BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/centralrepository/20022E82.txt $${EPOCROOT}epoc32/release/winscw/urel/z/private/10202BE9/20022E82.txt"
       
    74 }
   166 }
    75 index.path = .
       
    76 index.commands = $$THEMEINDEXER -f $$OUT_PWD/src/$${NAME}.txt
       
    77 QMAKE_EXTRA_TARGETS += index
       
    78 
   167 
    79 message(Run \'make install\')
   168 message(Run \'make install\')
    80 
       
    81 include($$OUT_PWD/src/$${NAME}.pri)
       
    82 
       
    83 # NOTE: must be after .pri include above!
       
    84 INSTALLS += index