public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-staging/EdkRepo] [PATCH 0/2] Add documentation for EdkRepo on macOS
@ 2020-04-07  0:39 Nate DeSimone
  2020-04-07  0:39 ` [edk2-staging/EdkRepo] [PATCH 1/2] EdkRepo: Add setup_git_pyenv_mac.sh Nate DeSimone
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nate DeSimone @ 2020-04-07  0:39 UTC (permalink / raw)
  To: devel

This patch series add setup instructions and scripts for macOS and
update the recommended versions for Git and Pyenv.

Nate DeSimone (2):
  EdkRepo: Add setup_git_pyenv_mac.sh
  EdkRepo: Update README.md

 README.md                                     |  81 +++++++++++-
 .../mac-scripts/setup_git_pyenv_mac.sh        | 118 ++++++++++++++++++
 2 files changed, 194 insertions(+), 5 deletions(-)
 create mode 100755 edkrepo_installer/mac-scripts/setup_git_pyenv_mac.sh

--
2.25.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [edk2-staging/EdkRepo] [PATCH 1/2] EdkRepo: Add setup_git_pyenv_mac.sh
  2020-04-07  0:39 [edk2-staging/EdkRepo] [PATCH 0/2] Add documentation for EdkRepo on macOS Nate DeSimone
@ 2020-04-07  0:39 ` Nate DeSimone
  2020-04-08 20:29   ` [edk2-devel] " Ashley E Desimone
  2020-04-07  0:39 ` [edk2-staging/EdkRepo] [PATCH 2/2] EdkRepo: Update README.md Nate DeSimone
  2020-04-08 20:28 ` [edk2-devel] [edk2-staging/EdkRepo] [PATCH 0/2] Add documentation for EdkRepo on macOS Ashley E Desimone
  2 siblings, 1 reply; 6+ messages in thread
From: Nate DeSimone @ 2020-04-07  0:39 UTC (permalink / raw)
  To: devel
  Cc: Puja Pandya, Erik Bjorge, Prince Agyeman, Bret Barkelew,
	Philippe Mathieu-Daude

Script to configure pyenv and git for use on macOS.

Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Philippe Mathieu-Daude <philmd@redhat.com>
---
 .../mac-scripts/setup_git_pyenv_mac.sh        | 118 ++++++++++++++++++
 1 file changed, 118 insertions(+)
 create mode 100755 edkrepo_installer/mac-scripts/setup_git_pyenv_mac.sh

diff --git a/edkrepo_installer/mac-scripts/setup_git_pyenv_mac.sh b/edkrepo_installer/mac-scripts/setup_git_pyenv_mac.sh
new file mode 100755
index 0000000..34083d1
--- /dev/null
+++ b/edkrepo_installer/mac-scripts/setup_git_pyenv_mac.sh
@@ -0,0 +1,118 @@
+#!/usr/bin/env bash
+#
+## @file setup_git_pyenv_mac.sh
+#
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+IFS='' read -r -d '' python_script <<"EOF"
+import os
+import re
+import subprocess
+import sys
+import traceback
+
+profile_source_regex = re.compile(r"source\s+~/\.bashrc")
+profile_source_regex2 = re.compile(r".\s+~/\.bashrc")
+
+ls_alias_regex = re.compile(r"alias\s+ls='ls\s+-G'")
+bash_completion_regex = re.compile(r"\[\[\s+-r\s+\"/usr/local/etc/profile.d/bash_completion.sh\"\s+\]\]\s+&&\s+.\s+\"/usr/local/etc/profile.d/bash_completion.sh\"")
+zsh_autoload_compinit_regex = re.compile(r"autoload\s+-U\s+compinit")
+zsh_autoload_bashcompinit_regex = re.compile(r"autoload\s+-U\s+bashcompinit")
+zsh_autoload_colors_regex = re.compile(r"autoload\s+-U\s+colors")
+zsh_colors_regex = re.compile(r"\n\s*colors\n")
+zsh_compinit_regex = re.compile(r"compinit\s+-u")
+zsh_bashcompinit_regex = re.compile(r"\n\s*bashcompinit\n")
+pyenv_init_regex = re.compile(r"eval\s+\"\$\(pyenv\s+init\s+-\)\"")
+
+ls_alias = "alias ls='ls -G'"
+bash_completion = '[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"'
+
+zsh_autoload_compinit = 'autoload -U compinit'
+zsh_autoload_bashcompinit = 'autoload -U bashcompinit'
+zsh_autoload_colors = 'autoload -U colors'
+zsh_colors = 'colors'
+zsh_compinit = 'compinit -u'
+zsh_bashcompinit = 'bashcompinit'
+
+pyenv_init = '''
+# Use the pyenv intalled Python interperter
+if command -v pyenv 1>/dev/null 2>&1; then
+  eval "$(pyenv init -)"
+fi
+'''
+
+def add_command_to_startup_script(script_file, regex, command):
+    script = ''
+    if os.path.isfile(script_file):
+        with open(script_file, 'r') as f:
+            script = f.read().strip()
+    data = regex.search(script)
+    if not data:
+        if script == '':
+            script = command
+        else:
+            script = '{}\n{}'.format(script, command)
+        with open(script_file, 'w') as f:
+            f.write(script)
+
+def main():
+    home_dir = os.path.expanduser('~')
+
+    # Add "source ~/.bashrc" to ~/.bash_profile if it does not have it already
+    bash_profile_file = os.path.join(home_dir, '.bash_profile')
+    bash_profile = ''
+    if os.path.isfile(bash_profile_file):
+        with open(bash_profile_file, 'r') as f:
+            bash_profile = f.read().strip()
+    data = profile_source_regex.search(bash_profile)
+    if not data:
+        data = profile_source_regex2.search(bash_profile)
+        if not data:
+            if bash_profile == '':
+                bash_profile = 'source ~/.bashrc\n'
+            else:
+                bash_profile = '{}\nsource ~/.bashrc\n'.format(bash_profile)
+            with open(bash_profile_file, 'w') as f:
+                f.write(bash_profile)
+
+    # Add pyenv configuration to ~/.bashrc if it does not have it already
+    bash_rc_file = os.path.join(home_dir, '.bashrc')
+    add_command_to_startup_script(bash_rc_file, ls_alias_regex, ls_alias)
+    add_command_to_startup_script(bash_rc_file, bash_completion_regex, bash_completion)
+    add_command_to_startup_script(bash_rc_file, pyenv_init_regex, pyenv_init)
+    zsh_rc_file = os.path.join(home_dir, '.zshrc')
+    add_command_to_startup_script(zsh_rc_file, ls_alias_regex, ls_alias)
+    add_command_to_startup_script(zsh_rc_file, zsh_autoload_compinit_regex, zsh_autoload_compinit)
+    add_command_to_startup_script(zsh_rc_file, zsh_autoload_bashcompinit_regex, zsh_autoload_bashcompinit)
+    add_command_to_startup_script(zsh_rc_file, zsh_autoload_colors_regex, zsh_autoload_colors)
+    add_command_to_startup_script(zsh_rc_file, zsh_colors_regex, zsh_colors)
+    add_command_to_startup_script(zsh_rc_file, zsh_compinit_regex, zsh_compinit)
+    add_command_to_startup_script(zsh_rc_file, zsh_bashcompinit_regex, zsh_bashcompinit)
+    add_command_to_startup_script(zsh_rc_file, bash_completion_regex, bash_completion)
+    add_command_to_startup_script(zsh_rc_file, pyenv_init_regex, pyenv_init)
+
+    print('Pyenv configured successfully')
+    return 0
+
+if __name__ == '__main__':
+    ret_val = 255
+    try:
+        ret_val = main()
+    except Exception:
+        print('Unhandled Exception...')
+        traceback.print_exc()
+
+    sys.exit(ret_val)
+EOF
+
+# On Catalina and later python3 is preferred,
+# however it is not packaged by Apple on earlier OSes
+if [ -x "$(command -v python3)" ]; then
+    python3 -c "$python_script"
+    exit $?
+else
+    python -c "$python_script"
+    exit $?
+fi
--
2.25.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [edk2-staging/EdkRepo] [PATCH 2/2] EdkRepo: Update README.md
  2020-04-07  0:39 [edk2-staging/EdkRepo] [PATCH 0/2] Add documentation for EdkRepo on macOS Nate DeSimone
  2020-04-07  0:39 ` [edk2-staging/EdkRepo] [PATCH 1/2] EdkRepo: Add setup_git_pyenv_mac.sh Nate DeSimone
