Ravenports generated: 20 Jun 2024 17:00
[ravenports.git] / bucket_98 / imake
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               imake
4 VERSION=                1.0.10
5 KEYWORDS=               devel
6 VARIANTS=               standard
7 SDESC[standard]=        X.Org imake program and related utilities
8 HOMEPAGE=               https://www.x.org/
9 CONTACT=                nobody
10
11 DOWNLOAD_GROUPS=        main
12 SITES[main]=            XORG/individual/util
13 DISTFILE[1]=            imake-1.0.10.tar.xz:main
14 DF_INDEX=               1
15 SPKGS[standard]=        single
16
17 OPTIONS_AVAILABLE=      none
18 OPTIONS_STANDARD=       none
19
20 BUILDRUN_DEPENDS=       tradcpp:single:standard
21 RUN_DEPENDS=            xorg-cf-files:single:standard
22                         gccmakedep:single:standard
23                         makedepend:single:standard
24
25 USES=                   perl:run pkgconfig shebangfix
26 XORG_COMPONENTS=        xorgproto
27
28 LICENSE=                MIT:single
29 LICENSE_FILE=           MIT:{{WRKSRC}}/COPYING
30 LICENSE_SCHEME=         solo
31
32 FPC_EQUIVALENT=         devel/imake
33 SHEBANG_FILES=          mkhtmlindex.pl
34
35 MUST_CONFIGURE=         gnu
36 CONFIGURE_ARGS=         --with-create-lib-cmd="ar cq"
37 CONFIGURE_ENV=          APP_MAN_SUFFIX=1
38                         HAS_PERL=no
39
40 post-patch:
41         ${REINPLACE_CMD} -e 's|RAWCPP|"${PREFIX}/bin/tradcpp"|' \
42                 ${WRKSRC}/imakemdep.h
43
44 post-build:
45         # This required with some C preprocessors and not others,
46         # but is harmless when not required.
47         ${REINPLACE_CMD} -e "s/^configdirspec= */configdirspec=/" \
48                 ${WRKSRC}/xmkmf
49
50 [FILE:224:descriptions/desc.single]
51 The imake package contains Xorg's imake utility for generating Makefiles,
52 plus the following support programs:
53
54    - ccmakedep
55    - cleanlinks
56    - makeg
57    - mergelib
58    - mkdirhier
59    - mkhtmlindex
60    - revpath
61    - xmkmf
62
63
64 [FILE:98:distinfo]
65 75decbcea8d7b354cf36adc9675e53c4790ee3de56a14bd87b42c8e8aad2ecf5       155284 imake-1.0.10.tar.xz
66
67
68 [FILE:240:manifests/plist.single]
69 bin/
70  ccmakedep
71  cleanlinks
72  imake
73  makeg
74  mergelib
75  mkdirhier
76  mkhtmlindex
77  revpath
78  xmkmf
79 share/man/man1/
80  ccmakedep.1.gz
81  cleanlinks.1.gz
82  imake.1.gz
83  makeg.1.gz
84  mergelib.1.gz
85  mkdirhier.1.gz
86  mkhtmlindex.1.gz
87  revpath.1.gz
88  xmkmf.1.gz
89
90
91 [FILE:5463:patches/patch-imake.c]
92 Beat some sense in.
93
94    - Generate all files into the current (build) directory, not /tmp.
95    - Do not delete any of the temporary files, to allow analysis after
96      build failure.
97    - Log the command lines executed.
98    - Warn if scrubbing the Imakefile to alert the user to check if that
99      broke it
100
101 Also,
102    - Use tradcpp's -debuglog feature to trace what happens in the
103      templates (requires imake always be run with tradcpp)
104    - Force ELF for all freebsd versions
105    - Force use of just "gcc"
106    - Recognize IMAKECPPFLAGS in the environment
107
108 --- imake.c.orig        2024-01-08 18:34:07 UTC
109 +++ imake.c
110 @@ -303,9 +303,9 @@ void KludgeOutputLine(char **), KludgeRe
111  const char *cpp = NULL;
112  
113  const char     *tmpMakefile;
114 -const char     *tmpMakefileTemplate = "/tmp/Imf.XXXXXX";
115 +const char     *tmpMakefileTemplate = ".imake.Makefile.XXXXXX";
116  const char     *tmpImakefile;
117 -const char     *tmpImakefileTemplate = "/tmp/IIf.XXXXXX";
118 +const char     *tmpImakefileTemplate = ".imake.Imakefile.XXXXXX";
119  const char     *make_argv[ ARGUMENTS ] = {
120  #ifdef WIN32
121      "nmake"
122 @@ -319,7 +319,7 @@ int cpp_argindex;
123  const char     *Imakefile = NULL;
124  const char     *Makefile = "Makefile";
125  const char     *Template = "Imake.tmpl";
126 -const char     *ImakefileC = "Imakefile.c";
127 +const char     *ImakefileC = ".imake.start.c";
128  boolean haveImakefileC = FALSE;
129  const char     *cleanedImakefile = NULL;
130  const char     *program;
131 @@ -407,7 +407,8 @@ main(int argc, char *argv[])
132  
133                 if (fd == -1 || (tmpfd = fdopen(fd, "w+")) == NULL) {
134                    if (fd != -1) {
135 -                     unlink(tmpMakefileName); close(fd);
136 +                     /*unlink(tmpMakefileName);*/
137 +                     close(fd);
138                    }
139                    LogFatal("Cannot create temporary file %s.", tmpMakefileName);
140                 }
141 @@ -449,12 +450,14 @@ showit(FILE *fd)
142  void
143  wrapup(void)
144  {
145 +#if 0
146         if (tmpMakefile != Makefile)
147                 unlink(tmpMakefile);
148         if (cleanedImakefile && cleanedImakefile != Imakefile)
149                 unlink(cleanedImakefile);
150         if (haveImakefileC)
151                 unlink(ImakefileC);
152 +#endif
153  }
154  
155  void
156 @@ -479,6 +482,10 @@ init(void)
157         while (cpp_argv[ cpp_argindex ] != NULL)
158                 cpp_argindex++;
159  
160 +       /* pkgsrc: generate a debug trace of reading the templates */
161 +       AddCppArg("-debuglog");
162 +       AddCppArg(".imake.cpplog");
163 +
164  #if defined CROSSCOMPILE
165         if (sys == netBSD)
166           if (CrossCompiling) {
167 @@ -522,6 +529,14 @@ init(void)
168                                 AddCppArg(p);
169                         }
170         }
171 +       if ((p = getenv("IMAKECPPFLAGS"))) {
172 +               AddCppArg(p);
173 +               for (; *p; p++)
174 +                       if (*p == ' ') {
175 +                               *p++ = '\0';
176 +                               AddCppArg(p);
177 +                       }
178 +       }
179         if ((p = getenv("IMAKECPP")))
180                 cpp = p;
181         if ((p = getenv("IMAKEMAKE")))
182 @@ -764,6 +779,13 @@ doit(FILE *outfd, const char *cmd, const
183  {
184         int             pid;
185         waitType        status;
186 +       unsigned i;
187 +
188 +       fprintf(stderr, "imake: executing:");
189 +       for (i=0; argv[i]; i++) {
190 +          fprintf(stderr, " %s", argv[i]);
191 +       }
192 +       fprintf(stderr, "\n");
193  
194         /*
195          * Fork and exec the command.
196 @@ -1130,32 +1152,7 @@ get_ld_version(FILE *inFile)
197  static void
198  get_binary_format(FILE *inFile)
199  {
200 -  int mib[2];
201 -  size_t len;
202 -  int osrel = 0;
203 -  FILE *objprog = NULL;
204 -  int iself = 0;
205 -  char buf[10];
206 -  char cmd[PATH_MAX];
207 -
208 -  mib[0] = CTL_KERN;
209 -  mib[1] = KERN_OSRELDATE;
210 -  len = sizeof(osrel);
211 -  sysctl(mib, 2, &osrel, &len, NULL, 0);
212 -  if (CrossCompiling) {
213 -      strcpy (cmd, CrossCompileDir);
214 -      strcat (cmd, "/");
215 -      strcat (cmd,"objformat");
216 -  } else
217 -      strcpy (cmd, "objformat");
218 -
219 -  if (osrel >= 300004 &&
220 -      (objprog = popen(cmd, "r")) != NULL &&
221 -      fgets(buf, sizeof(buf), objprog) != NULL &&
222 -      strncmp(buf, "elf", 3) == 0)
223 -    iself = 1;
224 -  if (objprog)
225 -    pclose(objprog);
226 +  int iself = 1;
227  
228    fprintf(inFile, "#define DefaultToElfFormat %s\n", iself ? "YES" : "NO");
229  }
230 @@ -1328,54 +1325,8 @@ get_gcc_version(FILE *inFile, char *name
231  static boolean
232  get_gcc(char *cmd)
233  {
234 -  struct stat sb;
235 -    static const char* gcc_path[] = {
236 -#if defined(linux) || \
237 -     defined(__NetBSD__) || \
238 -     defined(__OpenBSD__) || \
239 -     defined(__FreeBSD__) || \
240 -     defined(__DragonFly__) || \
241 -     defined(__APPLE__) || \
242 -     defined(__CYGWIN__) || \
243 -     defined(__MINGW32__) || \
244 -     defined(__GNU__) || \
245 -     defined(__GLIBC__)
246 -       "/usr/bin/cc",  /* for Linux PostIncDir */
247 -#endif
248 -       "/usr/local/bin/gcc",
249 -       "/opt/gnu/bin/gcc",
250 -       "/usr/pkg/bin/gcc"
251 -    };
252 -
253 -#ifdef CROSSCOMPILE
254 -    static const char* cross_cc_name[] = {
255 -       "cc",
256 -       "gcc"
257 -    };
258 -
259 -    if (CrossCompiling) {
260 -       unsigned int i;
261 -       for (i = 0; i < sizeof (cross_cc_name) / sizeof cross_cc_name[0]; i++){
262 -           strcpy (cmd, CrossCompileDir);
263 -           strcat (cmd, "/");
264 -           strcat (cmd, cross_cc_name[i]);
265 -           if (lstat (cmd, &sb) == 0) {
266 -               return TRUE;
267 -               break;
268 -           }
269 -       }
270 -    } else
271 -#endif
272 -      {
273 -       unsigned int i;
274 -       for (i = 0; i < sizeof (gcc_path) / sizeof gcc_path[0]; i++) {
275 -           if (lstat (gcc_path[i], &sb) == 0) {
276 -               strcpy (cmd, gcc_path[i]);
277 -               return TRUE;
278 -           }
279 -       }
280 -      }
281 -    return FALSE;
282 +      strcpy(cmd, "gcc");
283 +      return TRUE;
284  }
285  
286  #ifdef CROSSCOMPILE
287 @@ -1786,12 +1737,15 @@ CleanCppInput(const char *imakefile)
288                             outFile = fdopen(fd, "w");
289                         if (outFile == NULL) {
290                             if (fd != -1) {
291 -                              unlink(tmpImakefileName); close(fd);
292 +                              /*unlink(tmpImakefileName);*/
293 +                              close(fd);
294                             }
295                             LogFatal("Cannot open %s for write.",
296                                 tmpImakefileName);
297                         }
298  #endif
299 +                       fprintf(stderr, "%s: Warning: cleaning Imakefile\n",
300 +                               program);
301                         tmpImakefile = tmpImakefileName;
302                     }
303                     writetmpfile(outFile, punwritten, pbuf-punwritten,
304
305
306 [FILE:4186:patches/patch-imakemdep.h]
307 $NetBSD: patch-imakemdep.h,v 1.6 2016/09/17 17:49:36 richard Exp $
308
309  - Configure for pkgsrc: never set FIXUP_CPP_WHITESPACE as pkgsrc now
310 always uses a whitespace-preserving cpp and fixing it twice causes
311 bizarre lossage.
312
313  - Remove all the "logic" for guessing how to invoke cpp, and get it
314 via RAWCPP defined on the command line.
315
316  - Make argv[0] for invoking cpp "cpp" by default.
317
318  - Do not pass -m32 to cpp; it is not portable, valid, or even a
319 reasonable thing to do.
320
321  - Add support for __aarch64__
322
323 --- imakemdep.h.orig    2024-01-08 18:34:07 UTC
324 +++ imakemdep.h
325 @@ -229,7 +229,7 @@ in this Software without prior written a
326   *     all colons).  One way to tell if you need this is to see whether or not
327   *     your Makefiles have no tabs in them and lots of @@ strings.
328   */
329 -#  if defined(sun) || defined(SYSV) || defined(SVR4) || defined(hcx) || defined(WIN32) || defined(__SCO__) || (defined(AMOEBA) && defined(CROSS_COMPILE)) || defined(__QNX__) || defined(__sgi) || defined(__UNIXWARE__) || defined(__LCC__)
330 +#  if 0
331  #   define FIXUP_CPP_WHITESPACE
332  #  endif
333  #  ifdef WIN32
334 @@ -257,79 +257,7 @@ in this Software without prior written a
335   *     If the cpp you need is not in /lib/cpp, define DEFAULT_CPP.
336   */
337  #  if !defined (CROSSCOMPILE) || defined (CROSSCOMPILE_CPP)
338 -
339 -#   if defined(__APPLE__)
340 -#    define DEFAULT_CPP "/usr/bin/cpp"
341 -#    define DEFAULT_CC "cc"
342 -#   endif
343 -#   if defined(Lynx) || defined(__Lynx__)
344 -#    define DEFAULT_CC "gcc"
345 -#    define USE_CC_E
346 -#   endif
347 -#   ifdef hpux
348 -#    define USE_CC_E
349 -#   endif
350 -#   ifdef WIN32
351 -#    define USE_CC_E
352 -#    ifdef __GNUC__
353 -#     define DEFAULT_CC "gcc"
354 -#    else
355 -#     define DEFAULT_CC "cl"
356 -#    endif
357 -#   endif
358 -#   ifdef apollo
359 -#    define DEFAULT_CPP "/usr/lib/cpp"
360 -#   endif
361 -#   if defined(clipper) || defined(__clipper__)
362 -#    define DEFAULT_CPP "/usr/lib/cpp"
363 -#   endif
364 -#   if defined(_IBMR2) && !defined(DEFAULT_CPP)
365 -#    define DEFAULT_CPP "/usr/ccs/lib/cpp"
366 -#   endif
367 -#   ifdef __bsdi__
368 -#    define DEFAULT_CPP "/usr/bin/cpp"
369 -#   endif
370 -#   ifdef __uxp__
371 -#    define DEFAULT_CPP "/usr/ccs/lib/cpp"
372 -#   endif
373 -#   ifdef __sxg__
374 -#    define DEFAULT_CPP "/usr/lib/cpp"
375 -#   endif
376 -#   ifdef _CRAY
377 -#    define DEFAULT_CPP "/lib/pcpp"
378 -#   endif
379 -#   if defined(__386BSD__)
380 -#    define DEFAULT_CPP "/usr/libexec/cpp"
381 -#   endif
382 -#   if defined(__FreeBSD__)  || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
383 -#    define USE_CC_E
384 -#   endif
385 -#   if defined(__sgi) && defined(__ANSI_CPP__)
386 -#    define USE_CC_E
387 -#   endif
388 -#   if defined(MACH) && !defined(__GNU__)
389 -#    define USE_CC_E
390 -#   endif
391 -#   ifdef __minix_vmd
392 -#    define DEFAULT_CPP "/usr/lib/cpp"
393 -#   endif
394 -#   ifdef __CYGWIN__
395 -#    define DEFAULT_CC "gcc"
396 -#    define DEFAULT_CPP "/usr/bin/cpp"
397 -#   endif
398 -#   if defined (__QNX__)
399 -#    ifdef __QNXNTO__
400 -#     define DEFAULT_CPP "/usr/bin/cpp"
401 -#    else
402 -#     define DEFAULT_CPP "/usr/X11R6/bin/cpp"
403 -#    endif
404 -#   endif
405 -#   if defined(__GNUC__) && !defined(USE_CC_E)
406 -#    define USE_CC_E
407 -#    ifndef DEFAULT_CC
408 -#     define DEFAULT_CC "gcc"
409 -#    endif
410 -#   endif
411 +#    define DEFAULT_CPP RAWCPP
412  
413  #  endif /* !defined (CROSSCOMPILE) || defined (CROSSCOMPILE_CPP) */
414  /*
415 @@ -352,7 +280,7 @@ in this Software without prior written a
416  #  define      ARGUMENTS 50    /* number of arguments in various arrays */
417  #  if !defined (CROSSCOMPILE) || defined (CROSSCOMPILE_CPP)
418  const char *cpp_argv[ARGUMENTS] = {
419 -       "cc",           /* replaced by the actual program to exec */
420 +       "cpp",          /* replaced by the actual program to exec */
421         "-I.",          /* add current directory to include path */
422  #   if !defined(__NetBSD_Version__) || __NetBSD_Version__ < 103080000
423  #    ifdef unix
424 @@ -365,9 +293,6 @@ const char *cpp_argv[ARGUMENTS] = {
425      defined(__GNUC__) || defined(__GLIBC__)
426  #    ifdef __i386__
427         "-D__i386__",
428 -#     if defined(__GNUC__) && (__GNUC__ >= 3)
429 -       "-m32",
430 -#     endif
431  #    endif
432  #    ifdef __i486__
433         "-D__i486__",
434 @@ -399,6 +324,9 @@ const char *cpp_argv[ARGUMENTS] = {
435  #    ifdef __arm__
436         "-D__arm__",
437  #    endif
438 +#    ifdef __aarch64__
439 +       "-D__aarch64__",
440 +#    endif
441  #    ifdef __s390x__
442         "-D__s390x__",
443  #    endif
444
445
446 [FILE:329:patches/patch-mdepend.cpp]
447 --- mdepend.cpp.orig    2024-01-08 18:34:07 UTC
448 +++ mdepend.cpp
449 @@ -125,9 +125,6 @@ do
450                             shift
451                             ;;
452  
453 -                       # Flag to tell compiler to output dependencies directly
454 -                       # For example, with Sun compilers, -xM or -xM1 or
455 -                       # with gcc, -M
456                         -d)
457                             compilerlistsdepends="y"
458                             compilerlistdependsflag="$2"
459