Skip to content

Commit

Permalink
Put Python major version in shebang
Browse files Browse the repository at this point in the history
This allows building for systems with both Python 2 and 3 without replacing the shebang. Replacing will only be necessary if env shall not be used e.g. as PyEnv might be present (see #435) or a specific minor version needs to be defined (i.e. there are multiple minor versions on the target system and blueman is not built for the newest one; we cannot use minor versions as they are not mandatory, see PEP 394).
  • Loading branch information
cschramm committed Mar 14, 2016
1 parent f2e34eb commit cd2a757
Show file tree
Hide file tree
Showing 13 changed files with 36 additions and 11 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,23 @@ Makefile
/config.status
/libtool
/stamp-h1
/apps/blueman-adapters
/apps/blueman-applet
/apps/blueman-assistant
/apps/blueman-manager
/apps/blueman-mechanism
/apps/blueman-report
/apps/blueman-rfcomm-watcher
/apps/blueman-sendto
/apps/blueman-services
/blueman/Constants.py
/blueman/plugins/mechanism/Rfcomm.py
/data/configs/blueman-applet.service
/data/configs/blueman-mechanism.service
/data/configs/org.blueman.Applet.service
/data/configs/org.blueman.Mechanism.service
/module/.deps
/module/_blueman.pyx
/po/POTFILES
/po/stamp-it

Expand Down
6 changes: 5 additions & 1 deletion apps/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ polkit_SCRIPTS = \

helpersdir = $(libexecdir)
helpers_SCRIPTS = blueman-rfcomm-watcher

ALL_APPS = $(APPS) $(polkit_SCRIPTS) $(helpers_SCRIPTS)

EXTRA_DIST = $(APPS) blueman-mechanism blueman-rfcomm-watcher
EXTRA_DIST = $(ALL_APPS) $(addsuffix .in, $(ALL_APPS))

CLEANFILES = $(ALL_APPS)
2 changes: 1 addition & 1 deletion apps/blueman-adapters → apps/blueman-adapters.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python@PYTHON_MAJOR_VERSION@
# coding=utf-8

from __future__ import print_function
Expand Down
2 changes: 1 addition & 1 deletion apps/blueman-applet → apps/blueman-applet.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python@PYTHON_MAJOR_VERSION@
# coding=utf-8

from __future__ import print_function
Expand Down
2 changes: 1 addition & 1 deletion apps/blueman-assistant → apps/blueman-assistant.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python@PYTHON_MAJOR_VERSION@
# coding=utf-8

from __future__ import print_function
Expand Down
2 changes: 1 addition & 1 deletion apps/blueman-manager → apps/blueman-manager.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#/usr/bin/env python@PYTHON_VERSION@
# coding=utf-8

from __future__ import print_function
Expand Down
2 changes: 1 addition & 1 deletion apps/blueman-mechanism → apps/blueman-mechanism.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python@PYTHON_MAJOR_VERSION@
# coding=utf-8

from __future__ import print_function
Expand Down
2 changes: 1 addition & 1 deletion apps/blueman-report → apps/blueman-report.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python@PYTHON_MAJOR_VERSION@
# coding=utf-8

from __future__ import print_function
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python@PYTHON_MAJOR_VERSION@
# coding=utf-8

from __future__ import print_function
Expand Down
2 changes: 1 addition & 1 deletion apps/blueman-sendto → apps/blueman-sendto.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python@PYTHON_MAJOR_VERSION@
# coding=utf-8

from __future__ import print_function
Expand Down
2 changes: 1 addition & 1 deletion apps/blueman-services → apps/blueman-services.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python@PYTHON_MAJOR_VERSION@
# coding=utf-8

from __future__ import print_function
Expand Down
11 changes: 11 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ AC_ENABLE_STATIC(no)
AM_PATH_PYTHON([2.7])
PYTHON_MAJOR_VERSION="$(echo ${PYTHON_VERSION} | cut -d . -f 1)"
PYTHON_MINOR_VERSION="$(echo ${PYTHON_VERSION} | cut -d . -f 2)"
AC_SUBST(PYTHON_MAJOR_VERSION)

if [test ${PYTHON_MAJOR_VERSION} -eq 3] && [test ${PYTHON_MINOR_VERSION} -lt 2];then
AC_MSG_ERROR([Unsupported Python 3 version found (>=3.2 required)])
Expand Down Expand Up @@ -198,6 +199,15 @@ GLIB_GSETTINGS

AC_OUTPUT([
Makefile
apps/blueman-adapters
apps/blueman-applet
apps/blueman-assistant
apps/blueman-manager
apps/blueman-mechanism
apps/blueman-report
apps/blueman-rfcomm-watcher
apps/blueman-sendto
apps/blueman-services
apps/Makefile
blueman/Makefile
blueman/Constants.py
Expand Down Expand Up @@ -259,6 +269,7 @@ data/configs/blueman-applet.service
data/configs/blueman-mechanism.service
data/configs/org.blueman.Applet.service
data/configs/org.blueman.Mechanism.service
module/_blueman.pyx
module/Makefile
po/Makefile.in
])
Expand Down
2 changes: 1 addition & 1 deletion module/_blueman.pyx → module/_blueman.pyx.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python@PYTHON_MAJOR_VERSION@
# coding=utf-8
from __future__ import print_function
from __future__ import division
Expand Down

0 comments on commit cd2a757

Please sign in to comment.