Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#51863 closed enhancement (fixed)

New Port ChezScheme

Reported by: wbl (Watson Ladd) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.4
Keywords: Cc: mohd-akram (Mohamed Akram)
Port: chezscheme

Description

A portfile that installs ChezScheme. Unfortunately the command is named scheme, so there will be incompatibilities with other scheme implementations that also call the command scheme.

Attachments (10)

Portfile (922 bytes) - added by wbl (Watson Ladd) 8 years ago.
Portfile.2 (1.3 KB) - added by mohd-akram (Mohamed Akram) 7 years ago.
patch-c-Mf-base.diff (584 bytes) - added by mohd-akram (Mohamed Akram) 7 years ago.
patch-c-Mf-ta6osx.diff (951 bytes) - added by mohd-akram (Mohamed Akram) 7 years ago.
patch-c-Mf-ti3osx.diff (958 bytes) - added by mohd-akram (Mohamed Akram) 7 years ago.
patch-configure.diff (1.1 KB) - added by mohd-akram (Mohamed Akram) 7 years ago.
Portfile.3 (1.7 KB) - added by mohd-akram (Mohamed Akram) 7 years ago.
patch-configure.2.diff (1.2 KB) - added by mohd-akram (Mohamed Akram) 7 years ago.
Portfile.4 (1.4 KB) - added by mohd-akram (Mohamed Akram) 7 years ago.
patch-s-Mf-base.diff (1.1 KB) - added by mohd-akram (Mohamed Akram) 7 years ago.

Download all attachments as: .zip

Change History (25)

Changed 8 years ago by wbl (Watson Ladd)

Attachment: Portfile added

comment:1 Changed 8 years ago by neverpanic (Clemens Lang)

A couple of lint warnings:

$ port lint --nitpick
--->  Verifying Portfile for ChezScheme
Warning: Line 5 should be a newline (after PortSystem)
Warning: Line 11 seems to hardcode the version number, consider using ${version} instead
Warning: Line 25 has trailing whitespace before newline
Warning: no license set
--->  0 errors and 4 warnings found.

A couple of comments:

  • Your whitespace doesn't match the modeline; we usually use 4 spaces for indentation, but your Portfile uses a mix of spaces and tabs.
  • Instead of build.target-delete all, I'd just use build.target (without anything after it), which sets build.target to empty, like you did it for configure.pre_args.
  • The port uses curl to download additional files in the build phase. Can this be avoided?
  • The port seems to unconditionally use gcc to compile. We want it to use $CC from the environment and pay attention to our $CFLAGS (which it seems to do) and $LDFLAGS.
  • The port seems to build its own copy of zlib. It should use MacPorts' zlib instead. Additionally, the copy of zlib requires Xlib headers which causes the build to fail [1] and compiles a library that is only suitable for installing in /usr/local/lib [2]

[1]:

:info:build gcc  -m64 -Wpointer-arith -Wall -Wextra -Werror -O2 -I/opt/X11/include/  -c -DX86_64 -I../boot/ta6osx -I../zlib expeditor.c
:info:build expeditor.c:846:10: fatal error: 'X11/Xlib.h' file not found
:info:build #include <X11/Xlib.h>
:info:build          ^
:info:build 1 error generated.
:info:build make[2]: *** [expeditor.o] Error 1
:info:build make[2]: *** Waiting for unfinished jobs....

[2]:

:info:build gcc -dynamiclib -install_name /usr/local/lib/libz.1.dylib -compatibility_version 1 -current_version 1.2.8 -m64  -fPIC -m64 -DHAVE_HIDDEN -o libz.1.2.8.dylib adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo  -lc 

comment:2 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Since this software is hosted at github, please use the github portgroup. Its github.setup line will replace the name, version, distfiles, and master_sites lines. The checksums will need to change because the github portgroup uses "tarball"-style URLs, not "archive"-style URLs like you used.

The purpose of configure.pre_args is to specify the prefix, so instead of clearing configure.pre_args and putting --installprefix=${prefix} in configure.args, you should set configure.pre_args to --installprefix=${prefix}.

comment:3 Changed 8 years ago by wbl (Watson Ladd)

Is there an example of something in the github portgroup I can look up? I'm not entirely sure I follow that part of the comment.

