aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/aspcud.rb
diff options
context:
space:
mode:
authorAnil Madhavapeddy2014-01-21 10:49:53 +0000
committerMike McQuaid2014-01-29 15:57:18 +0100
commit149e049c8e5d6fdb30178d788d97757865ca778d (patch)
tree1d8120f107cbe0ccfdf5166208c0e578fb62e6c1 /Library/Formula/aspcud.rb
parenteecbe89a51c243da7f2e0145bccda3a69ef9f6d4 (diff)
downloadhomebrew-149e049c8e5d6fdb30178d788d97757865ca778d.tar.bz2
aspcud 1.8.0 (new formula)
Closes #26070. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula/aspcud.rb')
-rw-r--r--Library/Formula/aspcud.rb78
1 files changed, 78 insertions, 0 deletions
diff --git a/Library/Formula/aspcud.rb b/Library/Formula/aspcud.rb
new file mode 100644
index 000000000..42582da28
--- /dev/null
+++ b/Library/Formula/aspcud.rb
@@ -0,0 +1,78 @@
+require 'formula'
+
+class Aspcud < Formula
+ homepage 'http://potassco.sourceforge.net/'
+ url 'http://downloads.sourceforge.net/project/potassco/aspcud/1.8.0/aspcud-1.8.0-source.tar.gz'
+ sha1 '8e05dca2bcf3a388a985317b71f2fcd5586351f7'
+
+ depends_on 'boost' => :build
+ depends_on 'cmake' => :build
+ depends_on 're2c' => :build
+ depends_on 'gringo'
+ depends_on 'clasp'
+
+ def patches; DATA; end
+
+ def install
+ system "make"
+ inreplace "scripts/aspcud.sh", "$base/encodings", "#{share}/encodings"
+ bin.install "build/release/bin/cudf2lp"
+ bin.install "scripts/aspcud.sh" => "aspcud"
+ share.install "scripts/encodings"
+ end
+end
+
+__END__
+FreeBSD SVN: http://svnweb.freebsd.org/ports/head/math/aspcud/files/patch-libcudf-src-dependency.cpp?revision=339367
+--- a/libcudf/src/dependency.cpp.orig 2014-01-10 15:13:07.000000000 +0000
++++ b/libcudf/src/dependency.cpp 2014-01-10 15:29:32.000000000 +0000
+@@ -49,6 +49,7 @@
+ struct CudfPackageRefFilter
+ {
+ CudfPackageRefFilter(const Cudf::PackageRef &ref) : ref(ref) { }
++ CudfPackageRefFilter &operator = (const CudfPackageRefFilter &t) { return *this; }
+ bool operator()(const Entity *entity)
+ {
+ switch(ref.op)
+--- a/scripts/aspcud.sh.orig 2014-01-10 09:34:53.000000000 +0000
++++ b/scripts/aspcud.sh 2014-01-12 00:02:07.000000000 +0000
+@@ -60,7 +62,20 @@
+ echo
+ }
+
+-base="$(dirname "$(readlink -f "$0")")"
++# solve the missing `readlink -f` option on OSX
++canonical_readlink()
++{
++ cd `dirname $1`;
++ __filename=`basename $1`;
++ if [ -h "$__filename" ]; then
++ canonical_readlink `readlink $__filename`;
++ else
++ echo "`pwd -P`/$__filename";
++ fi
++}
++
++
++base=$(canonical_readlink $0)
+
+ # default options
+ clasp_opts_def=( "--opt-heu=1" "--sat-prepro" "--restarts=L,128" "--heuristic=VSIDS" "--opt-hierarch=1" "--local-restarts" "--del-max=200000,250" "--save-progress=0" )
+@@ -125,8 +125,16 @@
+ [[ ${#gringo_opts[*]} -eq 0 ]] && gringo_opts=( "${gringo_opts_def[@]}" )
+ clasp_opts=( "${clasp_opts[@]}" "${clasp_opts_implicit[@]}" )
+
++trendycriterion="-count(removed),-notuptodate(solution),-unsat_recommends(solution),-count(new)"
++
++if [[ $3 == trendy ]]; then
++ criterion=$trendycriterion;
++else
++ criterion=`echo $3 | sed -E -e 's/([+-])(new|removed|changed)/\1count(\2)/g' -e 's/([+-])(notuptodate|unsat_recommends)([^(]|$)/\1\2(solution)\3/g' -e 's/([+-])sum(([a-z]*))/\1sum(\2,solution)/g'`
++fi
++
+ if [[ $# -eq 3 ]]; then
+- cudf_opts=( "${cudf_opts[@]}" "-c" "$3" )
++ cudf_opts=( "${cudf_opts[@]}" "-c" "$criterion" )
+ elif echo $(basename "$0") | grep -q "paranoid"; then
+ [[ $# -ne 2 ]] && { die "error: exactly two arguments expected"; }
+ cudf_opts=( "${cudf_opts[@]}" "-c" "paranoid" )