Skip to content

Commit

Permalink
Issue #86: ruby
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Detwiler <[email protected]>
  • Loading branch information
detwiler committed May 10, 2023
1 parent bf2f0d1 commit 94a45eb
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 7 deletions.
13 changes: 13 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ AC_SUBST([bashconfdir], ["\$(XDG_CONFIG_HOME)/bash"])
AC_SUBST([bashrcdir], ["\$(bashconfdir)/bashrc.d"])
AC_SUBST([profiledir], ["\$(bashconfdir)/profile.d"])
AC_SUBST([readlineconfdir], ["\$(XDG_CONFIG_HOME)/readline"])
AC_SUBST([rubyconfdir], ["\$(XDG_CONFIG_HOME)"])
AC_SUBST([bundleconfdir], ["\$(XDG_CONFIG_HOME)/bundle"])
AC_SUBST([gitconfdir], ["\$(XDG_CONFIG_HOME)/git"])
AC_SUBST([vimconfdir], ["\$(XDG_CONFIG_HOME)/vim"])

Expand Down Expand Up @@ -294,6 +296,16 @@ AM_COND_IF([HAVE_GREP_COLOR],
AC_CHECK_PROGS([RUBY], [ruby])
AM_CONDITIONAL([HAVE_RUBY], [test "x$RUBY" = xruby])

QH_VAR_ENSURE([BUNDLE_USER_CONFIG],
[path to bundle user home],
["\$(bundleconfdir)"])
QH_VAR_ENSURE([BUNDLE_USER_CACHE],
[path to Go module cache],
["\$(XDG_CACHE_HOME)/bundle"])
QH_VAR_ENSURE([BUNDLE_USER_PLUGIN],
[path to Go module cache],
["\$(XDG_DATA_HOME)/bundle"])

## software collections ##

QH_ARG_ENABLE([scl], [no])
Expand Down Expand Up @@ -425,6 +437,7 @@ AC_CONFIG_FILES([Makefile
data/readline/Makefile
data/readline/profile.d/Makefile
data/ruby/Makefile
data/ruby/profile.d/Makefile
data/scl/Makefile
data/scl/profile.d/Makefile
data/ssh/Makefile
Expand Down
2 changes: 1 addition & 1 deletion data/ruby/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# generated data files
config
.gemrc
gemrc
11 changes: 5 additions & 6 deletions data/ruby/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

include $(top_srcdir)/rules.mk

SUBDIRS = profile.d

# data/script variables
config = config
gemrc = .gemrc

# directory variables
bundledir = $(homedir)/.bundle
gemrc = gemrc

# data/scripts generated by make (require explicit distribution of source file)
make_data = $(config) \
$(gemrc)

home_DATA = $(gemrc)
bundle_DATA = $(config)
bundleconf_DATA = $(config)
rubyconf_DATA = $(gemrc)

$(make_data): Makefile

Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions data/ruby/profile.d/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# .gitignore

# generated data files
bundle.sh
28 changes: 28 additions & 0 deletions data/ruby/profile.d/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Makefile.am

include $(top_srcdir)/rules.mk

# data/script variables
bundle = bundle.sh

# data/scripts generated by make (require explicit distribution of source file)
make_data = $(bundle)

$(make_data): Makefile

profile_DATA = $(make_data)

# variables to support building our output
make_output = $(make_data)

make_sources = $(addsuffix .in,$(make_output))

# explicit source file distribution
EXTRA_DIST = $(make_sources)

CLEANFILES = $(make_output)

# sed command to build data/scripts
EDIT = -e 's:@BUNDLE_USER_CONFIG[@]:$(BUNDLE_USER_CONFIG):g' \
-e 's:@BUNDLE_USER_CACHE[@]:$(BUNDLE_USER_CACHE):g' \
-e 's:@BUNDLE_USER_PLUGIN[@]:$(BUNDLE_USER_PLUGIN):g'
5 changes: 5 additions & 0 deletions data/ruby/profile.d/bundle.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# bundle settings

export BUNDLE_USER_CONFIG=@BUNDLE_USER_CONFIG@
export BUNDLE_USER_CACHE=@BUNDLE_USER_CACHE@
export BUNDLE_USER_PLUGIN=@BUNDLE_USER_PLUGIN@

0 comments on commit 94a45eb

Please sign in to comment.