Also, how should I declare an X11 dependency? I think once I get that and the CC patch adopted upstream we will be a lot closer to getting this in.

comment:4 in reply to:  3 Changed 8 years ago by larryv (Lawrence Velázquez)

Replying to watsonbladd@…:

Also, how should I declare an X11 dependency? I think once I get that and the CC patch adopted upstream we will be a lot closer to getting this in.

X11/Xlib.h comes from the xorg-libX11 port. You may need to add others, depending on the specific components required.

comment:5 Changed 7 years ago by mohd-akram (Mohamed Akram)

Cc: mohd-akram added

Changed 7 years ago by mohd-akram (Mohamed Akram)

Attachment: Portfile.2 added

Changed 7 years ago by mohd-akram (Mohamed Akram)

Attachment: patch-c-Mf-base.diff added

Changed 7 years ago by mohd-akram (Mohamed Akram)

Attachment: patch-c-Mf-ta6osx.diff added

Changed 7 years ago by mohd-akram (Mohamed Akram)

Attachment: patch-c-Mf-ti3osx.diff added

Changed 7 years ago by mohd-akram (Mohamed Akram)

Attachment: patch-configure.diff added

comment:6 Changed 7 years ago by mohd-akram (Mohamed Akram)

I've added a new Portfile and associated patches, and renamed the port to chez-scheme.

comment:7 Changed 7 years ago by wbl (Watson Ladd)

Thanks! I'll take a more in-depth look later on . Can we get some of these changes upstreamed? Modifying the makefiles and configure ourselves is less preferable than providing arguments to their system. You also missed the nanopass download in configure.

comment:8 Changed 7 years ago by mohd-akram (Mohamed Akram)

I'm not sure which changes can be upstreamed tbh. They statically link with zlib, but there's no libz.a on macOS from what I can tell. Letting the port use its own zlib would simplify the patches a lot, leaving just the $CC change. Couldn't get rid of the nanopass download, it's required.

comment:9 Changed 7 years ago by wbl (Watson Ladd)

What we'd like is if that could be downloaded in the fetch phase instead/could be included with the source tarball, but I'm just relaying what I was told above. I was trying to talk to upstream, but am pretty new to this myself.

Changed 7 years ago by mohd-akram (Mohamed Akram)

Attachment: Portfile.3 added

Changed 7 years ago by mohd-akram (Mohamed Akram)

Attachment: patch-configure.2.diff added

comment:10 Changed 7 years ago by mohd-akram (Mohamed Akram)

I've removed nanopass from the configure file and made MacPorts fetch it. Hopefully, this is sufficient.

comment:11 Changed 7 years ago by mf2k (Frank Schima)

Can nanopass be implemented as a new port and then make it a dependency for chezscheme?

comment:12 in reply to:  11 Changed 7 years ago by mohd-akram (Mohamed Akram)

So the folder is hardcoded in the Makefile which would need another patch file. We then need to decide on a directory to put it in (eg. $prefix/share/scheme/r6rs) since this is a Scheme library. Finally, the environment variable CHEZSCHEMELIBDIRS needs to be set to this directory before build. There doesn't seem to be a scheme folder in the ports tree where this (and other Scheme libraries) would ideally belong. I can create another ticket if I should proceed with this.

Changed 7 years ago by mohd-akram (Mohamed Akram)

Attachment: Portfile.4 added

Changed 7 years ago by mohd-akram (Mohamed Akram)

Attachment: patch-s-Mf-base.diff added

comment:13 Changed 7 years ago by mohd-akram (Mohamed Akram)

I've created a pull request for nanopass here - https://github.com/macports/macports-ports/pull/470 - and attached the relevant files for this change.

comment:14 Changed 7 years ago by raimue (Rainer Müller)

Resolution: fixed
Status: newclosed

In d4ef3b6f3b36379d28f7c26dc67ec7d767efd66b/macports-ports:

ChezScheme: new port, a Scheme implementation

Closes: #51863

comment:15 Changed 7 years ago by raimue (Rainer Müller)

Thank you for the port submission and working on its dependencies. I committed this port now with the following slight changes:

  • moved github.setup to the top
  • added your GitHub username to the maintainers option

For future update, please continue to file tickets in Trac or create pull requests on GitHub. Hopefully we should get to them faster than to this first submission.

Note: See TracTickets for help on using tickets.