@ 2020-04-07  0:39 ` Nate DeSimone
  2020-04-08 20:30   ` [edk2-devel] " Ashley E Desimone
  2020-04-08 20:28 ` [edk2-devel] [edk2-staging/EdkRepo] [PATCH 0/2] Add documentation for EdkRepo on macOS Ashley E Desimone
  2 siblings, 1 reply; 6+ messages in thread
From: Nate DeSimone @ 2020-04-07  0:39 UTC (permalink / raw)
  To: devel
  Cc: Puja Pandya, Erik Bjorge, Prince Agyeman, Bret Barkelew,
	Philippe Mathieu-Daude

- Added installation instructions for macOS
- Updated recommended versions of Git and Python

Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Philippe Mathieu-Daude <philmd@redhat.com>
---
 README.md | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 76 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 1fbb698..9b02e4c 100644
--- a/README.md
+++ b/README.md
@@ -47,25 +47,96 @@ To build a EdkRepo distribution tarball, the Python wheel package is required in
 2. `./build_linux_installer.py`

 ### Install From Source
-To install from source, one must have installedd using the tarball method above at least once in order to setup the EdkRepo configuration files. One this is done, one may use the standard distutils method to install EdkRepo from source:
+To install from source, one must have installed using the tarball method above at least once in order to setup the EdkRepo configuration files. One this is done, one may use the standard distutils method to install EdkRepo from source:

 `./setup.py install`

+## macOS Instructions
+
+### Install Pre-Requisites
+
+#### 1. Install the Xcode Command Line Tools
+
+a) Open a Terminal and type the following command:
+
+`xcode-select --install`
+
+b) A new window will appear, click Install.
+c) Accept the license agreement.
+d) Wait for the installation to complete.
+
+#### 2. Install Homebrew
+
+Install [Homebrew](https://brew.sh/) if it has not been installed already. Homebrew is a package manager for macOS that has become the most common method of installing command line software on macOS that was not originally provided by Apple. EdkRepo has several dependencies that are distributed via Homebrew.
+
+Type the following command to install Homebrew:
+
+`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"`
+
+Follow the on-screen prompts.
+
+#### 3. Install Dependencies
+
+Run the following commands to install EdkRepo's dependencies:
+
+`brew install bash-completion git git-gui pyenv`
+
+`pyenv install 3.8.2`
+
+`pyenv global 3.8.2`
+
+During installation, you may be prompted to enter your password.
+
+#### 4. Configure Shell for Pyenv and Git
+
+To enable usage of Pyenv installed Python interpreters and Git command completions, run the following command:
+
+`/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/tianocore/edk2-staging/EdkRepo/edkrepo_installer/mac-scripts/setup_git_pyenv_mac.sh)"`
+
+Restart your shell so the Pyenv changes can take effect:
+
+`exec $SHELL`
+
+### Install EdkRepo
+
+Extract the archive:
+
+`tar -xzvf edkrepo-<version>.tar.gz`
+
+If you are installing from source, you will need to build the distribution tarball using the following commands first:
+
+1. `pip install wheel` (If not done already)
+1. `cd build-scripts`
+2. `./build_linux_installer.py`
+
+Install EdkRepo:
+
+`./install.py`
+
+Restart your shell so the new Pyenv shim for EdkRepo can take effect:
+
+`exec $SHELL`
+
 ## Windows Instructions
 ### Pre-Requisites
 - Git 2.13.x or later
 - Python 3.5 or later

