Skip to content

Instantly share code, notes, and snippets.

@danielfone
Created August 16, 2011 19:13
Show Gist options
  • Save danielfone/1149891 to your computer and use it in GitHub Desktop.
Save danielfone/1149891 to your computer and use it in GitHub Desktop.
homebrew io.rb - snow leopard
require 'formula'
class Io < Formula
head 'https://github.com/stevedekorte/io.git', :tag => 'e3908ce802a5d4fb56713610f5e1d62d6bf1f011'
homepage 'http://iolanguage.com/'
depends_on 'cmake' => :build
depends_on 'libsgml'
depends_on 'ossp-uuid'
# Either CMake doesn't detect OS X's png include path correctly,
# or there's an issue with io's build system; force the path in
# so we can build.
def patches
DATA
end
def install
ENV.j1
mkdir 'io-build'
Dir.chdir 'io-build' do
system "cmake .. #{std_cmake_parameters}"
system "make install"
end
rm_f Dir['docs/*.pdf']
doc.install Dir['docs/*']
prefix.install 'license/bsd_license.txt' => 'LICENSE'
end
end
__END__
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a4cd440..e2d05eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -140,7 +140,7 @@ IF(WIN32 AND NOT CYGWIN)
ELSE(WIN32 AND NOT CYGWIN)
execute_process(COMMAND git rev-parse --short HEAD OUTPUT_VARIABLE IO_GIT_REV)
ENDIF(WIN32 AND NOT CYGWIN)
-string(REGEX REPLACE "(.......)." "\\1" IO_GIT_REV ${IO_GIT_REV})
+string(REGEX REPLACE "(.......)." "\\1" IO_GIT_REV ${IO_GIT_REV} "" "")
SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
SET(CPACK_PACKAGE_VENDOR "iolanguage.com")
diff --git a/addons/Image/CMakeLists.txt b/addons/Image/CMakeLists.txt
index a65693d..2166f1b 100644
--- a/addons/Image/CMakeLists.txt
+++ b/addons/Image/CMakeLists.txt
@@ -22,7 +22,7 @@ if(PNG_FOUND AND TIFF_FOUND AND JPEG_FOUND)
add_definitions(-DBUILDING_IMAGE_ADDON)
# Additional include directories
- include_directories(${PNG_INCLUDE_DIR} ${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR})
+ include_directories("/usr/X11/include" ${PNG_INCLUDE_DIR} ${TIFF_INCLUDE_DIR} ${JPEG_INCLUDE_DIR})
# Generate the IoImageInit.c file.
# Argument SHOULD ALWAYS be the exact name of the addon, case is
diff --git a/Library/Formula/io.rb b/Library/Formula/io.rb
index d6cd7a4..d7d0b95 100644
--- a/Library/Formula/io.rb
+++ b/Library/Formula/io.rb
@@ -1,7 +1,7 @@
require 'formula'
class Io < Formula
- head 'https://github.com/stevedekorte/io.git'
+ head 'https://github.com/stevedekorte/io.git', :tag => 'e3908ce802a5d4fb56713610f5e1d62d6bf1f011'
homepage 'http://iolanguage.com/'
depends_on 'cmake' => :build
@@ -32,6 +32,19 @@ class Io < Formula
end
__END__
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a4cd440..e2d05eb 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -140,7 +140,7 @@ IF(WIN32 AND NOT CYGWIN)
+ ELSE(WIN32 AND NOT CYGWIN)
+ execute_process(COMMAND git rev-parse --short HEAD OUTPUT_VARIABLE IO_GIT_REV)
+ ENDIF(WIN32 AND NOT CYGWIN)
+-string(REGEX REPLACE "(.......)." "\\1" IO_GIT_REV ${IO_GIT_REV})
++string(REGEX REPLACE "(.......)." "\\1" IO_GIT_REV ${IO_GIT_REV} "" "")
+
+ SET(CPACK_PACKAGE_NAME ${PROJECT_NAME})
+ SET(CPACK_PACKAGE_VENDOR "iolanguage.com")
@danielfone
Copy link
Author

Have you done a brew update?

@foreverman
Copy link

Yes, I've done a brew update. Thanks for quick reply!

@danielfone
Copy link
Author

Can you do a brew install -vd io and see if you can checkout that commit yourself?

@ecin
Copy link

ecin commented Sep 25, 2011

Should be :commit => 'e3908ce802a5d4fb56713610f5e1d62d6bf1f011' instead of :tag =>. However, it still fails when trying to apply the diff:

Sora:build ecin$ brew upgrade io
==> Upgrading io
==> Cloning https://github.com/stevedekorte/io.git
Updating /Users/ecin/Library/Caches/Homebrew/io--git
==> Checking out commit e3908ce802a5d4fb56713610f5e1d62d6bf1f011
==> Patching
patching file CMakeLists.txt
Hunk #1 FAILED at 140.
1 out of 1 hunk FAILED -- saving rejects to file CMakeLists.txt.rej
patching file addons/Image/CMakeLists.txt
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 22 with fuzz 1.
Error: Failure while executing: /usr/bin/patch -f -p1 -i 001-homebrew.diff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment