Skip to content

Commit

Permalink
py-pikepdf: fix hardcode reference to homebrew for arm
Browse files Browse the repository at this point in the history
  • Loading branch information
Schamschula committed Mar 22, 2022
1 parent 54ee1bb commit d5f5499
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/py-pikepdf/Portfile
Expand Up @@ -41,5 +41,14 @@ if {${name} ne ${subport}} {
# error: no matching constructor for initialization of 'match_replace'
compiler.blacklist-append {clang < 900}

if {${os.arch} == "arm" } {
patchfiles-append \
patch-setup.py.diff

post-patch {
reinplace "s|%PREFIX%|${prefix}|g" ${worksrcpath}/setup.py
}
}

livecheck.type none
}
13 changes: 13 additions & 0 deletions python/py-pikepdf/files/patch-setup.py.diff
@@ -0,0 +1,13 @@
--- setup.py.orig 2022-03-21 20:35:06.000000000 -0500
+++ setup.py 2022-03-21 20:35:36.000000000 -0500
@@ -19,8 +19,8 @@
if 'bsd' in sys.platform:
extra_includes.append('/usr/local/include')
elif 'darwin' in sys.platform and machine() == 'arm64':
- extra_includes.append('/opt/homebrew/include')
- extra_library_dirs.append('/opt/homebrew/lib')
+ extra_includes.append('%PREFIX%/include')
+ extra_library_dirs.append('%PREFIX%/lib')

This comment has been minimized.

Copy link
@ryandesign

ryandesign Mar 23, 2022

Contributor

So now on Darwin arm64 you add /opt/local/include and /opt/local/lib. But surely those paths are needed to build this on non-arm64 systems too. Thus surely those paths are already added elsewhere and don't need to be added here again. Seems like you could just remove the elif and the two following lines.

This comment has been minimized.

Copy link
@Schamschula

Schamschula Mar 23, 2022

Author Contributor

This was a quick fix. My suspicion is that they aren't needed at all.

I'll see if removing these paths, i.e. the elif block, will prevent the build.

This comment has been minimized.

Copy link
@Schamschula

Schamschula Mar 23, 2022

Author Contributor

See: 5461a9a


try:
from setuptools_scm import get_version

0 comments on commit d5f5499

Please sign in to comment.