diff --git a/client/Dockerfiles/finance/archlinux/Dockerfile.hledger.src.in b/client/Dockerfiles/finance/archlinux/Dockerfile.hledger.src.in new file mode 100644 index 0000000..e69ddd5 --- /dev/null +++ b/client/Dockerfiles/finance/archlinux/Dockerfile.hledger.src.in @@ -0,0 +1,44 @@ +# docker-finance | modern accounting for the power-user +# +# Copyright (C) 2024 Aaron Fiore (Evergreen Crypto LLC) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# +# hledger (source) +# + +USER root + +# Remove pre-existing +RUN pacman -Rsc \ + hledger \ + hledger-ui \ + hledger-web \ + --noconfirm + +# Remove incompatible (need `ghc` via `stack`) +RUN pacman -Rsc \ + ghc \ + --noconfirm + +USER builder +WORKDIR /usr/local/src +RUN git clone --depth=1 https://github.com/simonmichael/hledger + +WORKDIR /usr/local/src/hledger +RUN stack update +RUN stack install --resolver="lts-22.28" --install-ghc --local-bin-path=/usr/local/bin + +# vim: sw=2 sts=2 si ai et diff --git a/client/Dockerfiles/finance/ubuntu/Dockerfile.hledger.src.in b/client/Dockerfiles/finance/ubuntu/Dockerfile.hledger.src.in new file mode 100644 index 0000000..cc6fdb5 --- /dev/null +++ b/client/Dockerfiles/finance/ubuntu/Dockerfile.hledger.src.in @@ -0,0 +1,41 @@ +# docker-finance | modern accounting for the power-user +# +# Copyright (C) 2024 Aaron Fiore (Evergreen Crypto LLC) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# +# hledger (source) +# + +USER root + +# Remove pre-existing +RUN apt-get autoremove --purge -y \ + hledger \ + hledger-ui \ + hledger-web + +RUN apt-get install -y \ + haskell-stack + +USER builder +WORKDIR /usr/local/src +RUN git clone --depth=1 https://github.com/simonmichael/hledger + +WORKDIR /usr/local/src/hledger +RUN stack update +RUN stack install --resolver="lts-22.28" --install-ghc --local-bin-path=/usr/local/bin + +# vim: sw=2 sts=2 si ai et diff --git a/client/src/docker/lib/internal/lib_docker.bash b/client/src/docker/lib/internal/lib_docker.bash index efefc05..4c962c2 100644 --- a/client/src/docker/lib/internal/lib_docker.bash +++ b/client/src/docker/lib/internal/lib_docker.bash @@ -122,7 +122,7 @@ function lib_docker::__parse_args_build() Build type: - type${global_arg_delim_2} + type${global_arg_delim_2} \e[32mNotes:\e[0m @@ -131,17 +131,20 @@ function lib_docker::__parse_args_build() \e[32mExamples:\e[0m - \e[37;2m# Build normal (default) image\e[0m + \e[37;2m# Build normal 'default' image\e[0m $ $global_usage type${global_arg_delim_2}default - \e[37;2m# Build a smaller default image but *without* ROOT.cern (meta-analysis) support\e[0m + \e[37;2m# Build a smaller 'default' image but *without* ROOT.cern (meta-analysis) support\e[0m $ $global_usage type${global_arg_delim_2}slim - \e[37;2m# Build an even smaller default image with *pre-built* hledger-flow binary (but *with* ROOT.cern support)\e[0m + \e[37;2m# Build an even smaller 'default' image with *pre-built* hledger-flow binary (but *with* ROOT.cern support)\e[0m $ $global_usage type${global_arg_delim_2}tiny \e[37;2m# Build the smallest image possible: the 'tiny' image *without* ROOT.cern support\e[0m $ $global_usage type${global_arg_delim_2}micro + + \e[37;2m# Build experimental image based on 'default' image (WARNING: large image and possibly unstable)\e[0m + $ $global_usage type${global_arg_delim_2}experimental " ;; dev-tools) @@ -198,7 +201,7 @@ function lib_docker::__parse_args_build() # Arg: type if [ ! -z "$_arg_type" ]; then - [[ ! "$_arg_type" =~ ^default$|^slim$|^tiny$|^micro$ ]] \ + [[ ! "$_arg_type" =~ ^default$|^slim$|^tiny$|^micro$|^experimental$ ]] \ && lib_utils::die_usage "$_usage" declare -gr global_arg_type="$_arg_type" @@ -243,9 +246,10 @@ function lib_docker::__build() local _in_files=() case "$global_arg_type" in - default | slim) + default | slim | experimental) _in_files+=("hledger-flow.src") - [[ "$global_arg_type" == "default" ]] && _in_files+=("root") + [[ "$global_arg_type" =~ ^default$|^experimental$ ]] && _in_files+=("root") + [[ "$global_arg_type" =~ ^experimental$ ]] && _in_files+=("hledger.src") ;; tiny | micro) _in_files+=("hledger-flow.bin")