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