Fail to execute a custom local portfile

Giovanni Grieco giovanni.grc96 at
Sun Aug 21 06:37:20 PDT 2016


I’m trying to write a local portfile that compiles and sets up a project hosted on github.


To test my portfile, I’ve initialised a local repository in /Users/account _name/Documents/macports, followed the standard hierarchy and indexed my package via portindex command. All of these things went OK.


But I can’t install my package via ‘port install’ because MacPorts throws me the following error:

“Unable to execute port: Could not open file: /Users/…/Documents/macports/… /Portfile”


I have the file in that directory, I can open and write it. So I don’t know what the problem is.

Permissions are all set to macports:macports 755, both directories and files; port lint doesn’t find any error  related to Portfile; I have sources.conf with my local repository.



I tried to debug the install command. Here’s the output:


DEBUG: Copying /Users/corsaro/Library/Preferences/ to /opt/local/var/macports/home/Library/Preferences

DEBUG: Changing to port directory: /Users/corsaro/Documents/macports/graphics/kwm

DEBUG: OS darwin/16.0.0 (Mac OS X 10.12) arch i386

DEBUG: Sourcing PortGroup github 1.0 from /opt/local/var/macports/sources/

DEBUG: adding the default universal variant

DEBUG: Reading variant descriptions from /opt/local/var/macports/sources/

DEBUG: Running callback portconfigure::add_automatic_compiler_dependencies

DEBUG: Finished running callback portconfigure::add_automatic_compiler_dependencies

DEBUG: Running callback portbuild::add_automatic_buildsystem_dependencies

DEBUG: Finished running callback portbuild::add_automatic_buildsystem_dependencies

DEBUG: dropping privileges: euid changed to 502, egid changed to 501.

DEBUG: Could not open file: /Users/corsaro/Documents/macports/graphics/kwm/Portfile

    while executing

"sha256 file ${portpath}/Portfile"

    (procedure "open_statefile" line 52)

    invoked from within


    (procedure "check_variants" line 28)

    invoked from within

"check_variants activate"

    invoked from within

"$workername eval check_variants $target"

    (procedure "mportexec" line 7)

    invoked from within

"mportexec $workername $target"

Error: Unable to execute port: Could not open file: /Users/corsaro/Documents/macports/graphics/kwm/Portfile

DEBUG: Checking time since last reclaim run


Thanks for your helpful advice!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the macports-users mailing list