Skip to content

Instantly share code, notes, and snippets.

@arthurdarcet
Created December 9, 2015 10:27
Show Gist options
  • Save arthurdarcet/a08430dfe44ee66ae7ac to your computer and use it in GitHub Desktop.
Save arthurdarcet/a08430dfe44ee66ae7ac to your computer and use it in GitHub Desktop.
Homebrew patch fontforge-python3
From aff1b8de582e52c04f57223310ed07d562ff2d81 Mon Sep 17 00:00:00 2001
From: Arthur Darcet <arthur.darcet@m4x.org>
Date: Wed, 9 Dec 2015 11:26:50 +0100
Subject: [PATCH] fontforge python3
---
Library/Formula/fontforge.rb | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/Library/Formula/fontforge.rb b/Library/Formula/fontforge.rb
index 3bb99a4..9eb0d01 100644
--- a/Library/Formula/fontforge.rb
+++ b/Library/Formula/fontforge.rb
@@ -54,9 +54,10 @@ class Fontforge < Formula
# Don't link libraries to libpython, but do link binaries that expect
# to embed a python interpreter
# https://github.com/fontforge/fontforge/issues/2353#issuecomment-121009759
- ENV["PYTHON_CFLAGS"] = `python-config --cflags`.chomp
+ ENV["PYTHON"] = "/usr/local/bin/python3"
+ ENV["PYTHON_CFLAGS"] = `/usr/local/bin/python3-config --cflags`.chomp
ENV["PYTHON_LIBS"] = "-undefined dynamic_lookup"
- python_libs = `python2.7-config --ldflags`.chomp
+ python_libs = `/usr/local/bin/python3-config --ldflags`.chomp
inreplace "fontforgeexe/Makefile.am" do |s|
oldflags = s.get_make_var "libfontforgeexe_la_LDFLAGS"
s.change_make_var! "libfontforgeexe_la_LDFLAGS", "#{python_libs} #{oldflags}"
@@ -70,7 +71,7 @@ class Fontforge < Formula
--prefix=#{prefix}
--disable-silent-rules
--disable-dependency-tracking
- --with-pythonbinary=#{which "python2.7"}
+ --with-pythonbinary=/usr/local/bin/python3
--without-x
]
@@ -109,6 +110,6 @@ class Fontforge < Formula
test do
system bin/"fontforge", "-version"
- system "python", "-c", "import fontforge"
+ system "python3", "-c", "import fontforge"
end
end
--
2.6.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment