Search code examples
xcodemakefilejailbreaktweak

Xcode External Build System Make Package Install


I created an "External Build System" project in Xcode to run my custom Makefile when run. By default this works fine, but when I want to pass it -C ~/Desktop/GIFPaper/ package install so the full shell command equivalent would be:

make -C ~/Desktop/GIFPaper/ package install

I get this error:

/Applications/Xcode.app/Contents/Developer/usr/bin/make package requires dpkg-deb.
make: *** [internal-package-check] Error 1
Program ended with exit code: 2

The weird thing is that I have dpkg installed and if I open Terminal and change the directory to:

/Applications/Xcode.app/Contents/Developer/usr/bin/

and the run:

make -C ~/Desktop/GIFPaper/ package install

everything works fine. So far I have added:

-C ~/Desktop/GIFPaper/ package install

as arguments to the Run scheme. What am I doing wrong?


Solution

  • I guess you are using a Makefile depending on this file (or a similar rule):

    https://github.com/DHowett/theos/blob/master/makefiles/package/deb.mk

    It requires that dpkg-deb is in the path or will fail with the error message you posted.

    You say you installed dpkg, but this doesn't mean an executable called dpkg-deb is available to make when invoked from Xcode. Indeed, with your external build system, make is invoked with a restricted PATH. Your solution of installing dpkg-deb and copying to /Applications/Xcode.app/Contents/Developer/usr/bin/ is quite dirty and involves installing the missing binary in Xcode itself, in the first directory of the default PATH.

    Alternatively, you can modify the PATH directly from Xcode, by checking "Pass build settings in environment" (this is the default) and adding a PATH build setting. Ideal value would be ${inherited}:/usr/local/bin or ${inherited}:/opt/local/bin depending on where dpkg-deb is actually installed.