diff --git a/bin/mangohud-setup.sh b/bin/mangohud-setup.sh index d8bbfbbc..465b2934 100755 --- a/bin/mangohud-setup.sh +++ b/bin/mangohud-setup.sh @@ -1,12 +1,12 @@ install() { - [ "$UID" -eq 0 ] || exec sudo bash "$0" "$@" - tar -C / -xf MangoHud*.tar + [ "$UID" -eq 0 ] || exec sudo bash "$0" install + tar -C / -xvf MangoHud-package.tar ldconfig echo "MangoHud Installed" } uninstall() { - [ "$UID" -eq 0 ] || exec sudo bash "$0" "$@" + [ "$UID" -eq 0 ] || exec sudo bash "$0" uninstall rm -rfv "/usr/lib/MangoHud" rm -fv "/usr/share/vulkan/implicit_layer.d/mangohud.json" rm -fv "/etc/ld.so.conf.d/libmangohud.conf" diff --git a/bin/run-mangohud-gl-pkg.sh b/bin/run-mangohud-gl-pkg.sh index e8f61e22..b8702593 100755 --- a/bin/run-mangohud-gl-pkg.sh +++ b/bin/run-mangohud-gl-pkg.sh @@ -17,4 +17,4 @@ fi # pass through the overriden LD_PRELOAD environment variables LD_PRELOAD="${LD_PRELOAD}:${MANGOHUD_LIB_NAME}" -exec env MANGOHUD="1" LD_PRELOAD="${LD_PRELOAD}" "$@" +exec env MANGOHUD=1 LD_PRELOAD="${LD_PRELOAD}" "$@" diff --git a/build.sh b/build.sh index 31452cf5..e9331c47 100755 --- a/build.sh +++ b/build.sh @@ -139,31 +139,34 @@ package() { mkdir -p "$INSTALL_DIR/usr/lib/MangoHud/"{lib32,lib64} mkdir -p "$INSTALL_DIR/usr/share/vulkan/implicit_layer.d" mkdir -p "$INSTALL_DIR/etc/ld.so.conf.d" - + cp libmangohud.conf "$INSTALL_DIR/etc/ld.so.conf.d/libmangohud.conf" cp "$LIB" "$INSTALL_DIR/usr/lib/MangoHud/lib64/libMangoHud.so" cp "$LIB32" "$INSTALL_DIR/usr/lib/MangoHud/lib32/libMangoHud.so" cp "$LAYER" "$INSTALL_DIR/usr/share/vulkan/implicit_layer.d/" cp --preserve=mode "build/release/usr/bin/mangohud" "$INSTALL_DIR/usr/bin/mangohud" - tar -C build/package -cf "build/MangoHud-package.tar" . + tar --numeric-owner --owner=0 --group=0 \ + -C build/package -cvf "build/MangoHud-package.tar" . } release() { rm build/MangoHud-package.tar mkdir -p build/MangoHud package - cp bin/mangohud-setup.sh build/MangoHud/mangohud-setup.sh + cp --preserve=mode bin/mangohud-setup.sh build/MangoHud/mangohud-setup.sh cp build/MangoHud-package.tar build/MangoHud/MangoHud-package.tar - cd build/ - tar -czvf MangoHud-$VERSION.tar.gz MangoHud - cd .. + tar --numeric-owner --owner=0 --group=0 \ + -C build -czvf build/MangoHud-$VERSION.tar.gz MangoHud } install() { - package - [ "$UID" -eq 0 ] || exec sudo bash "$0" "$@" - tar -C / -xf build/MangoHud*.tar + if [[ ! -f build/MangoHud-package.tar ]]; then + echo No package found. Run \"$0 package\". + exit 1 + fi + [ "$UID" -eq 0 ] || exec sudo bash "$0" install + tar -C / -xvf build/MangoHud-package.tar ldconfig echo "MangoHud Installed" } @@ -173,7 +176,7 @@ clean() { } uninstall() { - [ "$UID" -eq 0 ] || exec sudo bash "$0" "$@" + [ "$UID" -eq 0 ] || exec sudo bash "$0" uninstall rm -rfv "/usr/lib/MangoHud" rm -fv "/usr/share/vulkan/implicit_layer.d/mangohud.json" rm -fv "/etc/ld.so.conf.d/libmangohud.conf" diff --git a/src/meson.build b/src/meson.build index 3a23a7ba..d156d9e0 100644 --- a/src/meson.build +++ b/src/meson.build @@ -96,4 +96,4 @@ install_data( install_dir : get_option('bindir'), install_mode: 'rwxr-xr-x', rename : ['mangohud'] -) \ No newline at end of file +)