Skip to content

Commit

Permalink
require/macfuse: generate/use alt fuse.pc
Browse files Browse the repository at this point in the history
  • Loading branch information
gromgit committed Aug 17, 2021
1 parent b4c0a2c commit 534bfb0
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions require/macfuse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def fuse_cmake_args
-DCMAKE_INCLUDE_PATH=#{alt_fuse_root}/include/fuse;#{alt_fuse_root}/include
-DCMAKE_LIBRARY_PATH=#{alt_fuse_root}/lib
-DCMAKE_CXX_FLAGS=-I#{alt_fuse_root}/include/fuse\ -D_USE_FILE_OFFSET_BITS=64
-DPKG_CONFIG=#{fuse_pkgconfig}
-DPKG_CONFIG_EXECUTABLE=#{fuse_pkgconfig}
]
# -DPKG_CONFIG=#{fuse_pkgconfig}
# -DPKG_CONFIG_EXECUTABLE=#{fuse_pkgconfig}
# -DFUSE_INCLUDE_DIR=#{alt_fuse_root}/include/fuse
# -DFUSE_LIBRARIES=#{alt_fuse_root}/lib/libfuse.dylib
end
Expand All @@ -58,16 +58,25 @@ def setup_fuse_libs
end

def setup_fuse_pkgconfig
mkdir "#{alt_fuse_root}/bin" do
cp path/"../../lib/fuse-pkg-config", "."
inreplace "fuse-pkg-config", "%FUSE_ROOT%", "#{alt_fuse_root}"
### OLD METHOD: Fake pkg-config
# mkdir "#{alt_fuse_root}/bin" do
# cp path/"../../lib/fuse-pkg-config", "."
# inreplace "fuse-pkg-config", "%FUSE_ROOT%", "#{alt_fuse_root}"
# end
# ENV["PKG_CONFIG"] = "#{fuse_pkgconfig}"

### NEW METHOD: Fix fuse.pc in alt root
mkdir "#{alt_fuse_root}/lib/pkgconfig" do
cp "/usr/local/lib/pkgconfig/fuse.pc", "."
inreplace "fuse.pc", "/usr/local", alt_fuse_root.to_s
end
ENV.prepend_path "PKG_CONFIG_PATH", "#{alt_fuse_root}/lib/pkgconfig"
end

def fuse_pkgconfig
return "#{alt_fuse_root}/bin/fuse-pkg-config" if need_alt_fuse?
"pkg-config"
end
# def fuse_pkgconfig
# return "#{alt_fuse_root}/bin/fuse-pkg-config" if need_alt_fuse?
# "pkg-config"
# end

def setup_fuse_env
odebug "Setting up FUSE temp environment under #{alt_fuse_root}"
Expand All @@ -91,8 +100,8 @@ def setup_fuse_flags
ENV.append "CGO_CPPFLAGS", "-I#{alt_fuse_root}/include"
ENV.append "CGO_CPPFLAGS", "-D_USE_FILE_OFFSET_BITS=64"
ENV.append "CGO_LDFLAGS", "-L#{alt_fuse_root}/lib"
ENV["PKG_CONFIG"] = "#{fuse_pkgconfig}"
odebug "PKG_CONFIG = #{ENV["PKG_CONFIG"]}"
odebug "PKG_CONFIG_PATH = #{ENV["PKG_CONFIG_PATH"]}"
odebug "CFLAGS = #{ENV["CFLAGS"]}"
end

Expand Down

0 comments on commit 534bfb0

Please sign in to comment.