-Git 2.16.2 is the version that has recieved the most validation, though any version of Git 2.13 or later works fine. If you want to install 2.16.2, here are some links:
-- [Direct Link - Git for Windows 2.16.2 - 64 Bit](https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/Git-2.16.2-64-bit.exe)
-- [Direct Link - Git for Windows 2.16.2 - 32 Bit](https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/Git-2.16.2-64-bit.exe)
+Git 2.26.0 is the version that has received the most validation, though any version of Git 2.13 or later works fine. If you want to install 2.26.0, here are some links:
+- [Direct Link - Git for Windows 2.26.0 - 64 Bit](https://github.com/git-for-windows/git/releases/download/v2.26.0.windows.1/Git-2.26.0-64-bit.exe)
+- [Direct Link - Git for Windows 2.26.0 - 32 Bit](https://github.com/git-for-windows/git/releases/download/v2.26.0.windows.1/Git-2.26.0-32-bit.exe)

-Python 3.7 or later is recommended due to performance improvements. You can get Python from here: https://www.python.org/
+Python 3.8 or later is recommended due to performance improvements. You can get Python from here: https://www.python.org/

 ### Install Process
 1. Run the installer .exe
 2. Click Install

+### Install From Source
+To install from source, one must build and run the installer .exe using the instructions below at least once in order to setup the EdkRepo configuration files. One this is done, one may use the standard distutils method to install EdkRepo from source:
+
+`py -3 setup.py install`
+
 ### Build Process
 #### Build Pre-Requisites
 - Visual Studio 2015 or later with the C# language installed
--
2.25.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH 0/2] Add documentation for EdkRepo on macOS
  2020-04-07  0:39 [edk2-staging/EdkRepo] [PATCH 0/2] Add documentation for EdkRepo on macOS Nate DeSimone
  2020-04-07  0:39 ` [edk2-staging/EdkRepo] [PATCH 1/2] EdkRepo: Add setup_git_pyenv_mac.sh Nate DeSimone
  2020-04-07  0:39 ` [edk2-staging/EdkRepo] [PATCH 2/2] EdkRepo: Update README.md Nate DeSimone
@ 2020-04-08 20:28 ` Ashley E Desimone
  2 siblings, 0 replies; 6+ messages in thread
From: Ashley E Desimone @ 2020-04-08 20:28 UTC (permalink / raw)
  To: devel@edk2.groups.io, Desimone, Nathaniel L

Reviewed=by: Ashley DeSimone <ashley.e.desimone@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Nate DeSimone
Sent: Monday, April 6, 2020 5:40 PM
To: devel@edk2.groups.io
Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH 0/2] Add documentation for EdkRepo on macOS

This patch series add setup instructions and scripts for macOS and update the recommended versions for Git and Pyenv.

Nate DeSimone (2):
  EdkRepo: Add setup_git_pyenv_mac.sh
  EdkRepo: Update README.md

 README.md                                     |  81 +++++++++++-
 .../mac-scripts/setup_git_pyenv_mac.sh        | 118 ++++++++++++++++++
 2 files changed, 194 insertions(+), 5 deletions(-)  create mode 100755 edkrepo_installer/mac-scripts/setup_git_pyenv_mac.sh

--
2.25.2





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH 1/2] EdkRepo: Add setup_git_pyenv_mac.sh
  2020-04-07  0:39 ` [edk2-staging/EdkRepo] [PATCH 1/2] EdkRepo: Add setup_git_pyenv_mac.sh Nate DeSimone
@ 2020-04-08 20:29   ` Ashley E Desimone
  0 siblings, 0 replies; 6+ messages in thread
From: Ashley E Desimone @ 2020-04-08 20:29 UTC (permalink / raw)
  To: devel@edk2.groups.io, Desimone, Nathaniel L
  Cc: Pandya, Puja, Bjorge, Erik C, Agyeman, Prince, Bret Barkelew,
	Philippe Mathieu-Daude

Reviewed-by: Ashley DeSimone <ashley.e.desimone@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Nate DeSimone
Sent: Monday, April 6, 2020 5:40 PM
To: devel@edk2.groups.io
Cc: Pandya, Puja <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Agyeman, Prince <prince.agyeman@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Philippe Mathieu-Daude <philmd@redhat.com>
Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH 1/2] EdkRepo: Add setup_git_pyenv_mac.sh

Script to configure pyenv and git for use on macOS.

Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Philippe Mathieu-Daude <philmd@redhat.com>
---
 .../mac-scripts/setup_git_pyenv_mac.sh        | 118 ++++++++++++++++++
 1 file changed, 118 insertions(+)
 create mode 100755 edkrepo_installer/mac-scripts/setup_git_pyenv_mac.sh

diff --git a/edkrepo_installer/mac-scripts/setup_git_pyenv_mac.sh b/edkrepo_installer/mac-scripts/setup_git_pyenv_mac.sh
new file mode 100755
index 0000000..34083d1
--- /dev/null
+++ b/edkrepo_installer/mac-scripts/setup_git_pyenv_mac.sh
@@ -0,0 +1,118 @@
+#!/usr/bin/env bash
+#
+## @file setup_git_pyenv_mac.sh
+#
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR> # 
+SPDX-License-Identifier: BSD-2-Clause-Patent #
+
+IFS='' read -r -d '' python_script <<"EOF"
+import os
+import re
+import subprocess
+import sys
+import traceback
+
+profile_source_regex = re.compile(r"source\s+~/\.bashrc")
+profile_source_regex2 = re.compile(r".\s+~/\.bashrc")
+
+ls_alias_regex = re.compile(r"alias\s+ls='ls\s+-G'")
+bash_completion_regex = 
+re.compile(r"\[\[\s+-r\s+\"/usr/local/etc/profile.d/bash_completion.sh\
+"\s+\]\]\s+&&\s+.\s+\"/usr/local/etc/profile.d/bash_completion.sh\"")
+zsh_autoload_compinit_regex = re.compile(r"autoload\s+-U\s+compinit")
+zsh_autoload_bashcompinit_regex = 
+re.compile(r"autoload\s+-U\s+bashcompinit")
+zsh_autoload_colors_regex = re.compile(r"autoload\s+-U\s+colors")
+zsh_colors_regex = re.compile(r"\n\s*colors\n") zsh_compinit_regex = 
+re.compile(r"compinit\s+-u") zsh_bashcompinit_regex = 
+re.compile(r"\n\s*bashcompinit\n")
+pyenv_init_regex = re.compile(r"eval\s+\"\$\(pyenv\s+init\s+-\)\"")
+
+ls_alias = "alias ls='ls -G'"
+bash_completion = '[[ -r "/usr/local/etc/profile.d/bash_completion.sh" ]] && . "/usr/local/etc/profile.d/bash_completion.sh"'
+
+zsh_autoload_compinit = 'autoload -U compinit'
+zsh_autoload_bashcompinit = 'autoload -U bashcompinit'
+zsh_autoload_colors = 'autoload -U colors'
+zsh_colors = 'colors'
+zsh_compinit = 'compinit -u'
+zsh_bashcompinit = 'bashcompinit'
+
+pyenv_init = '''
+# Use the pyenv intalled Python interperter if command -v pyenv 
+1>/dev/null 2>&1; then
+  eval "$(pyenv init -)"
+fi
+'''
+
+def add_command_to_startup_script(script_file, regex, command):
+    script = ''
+    if os.path.isfile(script_file):
+        with open(script_file, 'r') as f:
+            script = f.read().strip()
+    data = regex.search(script)
+    if not data:
+        if script == '':
+            script = command
+        else:
+            script = '{}\n{}'.format(script, command)
+        with open(script_file, 'w') as f:
+            f.write(script)
+
+def main():
+    home_dir = os.path.expanduser('~')
+
+    # Add "source ~/.bashrc" to ~/.bash_profile if it does not have it already
+    bash_profile_file = os.path.join(home_dir, '.bash_profile')
+    bash_profile = ''
+    if os.path.isfile(bash_profile_file):
+        with open(bash_profile_file, 'r') as f:
+            bash_profile = f.read().strip()
+    data = profile_source_regex.search(bash_profile)
+    if not data:
+        data = profile_source_regex2.search(bash_profile)
+        if not data:
+            if bash_profile == '':
+                bash_profile = 'source ~/.bashrc\n'
+            else:
+                bash_profile = '{}\nsource ~/.bashrc\n'.format(bash_profile)
+            with open(bash_profile_file, 'w') as f:
+                f.write(bash_profile)
+
+    # Add pyenv configuration to ~/.bashrc if it does not have it already
+    bash_rc_file = os.path.join(home_dir, '.bashrc')
+    add_command_to_startup_script(bash_rc_file, ls_alias_regex, ls_alias)
+    add_command_to_startup_script(bash_rc_file, bash_completion_regex, bash_completion)
+    add_command_to_startup_script(bash_rc_file, pyenv_init_regex, pyenv_init)
+    zsh_rc_file = os.path.join(home_dir, '.zshrc')
+    add_command_to_startup_script(zsh_rc_file, ls_alias_regex, ls_alias)
+    add_command_to_startup_script(zsh_rc_file, zsh_autoload_compinit_regex, zsh_autoload_compinit)
+    add_command_to_startup_script(zsh_rc_file, zsh_autoload_bashcompinit_regex, zsh_autoload_bashcompinit)
+    add_command_to_startup_script(zsh_rc_file, zsh_autoload_colors_regex, zsh_autoload_colors)
+    add_command_to_startup_script(zsh_rc_file, zsh_colors_regex, zsh_colors)
+    add_command_to_startup_script(zsh_rc_file, zsh_compinit_regex, zsh_compinit)
+    add_command_to_startup_script(zsh_rc_file, zsh_bashcompinit_regex, zsh_bashcompinit)
+    add_command_to_startup_script(zsh_rc_file, bash_completion_regex, bash_completion)
+    add_command_to_startup_script(zsh_rc_file, pyenv_init_regex, 
+ pyenv_init)
+
+    print('Pyenv configured successfully')
+    return 0
+
+if __name__ == '__main__':
+    ret_val = 255
+    try:
+        ret_val = main()
+    except Exception:
+        print('Unhandled Exception...')
+        traceback.print_exc()
+
+    sys.exit(ret_val)
+EOF
+
+# On Catalina and later python3 is preferred, # however it is not 
+packaged by Apple on earlier OSes if [ -x "$(command -v python3)" ]; 
+then
+    python3 -c "$python_script"
+    exit $?
+else
+    python -c "$python_script"
+    exit $?
+fi
--
2.25.2





^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [edk2-devel] [edk2-staging/EdkRepo] [PATCH 2/2] EdkRepo: Update README.md
  2020-04-07  0:39 ` [edk2-staging/EdkRepo] [PATCH 2/2] EdkRepo: Update README.md Nate DeSimone
@ 2020-04-08 20:30   ` Ashley E Desimone
  0 siblings, 0 replies; 6+ messages in thread
From: Ashley E Desimone @ 2020-04-08 20:30 UTC (permalink / raw)
  To: devel@edk2.groups.io, Desimone, Nathaniel L
  Cc: Pandya, Puja, Bjorge, Erik C, Agyeman, Prince, Bret Barkelew,
	Philippe Mathieu-Daude

Reviewed-by: Ashley DeSimone <ashley.e.desimone@intel.com>

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Nate DeSimone
Sent: Monday, April 6, 2020 5:40 PM
To: devel@edk2.groups.io
Cc: Pandya, Puja <puja.pandya@intel.com>; Bjorge, Erik C <erik.c.bjorge@intel.com>; Agyeman, Prince <prince.agyeman@intel.com>; Bret Barkelew <Bret.Barkelew@microsoft.com>; Philippe Mathieu-Daude <philmd@redhat.com>
Subject: [edk2-devel] [edk2-staging/EdkRepo] [PATCH 2/2] EdkRepo: Update README.md

- Added installation instructions for macOS
- Updated recommended versions of Git and Python

Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Philippe Mathieu-Daude <philmd@redhat.com>
---
 README.md | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 file changed, 76 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 1fbb698..9b02e4c 100644
--- a/README.md
+++ b/README.md
@@ -47,25 +47,96 @@ To build a EdkRepo distribution tarball, the Python wheel package is required in  2. `./build_linux_installer.py`

 ### Install From Source
-To install from source, one must have installedd using the tarball method above at least once in order to setup the EdkRepo configuration files. One this is done, one may use the standard distutils method to install EdkRepo from source:
+To install from source, one must have installed using the tarball method above at least once in order to setup the EdkRepo configuration files. One this is done, one may use the standard distutils method to install EdkRepo from source:

 `./setup.py install`

+## macOS Instructions
+
+### Install Pre-Requisites
+
+#### 1. Install the Xcode Command Line Tools
+
+a) Open a Terminal and type the following command:
+
+`xcode-select --install`
+
+b) A new window will appear, click Install.
+c) Accept the license agreement.
+d) Wait for the installation to complete.
+
+#### 2. Install Homebrew
+
+Install [Homebrew](https://brew.sh/) if it has not been installed already. Homebrew is a package manager for macOS that has become the most common method of installing command line software on macOS that was not originally provided by Apple. EdkRepo has several dependencies that are distributed via Homebrew.
+
+Type the following command to install Homebrew:
+
+`/bin/bash -c "$(curl -fsSL 
+https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"`
+
+Follow the on-screen prompts.
+
+#### 3. Install Dependencies
+
+Run the following commands to install EdkRepo's dependencies:
+
+`brew install bash-completion git git-gui pyenv`
+
+`pyenv install 3.8.2`
+
+`pyenv global 3.8.2`
+
+During installation, you may be prompted to enter your password.
+
+#### 4. Configure Shell for Pyenv and Git
+
+To enable usage of Pyenv installed Python interpreters and Git command completions, run the following command:
+
+`/bin/bash -c "$(curl -fsSL 
+https://raw.githubusercontent.com/tianocore/edk2-staging/EdkRepo/edkrep
+o_installer/mac-scripts/setup_git_pyenv_mac.sh)"`
+
+Restart your shell so the Pyenv changes can take effect:
+
+`exec $SHELL`
+
+### Install EdkRepo
+
+Extract the archive:
+
+`tar -xzvf edkrepo-<version>.tar.gz`
+
+If you are installing from source, you will need to build the distribution tarball using the following commands first:
+
+1. `pip install wheel` (If not done already) 1. `cd build-scripts` 2. 
+`./build_linux_installer.py`
+
+Install EdkRepo:
+
+`./install.py`
+
+Restart your shell so the new Pyenv shim for EdkRepo can take effect:
+
+`exec $SHELL`
+
 ## Windows Instructions
 ### Pre-Requisites
 - Git 2.13.x or later
 - Python 3.5 or later

-Git 2.16.2 is the version that has recieved the most validation, though any version of Git 2.13 or later works fine. If you want to install 2.16.2, here are some links:
-- [Direct Link - Git for Windows 2.16.2 - 64 Bit](https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/Git-2.16.2-64-bit.exe)
-- [Direct Link - Git for Windows 2.16.2 - 32 Bit](https://github.com/git-for-windows/git/releases/download/v2.16.2.windows.1/Git-2.16.2-64-bit.exe)
+Git 2.26.0 is the version that has received the most validation, though any version of Git 2.13 or later works fine. If you want to install 2.26.0, here are some links:
+- [Direct Link - Git for Windows 2.26.0 - 64 
+Bit](https://github.com/git-for-windows/git/releases/download/v2.26.0.w
+indows.1/Git-2.26.0-64-bit.exe)
+- [Direct Link - Git for Windows 2.26.0 - 32 
+Bit](https://github.com/git-for-windows/git/releases/download/v2.26.0.w
+indows.1/Git-2.26.0-32-bit.exe)

-Python 3.7 or later is recommended due to performance improvements. You can get Python from here: https://www.python.org/
+Python 3.8 or later is recommended due to performance improvements. You 
+can get Python from here: https://www.python.org/

 ### Install Process
 1. Run the installer .exe
 2. Click Install

+### Install From Source
+To install from source, one must build and run the installer .exe using the instructions below at least once in order to setup the EdkRepo configuration files. One this is done, one may use the standard distutils method to install EdkRepo from source:
+
+`py -3 setup.py install`
+
 ### Build Process
 #### Build Pre-Requisites
 - Visual Studio 2015 or later with the C# language installed
--
2.25.2





^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-04-08 20:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-07  0:39 [edk2-staging/EdkRepo] [PATCH 0/2] Add documentation for EdkRepo on macOS Nate DeSimone
2020-04-07  0:39 ` [edk2-staging/EdkRepo] [PATCH 1/2] EdkRepo: Add setup_git_pyenv_mac.sh Nate DeSimone
2020-04-08 20:29   ` [edk2-devel] " Ashley E Desimone
2020-04-07  0:39 ` [edk2-staging/EdkRepo] [PATCH 2/2] EdkRepo: Update README.md Nate DeSimone
2020-04-08 20:30   ` [edk2-devel] " Ashley E Desimone
2020-04-08 20:28 ` [edk2-devel] [edk2-staging/EdkRepo] [PATCH 0/2] Add documentation for EdkRepo on macOS Ashley E Desimone

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox