Skip to content

Commit 5ac192c

Browse files
abramhindlerevmischa
authored andcommitted
build your config w/o fancy sed (#43)
1 parent 1969e14 commit 5ac192c

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

Makefile.am

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,14 @@ pm_shaders__DATA = src/libprojectM/Renderer/blur.cg \
2020
install-data-local:
2121
test -z $(pkgdatadir) || $(MKDIR_P) $(pm_presets_dir)
2222
find "$(PRESETSDIR)" -type f -exec $(INSTALL_DATA) {} $(pm_presets_dir) \;
23+
24+
# from https://stackoverflow.com/questions/30897170/ac-subst-does-not-expand-variable answer: https://stackoverflow.com/a/30960268
25+
# ptomato https://stackoverflow.com/users/172999/ptomato
26+
27+
src/libprojectM/config.inp: src/libprojectM/config.inp.in Makefile
28+
$(AM_V_GEN)rm -f $@ $@.tmp && \
29+
$(SED) -e "s,%datadir%,$(datadir),"g $< >$@.tmp && \
30+
chmod a-w $@.tmp && \
31+
mv $@.tmp $@
32+
33+
CLEANFILES += src/libprojectM/config.inp

configure.ac

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ AC_CONFIG_FILES([
3232
src/libprojectM/NativePresetFactory/Makefile
3333
src/libprojectM/MilkdropPresetFactory/Makefile
3434
])
35-
dnl FIXME
36-
dnl AC_CONFIG_FILES([src/libprojectM/config.inp],
37-
dnl [cat src/libprojectM/config.inp | sed -e"s,\${prefix},$prefix," > src/libprojectM/config.inp.b])
35+
36+
dnl from https://stackoverflow.com/questions/30897170/ac-subst-does-not-expand-variable answer: https://stackoverflow.com/a/30960268
37+
dnl ptomato https://stackoverflow.com/users/172999/ptomato
38+
39+
AC_SUBST([PACKAGE])
40+
AC_PROG_SED
41+
AC_CONFIG_FILES([src/libprojectM/config.inp.in])
42+
3843

3944
AC_PREFIX_DEFAULT([/usr/local])
4045

src/libprojectM/config.inp.in renamed to src/libprojectM/config.inp.in.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ Easter Egg Parameter = 1
1616
Hard Cut Sensitivity = 10 # Lower to make hard cuts more frequent
1717
Aspect Correction = true # Custom Shape Aspect Correction
1818

19-
Preset Path = @datarootdir@/presets # preset location
19+
Preset Path = %datadir%/@PACKAGE@/presets # preset location
2020
Title Font = Vera.ttf
2121
Menu Font = VeraMono.ttf

0 commit comments

Comments
 (0)