new: port the meson, cmake and autotools template bodies to manifests
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
bin_PROGRAMS = {command}
|
||||
{command}_SOURCES = hello.c
|
||||
@@ -0,0 +1,5 @@
|
||||
AC_INIT([{name}], [{upstream_version}])
|
||||
AM_INIT_AUTOMAKE([foreign])
|
||||
AC_PROG_CC
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
|
||||
/* Placeholder for {name}, generated by `pkh new`. */
|
||||
int main(void)
|
||||
{
|
||||
printf("Hello from {command}!\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -1,8 +1,13 @@
|
||||
## The `autotools` template: a C project with a configure.ac built through
|
||||
## debhelper's auto-detection (dh runs autoreconf itself when it finds
|
||||
## configure.ac, debhelper >= 10 — no override needed). The logic half —
|
||||
## the AC_INIT probe, the skeleton bodies and the gettext detection
|
||||
## (appended to Build-Depends) — lives in src/new/templates/autotools.rs.
|
||||
## configure.ac, debhelper >= 10 — no override needed). The skeleton bodies
|
||||
## below are static data (the first source build runs `autoreconf`,
|
||||
## integrated in the dh sequence, so no generated configure script is
|
||||
## committed); the logic half — the AC_INIT probe and the GNU-gettext
|
||||
## detection (appended to Build-Depends) — lives in
|
||||
## src/new/templates/autotools.rs. hello.c.tpl duplicates the shared C
|
||||
## skeleton of the other C/C++ template directories (see
|
||||
## meson/manifest.yml for why).
|
||||
##
|
||||
## Schema: see src/new/templates/mod.rs.
|
||||
|
||||
@@ -16,4 +21,10 @@ build_depends:
|
||||
- libtool
|
||||
architecture: any
|
||||
rules_dh_line: "dh $@"
|
||||
files: []
|
||||
files:
|
||||
- path: configure.ac
|
||||
template: configure.ac.tpl
|
||||
- path: Makefile.am
|
||||
template: Makefile.am.tpl
|
||||
- path: hello.c
|
||||
template: hello.c.tpl
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project({name} VERSION {upstream_version})
|
||||
|
||||
add_executable({command} hello.c)
|
||||
install(TARGETS {command} RUNTIME DESTINATION bin)
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
|
||||
/* Placeholder for {name}, generated by `pkh new`. */
|
||||
int main(void)
|
||||
{
|
||||
printf("Hello from {command}!\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
## The `cmake` template: a C/C++ project built with CMake through the
|
||||
## debhelper cmake buildsystem. The logic half — the project() probe, the
|
||||
## skeleton bodies and the wizard's pkg-config opt-in (appended to
|
||||
## Build-Depends) — lives in src/new/templates/cmake.rs.
|
||||
## debhelper cmake buildsystem. The skeleton bodies below are static data;
|
||||
## the logic half — the project() probe and the wizard's pkg-config
|
||||
## opt-in (appended to Build-Depends) — lives in src/new/templates/cmake.rs.
|
||||
## hello.c.tpl duplicates the shared C skeleton of the other C/C++
|
||||
## template directories (see meson/manifest.yml for why).
|
||||
##
|
||||
## Schema: see src/new/templates/mod.rs.
|
||||
|
||||
@@ -13,4 +15,8 @@ build_depends:
|
||||
- cmake
|
||||
architecture: any
|
||||
rules_dh_line: "dh $@ --buildsystem=cmake"
|
||||
files: []
|
||||
files:
|
||||
- path: CMakeLists.txt
|
||||
template: CMakeLists.txt.tpl
|
||||
- path: hello.c
|
||||
template: hello.c.tpl
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#include <stdio.h>
|
||||
|
||||
/* Placeholder for {name}, generated by `pkh new`. */
|
||||
int main(void)
|
||||
{
|
||||
printf("Hello from {command}!\n");
|
||||
return 0;
|
||||
}
|
||||
@@ -1,7 +1,15 @@
|
||||
## The `meson` template: a C/C++ project built with Meson through the
|
||||
## debhelper meson buildsystem. The logic half — the project() probe, the
|
||||
## skeleton bodies and the wizard's pkg-config opt-in (appended to
|
||||
## Build-Depends) — lives in src/new/templates/meson.rs.
|
||||
## debhelper meson buildsystem. The skeleton bodies below are static data;
|
||||
## the logic half — the project() probe and the wizard's pkg-config
|
||||
## opt-in (appended to Build-Depends) — lives in src/new/templates/meson.rs.
|
||||
##
|
||||
## hello.c.tpl is deliberately duplicated (byte-identical) across the
|
||||
## makefile, cmake and autotools template directories: every template
|
||||
## directory is self-contained — the registry embeds each directory's
|
||||
## bodies under its own entry — so a shared body would need
|
||||
## cross-directory references the manifest schema has no machinery for.
|
||||
## The duplication replaces the Rust hello_c() helper meson.rs used to
|
||||
## lend cmake.rs and autotools.rs.
|
||||
##
|
||||
## Schema: see src/new/templates/mod.rs.
|
||||
|
||||
@@ -13,4 +21,8 @@ build_depends:
|
||||
- meson
|
||||
architecture: any
|
||||
rules_dh_line: "dh $@ --buildsystem=meson"
|
||||
files: []
|
||||
files:
|
||||
- path: meson.build
|
||||
template: meson.build.tpl
|
||||
- path: hello.c
|
||||
template: hello.c.tpl
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
project('{name}', version: '{upstream_version}', license: '{license}', default_options: ['c_std=c11'])
|
||||
|
||||
executable('{command}', 'hello.c', install: true)
|
||||
Reference in New Issue
Block a user