mate-desktop / pluma

A powerful text editor for MATE
http://www.mate-desktop.org
GNU General Public License v2.0
158 stars 66 forks source link

build: Use PACKAGE_URL variable #603

Closed rbuj closed 3 years ago

rbuj commented 3 years ago

Test:

$ grep -HR Website --include=*.plugin
plugins/docinfo/docinfo.plugin:Website=http://mate-desktop.org
plugins/externaltools/externaltools.plugin:Website=http://mate-desktop.org
plugins/filebrowser/filebrowser.plugin:Website=http://mate-desktop.org
plugins/modelines/modelines.plugin:Website=http://mate-desktop.org
plugins/pythonconsole/pythonconsole.plugin:Website=http://mate-desktop.org
plugins/quickopen/quickopen.plugin:Website=http://mate-desktop.org
plugins/snippets/snippets.plugin:Website=http://mate-desktop.org
plugins/sort/sort.plugin:Website=http://mate-desktop.org
plugins/spell/spell.plugin:Website=http://mate-desktop.org
plugins/taglist/taglist.plugin:Website=http://mate-desktop.org
plugins/time/time.plugin:Website=http://mate-desktop.org
plugins/trailsave/trailsave.plugin:Website=http://mate-desktop.org
$ grep homepage data/pluma.appdata.xml
  <url type="homepage">https://mate-desktop.org</url>
$ grep PACKAGE_URL config.h
#define PACKAGE_URL "http://mate-desktop.org"

The AC_INIT macro sets the PACKAGE_URL variable to https://mate-desktop.org in configure.ac file. Next the AC_OUTPUT creates the listed files, as follows: for instance, if there is a file called X in AC_OUTPUT file list, then it copies the content of X.in to X file, and replaces the output variables such as @PACKAGE_URL@.

For that reason, the X.in file must be in EXTRA_DIST since it's the seed that allows to generate other files. Furthermore, If the generated file by AC_OUTPUT still requires another transformation, such as adding the translations through $(MSGFMT), the last transformation may be in CLEANFILES, and the file generated by the AC_OUTPUT may be in DISTCLEANFILES.

Note distclean calls clean target. By doing so, the distclean target provides a clean working directory, since it removes the files generated in configuration and build stages, avoiding the deletion of the files generated in the configuration stage by using the clean target when cleaning the build.

As a basic rule, now we can say that the data files that are treated as seeds cannot be in any of the cleanup file lists, they should be in EXTRADIST, and EXTRADIST shouldn't include any transformation.

The AC_INIT macro also defines PACKAGE_URL in config.h file, so the source files only need to include that file to use the definition.

The POTFILES.in file contains the list of files for which the translations need to be extracted. These files are not generated in either the configuration or build stages.

raveit65 commented 3 years ago

You changed a lot of more with this change and commit message doesn't match. Eg. creating desktop files. Can you please update commit body?

raveit65 commented 3 years ago

@rbuj Or are changes with appdata and desktop files in Makefile.am are needed for using PACKAGE_URL variable?

rbuj commented 3 years ago

@raveit65 I'm writing a brief summary about the change.

rbuj commented 3 years ago

@raveit65 done. If there is anything else that is not well documented enough feel free to tell me.