From aaf77ed513dca5a209187f9309804e54dff009eb Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 14 Oct 2024 09:00:24 +0200 Subject: [PATCH] Add reproducible --- .gitattributes | 19 ++++++++++++++ .gitignore | 31 ++++++++++++++++++++++ README.md | 44 ++++++++++++++++++++++++++++++++ build/.gitignore | 4 +++ build/bootstrap.build | 7 +++++ build/root.build | 16 ++++++++++++ buildfile | 1 + manifest | 13 ++++++++++ repositories.manifest | 11 ++++++++ reproduce/.gitignore | 5 ++++ reproduce/buildfile | 29 +++++++++++++++++++++ reproduce/public-html/index.html | 3 +++ reproduce/public-html/styles.css | 1 + reproduce/reproduce.cxx | 14 ++++++++++ reproduce/testscript | 9 +++++++ 15 files changed, 207 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 README.md create mode 100644 build/.gitignore create mode 100644 build/bootstrap.build create mode 100644 build/root.build create mode 100644 buildfile create mode 100644 manifest create mode 100644 repositories.manifest create mode 100644 reproduce/.gitignore create mode 100644 reproduce/buildfile create mode 100644 reproduce/public-html/index.html create mode 100644 reproduce/public-html/styles.css create mode 100644 reproduce/reproduce.cxx create mode 100644 reproduce/testscript diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1631641 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,19 @@ +# This is a good default: files that are auto-detected by git to be text are +# converted to the platform-native line ending (LF on Unix, CRLF on Windows) +# in the working tree and to LF in the repository. +# +* text=auto + +# Use `eol=crlf` for files that should have the CRLF line ending both in the +# working tree (even on Unix) and in the repository. +# +#*.bat text eol=crlf + +# Use `eol=lf` for files that should have the LF line ending both in the +# working tree (even on Windows) and in the repository. +# +#*.sh text eol=lf + +# Use `binary` to make sure certain files are never auto-detected as text. +# +#*.png binary diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c96e1ec --- /dev/null +++ b/.gitignore @@ -0,0 +1,31 @@ +.bdep/ + +# Local default options files. +# +.build2/local/ + +# Compiler/linker output. +# +*.d +*.t +*.i +*.i.* +*.ii +*.ii.* +*.o +*.obj +*.gcm +*.pcm +*.ifc +*.so +*.dylib +*.dll +*.a +*.lib +*.exp +*.pdb +*.ilk +*.exe +*.exe.dlls/ +*.exe.manifest +*.pc diff --git a/README.md b/README.md new file mode 100644 index 0000000..019f6b6 --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +# reproduce - An executable + +The `reproduce` executable is a . + +Note that the `reproduce` executable in this package provides `build2` metadata. + + +## Usage + +To start using `reproduce` in your project, add the following build-time +`depends` value to your `manifest`, adjusting the version constraint as +appropriate: + +``` +depends: * reproduce ^ +``` + +Then import the executable in your `buildfile`: + +``` +import! [metadata] = reproduce%exe{} +``` + + +## Importable targets + +This package provides the following importable targets: + +``` +exe{} +``` + + + + +## Configuration variables + +This package provides the following configuration variables: + +``` +[bool] config.reproduce. ?= false +``` + + diff --git a/build/.gitignore b/build/.gitignore new file mode 100644 index 0000000..974e01d --- /dev/null +++ b/build/.gitignore @@ -0,0 +1,4 @@ +/config.build +/root/ +/bootstrap/ +build/ diff --git a/build/bootstrap.build b/build/bootstrap.build new file mode 100644 index 0000000..9c6cac4 --- /dev/null +++ b/build/bootstrap.build @@ -0,0 +1,7 @@ +project = reproduce + +using version +using config +using test +using install +using dist diff --git a/build/root.build b/build/root.build new file mode 100644 index 0000000..21e0a2e --- /dev/null +++ b/build/root.build @@ -0,0 +1,16 @@ +# Uncomment to suppress warnings coming from external libraries. +# +#cxx.internal.scope = current + +cxx.std = latest + +using cxx + +hxx{*}: extension = hxx +ixx{*}: extension = ixx +txx{*}: extension = txx +cxx{*}: extension = cxx + +# The test target for cross-testing (running tests under Wine, etc). +# +test.target = $cxx.target diff --git a/buildfile b/buildfile new file mode 100644 index 0000000..4bec3bc --- /dev/null +++ b/buildfile @@ -0,0 +1 @@ +./: {*/ -build/} doc{README.md} manifest diff --git a/manifest b/manifest new file mode 100644 index 0000000..615fa10 --- /dev/null +++ b/manifest @@ -0,0 +1,13 @@ +: 1 +name: reproduce +version: 0.1.0-a.0.z +language: c++ +summary: reproduce C++ executable +license: other: proprietary ; Not free/open source. +description-file: README.md +url: https://example.org/reproduce +email: ryan@helloryan.se +#build-error-email: ryan@helloryan.se +depends: * build2 >= 0.16.0 +depends: * bpkg >= 0.16.0 +#depends: libhello ^1.0.0 diff --git a/repositories.manifest b/repositories.manifest new file mode 100644 index 0000000..b547c40 --- /dev/null +++ b/repositories.manifest @@ -0,0 +1,11 @@ +: 1 +summary: reproduce project repository + +#: +#role: prerequisite +#location: https://pkg.cppget.org/1/stable +#trust: ... + +#: +#role: prerequisite +#location: https://git.build2.org/hello/libhello.git diff --git a/reproduce/.gitignore b/reproduce/.gitignore new file mode 100644 index 0000000..a833d75 --- /dev/null +++ b/reproduce/.gitignore @@ -0,0 +1,5 @@ +reproduce + +# Testscript output directory (can be symlink). +# +test-reproduce diff --git a/reproduce/buildfile b/reproduce/buildfile new file mode 100644 index 0000000..529f23b --- /dev/null +++ b/reproduce/buildfile @@ -0,0 +1,29 @@ +libs = +#import libs += libhello%lib{hello} + +exe{reproduce}: {hxx ixx txx cxx}{**} $libs testscript + +for f: file{public-html/**.css... public-html/**.html...} +{ + n = $name($f) + e = $extension($f) + d = $directory($f) + t = $process.run(file -b --mime-type $d/$n.$e) + + exe{reproduce}: $d/cxx{$n} + + $d/cxx{$n}: $f + {{ + i = $path($<[0]) + o = $path($>[0]) + + diag xxd ($<[0]) + + echo "namespace {" > $o + echo "char const* type = \"$t\";" >> $o + xxd -i -name content "$i" >> $o + echo "}" >> $o + }} +} + +cxx.poptions =+ "-I$out_root" "-I$src_root" diff --git a/reproduce/public-html/index.html b/reproduce/public-html/index.html new file mode 100644 index 0000000..bd54434 --- /dev/null +++ b/reproduce/public-html/index.html @@ -0,0 +1,3 @@ + + + diff --git a/reproduce/public-html/styles.css b/reproduce/public-html/styles.css new file mode 100644 index 0000000..8cd8941 --- /dev/null +++ b/reproduce/public-html/styles.css @@ -0,0 +1 @@ +style diff --git a/reproduce/reproduce.cxx b/reproduce/reproduce.cxx new file mode 100644 index 0000000..086aaa1 --- /dev/null +++ b/reproduce/reproduce.cxx @@ -0,0 +1,14 @@ +#include + +int main (int argc, char* argv[]) +{ + using namespace std; + + if (argc < 2) + { + cerr << "error: missing name" << endl; + return 1; + } + + cout << "Hello, " << argv[1] << '!' << endl; +} diff --git a/reproduce/testscript b/reproduce/testscript new file mode 100644 index 0000000..cefda39 --- /dev/null +++ b/reproduce/testscript @@ -0,0 +1,9 @@ +: basics +: +$* 'World' >'Hello, World!' + +: missing-name +: +$* 2>>EOE != 0 +error: missing name +EOE