1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 12:00:31 +01:00

Configure: Rename setting DEFSDATADIR to PKGCONFDIR

Directory /etc/WindowMaker is for global defaults configuration, it is not
a "data" folder which is $PREFIX/share/WindowMaker.

The name change make it more consistent with other names.
This commit is contained in:
John D Pell
2021-08-08 09:36:23 +02:00
committed by Carlos R. Mafra
parent 85169642ca
commit 24f5b32469
9 changed files with 24 additions and 22 deletions

View File

@@ -22,7 +22,7 @@ config-paths.h: Makefile
@echo '#define PKGDATADIR "$(datadir)/WindowMaker"' >> $@
@echo '' >> $@
@echo '/* where the global defaults are stored */' >> $@
@echo '#define DEFSDATADIR "$(defsdatadir)"' >> $@
@echo '#define PKGCONFDIR "$(pkgconfdir)"' >> $@
@echo '' >> $@
@echo '/* where the user data root is located */' >> $@
@echo '#define GSUSER_SUBDIR "GNUstep"' >> $@

View File

@@ -116,9 +116,9 @@ char *wglobaldefaultspathfordomain(const char *domain)
char *t = NULL;
size_t len;
len = strlen(DEFSDATADIR) + strlen(domain) + 2;
len = strlen(PKGCONFDIR) + strlen(domain) + 2;
t = wmalloc(len);
snprintf(t, len, "%s/%s", DEFSDATADIR, domain);
snprintf(t, len, "%s/%s", PKGCONFDIR, domain);
return t;
}

View File

