Skip to content

Commit

Permalink
docs: the return of core dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarcoatl committed Apr 3, 2024
1 parent c316f4e commit 43143cc
Show file tree
Hide file tree
Showing 6 changed files with 154 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/generate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
- run: |
./script/find-replace.sh
- run: |
./script/generate-core.sh
- uses: coatl-dev/actions/simple-git-diff@v3
id: git-diff

Expand Down
7 changes: 7 additions & 0 deletions _includes/install_command_core.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

<div class="install">
<span class="label">Install command: </span>
<div class="copyable">
{%- highlight bash -%} brew install{{include.modifier}} {{include.item}} {%- endhighlight -%}
</div>
</div>
4 changes: 2 additions & 2 deletions _layouts/formula.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@
</table>
{%- endif -%}

<!-- {%- include formulae.html formula_path=formula_path formulae=f.dependencies description="Depends on" -%}
{%- include formulae.html formula_path=formula_path formulae=f.dependencies description="Depends on" -%}
{%- include formulae.html formula_path=formula_core_path formulae=f.core_dependencies description="Depends on" -%}
{%- include formulae.html formula_path=formula_path formulae=f.recommended_dependencies description="Depends on recommended" -%}
{%- include formulae.html formula_path=formula_core_path formulae=f.core_recommended_dependencies description="Depends on recommended" -%}
{%- include formulae.html formula_path=formula_path formulae=f.optional_dependencies description="Depends on optionally" -%}
{%- include formulae.html formula_path=formula_core_path formulae=f.core_optional_dependencies description="Depends on optionally" -%}
{%- include formulae.html formula_path=formula_path formulae=f.build_dependencies description="Depends on when building from source" -%}
{%- include formulae.html formula_path=formula_core_path formulae=f.core_build_dependencies description="Depends on when building from source" -%} -->
{%- include formulae.html formula_path=formula_core_path formulae=f.core_build_dependencies description="Depends on when building from source" -%}

{%- if f.requirements.size > 0 %}
<p>Requires:
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
---
<p><a href="{{ site.baseurl }}/">{{site.title}}</a> is an online package browser for <a href="{{site.taps.coatl-dev.remote}}" target="_blank">{{site.taps.coatl-dev.repo}}</a>'s Homebrew tap. For more information on how to install and use Homebrew see <a href="https://brew.sh">Homebrew's homepage</a>.</p>

<h2><a href="{{ site.baseurl }}/formula/">Browse all coatl-dev formulae</a></h2>
<h2><a href="{{ site.baseurl }}/formula/">Browse all formulae</a></h2>
4 changes: 3 additions & 1 deletion script/find-replace.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#!/bin/bash

keys=(
"dependencies"
"build_dependencies"
"test_dependencies"
)

for key in "${keys[@]}"
do
find _data/formula -name "*.json" -type f -exec sed -i "s/$key/core_$key/g" {} +
find _data/formula -name "*.json" -type f -exec sed -i "s/\"$key\"/\"core_$key\"/g" {} +
done
138 changes: 138 additions & 0 deletions script/generate-core.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
#!/bin/bash

formulae=(
"autoconf"
"[email protected]"
"[email protected]"
"automake"
"[email protected]"
"bison"
"ca-certificates"
"cairo"
"certifi"
"cmake"
"fontconfig"
"freetype"
"gawk"
"gdbm"
"gettext"
"giflib"
"glib"
"gmp"
"gobject-introspection"
"graphite2"
"harfbuzz"
"icu4c"
"jpeg-turbo"
"[email protected]"
"[email protected]"
"libgit2"
"libpng"
"libssh2"
"libtermkey"
"libtiff"
"libtool"
"libuv"
"libvterm"
"libx11"
"libxau"
"libxcb"
"libxdmcp"
"libxext"
"libxrender"
"little-cms2"
"llvm@8"
"llvm@9"
"llvm@11"
"llvm@12"
"llvm@13"
"llvm@14"
"llvm@15"
"llvm@16"
"llvm"
"lpeg"
"lua"
"[email protected]"
"[email protected]"
"luajit"
"luarocks"
"luv"
"lz4"
"lzo"
"m4"
"meson"
"mpdecimal"
"mpfr"
"msgpack"
"nasm"
"neovim"
"ninja"
"openjdk@11"
"openjdk@17"
"openjdk@8"
"[email protected]"
"openssl@3"
"[email protected]"
"page"
"pcre"
"pcre2"
"pixman"
"pkg-config"
"pkgconf"
"python-setuptools"
"[email protected]"
"[email protected]"
"[email protected]"
"[email protected]"
"[email protected]"
"[email protected]"
"readline"
"rust"
"sphinx-doc"
"sqlite"
"swig@3"
"swig"
"tcl-tk"
"tree-sitter"
"unibilium"
"unzip"
"util-macros"
"xcb-proto"
"xorgproto"
"xtrans"
"xz"
"z3"
"zstd"
)

for formula in "${formulae[@]}"
do
# Download and format JSON
mkdir -p _data/formula-core
curl --silent --output-dir _data/formula-core --output "$formula_raw.json" "https://formulae.brew.sh/api/formula/$formula.json"
jq '.' "_data/formula-core/$formula_raw.json" > "_data/formula-core/$formula.json"
rm -f "_data/formula-core/$formula_raw.json"

# Make HTML file
mkdir -p formula-core
html="formula-core/$formula.html"
cat << EOF > "$html"
---
title: "$formula"
layout: formula
---
{{ content }}
EOF

# Make JSON file
mkdir -p api/formula-core
json="api/formula-core/$formula.json"
cat << EOF > "$json"
---
layout: formula_json
---
{{ content }}
EOF
done

0 comments on commit 43143cc

Please sign in to comment.