about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/opensfm/fix-scripts.patch
blob: 634820a3275580f5debc41459b98f54c0d3e6e27 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
diff --git a/bin/opensfm b/bin/opensfm
index b5ee4b15..f05c0d1c 100755
--- a/bin/opensfm
+++ b/bin/opensfm
@@ -1,12 +1,6 @@
-#!/bin/bash
+#!/usr/bin/env bash
 set -e
 
 DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
 
-if [ -x "$(command -v python3)" ]; then
-    PYTHON=python3
-else
-    PYTHON=python
-fi
-
-"$PYTHON" "$DIR"/opensfm_main.py "$@"
+exec "$DIR"/opensfm_main.py "$@"
diff --git a/bin/opensfm_main.py b/bin/opensfm_main.py
index 31249e12..cc71560c 100755
--- a/bin/opensfm_main.py
+++ b/bin/opensfm_main.py
@@ -1,3 +1,5 @@
+#!/usr/bin/env python
+
 import sys
 from os.path import abspath, join, dirname
 
diff --git a/setup.py b/setup.py
index 1120717f..438a16db 100644
--- a/setup.py
+++ b/setup.py
@@ -71,6 +71,7 @@ setuptools.setup(
     scripts=[
         "bin/opensfm_run_all",
         "bin/opensfm",
+        "bin/opensfm_main.py",
     ],
     package_data={
         "opensfm": [