From 38e324af8693eb0c3d4bf22df9cbb73667f195ce Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 10 Jun 2014 15:43:02 -0400 Subject: [PATCH] build: qt: split locale resources. Fixes non-deterministic distcheck The rcc tool is quirky and only honors files in the same directory as the qrc. When doing an out-of-tree build (as 'make distcheck' does), the generated translation files end up in a different path, so rcc can't find them. Split them up so that rcc is run twice: once for static source files and once for generated files. --- src/Makefile.qt.include | 18 +++++++--- src/qt/bitcoin.cpp | 1 + src/qt/bitcoin.qrc | 73 ------------------------------------- src/qt/bitcoin_locale.qrc | 75 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 78 deletions(-) create mode 100644 src/qt/bitcoin_locale.qrc diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 749b976c44..72c7486258 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -152,6 +152,8 @@ QT_MOC = \ QT_QRC_CPP = qt/qrc_bitcoin.cpp QT_QRC = qt/bitcoin.qrc +QT_QRC_LOCALE_CPP = qt/qrc_bitcoin_locale.cpp +QT_QRC_LOCALE = qt/bitcoin_locale.qrc PROTOBUF_CC = qt/paymentrequest.pb.cc PROTOBUF_H = qt/paymentrequest.pb.h @@ -321,10 +323,10 @@ qt_libbitcoinqt_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ $(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS) qt_libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \ - $(QT_QRC) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) + $(QT_QRC) $(QT_QRC_LOCALE) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) nodist_qt_libbitcoinqt_a_SOURCES = $(QT_MOC_CPP) $(QT_MOC) $(PROTOBUF_CC) \ - $(PROTOBUF_H) $(QT_QRC_CPP) + $(PROTOBUF_H) $(QT_QRC_CPP) $(QT_QRC_LOCALE_CPP) # forms/foo.h -> forms/ui_foo.h QT_FORMS_H=$(join $(dir $(QT_FORMS_UI)),$(addprefix ui_, $(notdir $(QT_FORMS_UI:.ui=.h)))) @@ -371,10 +373,16 @@ translate: qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) @test -n $(LUPDATE) || echo "lupdate is required for updating translations" $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts qt/locale/bitcoin_en.ts -$(QT_QRC_CPP): $(QT_QRC) $(QT_QM) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H) +$(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM) @test -f $(RCC) - $(AM_V_GEN) cd $(srcdir); QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin $< | \ - $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $(abs_builddir)/$@ + @test -f $(@D)/$( $@ + +$(QT_QRC_CPP): $(QT_QRC) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H) + @test -f $(RCC) + $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin $< | \ + $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@ CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda qt/*.gcno diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 45d7a52889..2be8191eb5 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -475,6 +475,7 @@ int main(int argc, char *argv[]) #endif Q_INIT_RESOURCE(bitcoin); + Q_INIT_RESOURCE(bitcoin_locale); BitcoinApplication app(argc, argv); #if QT_VERSION > 0x050100 // Generate high-dpi pixmaps diff --git a/src/qt/bitcoin.qrc b/src/qt/bitcoin.qrc index e1c739b022..f38200c7f7 100644 --- a/src/qt/bitcoin.qrc +++ b/src/qt/bitcoin.qrc @@ -84,77 +84,4 @@ res/movies/spinner-033.png res/movies/spinner-034.png - - locale/bitcoin_ach.qm - locale/bitcoin_af_ZA.qm - locale/bitcoin_ar.qm - locale/bitcoin_be_BY.qm - locale/bitcoin_bg.qm - locale/bitcoin_bs.qm - locale/bitcoin_ca_ES.qm - locale/bitcoin_ca.qm - locale/bitcoin_ca@valencia.qm - locale/bitcoin_cmn.qm - locale/bitcoin_cs.qm - locale/bitcoin_cy.qm - locale/bitcoin_da.qm - locale/bitcoin_de.qm - locale/bitcoin_el_GR.qm - locale/bitcoin_en.qm - locale/bitcoin_eo.qm - locale/bitcoin_es_CL.qm - locale/bitcoin_es_DO.qm - locale/bitcoin_es_MX.qm - locale/bitcoin_es.qm - locale/bitcoin_es_UY.qm - locale/bitcoin_et.qm - locale/bitcoin_eu_ES.qm - locale/bitcoin_fa_IR.qm - locale/bitcoin_fa.qm - locale/bitcoin_fi.qm - locale/bitcoin_fr_CA.qm - locale/bitcoin_fr.qm - locale/bitcoin_gl.qm - locale/bitcoin_gu_IN.qm - locale/bitcoin_he.qm - locale/bitcoin_hi_IN.qm - locale/bitcoin_hr.qm - locale/bitcoin_hu.qm - locale/bitcoin_id_ID.qm - locale/bitcoin_it.qm - locale/bitcoin_ja.qm - locale/bitcoin_ka.qm - locale/bitcoin_kk_KZ.qm - locale/bitcoin_ko_KR.qm - locale/bitcoin_ky.qm - locale/bitcoin_la.qm - locale/bitcoin_lt.qm - locale/bitcoin_lv_LV.qm - locale/bitcoin_mn.qm - locale/bitcoin_ms_MY.qm - locale/bitcoin_nb.qm - locale/bitcoin_nl.qm - locale/bitcoin_pam.qm - locale/bitcoin_pl.qm - locale/bitcoin_pt_BR.qm - locale/bitcoin_pt_PT.qm - locale/bitcoin_ro_RO.qm - locale/bitcoin_ru.qm - locale/bitcoin_sah.qm - locale/bitcoin_sk.qm - locale/bitcoin_sl_SI.qm - locale/bitcoin_sq.qm - locale/bitcoin_sr.qm - locale/bitcoin_sv.qm - locale/bitcoin_th_TH.qm - locale/bitcoin_tr.qm - locale/bitcoin_uk.qm - locale/bitcoin_ur_PK.qm - locale/bitcoin_uz@Cyrl.qm - locale/bitcoin_vi.qm - locale/bitcoin_vi_VN.qm - locale/bitcoin_zh_CN.qm - locale/bitcoin_zh_HK.qm - locale/bitcoin_zh_TW.qm - diff --git a/src/qt/bitcoin_locale.qrc b/src/qt/bitcoin_locale.qrc new file mode 100644 index 0000000000..b70a107397 --- /dev/null +++ b/src/qt/bitcoin_locale.qrc @@ -0,0 +1,75 @@ + + + locale/bitcoin_ach.qm + locale/bitcoin_af_ZA.qm + locale/bitcoin_ar.qm + locale/bitcoin_be_BY.qm + locale/bitcoin_bg.qm + locale/bitcoin_bs.qm + locale/bitcoin_ca_ES.qm + locale/bitcoin_ca.qm + locale/bitcoin_ca@valencia.qm + locale/bitcoin_cmn.qm + locale/bitcoin_cs.qm + locale/bitcoin_cy.qm + locale/bitcoin_da.qm + locale/bitcoin_de.qm + locale/bitcoin_el_GR.qm + locale/bitcoin_en.qm + locale/bitcoin_eo.qm + locale/bitcoin_es_CL.qm + locale/bitcoin_es_DO.qm + locale/bitcoin_es_MX.qm + locale/bitcoin_es.qm + locale/bitcoin_es_UY.qm + locale/bitcoin_et.qm + locale/bitcoin_eu_ES.qm + locale/bitcoin_fa_IR.qm + locale/bitcoin_fa.qm + locale/bitcoin_fi.qm + locale/bitcoin_fr_CA.qm + locale/bitcoin_fr.qm + locale/bitcoin_gl.qm + locale/bitcoin_gu_IN.qm + locale/bitcoin_he.qm + locale/bitcoin_hi_IN.qm + locale/bitcoin_hr.qm + locale/bitcoin_hu.qm + locale/bitcoin_id_ID.qm + locale/bitcoin_it.qm + locale/bitcoin_ja.qm + locale/bitcoin_ka.qm + locale/bitcoin_kk_KZ.qm + locale/bitcoin_ko_KR.qm + locale/bitcoin_ky.qm + locale/bitcoin_la.qm + locale/bitcoin_lt.qm + locale/bitcoin_lv_LV.qm + locale/bitcoin_mn.qm + locale/bitcoin_ms_MY.qm + locale/bitcoin_nb.qm + locale/bitcoin_nl.qm + locale/bitcoin_pam.qm + locale/bitcoin_pl.qm + locale/bitcoin_pt_BR.qm + locale/bitcoin_pt_PT.qm + locale/bitcoin_ro_RO.qm + locale/bitcoin_ru.qm + locale/bitcoin_sah.qm + locale/bitcoin_sk.qm + locale/bitcoin_sl_SI.qm + locale/bitcoin_sq.qm + locale/bitcoin_sr.qm + locale/bitcoin_sv.qm + locale/bitcoin_th_TH.qm + locale/bitcoin_tr.qm + locale/bitcoin_uk.qm + locale/bitcoin_ur_PK.qm + locale/bitcoin_uz@Cyrl.qm + locale/bitcoin_vi.qm + locale/bitcoin_vi_VN.qm + locale/bitcoin_zh_CN.qm + locale/bitcoin_zh_HK.qm + locale/bitcoin_zh_TW.qm + +