1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
7 SDESC[standard]= X.Org imake program and related utilities
8 HOMEPAGE= https://www.x.org/
12 SITES[main]= XORG/individual/util
13 DISTFILE[1]= imake-1.0.10.tar.xz:main
15 SPKGS[standard]= single
17 OPTIONS_AVAILABLE= none
18 OPTIONS_STANDARD= none
20 BUILDRUN_DEPENDS= tradcpp:single:standard
21 RUN_DEPENDS= xorg-cf-files:single:standard
22 gccmakedep:single:standard
23 makedepend:single:standard
25 USES= perl:run pkgconfig shebangfix
26 XORG_COMPONENTS= xorgproto
29 LICENSE_FILE= MIT:{{WRKSRC}}/COPYING
32 FPC_EQUIVALENT= devel/imake
33 SHEBANG_FILES= mkhtmlindex.pl
36 CONFIGURE_ARGS= --with-create-lib-cmd="ar cq"
37 CONFIGURE_ENV= APP_MAN_SUFFIX=1
41 ${REINPLACE_CMD} -e 's|RAWCPP|"${PREFIX}/bin/tradcpp"|' \
45 # This required with some C preprocessors and not others,
46 # but is harmless when not required.
47 ${REINPLACE_CMD} -e "s/^configdirspec= */configdirspec=/" \
50 [FILE:224:descriptions/desc.single]
51 The imake package contains Xorg's imake utility for generating Makefiles,
52 plus the following support programs:
65 75decbcea8d7b354cf36adc9675e53c4790ee3de56a14bd87b42c8e8aad2ecf5 155284 imake-1.0.10.tar.xz
68 [FILE:240:manifests/plist.single]
91 [FILE:5463:patches/patch-imake.c]
94 - Generate all files into the current (build) directory, not /tmp.
95 - Do not delete any of the temporary files, to allow analysis after
97 - Log the command lines executed.
98 - Warn if scrubbing the Imakefile to alert the user to check if that
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
108 --- imake.c.orig 2024-01-08 18:34:07 UTC
110 @@ -303,9 +303,9 @@ void KludgeOutputLine(char **), KludgeRe
111 const char *cpp = NULL;
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 ] = {
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;
131 @@ -407,7 +407,8 @@ main(int argc, char *argv[])
133 if (fd == -1 || (tmpfd = fdopen(fd, "w+")) == NULL) {
135 - unlink(tmpMakefileName); close(fd);
136 + /*unlink(tmpMakefileName);*/
139 LogFatal("Cannot create temporary file %s.", tmpMakefileName);
141 @@ -449,12 +450,14 @@ showit(FILE *fd)
146 if (tmpMakefile != Makefile)
148 if (cleanedImakefile && cleanedImakefile != Imakefile)
149 unlink(cleanedImakefile);
156 @@ -479,6 +482,10 @@ init(void)
157 while (cpp_argv[ cpp_argindex ] != NULL)
160 + /* pkgsrc: generate a debug trace of reading the templates */
161 + AddCppArg("-debuglog");
162 + AddCppArg(".imake.cpplog");
164 #if defined CROSSCOMPILE
166 if (CrossCompiling) {
167 @@ -522,6 +529,14 @@ init(void)
171 + if ((p = getenv("IMAKECPPFLAGS"))) {
179 if ((p = getenv("IMAKECPP")))
181 if ((p = getenv("IMAKEMAKE")))
182 @@ -764,6 +779,13 @@ doit(FILE *outfd, const char *cmd, const
188 + fprintf(stderr, "imake: executing:");
189 + for (i=0; argv[i]; i++) {
190 + fprintf(stderr, " %s", argv[i]);
192 + fprintf(stderr, "\n");
195 * Fork and exec the command.
196 @@ -1130,32 +1152,7 @@ get_ld_version(FILE *inFile)
198 get_binary_format(FILE *inFile)
203 - FILE *objprog = NULL;
206 - char cmd[PATH_MAX];
209 - mib[1] = KERN_OSRELDATE;
210 - len = sizeof(osrel);
211 - sysctl(mib, 2, &osrel, &len, NULL, 0);
212 - if (CrossCompiling) {
213 - strcpy (cmd, CrossCompileDir);
215 - strcat (cmd,"objformat");
217 - strcpy (cmd, "objformat");
219 - if (osrel >= 300004 &&
220 - (objprog = popen(cmd, "r")) != NULL &&
221 - fgets(buf, sizeof(buf), objprog) != NULL &&
222 - strncmp(buf, "elf", 3) == 0)
228 fprintf(inFile, "#define DefaultToElfFormat %s\n", iself ? "YES" : "NO");
230 @@ -1328,54 +1325,8 @@ get_gcc_version(FILE *inFile, char *name
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__) || \
246 - "/usr/bin/cc", /* for Linux PostIncDir */
248 - "/usr/local/bin/gcc",
249 - "/opt/gnu/bin/gcc",
254 - static const char* cross_cc_name[] = {
259 - if (CrossCompiling) {
261 - for (i = 0; i < sizeof (cross_cc_name) / sizeof cross_cc_name[0]; i++){
262 - strcpy (cmd, CrossCompileDir);
264 - strcat (cmd, cross_cc_name[i]);
265 - if (lstat (cmd, &sb) == 0) {
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]);
282 + strcpy(cmd, "gcc");
287 @@ -1786,12 +1737,15 @@ CleanCppInput(const char *imakefile)
288 outFile = fdopen(fd, "w");
289 if (outFile == NULL) {
291 - unlink(tmpImakefileName); close(fd);
292 + /*unlink(tmpImakefileName);*/
295 LogFatal("Cannot open %s for write.",
299 + fprintf(stderr, "%s: Warning: cleaning Imakefile\n",
301 tmpImakefile = tmpImakefileName;
303 writetmpfile(outFile, punwritten, pbuf-punwritten,
306 [FILE:4186:patches/patch-imakemdep.h]
307 $NetBSD: patch-imakemdep.h,v 1.6 2016/09/17 17:49:36 richard Exp $
309 - Configure for pkgsrc: never set FIXUP_CPP_WHITESPACE as pkgsrc now
310 always uses a whitespace-preserving cpp and fixing it twice causes
313 - Remove all the "logic" for guessing how to invoke cpp, and get it
314 via RAWCPP defined on the command line.
316 - Make argv[0] for invoking cpp "cpp" by default.
318 - Do not pass -m32 to cpp; it is not portable, valid, or even a
319 reasonable thing to do.
321 - Add support for __aarch64__
323 --- imakemdep.h.orig 2024-01-08 18:34:07 UTC
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.
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__)
331 # define FIXUP_CPP_WHITESPACE
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.
337 # if !defined (CROSSCOMPILE) || defined (CROSSCOMPILE_CPP)
339 -# if defined(__APPLE__)
340 -# define DEFAULT_CPP "/usr/bin/cpp"
341 -# define DEFAULT_CC "cc"
343 -# if defined(Lynx) || defined(__Lynx__)
344 -# define DEFAULT_CC "gcc"
353 -# define DEFAULT_CC "gcc"
355 -# define DEFAULT_CC "cl"
359 -# define DEFAULT_CPP "/usr/lib/cpp"
361 -# if defined(clipper) || defined(__clipper__)
362 -# define DEFAULT_CPP "/usr/lib/cpp"
364 -# if defined(_IBMR2) && !defined(DEFAULT_CPP)
365 -# define DEFAULT_CPP "/usr/ccs/lib/cpp"
368 -# define DEFAULT_CPP "/usr/bin/cpp"
371 -# define DEFAULT_CPP "/usr/ccs/lib/cpp"
374 -# define DEFAULT_CPP "/usr/lib/cpp"
377 -# define DEFAULT_CPP "/lib/pcpp"
379 -# if defined(__386BSD__)
380 -# define DEFAULT_CPP "/usr/libexec/cpp"
382 -# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
385 -# if defined(__sgi) && defined(__ANSI_CPP__)
388 -# if defined(MACH) && !defined(__GNU__)
392 -# define DEFAULT_CPP "/usr/lib/cpp"
395 -# define DEFAULT_CC "gcc"
396 -# define DEFAULT_CPP "/usr/bin/cpp"
398 -# if defined (__QNX__)
400 -# define DEFAULT_CPP "/usr/bin/cpp"
402 -# define DEFAULT_CPP "/usr/X11R6/bin/cpp"
405 -# if defined(__GNUC__) && !defined(USE_CC_E)
408 -# define DEFAULT_CC "gcc"
411 +# define DEFAULT_CPP RAWCPP
413 # endif /* !defined (CROSSCOMPILE) || defined (CROSSCOMPILE_CPP) */
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
424 @@ -365,9 +293,6 @@ const char *cpp_argv[ARGUMENTS] = {
425 defined(__GNUC__) || defined(__GLIBC__)
428 -# if defined(__GNUC__) && (__GNUC__ >= 3)
434 @@ -399,6 +324,9 @@ const char *cpp_argv[ARGUMENTS] = {
446 [FILE:329:patches/patch-mdepend.cpp]
447 --- mdepend.cpp.orig 2024-01-08 18:34:07 UTC
449 @@ -125,9 +125,6 @@ do
453 - # Flag to tell compiler to output dependencies directly
454 - # For example, with Sun compilers, -xM or -xM1 or
457 compilerlistsdepends="y"
458 compilerlistdependsflag="$2"