tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Failure message when inconsistent X11_TYPE



Edgar Fuß wrote:
>> Is there any objection to such a commit?
> Would that trigger in case I don't have X11 installed and don't build any X11 
> packages?
Yes. This is a relevant remark. I can be disturbing to see a error message related to X11_TYPE if we install a package that doesn't need X11.
Since I encountered a problem with USE_TOOLS+=makedepend, maybe it could be sufficient to fix it with a patch such as:

--- mk/tools/replace.mk 6 Oct 2020 17:36:50 -0000       1.291
+++ mk/tools/replace.mk 13 Jul 2021 19:42:02 -0000
@@ -1265,7 +1265,7 @@
 .if !defined(TOOLS_IGNORE.makedepend) && !empty(_USE_TOOLS:Mmakedepend) && \
     !empty(_TOOLS_USE_PKGSRC.makedepend:M[yY][eE][sS])
 TOOLS_CREATE+=         makedepend
-.  if defined(X11_TYPE) && !empty(X11_TYPE:Mmodular)
+.  if defined(X11_TYPE) && !empty(X11_TYPE:Mmodular) || !exists(/etc/mtree/set.xbase)
 TOOLS_DEPENDS.makedepend?=     makedepend-[0-9]*:../../devel/makedepend
 TOOLS_PATH.makedepend= ${LOCALBASE}/bin/makedepend
 .  else # !empty(X11_TYPE:Mnative)

But with such an approach, we silently bypass the definition of X11_TYPE because of a misconfiguration. Maybe it should be better to apply (for several tools) the approach I previously suggested:

--- mk/tools/replace.mk 6 Oct 2020 17:36:50 -0000       1.291
+++ mk/tools/replace.mk 13 Jul 2021 19:51:20 -0000
@@ -1269,6 +1269,9 @@
 TOOLS_DEPENDS.makedepend?=     makedepend-[0-9]*:../../devel/makedepend
 TOOLS_PATH.makedepend= ${LOCALBASE}/bin/makedepend
 .  else # !empty(X11_TYPE:Mnative)
+.    if !exists(/etc/mtree/set.xbase)
+PKG_FAIL_REASON+=      "Native X11 distribution cannot be used if xbase set has not been installed. You should set X11_TYPE=modular or install xbase set."
+.    endif
 TOOLS_PATH.makedepend= ${X11BASE}/bin/makedepend
 .  endif
 .endif


Home | Main Index | Thread Index | Old Index