Skip to content
This repository has been archived by the owner on Jun 19, 2022. It is now read-only.

Commit

Permalink
Feature: feature-hacking-environment (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
bossjones committed Jun 17, 2018
1 parent 91ae3f2 commit c25a02d
Show file tree
Hide file tree
Showing 45 changed files with 3,032 additions and 1,104 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ cov.xml

gir-1.0
gir-1.0/*
.pytest_cache
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,18 @@ gir-1.0
gir-1.0/*

fakegir/

##########################################
# flatpak-etc, based on pitivi
##########################################
# Generated by configure
mesonbuild/
bin/scarlett

# xdg-app/flatpak
.bashrc
*.flatpak-builder/
hacking/flatpak/Scarlett.*.json
hacking/flatpak/scarlett/*
hacking/devel/
.pytest_cache
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ notifications:
email:
recipients:
- bossjones@theblacktonystark.com
on_success: always # default: change
on_failure: always # default: always
on_success: change # default: change
on_failure: change # default: always

deploy:
distributions: sdist bdist_wheel
Expand All @@ -109,8 +109,8 @@ deploy:

notifications:
slack:
# on_success: change
on_success: always
on_failure: always
on_success: change
# on_success: always
on_failure: change
rooms:
secure: arS7e7IDG80ukrrjy4fVfNDh5Yqrz4mxmduWqJU2zHzwxL0QkJWnhncWBpTgXr06MVgWYwq/YnoCGZ+wcWHkYzsqDHWtFI0JguZuJcFAWV5l7PWOxcUUh731hipRcgkZIH03pqnfZTbN3kkNTvFcTL9NG92ZOYd/ZSQeCnNPF9T2PUjn5LnPNwOxJSVAdmvz7CoLJWIR6vF9ojoxZdMj1RhV4b1C9orP3pBh3V3sVc5ExX6cUePXJtkvb51fXwdCsGNA22xZrDfbxCoOXfMmgDuN/7W/DVPPyaZCInYQl2B/oLF+3TOqUZ8STM3BPDIBjxgPRBdULIqeaQJNNJ9rfQ6h+YhvCWDmZD5ugdTQkGCSX2hR4TGMnS9v/nu5KKSalQEkNOfcqZUSTRVHKL800arEwja2avRGu9KBlijg79r/k2EILb7sPfleeS0+eLKIYTBVyQvuiqo31NcZ4Yun9ykQlTJW0n1NiVrLRVHbCIScrHwyH8pI4ts6PbwtUO8HWWDXEUSZRipc14ckZBzqB6ozAAwtF4fStnHC5rkd1sRreZalLKsZxaVpsX0mspZfSLfz6eV34vnDs9Xv0+tPuW0X0P1/FZIykvjDrmoM8s5TD1xzES9zRslhWxK2yv0a5OaryWvicQKcCwg8zwdiCTAwq1wBNkYzrtTnTN9QnRA=
37 changes: 10 additions & 27 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
{
// INFO: Good default settings config - https://github.com/DonJayamanne/vscode-setup/blob/master/settings.json
// Render all the whitespaces
"editor.renderWhitespace": "all",
// Controls how lines should wrap. Can be:
// - 'off' (disable wrapping),
// - 'on' (viewport wrapping),
// - 'wordWrapColumn' (wrap at `editor.wordWrapColumn`) or
// - 'bounded' (wrap at minimum of viewport and `editor.wordWrapColumn`).
"editor.wordWrap": "on",
"workbench.iconTheme": "material-icon-theme",
"window.zoomLevel": 0,
Expand Down Expand Up @@ -117,7 +110,15 @@
"htmlcov": true,
"gir-1.0": true,
"gir-1.0/*": true,
"fakegir/": true
"fakegir/": true,
"mesonbuild/": "explorerExcludedFiles",
"bin/scarlett": "explorerExcludedFiles",
".bashrc": "explorerExcludedFiles",
"*.flatpak-builder/": "explorerExcludedFiles",
"hacking/flatpak/Scarlett.*.json": "explorerExcludedFiles",
"hacking/flatpak/scarlett/*": "explorerExcludedFiles",
"hacking/devel/": "explorerExcludedFiles",
".pytest_cache": "explorerExcludedFiles"
},
"files.trimTrailingWhitespace": true,
"search.exclude": {
Expand All @@ -127,16 +128,12 @@
"**/.vendor": true,
"**/build": true
},
// Exclude types of warnings, for example ["SC1090"].
"shellcheck.exclude": [
"2086"
],
"python.pythonPath": "~/.virtualenvs/scarlett-os-venv2/bin/python3",
"python.formatting.provider": "autopep8",

