Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build all binaries with a Makefile #213

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ganskef
Copy link
Contributor

@ganskef ganskef commented Jul 16, 2023

It's very unpleasant, inflexible and error prone to handle all the gettext files by hand. I've found some misnamed files and wrong parameters in the master branch (see the fixes in #212 ). I think it would be better to use a make or meson build.

@RaphaelRochet
Copy link
Owner

Hi, thanks for you interest, but I'm not used to makefiles and such, and i don't need to mess with it for now. (I have scripts to update pot, update all .po, compile all .mo and make the .zip ).
I like editing and testing right in place, hate to have to "make /make install" every time I change a coma somewhere. Extensions are pure javascript, and it's a blessing not to have to compile it each time.
Need to read about makefiles, I want to fully understand what it does.
Also can't merge that, I need .mo files right now for my release routine to work. (even thought I recompile them all)

ZIPVER = -v$(shell cat metadata.json | sed '/"version"/!d' | sed s/\"version\"://g | sed s/\ //g)
endif

.PHONY: all clean extension potfile mergepo install install-local zip-file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does PHONY mean ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Short: these are the target names you can explicit request, longer: I've taken a working file of an extension good looking for me and modified it according your paths.

# The command line passed variable VERSION is used to set the version integer
# in the metadata and in the generated zip file. If no VERSION is passed, we
# won't touch the metadata version and instead use that for the zip file.
ifdef VERSION
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is is supposed to be set on command line ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes a shell variable, try VERSION=99 make zip-file or VERSION=99 make install and restart. The manifest isn't touched.

./schemas/gschemas.compiled: ./schemas/org.gnome.shell.extensions.arch-update.gschema.xml
glib-compile-schemas ./schemas/

# TODO: disabled, since xgettext is not able to include prefs.xml to the pot file
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use this CLI :
xgettext --from-code=UTF-8 -j -o "$POTFILE" -L glade *.xml

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I couldn't reproduce the binaries. What's your msgfmt command line?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use msgfmt "$pofile" -o "$mofile", no checking. In rare cases of something wrong, I let translators come back and fix it.

@ganskef
Copy link
Contributor Author

ganskef commented Jul 17, 2023

I like the simplicity of arch-update. It's clean, not complicated. I needed to test my translation. My modifications caused updating the other translations - without your scripts. I've found some inconsistencies during this process. And, I needed to know what's in the binaries, maybe a payload :-) .

I'm not very familiar with GNU make, but I'm familiar with build systems in general. I've adapted this file, but I'll strip down unnecessary features. Just give me the .PHONY list and suggestions.

@RaphaelRochet
Copy link
Owner

Correct workflow would be : 1/ PR for features an d 2/ PR for translations (after I'd update the pot/po files)
But I get the point. As you can see I've not close this PR, a makefile may be the way to go. However I will probably come with my own, as an exercise to learn about it. As you said for binaries, I don't want to include something I don't fully understand.

@ganskef
Copy link
Contributor Author

ganskef commented Jul 17, 2023

Great! Build systems always should make your day better :-) . But they are not programmatic like a shell script. Their goal is to handle the necessary files and steps only. A make twice should always return nothing to do. A make; make install is the same as make install only. Nevertheless GNU make is very close to shell and it's simple in this scale. It's good for build to have a src folder to search and good to have a build folder to delete and exclude from repository. Note: Meson, a modern build system used for GNOME, uses more the convention over configuration approach. If you use the conventional structure the build file is very simple, but you have to know and follow the convention. I've seen https://github.com/F-i-f/meson-gse/ used in extensions, a very little extension too (maybe for educational reason). Every build system with misunderstood build files can be a pain and simple mistakes often not depends on the system. So lets keep it simple and clean with make.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants