From 9feca681ef1fa3154c565669c334da48dfb54e15 Mon Sep 17 00:00:00 2001 From: autoantwort <41973254+autoantwort@users.noreply.github.com> Date: Wed, 1 Jun 2022 00:12:09 +0200 Subject: [PATCH] [openmvs] no absolute paths (#24848) --- ports/openmvs/fix-build.patch | 17 ----------------- ports/openmvs/no-absolute-paths.patch | 24 ++++++++++++++++++++++++ ports/openmvs/portfile.cmake | 1 + ports/openmvs/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/o-/openmvs.json | 5 +++++ 6 files changed, 32 insertions(+), 19 deletions(-) create mode 100644 ports/openmvs/no-absolute-paths.patch diff --git a/ports/openmvs/fix-build.patch b/ports/openmvs/fix-build.patch index 48f62ae0a9..f40ec26f48 100644 --- a/ports/openmvs/fix-build.patch +++ b/ports/openmvs/fix-build.patch @@ -107,23 +107,6 @@ rename to MvgMvsPipeline.py.in index f4914bf..23d03e6 100644 --- a/MvgMvsPipeline.py +++ b/MvgMvsPipeline.py.in -@@ -91,12 +91,12 @@ def find(afile): - - - # Try to find openMVG and openMVS binaries in PATH --OPENMVG_BIN = whereis("openMVG_main_SfMInit_ImageListing") --OPENMVS_BIN = whereis("ReconstructMesh") -+OPENMVG_BIN = "@OPENMVG_TOOLS_PATH@" -+OPENMVS_BIN = "@OPENMVS_TOOLS_PATH@" - - # Try to find openMVG camera sensor database --CAMERA_SENSOR_DB_FILE = "sensor_width_camera_database.txt" --CAMERA_SENSOR_DB_DIRECTORY = find(CAMERA_SENSOR_DB_FILE) -+CAMERA_SENSOR_DB_FILE = "@SENSOR_WIDTH_CAMERA_DATABASE_TXT_PATH@" -+CAMERA_SENSOR_DB_DIRECTORY = "@OPENMVG_TOOLS_PATH@" - - # Ask user for openMVG and openMVS directories if not found - if not OPENMVG_BIN: @@ -175,10 +175,10 @@ class StepsStore: ["-i", "%input_dir%", "-o", "%matches_dir%", "-d", "%camera_file_params%"]], ["Compute features", # 1 diff --git a/ports/openmvs/no-absolute-paths.patch b/ports/openmvs/no-absolute-paths.patch new file mode 100644 index 0000000000..0eda537708 --- /dev/null +++ b/ports/openmvs/no-absolute-paths.patch @@ -0,0 +1,24 @@ +diff --git a/MvgMvsPipeline.py.in b/MvgMvsPipeline.py.in +index 04433f4..e1beaf6 100644 +--- a/MvgMvsPipeline.py.in ++++ b/MvgMvsPipeline.py.in +@@ -95,14 +95,14 @@ def find(afile): + return d + return None + +- ++current_dir = os.path.dirname(os.path.abspath(__file__)) + # Try to find openMVG and openMVS binaries in PATH +-OPENMVG_BIN = whereis("openMVG_main_SfMInit_ImageListing") +-OPENMVS_BIN = whereis("ReconstructMesh") ++OPENMVG_BIN = os.path.join(current_dir, '..', 'openmvg') ++OPENMVS_BIN = current_dir + + # Try to find openMVG camera sensor database +-CAMERA_SENSOR_DB_FILE = "sensor_width_camera_database.txt" +-CAMERA_SENSOR_DB_DIRECTORY = find(CAMERA_SENSOR_DB_FILE) ++CAMERA_SENSOR_DB_FILE = os.path.join(OPENMVG_BIN, 'sensor_width_camera_database.txt') ++CAMERA_SENSOR_DB_DIRECTORY = OPENMVS_BIN + + # Ask user for openMVG and openMVS directories if not found + if not OPENMVG_BIN: diff --git a/ports/openmvs/portfile.cmake b/ports/openmvs/portfile.cmake index f7232ee1be..ac41210625 100644 --- a/ports/openmvs/portfile.cmake +++ b/ports/openmvs/portfile.cmake @@ -9,6 +9,7 @@ vcpkg_from_github( PATCHES fix-build.patch fix-build-boost-1_77_0.patch + no-absolute-paths.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/openmvs/vcpkg.json b/ports/openmvs/vcpkg.json index 14a8c3e63e..1f1fc66a10 100644 --- a/ports/openmvs/vcpkg.json +++ b/ports/openmvs/vcpkg.json @@ -1,7 +1,7 @@ { "name": "openmvs", "version": "1.1.1", - "port-version": 2, + "port-version": 3, "description": "OpenMVS: open Multi-View Stereo reconstruction library", "homepage": "https://cdcseacave.github.io/openMVS", "dependencies": [ diff --git a/versions/baseline.json b/versions/baseline.json index 7327cec2fc..0c0da027ff 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5174,7 +5174,7 @@ }, "openmvs": { "baseline": "1.1.1", - "port-version": 2 + "port-version": 3 }, "openni2": { "baseline": "2.2.0.33", diff --git a/versions/o-/openmvs.json b/versions/o-/openmvs.json index 2288252129..883764f139 100644 --- a/versions/o-/openmvs.json +++ b/versions/o-/openmvs.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "b6123f8755c140325b2800c51c6c68e3fb51c668", + "version": "1.1.1", + "port-version": 3 + }, { "git-tree": "a66ad18d59e5ffdd21f5bc1cae0b195ba35aba18", "version": "1.1.1",