@@ -834,21 +834,23 @@ AS_IF([test "x$with_gnustepdir" = "x"],
AC_SUBST([wprefs_datadir])dnl
AC_SUBST([wprefs_bindir])dnl
dnl Support for DEFSDATADIR option
dnl ============================
AC_ARG_WITH([defsdatadir],
[AS_HELP_STRING([--with-defsdatadir=PATH], [specify where global defaults are located [SYSCONFDIR/WindowMaker]])],
dnl Support for PKGCONFDIR option
dnl =============================
AC_ARG_WITH([pkgconfdir],
[AS_HELP_STRING([--with-pkgconfdir=PATH], [specify where global defaults are located [SYSCONFDIR/WindowMaker]])],
[AS_CASE([$withval],
[yes|no], [AC_MSG_ERROR([bad value '$withval' for --with-defsdatadir, expected a path]) ],
[yes|no], [AC_MSG_ERROR([bad value '$withval' for --with-pkgconfdir, expected a path]) ],
[/*], [], dnl Absolute path, ok
[\$*], [], dnl Assumes it starts with a reference to $prefix or a similar variable, ok
[AC_MSG_ERROR([bad path '$withval' for defsdatadir, expecting an absolute path])])],
[with_defsdatadir=""])
[AC_MSG_ERROR([bad path '$withval' for pkgconfdir, expecting an absolute path])])],
[with_pkgconfdir=""])
AS_IF([test "x$with_pkgconfdir" != "x"],
[pkgconfdir="$with_pkgconfdir"],
[pkgconfdir='${sysconfdir}/${PACKAGE_TARNAME}'])
AC_SUBST([pkgconfdir])dnl
AS_IF([test "x$with_defsdatadir" != "x"],
[defsdatadir="$with_defsdatadir"],
[defsdatadir='${sysconfdir}/WindowMaker'])
AC_SUBST([defsdatadir])dnl
dnl Enable User Defined Menu thing
dnl ==============================

View File

@@ -37,7 +37,7 @@ wmaker.1: wmaker.in Makefile $(top_builddir)/config.h
--header "$(top_builddir)/config.h" --filter "HAVE_INOTIFY" \
--filter "USE_ICCCM_WMREPLACE" \
-D"pkgdatadir=$(pkgdatadir)" --replace "pkgdatadir" \
-D"defsdatadir=$(defsdatadir)" --replace "defsdatadir" \
-D"pkgconfdir=$(pkgconfdir)" --replace "pkgconfdir" \
-o "wmaker.1" "$(srcdir)/wmaker.in"
wmsetbg.1: wmsetbg.in Makefile $(top_builddir)/config.h

View File

@@ -449,7 +449,7 @@ Specific to @sc{Window Maker}, this option defines an additional path where @emp
searched. Nothing will be installed there; the default path taken is @file{@emph{DATADIR}/pixmaps},
where @var{DATADIR} is the path defined from @option{--datadir}.
@item --with-defsdatadir=@i{DIR}
@item --with-pkgconfdir=@i{DIR}
Specific to @sc{Window Maker}, defines the directory where system configuration
files, e.g., @file{WindowMaker}, @file{WMRootMenu}, etc., are installed. The
default value is @file{@emph{SYSCONFDIR}/WindowMaker}, where @var{SYSCONFDIR} is

View File

@@ -85,7 +85,7 @@ Attribute Editor (right drag the application's title bar, select
Attributes) instead of modifying this file directly. There are just a
few options not available using the Attributes Editor.
.TP
.B @defsdatadir@/
.B @pkgconfdir@/
All the above-mentioned files are READ from here if not found except
for WMState, which is COPIED from here. No matter where they are read
from, if it's necessary to write configuration changes back into this

View File

@@ -866,7 +866,7 @@ static WMPropList *readGlobalDomain(const char *domainName, Bool requireDictiona
char path[PATH_MAX];
struct stat stbuf;
snprintf(path, sizeof(path), "%s/%s", DEFSDATADIR, domainName);
snprintf(path, sizeof(path), "%s/%s", PKGCONFDIR, domainName);
if (stat(path, &stbuf) >= 0) {
globalDict = WMReadPropListFromFile(path);
if (globalDict && requireDictionary && !WMIsPLDictionary(globalDict)) {
@@ -916,7 +916,7 @@ void wDefaultsMergeGlobalMenus(WDDomain * menuDomain)
return;
#ifdef GLOBAL_PREAMBLE_MENU_FILE
submenu = WMReadPropListFromFile(DEFSDATADIR "/" GLOBAL_PREAMBLE_MENU_FILE);
submenu = WMReadPropListFromFile(PKGCONFDIR "/" GLOBAL_PREAMBLE_MENU_FILE);
if (submenu && !WMIsPLArray(submenu)) {
wwarning(_("invalid global menu file %s"), GLOBAL_PREAMBLE_MENU_FILE);
@@ -930,7 +930,7 @@ void wDefaultsMergeGlobalMenus(WDDomain * menuDomain)
#endif
#ifdef GLOBAL_EPILOGUE_MENU_FILE
submenu = WMReadPropListFromFile(DEFSDATADIR "/" GLOBAL_EPILOGUE_MENU_FILE);
submenu = WMReadPropListFromFile(PKGCONFDIR "/" GLOBAL_EPILOGUE_MENU_FILE);
if (submenu && !WMIsPLArray(submenu)) {
wwarning(_("invalid global menu file %s"), GLOBAL_EPILOGUE_MENU_FILE);

View File

@@ -658,7 +658,7 @@ static int real_main(int argc, char **argv)
printf("Window Maker %s\n", VERSION);
exit(0);
} else if (strcmp(argv[i], "--global_defaults_path") == 0) {
printf("%s\n", DEFSDATADIR);
printf("%s\n", PKGCONFDIR);
exit(0);
} else if (strcmp(argv[i], "-locale") == 0 || strcmp(argv[i], "--locale") == 0) {
i++;

View File

@@ -1017,7 +1017,7 @@ Bool UpdateDomainFile(WDDomain * domain)
dict = domain->dictionary;
if (WMIsPLDictionary(domain->dictionary)) {
/* retrieve global system dictionary */
snprintf(path, sizeof(path), "%s/%s", DEFSDATADIR, domain->domain_name);
snprintf(path, sizeof(path), "%s/%s", PKGCONFDIR, domain->domain_name);
if (stat(path, &stbuf) >= 0) {
shared_dict = WMReadPropListFromFile(path);
if (shared_dict) {