// Turn off formatting on type
"editor.formatOnType": false,

"python.linting.pylintArgs": [
"--rcfile",
"${workspaceFolder}/pylintrc"
Expand All @@ -148,7 +145,6 @@
"python.venvPath": "~/.virtualenvs",
"python.sortImports.path": "~/.virtualenvs/scarlett-os-venv2/bin/isort",
"python.autoComplete.extraPaths": [
// "~/.cache/fakegir/",
"~/.virtualenvs/scarlett-os-venv2/lib/python3.5/site-packages"
],
"terminal.integrated.shellArgs.osx": [
Expand All @@ -157,15 +153,10 @@
"terminal.integrated.shellArgs.linux": [
"-l"
],
// The path of the shell that the terminal uses on Linux.
"terminal.integrated.shell.linux": "/usr/local/bin/bash",
// Path to the shellcheck executable.
"shellcheck.executablePath": "/usr/local/bin/shellcheck",
// Controls whether locale variables are set at startup of the terminal, this defaults to true on OS X, false on other platforms.
"terminal.integrated.setLocaleVariables": true,
// The path of the shell that the terminal uses on OS X.
"terminal.integrated.shell.osx": "/usr/local/bin/bash",
// Glob patterns that defines the files to search for. Only include files you need, DO NOT USE `{**/*.*}` for both permormance and avoiding binary files reason.
"todohighlight.keywords": [
{
"text": "TODO:",
Expand Down Expand Up @@ -215,16 +206,9 @@
"backgroundColor": "maroon"
}
],

// The number of spaces a tab is equal to. This setting is overridden based on the file contents when `editor.detectIndentation` is on.
"editor.tabSize": 4,

// Insert spaces when pressing Tab. This setting is overridden based on the file contents when `editor.detectIndentation` is on.
"editor.insertSpaces": true,

// When opening a file, `editor.tabSize` and `editor.insertSpaces` will be detected based on the file contents.
"editor.detectIndentation": true,

"todohighlight.toggleURI": false,
"todohighlight.exclude": [
"**/node_modules/**",
Expand All @@ -240,7 +224,6 @@
"**/.next/**"
],
"todohighlight.maxFilesForSearch": 5120,
// Specifies whether or not to enable GitLens telemetry (even if enabled still abides by the overall `telemetry.enableTelemetry` setting
"gitlens.advanced.telemetry.enabled": false,
"todohighlight.include": [
"**/*.js",
Expand Down Expand Up @@ -298,4 +281,4 @@
"restructuredtext.sphinxBuildPath": "/usr/local/bin/sphinx-build",
"restructuredtext.workspaceRoot": "${workspaceFolder}",
"python.linting.enabled": true
}
}
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ RUN set -x cd /home/pi/dev/bossjones-github/scarlett_os \
&& jhbuild run -- pip install -r requirements.txt \
&& jhbuild run -- pip freeze \
&& jhbuild run python3 setup.py install \
&& jhbuild run -- pip install -r requirements_test_all.txt && \
jhbuild run -- pip freeze
&& jhbuild run -- pip install -r requirements_test_all.txt

USER root

Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1006,3 +1006,13 @@ run-gnome-builder:

pull-gnome-builder:
docker pull $(gnome_username)/$(gnome_container_name):latest

# TODO: Use this to autogenerate the flatpak-pip-update json files!!!!
# SOURCE: https://github.com/freedomofpress/ansible-role-jenkins-config/blob/master/requirements.txt
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile --output-file requirements.txt requirements.in
#
pip-compile:
pip-compile --output-file requirements_all.txt requirements.txt
180 changes: 180 additions & 0 deletions RESEARCH.md
Original file line number Diff line number Diff line change
Expand Up @@ -2114,3 +2114,183 @@ app-dir directory.
To verify that the build was successful, run the following:

`$ flatpak-builder --run app-dir org.flatpak.Hello.json hello.sh`



# os x virtualenv artifacts ( old shit before updating things with brew )

```
l
|2.4.2| using virtualenv: scarlett-os-venv2 hyenatop in ~/.virtualenvs/scarlett-os-venv2/lib/python3.5/site-packages/gi
○ → ls -lta
total 1072
drwxr-xr-x 284 malcolm staff 9656 Mar 8 12:18 ..
drwxr-xr-x 21 malcolm staff 714 Sep 5 2016 .
-rwxr-xr-x 1 malcolm staff 412772 Sep 5 2016 _gi.cpython-35m-darwin.so
-rwxr-xr-x 1 malcolm staff 1214 Sep 5 2016 _gi.la
-rwxr-xr-x 1 malcolm staff 16148 Sep 5 2016 _gi_cairo.cpython-35m-darwin.so
-rwxr-xr-x 1 malcolm staff 1249 Sep 5 2016 _gi_cairo.la
drwxr-xr-x 4 malcolm staff 136 Sep 5 2016 _gobject
drwxr-xr-x 12 malcolm staff 408 Sep 5 2016 overrides
-rw-r--r-- 1 malcolm staff 4605 Sep 5 2016 __init__.py
drwxr-xr-x 24 malcolm staff 816 Sep 5 2016 __pycache__
-rw-r--r-- 1 malcolm staff 2078 Sep 5 2016 _constants.py
-rw-r--r-- 1 malcolm staff 2080 Sep 5 2016 _error.py
-rw-r--r-- 1 malcolm staff 13249 Sep 5 2016 _option.py
-rw-r--r-- 1 malcolm staff 15175 Sep 5 2016 _propertyhelper.py
-rw-r--r-- 1 malcolm staff 9860 Sep 5 2016 _signalhelper.py
-rw-r--r-- 1 malcolm staff 6688 Sep 5 2016 docstring.py
-rw-r--r-- 1 malcolm staff 5288 Sep 5 2016 importer.py
-rw-r--r-- 1 malcolm staff 10037 Sep 5 2016 module.py
-rw-r--r-- 1 malcolm staff 766 Sep 5 2016 pygtkcompat.py
drwxr-xr-x 4 malcolm staff 136 Sep 5 2016 repository
-rw-r--r-- 1 malcolm staff 13801 Sep 5 2016 types.py
|2.4.2| using virtualenv: scarlett-os-venv2 hyenatop in ~/.virtualenvs/scarlett-os-venv2/lib/python3.5/site-packages/gi
○ →
```


# Example of ninja file ( generated by meson by default, found in mesonbuild/ folder )


```
~/dev/scarlett_os-dev/scarlett_os/mesonbuild $ cat build.ninja
# This is the build file for project "scarlett-os"
# It is autogenerated by the Meson build system.
# Do not edit by hand.
ninja_required_version = 1.5.1
# Rules for compiling.
rule c_COMPILER
command = ccache gcc $ARGS -MD -MQ $out -MF '$DEPFILE' -o $out -c $in
deps = gcc
depfile = $DEPFILE
description = Compiling C object $out.
rule c_PCH
command = ccache gcc $ARGS -MD -MQ $out -MF '$DEPFILE' -o $out -c $in
deps = gcc
depfile = $DEPFILE
description = Precompiling header $in.
# Rules for linking.
rule STATIC_LINKER
command = rm -f $out && ar $LINK_ARGS $out $in
description = Linking static target $out.
rule c_LINKER
command = ccache gcc $ARGS -o $out $in $LINK_ARGS $aliasing
description = Linking target $out.
rule SHSYM
command = /app/bin/python3.5 /app/bin/meson --internal symbolextractor $in $out $CROSS
restat = 1
description = Generating symbol file $out.
# Other rules
rule CUSTOM_COMMAND
command = $COMMAND
description = $DESC
restat = 1
rule CUSTOM_COMMAND_DEP
command = $COMMAND
description = $DESC
deps = gcc
depfile = $DEPFILE
restat = 1
rule REGENERATE_BUILD
command = /app/bin/python3.5 /app/bin/meson --internal regenerate /home/pi/dev/scarlett_os-dev/scarlett_os /home/pi/dev/scarlett_os-dev/scarlett_os/mesonbuild --backend ninja
description = Regenerating build files.
generator = 1
# Phony build target, always out of date
build PHONY: phony
# Build rules for targets
# Test rules
build meson-test: CUSTOM_COMMAND all PHONY
COMMAND = /app/bin/python3.5 -u /app/bin/meson test --no-rebuild --print-errorlogs
DESC = Running$ all$ tests.
pool = console
build test: phony meson-test
build meson-benchmark: CUSTOM_COMMAND all PHONY
COMMAND = /app/bin/python3.5 -u /app/bin/meson test --benchmark --logbase benchmarklog --num-processes=1 --no-rebuild
DESC = Running$ benchmark$ suite.
pool = console
build benchmark: phony meson-benchmark
# Install rules
build meson-install: CUSTOM_COMMAND PHONY | all
DESC = Installing$ files.
COMMAND = /app/bin/python3.5 /app/bin/meson --internal install /home/pi/dev/scarlett_os-dev/scarlett_os/mesonbuild/meson-private/install.dat
pool = console
build install: phony meson-install
build meson-dist: CUSTOM_COMMAND PHONY
DESC = Creating$ source$ packages
COMMAND = /app/bin/python3.5 /app/bin/meson --internal dist /home/pi/dev/scarlett_os-dev/scarlett_os /home/pi/dev/scarlett_os-dev/scarlett_os/mesonbuild /app/bin/python3.5 /app/bin/meson
pool = console
build dist: phony meson-dist
# Suffix
build meson-scan-build: CUSTOM_COMMAND PHONY
COMMAND = /app/bin/python3.5 /app/bin/meson --internal scanbuild /home/pi/dev/scarlett_os-dev/scarlett_os /home/pi/dev/scarlett_os-dev/scarlett_os/mesonbuild /app/bin/python3.5 /app/bin/meson -Ddisable-help=false
pool = console
build scan-build: phony meson-scan-build
build meson-uninstall: CUSTOM_COMMAND PHONY
COMMAND = /app/bin/python3.5 /app/bin/meson --internal uninstall
pool = console
build uninstall: phony meson-uninstall
build all: phony
default all
build clean: phony meson-clean
build meson-clean: CUSTOM_COMMAND PHONY
COMMAND = ninja -t clean
description = Cleaning.
build build.ninja: REGENERATE_BUILD ../meson.build ../data/meson.build ../data/icons/meson.build ../getenvvar.py ../scarlett_os/shim.py.in ../mesonbuild/shim.py ../bin/meson.build ../bin/scarlett.in ../mesonbuild/bin/scarlett ../tests/meson.build meson-private/coredata.dat ../meson_options.txt
pool = console
build reconfigure: REGENERATE_BUILD PHONY
pool = console
build ../meson.build ../data/meson.build ../data/icons/meson.build ../getenvvar.py ../scarlett_os/shim.py.in ../mesonbuild/shim.py ../bin/meson.build ../bin/scarlett.in ../mesonbuild/bin/scarlett ../tests/meson.build meson-private/coredata.dat ../meson_options.txt: phony
(scarlett-flatpak) (pyvenv) [pi@avengers-tower, load: 0.11] (Mon Jun 11 - 00:52:47)
~/dev/scarlett_os-dev/scarlett_os/mesonbuild $
```

# Look at these paths, inside flatpak sandbox env

```
Installing /home/pi/dev/scarlett_os-dev/scarlett_os/mesonbuild/shim.py to /app/lib/scarlett_os/python/scarlett_os
Installing /home/pi/dev/scarlett_os-dev/scarlett_os/mesonbuild/bin/scarlett to /app/bin
```
10 changes: 10 additions & 0 deletions bin/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
configure_file(input: 'scarlett.in',
output: 'scarlett',
configuration: cdata)

scarlett_bin = '@0@/scarlett'.format(meson.current_build_dir())
install_data(scarlett_bin, install_dir: get_option('bindir'))

# Create `scarlett` in the current dir at build time to be able to
# run uninstalled in the dev env.
run_command('cp', scarlett_bin, meson.current_source_dir())
Loading

0 comments on commit c25a02d

Please sign in to comment.