Skip to content

Instantly share code, notes, and snippets.

@nkoguro
Created July 20, 2014 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkoguro/10cddd784b6f5237cc83 to your computer and use it in GitHub Desktop.
Save nkoguro/10cddd784b6f5237cc83 to your computer and use it in GitHub Desktop.
Fix gauche-package templates.
diff --git a/ext/template.Makefile.in b/ext/template.Makefile.in
index 4955643..1273e0e 100644
--- a/ext/template.Makefile.in
+++ b/ext/template.Makefile.in
@@ -70,5 +70,5 @@ distclean : clean
rm -rf $(CONFIG_GENERATED)
maintainer-clean : clean
- rm -rf $(CONFIG_GENERATED) configure VERSION
+ rm -rf $(CONFIG_GENERATED) VERSION
diff --git a/ext/template.configure b/ext/template.configure
index d98e7e3..66f9e95 100755
--- a/ext/template.configure
+++ b/ext/template.configure
@@ -3,6 +3,7 @@
;; Run ./configure (or gosh ./configure) to generate Makefiles.
(use gauche.configure)
+(use gauche.package)
;; Define extra --with-PACKAGE and --enable-FEATURE options.
;; These should come before cf-init so that cf-init can construct
@@ -42,6 +43,16 @@
(cf-subst 'GAUCHE_PKGLIBDIR (gauche-config "--pkglibdir"))
(cf-subst 'GAUCHE_PKGARCHDIR (gauche-config "--pkgarchdir"))
+;; Creating gpd (gauche package description) file
+(let1 gpd-file #"~(cf$ 'PACKAGE_NAME).gpd"
+ (cf-echo #"creating ~gpd-file")
+ (with-output-to-file gpd-file
+ (cut write-gauche-package-description
+ (make <gauche-package-description>
+ :name (cf$ 'PACKAGE_NAME)
+ :version (cf$ 'PACKAGE_VERSION)
+ :configure (string-join (command-line))))))
+
;; Output
(cf-echo (cf$ 'PACKAGE_VERSION) > "VERSION")
(cf-output "Makefile")
diff --git a/lib/gauche/configure.scm b/lib/gauche/configure.scm
index c3ee9e1..d67473e 100644
--- a/lib/gauche/configure.scm
+++ b/lib/gauche/configure.scm
@@ -158,7 +158,7 @@
`(with-output-to-file ,name
(cut print ,@(intersperse " " (drop-right* args 2)))
:if-exists :append)]
- [_ `(print ,@(intersperse " " (drop-right* args 2)))]))
+ [_ `(print ,@(intersperse " " args))]))
;; API
;; Like AC_INIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment