Skip to content

Commit 9a4a919

Browse files
committed
Moved scripts to Makefile. Updated node-filerix to include /usr/local/lib64/node_modules/filerix/filerix.node
1 parent 405badd commit 9a4a919

File tree

5 files changed

+48
-70
lines changed

5 files changed

+48
-70
lines changed

Makefile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
VCPKG_REPO = https://github.com/microsoft/vcpkg.git
2+
PREFIX ?= /usr/local
3+
4+
all: install
5+
6+
install: build
7+
@echo "Installing node-filerix..."
8+
cmake --install build --prefix=$(PREFIX) || { echo "Installation failed"; exit 1; }
9+
chrpath --delete ./build/filerix.node || echo "No RPATH to remove"
10+
@echo "Installation complete!"
11+
12+
build: check-vcpkg setup-vcpkg-port
13+
@echo "Bootstrapping vcpkg..."
14+
./vcpkg/bootstrap-vcpkg.sh || { echo "Failed to bootstrap vcpkg"; exit 1; }
15+
@echo "Installing dependencies with vcpkg..."
16+
./vcpkg/vcpkg --feature-flags=manifests install --triplet x64-linux-release || { echo "Failed to install dependencies"; exit 1; }
17+
@echo "Generating build files with CMake..."
18+
mkdir -p build && cd build && cmake .. || { echo "Failed to generate CMake build files"; exit 1; }
19+
@echo "Building the project..."
20+
cmake --build build --parallel || { echo "Build failed"; exit 1; }
21+
@echo "Build complete!"
22+
23+
setup-vcpkg-port:
24+
@if [ ! -d "./vcpkg/ports/filerix" ]; then \
25+
echo "Downloading filerix vcpkg port..."; \
26+
git clone --recurse-submodules https://github.com/filesverse/vcpkg-port.git vcpkg-port || { echo "Failed to download filerix vcpkg port"; exit 1; }; \
27+
echo "Copying filerix vcpkg port..."; \
28+
mv ./vcpkg-port ./vcpkg/ports/filerix || { echo "Failed to copy filerix vcpkg port"; exit 1; }; \
29+
fi
30+
31+
check-vcpkg:
32+
@if [ ! -d "./vcpkg" ] || [ -z "$$(ls -A ./vcpkg 2>/dev/null)" ]; then \
33+
echo "vcpkg is missing or empty. Cloning vcpkg..."; \
34+
git clone $(VCPKG_REPO) vcpkg || { echo "Failed to clone vcpkg"; exit 1; }; \
35+
fi
36+
37+
uninstall:
38+
@echo "Removing installed files..."
39+
rm -f $(PREFIX)/lib64/node_modules/filerix.node
40+
@echo "Uninstallation complete!"
41+
42+
clean:
43+
@echo "Cleaning build directory..."
44+
rm -rf build vcpkg_installed vcpkg-port
45+
@echo "Clean complete!"
46+
47+
.PHONY: all install build uninstall clean

scripts/build.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

scripts/install.sh

Lines changed: 0 additions & 39 deletions
This file was deleted.

scripts/uninstall.sh

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/lib/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const require = createRequire(import.meta.url);
55

66
const possiblePaths = [
77
"/usr/local/lib/node_modules/filerix/filerix.node",
8+
"/usr/local/lib64/node_modules/filerix/filerix.node",
89
"/usr/lib/node_modules/filerix/filerix.node",
910
"/usr/lib64/node_modules/filerix/filerix.node"
1011
];

0 commit comments

Comments
 (0)