yktoo / indicator-sound-switcher

Sound input/output selector indicator for Linux
https://yktoo.com/en/software/sound-switcher-indicator/
GNU General Public License v3.0
367 stars 29 forks source link

No .mo files bundled in .deb #82

Closed yktoo closed 4 years ago

yktoo commented 5 years ago

So no localisation is installed.

From build log:

[...]
dpkg-buildpackage
-----------------

dpkg-buildpackage: info: source package indicator-sound-switcher
dpkg-buildpackage: info: source version 2.2.2-1
dpkg-buildpackage: info: source distribution disco
 dpkg-source --before-build .
dpkg-buildpackage: info: host architecture amd64
 fakeroot debian/rules clean
dh clean --with python3 --buildsystem=pybuild
   debian/rules override_dh_auto_clean
make[1]: Entering directory '/<<PKGBUILDDIR>>'
dh_auto_clean
I: pybuild base:217: python3.7 setup.py clean 
running clean
removing '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build' (and everything under it)
'build/bdist.linux-amd64' does not exist -- can't clean it
'build/scripts-3.7' does not exist -- can't clean it
rm -rf locale/
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   dh_autoreconf_clean -O--buildsystem=pybuild
   dh_clean -O--buildsystem=pybuild
 debian/rules build
dh build --with python3 --buildsystem=pybuild
   dh_update_autotools_config -O--buildsystem=pybuild
   dh_autoreconf -O--buildsystem=pybuild
   dh_auto_configure -O--buildsystem=pybuild
I: pybuild base:217: python3.7 setup.py config 
WARNING: Directory /<<PKGBUILDDIR>>/locale doesn't exist, no locale files will be included.
running config
   dh_auto_build -O--buildsystem=pybuild
I: pybuild base:217: /usr/bin/python3 setup.py build 
WARNING: Directory /<<PKGBUILDDIR>>/locale doesn't exist, no locale files will be included.
running build
running build_py
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.7/build/indicator_sound_switcher
[...]
yktoo commented 5 years ago

@paravoid I suspect #76 has broken the i18n support, there's no /usr/share/locale/ dir in the .deb anymore. Any idea why?

paravoid commented 5 years ago

I'm trying this on my buster system and I cannot reproduce it, even after multiple consecutive clean/builds.

Looking at the code in setup.py, it seems like it does create the "locale" (locale_dir) directory, as long as os.path.isdir(PO_DIR) matches, i.e. as long as there is a po/ directory. I'm out of ideas on why that would not be the case here :/

leobasilio commented 4 years ago

Commit a688553 did it. The build directory is created by the extraction of the .tar file, which does include the locale directory, but the clean step removes it. I guess the build system expects a po directory, so that the files are compiled on build time. That means adding the po directory to .tar file. Since the build_package script always generate a fresh tarball, I think this commit could be reverted.

yktoo commented 4 years ago

Resolved in v2.3.2.

I'm still not quite sure what caused this but inspecting the source package showed there were no .po files packaged, which the setup script fairly pointed out. I've sorted that by explicitly including *.po and excluding *.mo in MAINFEST.in.