Skip to content

Commit

Permalink
OSX: add new homebrew role and update macports
Browse files Browse the repository at this point in the history
 homebrew:
 - Add new macOS role for homebrew users
 macports:
 - add texinfo and texi2html utilities
 - add missing vulkan packages for macports
 - Cleanup redundant ports in macports
 - Update macports python to 3.11
 general:
 - Update README
  • Loading branch information
jhoyt4 committed Dec 14, 2023
1 parent 8af774b commit 72c2efb
Show file tree
Hide file tree
Showing 11 changed files with 313 additions and 20 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,12 @@ For Qt6 support, add ``` -e "qt6=true" ``` to the end of the command line. E.G.

``` ./mythtv.yml --limit=localhost -e "qt6=true" ```

#### MacOSX Users
#### MacOSX Homebrew Users
```brew install ansible```<br>
```./mythtv.yml --limit=localhost```

```sudo port -v selfupdate```<br>
```sudo port upgrade outdated```<br>
```sudo port install py310-ansible```<br>
#### MacOSX MacPorts Users
```sudo port install py311-ansible```<br>
```./mythtv.yml --limit=localhost```

- Optionally specify a database version:
Expand Down
6 changes: 5 additions & 1 deletion hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ mythtv_hosts:
freebsd:
ansible_python_interpreter: /usr/local/bin/python2.7
macosx:
ansible_python_interpreter: /opt/local/bin/python3.10
ansible_pkg_mgr:
homebrew:
ansible_python_interpreter: ${HOMEBREW_PREFIX}/bin/python3
macports:
ansible_python_interpreter: /opt/local/bin/python3.11
builder:
mythtv_builders: true
tags: never
Expand Down
6 changes: 6 additions & 0 deletions mythtv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
- ansible_pkg_mgr == "pkgng"
- not mythtv_tools

- include_role:
name: mythtv-homebrew
when:
- ansible_pkg_mgr == "homebrew"
- not mythtv_tools

- include_role:
name: mythtv-macports
when:
Expand Down
226 changes: 226 additions & 0 deletions roles/mythtv-homebrew/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,226 @@
# roles/mythtv-homebrew/tasks/main.yml

---
- name: Get homebrew install prefix
command: brew --prefix
register: HB_OUT

- name: set homebrew_prefix fact
set_fact: homebrew_prefix={{ HB_OUT.stdout }}

- name: specify a mariadb/mysql version to install
set_fact:
database_version=mysql
when:
database_version is undefined

- name: check if this is a mariadb based install
set_fact:
database_name=mariadb
when: database_version is search("mariadb")

- name: check if this is a mysql based install
set_fact:
database_name=mysql
when: database_version is search("mysql")

- name: create a list of compilers and build essentials
set_fact:
homebrew_pkg_list:
- ccache
- nasm
- autoconf
- automake
- pkgconfig

- name: add essential libraries
set_fact:
homebrew_pkg_list:
- '{{ homebrew_pkg_list }}'
- libxml2
- taglib
- exiv2
- libbluray
- lzo
- libsamplerate
- libzip
- glslang
- [email protected]
- openssl@3
- '{{ database_version }}'

- name: add optional libraries
set_fact:
homebrew_pkg_list:
- '{{ homebrew_pkg_list }}'
- openssl
- libvpx
- x264
- x265
- XviD
- libvorbis
- flac
- faac
- freetype
- libxml2
- fftw
- libass
- aom
- dav1d
- minizip
- ant
- libhdhomerun
- libX11
- sound-touch
- libcec
- zstd
- vulkan-headers
- vulkan-tools
- vulkan-loader
- molten-vk
- audiofile
- libdiscid
- http-parser

- name: develop a Python package version suffix
set_fact:
python_exe_suffix:
'{{ ansible_python.version.major }}.{{ ansible_python.version.minor }}'

- name: add python essentials
set_fact:
homebrew_pkg_list:
- '{{ homebrew_pkg_list }}'
- 'python@{{ python_exe_suffix }}'
- virtualenv
- pyenv-virtualenv
- python-lxml
- python-oauthlib
- python-dateutil
- python-requests
- python-urllib3
- python-configargparse
- python-markdown
- python-cryptography

- name: add perl essentials
set_fact:
homebrew_pkg_list:
- '{{ homebrew_pkg_list }}'
- perl
- cpanminus

- name: utility packages from ports
set_fact:
homebrew_pkg_list:
- '{{ homebrew_pkg_list }}'
- make
- libtool
- lame
- gnutls
- gnu-sed
- curl
- texinfo
- texi2html

- name: print final list of ports
debug:
msg:
'{{ lookup("flattened", homebrew_pkg_list) }}'

- name: install packages
become: false
homebrew:
name:
'{{ lookup("flattened", homebrew_pkg_list) }}'

- name: add fonts cask to homebrew
become: false
command: brew tap homebrew/cask-fonts

- name: install dejavu fonts from brew cask
become: false
command: brew install --cask font-dejavu

- name: install liberation fonts from brew cask
become: false
command: brew install --cask font-liberation

- name: create Python virtual environment folder for standard user
become: false
file:
name: ~/.mythtv/python-virtualenv
state: directory

