release: Drop flatpak releases.
- Too much effort required to maintain the manifest file. - Still have appimage and docker, which are both much easier to keep working.
This commit is contained in:
parent
a963dd7377
commit
e76d0bd03d
6 changed files with 0 additions and 2955 deletions
14
README.md
14
README.md
|
|
@ -14,20 +14,6 @@ Eris maintains an up-to-date set of reports for every file in a codebase.
|
|||
# python3.9 -m pip install .
|
||||
# eris -h
|
||||
|
||||
### Flatpak
|
||||
|
||||
# flatpak install org.freedesktop.Sdk/x86_64/20.08 # Install the required runtime
|
||||
# Download flatpak bundle file from github releases page:
|
||||
https://github.com/ahamilton/eris/releases
|
||||
# flatpak install eris-2020-09-24.flatpak # Install the downloaded bundle
|
||||
# flatpak run --filesystem=host com.github.ahamilton.eris -h
|
||||
|
||||
There is a wrapper script available to make running easier:
|
||||
|
||||
# git clone https://github.com/ahamilton/eris
|
||||
# cp eris/eris-flatpak ~/bin/eris # e.g. Put wrapper script in your PATH
|
||||
# eris -h
|
||||
|
||||
### Docker
|
||||
|
||||
# git clone https://github.com/ahamilton/eris
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
#!/usr/bin/python3.9
|
||||
|
||||
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
USAGE = """Make a flatpak build of eris.
|
||||
|
||||
Usage: build-flatpak.sh <manifest_path> <build_dir> <state_dir>
|
||||
|
||||
e.g. # build-flatpak.sh com.github.ahamilton.eris.json eris-build flatpak-cache
|
||||
|
||||
The script should only be run from the root of the local eris repository.
|
||||
"""
|
||||
|
||||
|
||||
def patch_manifest(manifest_path, patched_manifest_path):
|
||||
with open(manifest_path) as manifest_file:
|
||||
manifest = json.load(manifest_file)
|
||||
eris_module = manifest["modules"][-1]
|
||||
eris_module["sources"][0]["url"] = "file://" + os.getcwd()
|
||||
with open(patched_manifest_path, "w") as patched_manifest_file:
|
||||
json.dump(manifest, patched_manifest_file, indent=2)
|
||||
|
||||
|
||||
def main(argv):
|
||||
if len(argv) != 4:
|
||||
print(USAGE)
|
||||
sys.exit(1)
|
||||
manifest_path, build_dir, state_dir = argv[1:4]
|
||||
patched_manifest_path = "manifests-cache/patched-manifest.json"
|
||||
patch_manifest(manifest_path, patched_manifest_path)
|
||||
subprocess.run(["flatpak-builder", build_dir, patched_manifest_path,
|
||||
"--force-clean", "--state-dir", state_dir,
|
||||
"--disable-updates"], check=True)
|
||||
subprocess.run(["flatpak", "build", build_dir, "test-all"], check=True)
|
||||
subprocess.run(["flatpak", "build", build_dir, "eris", "--help"],
|
||||
check=True)
|
||||
print("Build successful:", build_dir)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv)
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,4 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
|
||||
exec flatpak run --filesystem=host com.github.ahamilton.eris "$@"
|
||||
|
|
@ -1,537 +0,0 @@
|
|||
#!/usr/bin/python3.9
|
||||
|
||||
|
||||
import json
|
||||
import os.path
|
||||
import pathlib
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
import eris.tools
|
||||
|
||||
|
||||
def get_package_sources(packages):
|
||||
output = subprocess.check_output(["apt-get", "source", "--print-uris"]
|
||||
+ packages, text=True)
|
||||
seen = set()
|
||||
for line in output.splitlines():
|
||||
if line.startswith("'") and ".dsc" not in line:
|
||||
parts = line.split()
|
||||
package = parts[1].split("_")[0]
|
||||
url = parts[0][1:-1]
|
||||
sha256 = parts[3][-64:]
|
||||
if package not in seen:
|
||||
yield package, url, sha256
|
||||
seen.add(package)
|
||||
|
||||
|
||||
def make_simple_module(package, url, sha256):
|
||||
return {"name": package,
|
||||
"sources": [{"type": "archive",
|
||||
"url": url,
|
||||
"sha256": sha256}]}
|
||||
|
||||
|
||||
def get_file_sha256(path):
|
||||
return subprocess.check_output(["sha256sum", path], text=True).split()[0]
|
||||
|
||||
|
||||
def get_url_sha256(url):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
subprocess.check_output(["wget", "-O", "file", url], cwd=temp_dir,
|
||||
stderr=subprocess.STDOUT)
|
||||
return get_file_sha256(os.path.join(temp_dir, "file"))
|
||||
|
||||
|
||||
def get_haskell_deps(package):
|
||||
subprocess.check_output(["cabal", "update"])
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
subprocess.check_output(["cabal", "sandbox", "init"], cwd=temp_dir)
|
||||
lines = subprocess.check_output([
|
||||
"cabal", "install", "--allow-boot-library-installs",
|
||||
"--reinstall", "--dry-run", package],
|
||||
cwd=temp_dir, text=True).splitlines()[2:]
|
||||
return [line.split()[0] for line in lines if not line.startswith("Use")]
|
||||
|
||||
|
||||
def make_haskell_module(package, deps):
|
||||
commands = []
|
||||
sources = []
|
||||
for dep in deps:
|
||||
package_url = f"http://hackage.haskell.org/package/{dep}"
|
||||
url = package_url + f"/{dep}.tar.gz"
|
||||
sources.append({"type": "archive", "url": url,
|
||||
"sha256": get_url_sha256(url), "dest": dep})
|
||||
revision = 1
|
||||
try:
|
||||
while True:
|
||||
revision_url = package_url + f"/revision/{revision}.cabal"
|
||||
sha256 = get_url_sha256(revision_url)
|
||||
last_url = revision_url
|
||||
revision += 1
|
||||
except subprocess.CalledProcessError:
|
||||
revision -= 1
|
||||
if revision > 0:
|
||||
revision_path = dep.rsplit("-", maxsplit=1)[0] + ".cabal"
|
||||
sources.append({"type": "file", "url": last_url, "sha256": sha256,
|
||||
"dest": dep, "dest-filename": revision_path})
|
||||
commands.append(f"./install-package {dep}")
|
||||
for dep in reversed(deps):
|
||||
commands.append(f"cd {dep}; ./Setup unregister")
|
||||
sources.append({
|
||||
"type": "script",
|
||||
"commands": ["set -x", "cd $1",
|
||||
"if [ ! -e Setup.hs ] && [ ! -e Setup.lhs ]; then",
|
||||
" echo 'import Distribution.Simple' > Setup.hs",
|
||||
" echo 'main = defaultMain' >> Setup.hs", "fi",
|
||||
"ghc -threaded --make Setup",
|
||||
"./Setup configure --disable-optimization --prefix=/app",
|
||||
"./Setup build", "./Setup install"],
|
||||
"dest-filename": "install-package"})
|
||||
return {"name": f"haskell-{package}", "buildsystem": "simple",
|
||||
"build-commands": commands, "builddir": True, "sources": sources,
|
||||
"cleanup": ["/lib/x86_64-linux-ghc-*"]}
|
||||
|
||||
|
||||
def haskell_modules(dep):
|
||||
modules = []
|
||||
for package, url, sha256 in get_package_sources(["ghc"]):
|
||||
modules.append(make_simple_module(package, url, sha256))
|
||||
modules = [patch_module(module, patches) for module in modules]
|
||||
modules.append(make_haskell_module(dep, get_haskell_deps(dep)))
|
||||
return modules
|
||||
|
||||
|
||||
def python_modules(package):
|
||||
python_version = "python3.9"
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
output = subprocess.check_output(
|
||||
[python_version, "-m", "pip", "-v", "download", "--dest", temp_dir,
|
||||
package], text=True)
|
||||
sources = []
|
||||
for line in output.splitlines():
|
||||
if " from build tracker " in line:
|
||||
url = [part for part in line.split()
|
||||
if part.startswith("http")][0]
|
||||
sources.append((url, get_url_sha256(url)))
|
||||
assert sources != [], ("No python modules found for:", package)
|
||||
return [{"name": python_version + "-" + package,
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
python_version + " -m pip install --no-index"
|
||||
' --find-links="file://${PWD}" --prefix=/app ' + package
|
||||
],
|
||||
"sources": [{"type": "file", "url": url, "sha256": sha256}
|
||||
for url, sha256 in sorted(sources)]}]
|
||||
|
||||
|
||||
def python_modules_all(packages):
|
||||
python_version = "python3.9"
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
output = subprocess.check_output(
|
||||
[python_version, "-m", "pip", "-v", "download", "--dest", temp_dir]
|
||||
+ packages, text=True)
|
||||
sources = []
|
||||
for line in output.splitlines():
|
||||
if " from build tracker " in line:
|
||||
url = [part for part in line.split()
|
||||
if part.startswith("http")][0]
|
||||
sources.append((url, get_url_sha256(url)))
|
||||
assert sources != [], ("No python modules found for:", package)
|
||||
return [{"name": python_version,
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
python_version + " -m pip install --no-index"
|
||||
' --find-links="file://${PWD}" --prefix=/app ' + " ".join(packages)
|
||||
],
|
||||
"sources": [{"type": "file", "url": url, "sha256": sha256}
|
||||
for url, sha256 in sorted(sources)]}]
|
||||
|
||||
|
||||
def go_repo_source(repo_path):
|
||||
current_commit = subprocess.check_output(["git", "rev-parse", "HEAD"],
|
||||
cwd=repo_path, text=True).strip()
|
||||
remote_url = subprocess.check_output(
|
||||
["git", "remote", "get-url", "origin"],
|
||||
cwd=repo_path, text=True).strip()
|
||||
dest_path = repo_path[repo_path.rfind("src/"):]
|
||||
return {"type": "git", "url": remote_url, "commit": current_commit,
|
||||
"dest": dest_path}
|
||||
|
||||
|
||||
def go_repo_paths(build_dir):
|
||||
src_dir = build_dir / "src"
|
||||
go_repo_paths = []
|
||||
domains = src_dir.iterdir()
|
||||
for domain in domains:
|
||||
domain_users = domain.iterdir()
|
||||
for user in domain_users:
|
||||
user_repos = user.iterdir()
|
||||
go_repo_paths += list(user_repos)
|
||||
return go_repo_paths
|
||||
|
||||
|
||||
def go_modules(package_url):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
new_env = os.environ.copy()
|
||||
new_env.update({"GOPATH": temp_dir})
|
||||
subprocess.run(["go", "get", "-d", package_url], cwd=temp_dir,
|
||||
env=new_env, check=True)
|
||||
sources = [go_repo_source(str(repo_path))
|
||||
for repo_path in go_repo_paths(pathlib.Path(temp_dir))]
|
||||
return [{"name": os.path.basename(package_url),
|
||||
"buildsystem": "simple",
|
||||
"build-options": {"env": {"GOBIN": "/app/bin"}},
|
||||
"build-commands":
|
||||
[". /usr/lib/sdk/golang/enable.sh; "
|
||||
f"GOPATH=$PWD go install {package_url}"],
|
||||
"sources": sources}]
|
||||
|
||||
|
||||
def git_repo_latest_commit(repo_url):
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
subprocess.run(["git", "clone", "--bare", "--depth=1",
|
||||
repo_url, temp_dir], check=True, capture_output=True)
|
||||
with open(os.path.join(temp_dir, "shallow")) as shallow_file:
|
||||
return shallow_file.read().strip()
|
||||
|
||||
|
||||
def git_modules(package_url):
|
||||
remote_url = "https://" + package_url
|
||||
modules = [{"name": os.path.basename(package_url),
|
||||
"sources": [{"type": "git", "url": remote_url,
|
||||
"commit": git_repo_latest_commit(remote_url)}]}]
|
||||
return [patch_module(module, patches) for module in modules]
|
||||
|
||||
|
||||
patches = {
|
||||
"cppcheck": {"buildsystem": "cmake"},
|
||||
|
||||
# For genisoimage.
|
||||
"cdrkit": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"cmake .",
|
||||
"make -j4 isoinfo",
|
||||
"install -D -t /app/bin genisoimage/isoinfo"]},
|
||||
|
||||
"db5.3": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"cd build_unix && ../dist/configure"
|
||||
" --prefix=/app && make -j4 && make install"]},
|
||||
|
||||
"dpkg": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"./configure --disable-dselect --disable-start-stop-daemon "
|
||||
"--disable-update-alternatives --prefix=/app",
|
||||
"make install"]},
|
||||
|
||||
"ghc": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"mkdir -p /app/lib",
|
||||
"ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6 "
|
||||
"/app/lib/libtinfo.so.5",
|
||||
"./configure --prefix=/app",
|
||||
"make install"],
|
||||
"sources": [{
|
||||
"type": "archive",
|
||||
"url": "https://downloads.haskell.org/~ghc/8.6.5/"
|
||||
"ghc-8.6.5-x86_64-deb9-linux.tar.xz",
|
||||
"sha256": "bc75f5601a9f41d58b2ba161b9e28f"
|
||||
"ad52143a7229060f1e084168d9b2e914df"}],
|
||||
"cleanup": ["/lib/ghc-*", "/lib/libtinfo*", "/app/bin/*ghc*",
|
||||
"/app/bin/aeson-pretty", "/app/bin/hpc",
|
||||
"/app/bin/haddock*", "/app/bin/hsc2hs",
|
||||
"/app/bin/runhaskell", "/app/bin/hp2ps"]},
|
||||
|
||||
"html2text": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"./configure --prefix=/app",
|
||||
"make -j4",
|
||||
"install -D -t /app/bin html2text"]},
|
||||
|
||||
"libzen": {"subdir": "Project/GNU/Library"},
|
||||
|
||||
"libmediainfo": {"subdir": "Project/GNU/Library"},
|
||||
|
||||
"lua": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
r'sed -e "s/INSTALL_TOP= \/usr\/local/INSTALL_TOP= \/app/" '
|
||||
'Makefile > new',
|
||||
"mv new Makefile",
|
||||
"make -j4 linux",
|
||||
"make install"]},
|
||||
|
||||
"lua5.3": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
r'sed -e "s/INSTALL_TOP= \/usr\/local/INSTALL_TOP= \/app/" '
|
||||
'Makefile > new',
|
||||
"mv new Makefile",
|
||||
"make -j4 linux",
|
||||
"make install"]},
|
||||
|
||||
"mediainfo": {"subdir": "Project/GNU/CLI"},
|
||||
|
||||
"php7.4": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"./configure --prefix=/app --disable-all --disable-cgi"
|
||||
" --disable-phpdbg",
|
||||
"make -j4",
|
||||
"make install"]},
|
||||
|
||||
"ruby2.7": {"cleanup": ["/share/ri", "/lib/libruby-static.a",
|
||||
"/lib/ruby/*/rdoc",
|
||||
"/lib/ruby/*/x86_64-linux/enc"]},
|
||||
|
||||
"python2.7": {"cleanup": ["*"]},
|
||||
|
||||
"perl": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"./Configure -des -Dprefix=/app",
|
||||
"make -j4",
|
||||
"make install"],
|
||||
"post-install": [
|
||||
"chmod 755 -R /app/lib/perl5/5.32.0/x86_64-linux/auto"],
|
||||
"sources": [{
|
||||
"type": "archive",
|
||||
"url": "https://www.cpan.org/src/5.0/perl-5.32.0.tar.gz",
|
||||
"sha256": "efeb1ce1f10824190ad1cadbcccf6fdb"
|
||||
"8a5d37007d0100d2d9ae5f2b5900c0b4"}]},
|
||||
|
||||
"rakudo": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"cd src/moarvm-2020.05; perl Configure.pl --prefix=/app",
|
||||
"cd src/moarvm-2020.05; make -j6",
|
||||
"cd src/moarvm-2020.05; make install",
|
||||
"cd src/nqp-2020.05; perl Configure.pl --prefix=/app",
|
||||
"cd src/nqp-2020.05; make -j6",
|
||||
"cd src/nqp-2020.05; make install",
|
||||
"cd src/rakudo-2020.05.1; perl Configure.pl --prefix=/app",
|
||||
"cd src/rakudo-2020.05.1; make -j6",
|
||||
"cd src/rakudo-2020.05.1; make install"
|
||||
],
|
||||
"sources": [{
|
||||
"type": "archive",
|
||||
"url": "https://rakudo.org/dl/star/"
|
||||
"rakudo-star-2020.05.tar.gz",
|
||||
"sha256": "d0d0a4ed5f75a5fb010d9630c052c061"
|
||||
"df9b6ce8325d578fae21fc6a4b99e6d6"}]},
|
||||
|
||||
"p7zip": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"make -f makefile",
|
||||
"install -DT bin/7za /app/bin/7zr"]},
|
||||
|
||||
"wabt": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"mkdir build && cd build && "
|
||||
"cmake -DCMAKE_INSTALL_PREFIX=/app ..",
|
||||
"cd build && make -j4 install"]
|
||||
},
|
||||
|
||||
"rpm": {"config-opts": ["--without-lua"]},
|
||||
|
||||
"tidy-html5": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"cmake ../.. -DCMAKE_INSTALL_PREFIX=/app",
|
||||
"make -j4",
|
||||
"make install"],
|
||||
"subdir": "build/cmake"},
|
||||
|
||||
"unrar-nonfree": {"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"make -j4",
|
||||
"install -D -t /app/bin unrar"]}}
|
||||
|
||||
|
||||
def patch_module(module, patches):
|
||||
patch = patches.get(module["name"], {})
|
||||
module.update(patch)
|
||||
return module
|
||||
|
||||
|
||||
def make_manifest(modules, dep):
|
||||
module_name = os.path.basename(dep)
|
||||
manifest = {"app-id": "com.github.ahamilton." + module_name,
|
||||
"runtime": "org.freedesktop.Sdk",
|
||||
"runtime-version": "20.08",
|
||||
"sdk": "org.freedesktop.Sdk",
|
||||
"sdk-extensions": ["org.freedesktop.Sdk.Extension.golang"],
|
||||
"cleanup": ["/lib/debug", "/share/man", "/man", "/include",
|
||||
"/share/doc", "/doc", "/docs"],
|
||||
"strip": True,
|
||||
"modules": modules}
|
||||
if module_name == "eris":
|
||||
manifest["command"] = "eris"
|
||||
return manifest
|
||||
|
||||
|
||||
EXTRA_DEPS = {"rpm": ["db5.3"],
|
||||
"mediainfo": ["libzen", "libmediainfo"]}
|
||||
|
||||
|
||||
def ubuntu_modules(dep):
|
||||
new_dist_deps = []
|
||||
if dep in EXTRA_DEPS:
|
||||
new_dist_deps.extend(EXTRA_DEPS[dep])
|
||||
new_dist_deps.append(dep)
|
||||
modules = []
|
||||
for new_dist_dep in new_dist_deps:
|
||||
for package, url, sha256 in get_package_sources([new_dist_dep]):
|
||||
modules.append(make_simple_module(package, url, sha256))
|
||||
assert modules != []
|
||||
return [patch_module(module, patches) for module in modules]
|
||||
|
||||
|
||||
def lua_modules(dep):
|
||||
modules = [make_simple_module(
|
||||
"lua", "https://www.lua.org/ftp/lua-5.3.5.tar.gz",
|
||||
"0c2eed3f960446e1a3e4b9a1ca2f3ff893b6ce41942cf54d5dd59ab4b3b058ac")]
|
||||
modules = [patch_module(module, patches) for module in modules]
|
||||
modules.extend(git_modules("github.com/luarocks/luarocks"))
|
||||
modules[-1]["cleanup"] = ["*"]
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
process = subprocess.run(
|
||||
["luarocks", "--verbose", "--to", temp_dir, "install", dep],
|
||||
check=True, capture_output=True, text=True)
|
||||
sources = []
|
||||
for line in process.stdout.splitlines():
|
||||
if line.startswith("Installing "):
|
||||
url = line.split()[1]
|
||||
sources.append({"type": "file", "url": url,
|
||||
"sha256": get_url_sha256(url)})
|
||||
commands = ["luarocks-admin make_manifest .",
|
||||
f"luarocks install --only-from=$PWD {dep}"]
|
||||
return modules + [{"name": dep, "buildsystem": "simple",
|
||||
"build-commands": commands,
|
||||
"sources": sources}]
|
||||
|
||||
|
||||
def get_latest_commit():
|
||||
return subprocess.check_output(["git", "rev-parse", "HEAD"],
|
||||
text=True).strip()
|
||||
|
||||
|
||||
def eris_modules():
|
||||
eris_url = "https://github.com/ahamilton/eris"
|
||||
modules = []
|
||||
for dep in ["docopt", "pyinotify", "pygments", "pillow", "toml",
|
||||
"sortedcontainers", "markupsafe"]:
|
||||
modules.extend(python_modules(dep))
|
||||
modules.append({"name": "eris",
|
||||
"buildsystem": "simple",
|
||||
"build-commands": [
|
||||
"python3.9 -m pip install --no-index --prefix=/app .",
|
||||
"cp -a tests test-all /app/bin"],
|
||||
"sources": [{"type": "git", "url": eris_url,
|
||||
"commit": get_latest_commit()}]})
|
||||
return modules
|
||||
|
||||
|
||||
def nodejs_modules():
|
||||
return ubuntu_modules("python2.7") + [{"name": "nodejs",
|
||||
"cleanup": ["/include", "/share", "/lib/node_modules"],
|
||||
"sources": [
|
||||
{"type": "archive",
|
||||
"url": "https://nodejs.org/dist/latest-v12.x/"
|
||||
"node-v12.18.4.tar.xz",
|
||||
"sha256": "25f03cb18e53b6d0959d0c219e701a85"
|
||||
"eb4693f526bdda7c72bc6199b364f609"}]}]
|
||||
|
||||
|
||||
BUILD_FUNCS = {"ubuntu": ubuntu_modules, "pip": python_modules,
|
||||
"haskell": haskell_modules, "go": go_modules,
|
||||
"git": git_modules, "luarocks": lua_modules}
|
||||
|
||||
|
||||
def get_build_func(dep):
|
||||
build_type, package = (dep.split("/", maxsplit=1) if "/" in dep
|
||||
else ("ubuntu", dep))
|
||||
return BUILD_FUNCS[build_type], package
|
||||
|
||||
|
||||
DEPS_IN_RUNTIME = {"g++", "clang-format", "tar", "file", "perl-doc", "gcc",
|
||||
"binutils", "coreutils", "git", "unzip", "python",
|
||||
"python3", "python-setuptools", "p7zip"}
|
||||
|
||||
|
||||
def save_manifest(manifest, manifest_path):
|
||||
with open(manifest_path, "w") as manifest_file:
|
||||
json.dump(manifest, manifest_file, indent=2)
|
||||
|
||||
|
||||
def make_combined_manifest(all_modules):
|
||||
unique_modules = []
|
||||
seen = set()
|
||||
for module in all_modules:
|
||||
if module["name"] in seen:
|
||||
continue
|
||||
else:
|
||||
unique_modules.append(module)
|
||||
seen.add(module["name"])
|
||||
return make_manifest(unique_modules, "eris")
|
||||
|
||||
|
||||
SUBSTITUTIONS = {"shellcheck": "haskell/ShellCheck",
|
||||
"pandoc": "haskell/pandoc",
|
||||
"wabt": "git/github.com/WebAssembly/wabt"}
|
||||
|
||||
|
||||
def install_script_deps():
|
||||
# cabal-install - cabal
|
||||
subprocess.run(["sudo", "apt-get", "install", "cabal-install"], check=True)
|
||||
|
||||
|
||||
def main():
|
||||
install_script_deps()
|
||||
manifests_dir = os.path.join(os.getcwd(), "manifests-cache")
|
||||
os.makedirs(manifests_dir, exist_ok=True)
|
||||
deps = {SUBSTITUTIONS.get(dep, dep) for dep in eris.tools.dependencies()}
|
||||
all_modules = []
|
||||
python_modules_list = []
|
||||
for dep in sorted(deps - DEPS_IN_RUNTIME) + ["eris"]:
|
||||
build_func, package = get_build_func(dep)
|
||||
if build_func == python_modules:
|
||||
python_modules_list.append(package)
|
||||
continue
|
||||
dep_name = os.path.basename(package)
|
||||
manifest_path = os.path.join(manifests_dir, dep_name+".json")
|
||||
print(f"Making manifest for {dep} …".ljust(70), end="", flush=True)
|
||||
if os.path.exists(manifest_path):
|
||||
print(" (cached)")
|
||||
with open(manifest_path) as json_file:
|
||||
modules = json.load(json_file)["modules"]
|
||||
all_modules.extend(modules)
|
||||
continue
|
||||
elif dep == "eris":
|
||||
modules = eris_modules()
|
||||
elif dep == "nodejs":
|
||||
modules = nodejs_modules()
|
||||
else:
|
||||
modules = build_func(package)
|
||||
print()
|
||||
all_modules.extend(modules)
|
||||
save_manifest(make_manifest(modules, dep), manifest_path)
|
||||
|
||||
manifest_path = os.path.join(manifests_dir, "python.json")
|
||||
dep = "python3.9"
|
||||
print(f"Making manifest for {dep} …".ljust(70), end="", flush=True)
|
||||
if os.path.exists(manifest_path):
|
||||
print(" (cached)")
|
||||
with open(manifest_path) as json_file:
|
||||
modules = json.load(json_file)["modules"]
|
||||
else:
|
||||
modules = python_modules_all(python_modules_list)
|
||||
save_manifest(make_manifest(modules, dep), manifest_path)
|
||||
all_modules[-1:-1] = modules
|
||||
|
||||
eris_module = all_modules[-1]
|
||||
eris_module["sources"][0]["commit"] = get_latest_commit()
|
||||
manifest = make_combined_manifest(all_modules)
|
||||
manifest_path = "com.github.ahamilton.eris.json"
|
||||
print()
|
||||
print(f"Saving manifest file: ./{manifest_path}")
|
||||
save_manifest(manifest, manifest_path)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
@ -31,20 +31,6 @@ Eris maintains an up-to-date set of reports for every file in a codebase.
|
|||
# python3.9 -m pip install .
|
||||
# eris -h
|
||||
|
||||
### Flatpak
|
||||
|
||||
# flatpak install org.freedesktop.Sdk/x86_64/20.08 # Install the required runtime
|
||||
# Download flatpak bundle file from github releases page:
|
||||
https://github.com/ahamilton/eris/releases
|
||||
# flatpak install eris-2020-09-24.flatpak # Install the downloaded bundle
|
||||
# flatpak run --filesystem=host com.github.ahamilton.eris -h
|
||||
|
||||
There is a wrapper script available to make running easier:
|
||||
|
||||
# git clone https://github.com/ahamilton/eris
|
||||
# cp eris/eris-flatpak ~/bin/eris # e.g. Put wrapper script in your PATH
|
||||
# eris -h
|
||||
|
||||
### Docker
|
||||
|
||||
# git clone https://github.com/ahamilton/eris
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue