Index: Portfile
===================================================================
--- Portfile	(revision 141246)
+++ Portfile	(working copy)
@@ -10,16 +10,22 @@
 revision                8
 categories              science
 platforms               darwin
+license                 Restrictive
+# http://alps.comp-phys.org/static/software/ALPS/LICENSE.txt/
 maintainers             gmail.com:gamperl
 
-description             Parallel Algorithms for Lattice Models
+description             Algorithms and Libraries for Physics Simulations
 
-long_description        Libraries for generic parallel algorithms for \
-                        classical and quantum lattice models
+long_description        The ALPS project (Algorithms and Libraries for Physics Simulations) is an \
+                        open-source effort aiming at providing high-end simulation codes for strongly \
+                        correlated quantum mechanical systems as well as C++ libraries for simplifying \
+                        the development of such code. ALPS strives to increase software reuse in the \
+                        physics community.
 
 homepage                http://alps.comp-phys.org/
 master_sites            ${homepage}static/software/releases
 distname                ${name}-${version}-r6176-src-with-boost
+#worksrcdir              ${distname}/alps
 
 checksums               rmd160 f2ab3938a364a026be8557406427521901091a51                             \
                         sha256 554841986ad5a9d5d5a89941e5665c249fe1b8eba537078001bb6c5c21a1f335
@@ -29,7 +35,8 @@
 # alps has its own internal boost it wants to use, and fails if MacPorts' newer boost is active.
 conflicts_build         boost
 
-patchfiles              patch-CMakeLists.txt.diff
+patchfiles              patch-CMakeLists.txt.diff \
+                        patch-config-FindLapack.cmake.diff
 
 configure.args-delete   -DCMAKE_SYSTEM_PREFIX_PATH=\"${prefix}\;/usr\"
 configure.args-append   -DCMAKE_SYSTEM_PREFIX_PATH=\"/usr\;${prefix}\"                              \
@@ -39,11 +46,19 @@
                         -DALPS_BOOST_LIBRARY_NAME=alps-boost                                        \
                         -DALPS_BUILD_APPLICATIONS=OFF                                               \
                         -DALPS_ENABLE_MPI=OFF                                                       \
-                        ./alps
+                        -DHDF5_dl_LIBRARY_DEBUG=NO                                                  \
+                        -DHDF5_hdf5_LIBRARY_DEBUG=NO                                                \
+                        -DHDF5_hdf5_hl_LIBRARY_DEBUG=NO                                             \
+                        -DHDF5_m_LIBRARY_DEBUG=NO                                                   \
+                        -DHDF5_z_LIBRARY_DEBUG=NO
 
+# make sure this comes after further options that the cmake portgroup adds, to specify directory correctly,
+# overwrite the default setting to worksrcpath.
+configure.post_args    ./alps
+
 use_parallel_build      yes
 
-variant applications    description {compile ALPS with appliations} {
+variant applications    description {compile ALPS with applications} {
     # alps/applications/dmrg/dmrg/dmrg.h:610:49: error: expected expression
     #     std::string name = simplify_name(it->get<1>());
     #                                                 ^
@@ -52,6 +67,7 @@
     configure.args-delete -DALPS_BUILD_APPLICATIONS=OFF
 }
 
+# why not mpich also as a variant?
 variant openmpi         description {Build with MPI support} {
     depends_lib-append  port:openmpi
     
Index: files/patch-CMakeLists.txt.diff
===================================================================
--- files/patch-CMakeLists.txt.diff	(revision 141246)
+++ files/patch-CMakeLists.txt.diff	(working copy)
@@ -1,5 +1,5 @@
---- alps/CMakeLists.txt.orig	2012-05-30 23:49:50.000000000 +0200
-+++ alps/CMakeLists.txt	2013-07-22 11:07:16.000000000 +0200
+--- alps/CMakeLists.txt.orig	2015-10-13 12:32:28.000000000 -0400
++++ alps/CMakeLists.txt	2015-10-13 12:32:46.000000000 -0400
 @@ -107,7 +107,7 @@
  
  #maintenance building options
@@ -9,3 +9,12 @@
  #include (CMakeDetermineFortranCompiler)
  #message (STATUS "Fortran compiler: ${CMAKE_Fortran_COMPILER}")
  #include (CMakeTestFortranCompiler)
+@@ -318,7 +318,7 @@
+   ENDIF(NOT WIN32)
+ endif (NOT ALPS_FOR_VISTRAILS)
+ if(MAC_VECLIB)
+-  set(LAPACK_LDFLAGS "-framework vecLib")
++  set(LAPACK_LDFLAGS "-framework Accelerate")
+ endif(MAC_VECLIB) 
+ set(LAPACK_LINKER_FLAGS ${LAPACK_LDFLAGS})
+ 
Index: files/patch-config-FindLapack.cmake.diff
===================================================================
--- files/patch-config-FindLapack.cmake.diff	(nonexistent)
+++ files/patch-config-FindLapack.cmake.diff	(working copy)
@@ -0,0 +1,11 @@
+--- alps/config/FindLapack.cmake.orig	2015-10-13 12:54:11.000000000 -0400
++++ alps/config/FindLapack.cmake	2015-10-13 12:54:42.000000000 -0400
+@@ -108,7 +108,7 @@
+ 
+ IF(NOT HAVE_MKL)
+   IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+-    SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -framework vecLib")
++    SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -framework Accelerate")
+     SET(LAPACK_LIBRARY_INIT 1)
+     SET(MAC_VECLIB 1 CACHE BOOL "use Mac Framework")
+     SET(LAPACK_LIBRARY "")
