2021-05-02 23:10:46 +08:00
|
|
|
require_relative "../require/macfuse"
|
|
|
|
|
|
|
|
|
|
class GocryptfsMac < Formula
|
|
|
|
|
desc "Encrypted overlay filesystem written in Go"
|
|
|
|
|
homepage "https://nuetzlich.net/gocryptfs/"
|
2021-07-17 12:36:34 +08:00
|
|
|
url "https://github.com/rfjakob/gocryptfs/releases/download/v2.0.1/gocryptfs_v2.0.1_src-deps.tar.gz"
|
|
|
|
|
sha256 "31be3f3a9400bd5eb8a4d5f86f7aee52a488207e12d312f2601ae08e7e26dd02"
|
2021-05-02 23:10:46 +08:00
|
|
|
license "MIT"
|
|
|
|
|
|
|
|
|
|
bottle do
|
2021-07-17 12:36:34 +08:00
|
|
|
root_url "https://github.com/gromgit/homebrew-fuse/releases/download/gocryptfs-mac-2.0.1"
|
2021-07-17 12:42:32 +08:00
|
|
|
sha256 cellar: :any, big_sur: "27ebed45ea3f76615889f61306ead4d8f718a569f9916b25a2961211ecadd521"
|
|
|
|
|
sha256 cellar: :any, catalina: "8795cf8f374a9177a6cdc57a80fb97438c23e18cf73b478f9a39b31112d12ff4"
|
2021-07-17 12:55:12 +08:00
|
|
|
sha256 cellar: :any, mojave: "6a638d16925bf127e42e462c7051969ea34d5abbff4a200bf9a2230aebb09a9a"
|
2021-05-02 23:10:46 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
depends_on "go" => :build
|
|
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
|
depends_on MacfuseRequirement
|
|
|
|
|
depends_on :macos
|
2021-05-03 15:10:45 +08:00
|
|
|
depends_on "openssl@1.1"
|
2021-05-02 23:10:46 +08:00
|
|
|
|
|
|
|
|
# Remove SOURCE_DATE_EPOCH support (requires GNU date)
|
|
|
|
|
patch :DATA
|
|
|
|
|
|
|
|
|
|
def install
|
2021-07-04 00:27:00 +08:00
|
|
|
setup_fuse
|
2021-05-02 23:10:46 +08:00
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
|
(buildpath/"src/github.com/rfjakob/gocryptfs").install buildpath.children
|
|
|
|
|
cd "src/github.com/rfjakob/gocryptfs" do
|
|
|
|
|
system "./build.bash"
|
|
|
|
|
bin.install "gocryptfs"
|
|
|
|
|
prefix.install_metafiles
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
test do
|
|
|
|
|
(testpath/"encdir").mkpath
|
|
|
|
|
pipe_output("#{bin}/gocryptfs -init #{testpath}/encdir", "password", 0)
|
|
|
|
|
assert_predicate testpath/"encdir/gocryptfs.conf", :exist?
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
__END__
|
|
|
|
|
diff --git a/build.bash b/build.bash
|
|
|
|
|
index b5a0c4d..11f2f4c 100755
|
|
|
|
|
--- a/build.bash
|
|
|
|
|
+++ b/build.bash
|
|
|
|
|
@@ -57,12 +57,6 @@ if [[ -z ${BUILDDATE:-} ]] ; then
|
|
|
|
|
BUILDDATE=$(date +%Y-%m-%d)
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
-# If SOURCE_DATE_EPOCH is set, it overrides BUILDDATE. This is the
|
|
|
|
|
-# standard environment variable for faking the date in reproducible builds.
|
|
|
|
|
-if [[ -n ${SOURCE_DATE_EPOCH:-} ]] ; then
|
|
|
|
|
- BUILDDATE=$(date --utc --date="@${SOURCE_DATE_EPOCH}" +%Y-%m-%d)
|
|
|
|
|
-fi
|
|
|
|
|
-
|
|
|
|
|
# Only set GOFLAGS if it is not already set by the user
|
|
|
|
|
if [[ -z ${GOFLAGS:-} ]] ; then
|
|
|
|
|
GOFLAGS=""
|