Skip to content

Instantly share code, notes, and snippets.

@zbeekman
Last active January 31, 2016 03:41
Show Gist options
  • Save zbeekman/bbe7dd7a0eaee9061b9e to your computer and use it in GitHub Desktop.
Save zbeekman/bbe7dd7a0eaee9061b9e to your computer and use it in GitHub Desktop.
[Homebrew](http://brew.sh) formula for datetime-fortran.
class DatetimeFortran < Formula
desc "Fortran time and date manipulation library"
homepage "https://github.com/milancurcic/datetime-fortran"
url "https://github.com/milancurcic/datetime-fortran/archive/v1.4.0.tar.gz"
sha256 "e0fd02aa9ac1805d4779bf8fd9d8ae0c54d9964f07bc4a3a61181b6ae0d37d2e"
head do
url "https://github.com/milancurcic/datetime-fortran.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "pkg-config" => :build
end
depends_on :fortran
def install
system "autoreconf", "-fvi" if build.head?
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make"
system "make", "install"
(pkgshare/"test").install "src/tests/datetime_tests.f90"
end
test do
ENV.fortran
system ENV.fc, "-odatetime_test", "-ldatetime", "-I#{HOMEBREW_PREFIX}/include", pkgshare/"test/datetime_tests.f90"
system testpath/"datetime_test"
end
end
class DatetimeFortran < Formula
desc "Fortran time and date manipulation library"
homepage "https://github.com/milancurcic/datetime-fortran"
url "https://github.com/milancurcic/datetime-fortran/archive/v1.4.2.tar.gz"
sha256 "a164d377884828b43c01a46ebbc0e95f7549dd8ea198ee9868f3b9eddf3addf3"
head do
url "https://github.com/milancurcic/datetime-fortran.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "pkg-config" => :build
end
option "without-test", "Run build time tests"
depends_on :fortran
def install
system "autoreconf", "-fvi" if build.head?
system "./configure", "--prefix=#{prefix}",
"--disable-silent-rules"
system "make", "check" if build.with? "test"
system "make", "install"
(pkgshare/"test").install "src/tests/datetime_tests.f90"
end
test do
ENV.fortran
system ENV.fc, "-odatetime_test", "-ldatetime", "-I#{HOMEBREW_PREFIX}/include", pkgshare/"test/datetime_tests.f90"
system testpath/"datetime_test"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment