zephir icon indicating copy to clipboard operation
zephir copied to clipboard

Better Support FreeBSD

Open josh4trunks opened this issue 8 years ago • 11 comments

I was working to get this ported to FreeBSD. There are some issues I hit that I can work around but would be nice to have addressed.

  • [x] Use #!/usr/bin/env bash instead of #!/bin/bash
    • FreeBSD never installs packages to /bin, and bash is installed as a package since it is not the default shell.
  • [x] Make 'bin/zepher' completely POSIX compliant to drop the dependency for bash
    • This might not be doable in a clean way so we may need to skip this.
  • [x] Make 'parser/parser/build_linux.sh' completely POSIX compliant to drop the dependency for bash
  • [x] Execute 'parser/parser/build_linux.sh' using /bin/sh instead of directly so this script doesn't necessarily need execute permissions.
  • [ ] Replace instances of "gcc" with "cc" to drop the dependency for gcc
    • When I tested compiling an extension without gcc installed it failed because gcc was missing. I might be able to work around this by setting the CC variable to cc, but I did not have time to test this.
  • [ ] Drop dependency for sudo
    • It would be nice to allow systems admins, that do not have sudo installed to still install extensions. I noticed when I built an extension as root, without sudo installed, the extension was silently not installed.
    • Maybe this could be accomplished with su? If not, we can just disregard this.

josh4trunks avatar Sep 14 '16 16:09 josh4trunks

I had a possible idea to tackle the sudo point. Maybe we could do a check on the current UID and only use sudo if it is not '0'?

josh4trunks avatar Sep 14 '16 19:09 josh4trunks

@josh4trunks I like this approach

sergeyklay avatar Sep 14 '16 19:09 sergeyklay

Is there any reason https://github.com/phalcon/zephir/blob/master/Library/Compiler.php and https://github.com/phalcon/zephir/blob/master/parser/parser/build_linux.sh have gcc / CC="gcc" instead of cc?

josh4trunks avatar Sep 19 '16 16:09 josh4trunks

@andresgutierrez

sergeyklay avatar Sep 19 '16 17:09 sergeyklay

Any word on the the need for GCC?

It would be great to get this working by the next zephir release. That way we could add a stable version to the ports tree. See the request here https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211144

josh4trunks avatar Oct 25 '16 16:10 josh4trunks

@josh4trunks Any progress?

sergeyklay avatar Apr 01 '17 17:04 sergeyklay

I submitted the port for review and no FreeBSD ports reviewer has looked at it =
I could try authoring a new bug report (since I did not start that one) maybe that would get more attention.

josh4trunks avatar Apr 01 '17 17:04 josh4trunks

Also see: phalcon/cphalcon#12473

sergeyklay avatar Nov 28 '18 08:11 sergeyklay

Hi all,

I’m revisiting this. I’ve got connections to FreeBSD commiters so we should be able to make this happen pretty quickly.

I’ve got the parser port done, now just working through the Zephir port.

rcmcdonald91 avatar Feb 13 '22 18:02 rcmcdonald91

Ports for both Zephir (lang/zephir) and Zephir parser (textproc/pecl-zephir_parser) are available here for testing https://github.com/theonemcdonald/FreeBSD-ports/tree/add-zephir

Still need to write a patch to support clang on FreeBSD, which is preferred due to licensing reasons.

rcmcdonald91 avatar Feb 15 '22 04:02 rcmcdonald91

https://www.freshports.org/lang/zephir/ https://www.freshports.org/textproc/pecl-zephir_parser/

rcmcdonald91 avatar Aug 15 '22 18:08 rcmcdonald91