Skip to content

Instantly share code, notes, and snippets.

@kapsh
Last active August 25, 2019 01:13
Show Gist options
  • Save kapsh/db12fd046e0153b560a99b5942bcc06e to your computer and use it in GitHub Desktop.
Save kapsh/db12fd046e0153b560a99b5942bcc06e to your computer and use it in GitHub Desktop.
paludis: setup cross as separate environment
---
paludis_confdir: /etc/paludis
paludis_repos: /var/db/paludis/repositories
# TODO probably should also create dirs under /var/db/paludis/repositories/cross-installed/
---
- name: Plan things for {{cross_env_name}}
set_fact:
paludis_confdir_cross: "{{paludis_confdir}}-{{cross_env_name}}"
tool_prefix: "{{cross_compile_host}}-"
- name: Remove cross repo from main configuration
file:
path: "{{paludis_confdir}}/repositories/{{cross_compile_host}}.conf"
state: absent
notify:
- etckeeper
- name: Environment configuration directory
file:
path: "{{paludis_confdir_cross}}/repositories"
state: directory
- name: Installed repository for {{cross_env_name}}
template:
src: repo_config/installed-cross.conf
dest: "{{paludis_confdir_cross}}/repositories/installed-{{cross_env_name}}.conf"
notify: etckeeper
- name: Find existing configuration files
find:
paths: "{{paludis_confdir}}"
patterns:
- "bashrc"
- "hooks"
- "*.conf*"
recurse: no
file_type: any
register: found_configs
- name: Symlink configuration to {{cross_env_name}}
file:
src: "{{item.path}}"
dest: "{{paludis_confdir_cross}}/{{item.path | basename}}"
state: link
force: yes
loop: "{{found_configs.files}}"
loop_control:
label: "{{item.path | basename}}"
notify: etckeeper
- name: Find configured repositories
find:
paths: "{{paludis_confdir}}/repositories/"
patterns:
- "*.conf"
- "*.bash"
exclude:
- pbins.conf # only native there
register: found_repos
- name: Symlink repositories to {{cross_env_name}}
file:
src: "{{item.path}}"
dest: "{{paludis_confdir_cross}}/repositories/{{item.path | basename}}"
state: link
force: yes
loop: "{{found_repos.files}}"
loop_control:
label: "{{item.path | basename}}"
notify: etckeeper
---
- import_tasks: cross_env.yml
vars:
cross_env_name: i686
cross_compile_host: i686-pc-linux-gnu
format = exndbam
location = ${root}{{paludis_repos}}/cross-installed/{{cross_compile_host}}
name = {{cross_env_name}}
split_debug_location = /usr/{{cross_compile_host}}/lib/debug
tool_prefix = {{tool_prefix}}
cross_compile_host = {{cross_compile_host}}
@kapsh
Copy link
Author

kapsh commented Aug 25, 2019

Assuming configuration is shared between /etc/paludis and /etc/paludis-cross_env_name

@kapsh
Copy link
Author

kapsh commented Aug 25, 2019

Also targets for toolchain packages should contain cross_compile_host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment