Skip to content

Instantly share code, notes, and snippets.

@okofish
Last active January 20, 2018 10:12
Show Gist options
  • Save okofish/5e611d7caa3f44e65964053f8b13b9f3 to your computer and use it in GitHub Desktop.
Save okofish/5e611d7caa3f44e65964053f8b13b9f3 to your computer and use it in GitHub Desktop.
require 'formula'
class Sk1libs < Formula
homepage 'http://sk1project.net/modules.php?name=products&product=sk1&op=download'
url 'https://sk1project.net/dc.php?target=sk1libs-0.9.1.tar.gz'
depends_on 'lcms2'
# educate sk1libs about Mac OS X fonts directories
def patches; DATA; end
def install
ENV.x11
# Explicitly set the arch in CFLAGS so it will build against system Python
# We remove 'ppc' support, so we can pass Intel-optimized CFLAGS.
archs = archs_for_command("python")
archs.remove_ppc!
ENV.append_to_cflags archs.as_arch_flags
# for some reason it doesn't look at X11 freetype headers
ENV.append_to_cflags "-I /usr/X11/include/freetype2/"
system "python setup.py build"
system "python setup.py install --prefix=#{prefix}"
end
end
__END__
diff --git a/src/utils/fs.py b/src/utils/fs.py
index 2c90fab..0817573 100644
--- a/src/utils/fs.py
+++ b/src/utils/fs.py
@@ -220,8 +220,8 @@ def get_system_fontdirs():
finally:
_winreg.CloseKey( k )
if system.get_os_family()==system.MACOSX:
- #FIXME: It's a stub. The paths should be more exact.
- return ['/',]
+ return ['/Library/Fonts',
+ os.path.join(gethome(), 'Library/Fonts')]
DIRECTORY_OBJECT=0
@@ -311,4 +311,4 @@ def _test():
if __name__ == '__main__':
_test()
-
\ No newline at end of file
+
require 'formula'
class Uniconvertor < Formula
homepage 'http://sk1project.net/modules.php?name=Products&product=uniconvertor'
url 'http://sk1project.net/dc.php?target=uniconvertor-1.1.5.tar.gz'
depends_on 'sk1libs'
# make it see it's own and sk1libs modules
def patches; DATA; end
def install
# ENV.x11 # if your formula requires any X11 headers
# ENV.j1 # if your formula's build system can't parallelize
# Explicitly set the arch in CFLAGS so it will build against system Python
# We remove 'ppc' support, so we can pass Intel-optimized CFLAGS.
archs = archs_for_command("python")
archs.remove_ppc!
ENV.append_to_cflags archs.as_arch_flags
system "python setup.py build"
system "python setup.py install --prefix=#{prefix}"
end
end
__END__
diff --git a/src/uniconvertor b/src/uniconvertor
index 06496de..a21f934 100644
--- a/src/uniconvertor
+++ b/src/uniconvertor
@@ -8,6 +8,9 @@
# For more info see COPYRIGHTS file in uniconvertor root directory.
#
+import sys
+sys.path.insert(0, '/usr/local/Cellar/uniconvertor/1.1.5/lib/python2.6/site-packages/')
+sys.path.insert(0, '/usr/local/Cellar/sk1libs/0.9.1/lib/python2.6/site-packages/')
from uniconvertor import uniconv_run
-uniconv_run()
\ No newline at end of file
+uniconv_run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment