@@ -16,18 +16,50 @@ class RofsFilteredMac < Formula
16
16
end
17
17
18
18
depends_on "cmake" => :build
19
+ depends_on "pkgconf" => :build
19
20
depends_on MacfuseRequirement
20
21
depends_on :macos
21
22
23
+ # Use pkgconfig to find FUSE
24
+ patch :DATA
25
+
22
26
def install
23
27
setup_fuse
24
- mkdir "build" do
25
- system "cmake" , ".." , "-DCMAKE_INSTALL_SYSCONFDIR=#{ etc } " , *fuse_cmake_args , *std_cmake_args
26
- system "make" , "install"
27
- end
28
+ system "cmake" , "-S" , "." , "-B" , "build" ,
29
+ "-DCMAKE_INSTALL_SYSCONFDIR=#{ etc } " ,
30
+ *fuse_cmake_args , *std_cmake_args
31
+ system "cmake" , "--build" , "build"
32
+ system "cmake" , "--install" , "build"
28
33
end
29
34
30
35
test do
31
36
system "#{ bin } /rofs-filtered" , "--version"
32
37
end
33
38
end
39
+ __END__
40
+ diff --git a/CMakeLists.txt b/CMakeLists.txt
41
+ index 53a6687..cb4f121 100644
42
+ --- a/CMakeLists.txt
43
+ +++ b/CMakeLists.txt
44
+ @@ -12,8 +12,8 @@ add_definitions(-D_GNU_SOURCE)
45
+ set(CMAKE_C_FLAGS "-Wall -std=c99")
46
+
47
+ # find fuse library
48
+ -find_package (FUSE REQUIRED)
49
+ -include_directories (${FUSE_INCLUDE_DIR})
50
+ +find_package(PkgConfig REQUIRED)
51
+ +pkg_check_modules(FUSE fuse REQUIRED)
52
+ add_definitions(-D_FILE_OFFSET_BITS=64)
53
+
54
+ # generate config file
55
+ @@ -24,7 +24,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
56
+
57
+ # create and configure targets
58
+ add_executable(rofs-filtered rofs-filtered.c)
59
+ -target_link_libraries(rofs-filtered ${FUSE_LIBRARIES})
60
+ +target_include_directories(rofs-filtered PUBLIC ${FUSE_INCLUDE_DIRS})
61
+ +target_link_libraries(rofs-filtered PUBLIC ${LIBS} ${FUSE_LDFLAGS})
62
+ +target_compile_options(rofs-filtered PUBLIC ${FUSE_CFLAGS})
63
+
64
+ # configure installation
65
+ install(TARGETS rofs-filtered DESTINATION ${CMAKE_INSTALL_BINDIR})
0 commit comments