- name: initiate virtualenv for standard user
become: false
pip:
virtualenv: ~/.mythtv/python-virtualenv
name:
- argparse
- audiofile
- bs4
- common
- configparser
- datetime
- discid
- et
- features
- future
- HTMLParser
- httplib2
- importlib_metadata
- lxml
- markdown
- musicbrainzngs
- mysqlclient
- oauthlib
- port
- put
- py2app
- pycurl
- python_dateutil
- requests
- requests_cache==0.5.2
- simplejson
- traceback2
- urllib3
- virtualenv
- wheel
tags: pip

- name: cpanm - install Net-SSLeay perl module with special handling for openssl
become: false
command: cpanm
--mirror 'http://cpan.cpantesters.org/'
--force
--configure-args="--libs='-L{{ homebrew_prefix }}/lib' --inc='-I{{ homebrew_prefix }}/opt/openssl/'"
Net::SSLeay

- name: cpanm - install perl modules
become: false
command: cpanm
--mirror 'http://cpan.cpantesters.org/'
--force
Date::Manip
DateTime::Format::ISO8601
DBI
Image::Size
IO::Socket::INET6
JSON
LWP
HTTP::Request::AsCGI
Net::UPnP
SOAP::Lite
XML::XPath
XML::Simple

- name: cpanm - install DBD-mysql vwith special handling for mysql8
become: false
command: cpanm
--force
--mirror 'http://cpan.cpantesters.org/'
--configure-args="--libs='-L{{ homebrew_prefix }}/lib -lssl -lcrypto -lzstd'"
DBD::mysql

# vim: set expandtab tabstop=2 shiftwidth=2 smartindent noautoindent colorcolumn=2:
25 changes: 14 additions & 11 deletions roles/mythtv-macports/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
- lzo2
- libsamplerate
- libzip
- '{{ database_version }}'

- name: add optional libraries
set_fact:
Expand All @@ -63,19 +64,19 @@
- libxml2
- fftw-3
- libass
- x264
- x265
- aom
- dav1d
- libvpx
- minizip
- apache-ant
- hdhomerun
- xorg-libX11
- liberation-fonts
- dejavu-fonts
- soundtouch
- '{{ database_version }}'
- vulkan-headers
- vulkan-tools
- vulkan-loader
- MoltenVK

- name: develop a Python package version suffix
set_fact:
Expand Down Expand Up @@ -119,6 +120,8 @@
- lame
- gnutls
- gsed
- texinfo
- texi2html

- name: print final list of ports
debug:
Expand All @@ -129,21 +132,21 @@
macports:
name:
'{{ lookup("flattened", macports_pkg_list) }}'
update_cache: yes
update_cache: true

- name: install p{{ perl_version }}-dbd-mysql for previously specified mariadb/mysql version
- name: install p{{ perl_version }}-dbd-mysql
macports:
name: 'p{{ perl_version }}-dbd-mysql'
variant: +{{ mysql_variant }}

- name: select the installed version of mariadb/mysql and python
command: 'port select --set {{ item.group }} {{ item.version }}'
with_list:
- { group: mysql, version: '{{ database_version }}' }
- { group: python, version: 'python{{ python_package_suffix }}' }
- { group: python3, version: 'python{{ python_package_suffix }}' }
- { group: pip3, version: 'pip{{ python_package_suffix }}' }
- { group: virtualenv, version: 'virtualenv{{ python_package_suffix }}' }
- {group: mysql, version: '{{ database_version }}'}
- {group: python, version: 'python{{ python_package_suffix }}'}
- {group: python3, version: 'python{{ python_package_suffix }}'}
- {group: pip3, version: 'pip{{ python_package_suffix }}'}
- {group: virtualenv, version: 'virtualenv{{ python_package_suffix }}'}

- name: create Python virtual environment folder for standard user
become: false
Expand Down
3 changes: 3 additions & 0 deletions roles/qt5/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
- include_tasks: qt5-dnf.yml
when: ansible_pkg_mgr in [ "dnf", "dnf5" ]

- include_tasks: qt5-homebrew.yml
when: ansible_pkg_mgr == "homebrew"

- include_tasks: qt5-macports.yml
when: ansible_pkg_mgr == "macports"

Expand Down
23 changes: 23 additions & 0 deletions roles/qt5/tasks/qt5-homebrew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---

- name: create list of qt5 libraries
set_fact:
homebrew_pkg_list:
- qt@5
tags:
- qt5

- name: print final qt5 list of ports
debug:
msg:
'{{ lookup("flattened", homebrew_pkg_list) }}'

- name: install port qt5 packages
become: false
homebrew:
name:
'{{ lookup("flattened", homebrew_pkg_list) }}'
tags:
- qt5

# vim: set expandtab tabstop=2 shiftwidth=2 smartindent noautoindent colorcolumn=2:
4 changes: 2 additions & 2 deletions roles/qt5/tasks/qt5-macports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# parse out database name and major/minor version
# database_version is set in the macports main.yml
- name: specify mysql/mariadb database version to compile against
set_fact: qt_mysql_variant="{{ database_version | regex_replace('-') | regex_replace('\.', '_') }}"
set_fact: qt_mysql_variant="{{ database_version | regex_replace('-') | regex_replace('\.', '_') }}"

- name: create list of qt5 libraries
set_fact:
Expand Down Expand Up @@ -38,7 +38,7 @@
macports:
name:
'{{ lookup("flattened", macports_pkg_list) }}'
update_cache: yes
update_cache: true
tags:
- qt5

Expand Down
Loading

0 comments on commit 72c2efb

Please sign in to comment.