From e1f5135800d7450ace79d7220a47ac310a617ff5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 19 Feb 2021 16:38:30 -0500 Subject: build from static source-tree pre fetch depends --- org/spine_build_scaffold.org | 330 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 328 insertions(+), 2 deletions(-) (limited to 'org/spine_build_scaffold.org') diff --git a/org/spine_build_scaffold.org b/org/spine_build_scaffold.org index 08bf338..f476485 100644 --- a/org/spine_build_scaffold.org +++ b/org/spine_build_scaffold.org @@ -87,6 +87,7 @@ <> <> <> +<> <> <> <> @@ -348,6 +349,66 @@ all: dmd ldc gdc all_ver: dmd_ver ldc_ver gdc_ver #+END_SRC +******** get project dependencies + +#+NAME: make_get_project_dependencies_github +#+BEGIN_SRC makefile +get_depends: + hwd=$$(echo `pwd`) && \ + gwd="$${hwd}/src/ext_depends" && \ + dirs=$$(echo `ls -gx $${gwd}`) && \ + echo $${hwd} && \ + echo $${gwd} && \ + echo $${dirs} && \ + cd $${gwd} && \ + for dir in $${dirs}; do \ + if [ -d $${dir} ]; then \ + echo $${dir} && \ + if [ "imageformats" == $${dir} ]; then \ + echo $${dir} && \ + rm -rf $${dir} && \ + git clone --depth=1 https://github.com/tjhann/$${dir} && \ + cd $${dir} && \ + echo $$PWD && \ + echo "`git rev-parse HEAD | cut -c 1-8` - $${dir}" > ../shaHEADdep_$${dir} && \ + cd $${gwd} && \ + rm -rf $${dir}/.git; \ + elif [[ "d2sqlite3" == $${dir} || "D-YAML" == $${dir} || "tinyendian" == $${dir} ]]; then \ + echo $${dir} && \ + rm -rf $${dir} && \ + git clone --depth=1 https://github.com/dlang-community/$${dir} && \ + cd $${dir} && \ + echo "`git rev-parse HEAD | cut -c 1-8` - $${dir}" > ../shaHEADdep_$${dir} && \ + cd $${gwd} && \ + rm -rf $${dir}/.git; \ + fi; \ + fi; \ + done; \ + ewd="$${hwd}/src/build_depends" && \ + dirs=$$(echo `ls -gx $${ewd}`) && \ + cd $${ewd} && \ + for dir in $${dirs}; do \ + if [ -d $${dir} ]; then \ + echo $${dir} && \ + if [[ "dub2nix" == $${dir} ]]; then \ + echo $${dir} && \ + rm -rf $${dir} && \ + git clone --depth=1 https://github.com/lionello/$${dir} && \ + cd $${dir} && \ + echo "`git rev-parse HEAD | cut -c 1-8` - $${dir}" > ../shaHEADdep_$${dir} && \ + cd $${ewd} && \ + rm -rf $${dir}/.git; \ + fi; \ + fi; \ + done; \ + cd $${hwd} +set_depends: get_depends + cp -vi src/ext_depends/tinyendian/source/tinyendian.d src/ext_depends/D-YAML/source/dyaml/tinyendian.d && \ + echo "`cat src/ext_depends/shaHEADdep_tinyendian` - dyaml/tinyendian.d" >> src/ext_depends/shaHEADdep_D-YAML +#+END_SRC + +gitDir=dub2nix; git clone --depth=1 https://github.com/lionello/${gitDir} | rm -rf ${gitDir}/.git + ******** debug :debug: #+NAME: make_compile_3_compiler_all_debug @@ -1059,8 +1120,235 @@ gitsnapshot: distclean tangle * dub.json :dub:config:json: ** dub.json +*** file-system download external dependencies + +- d2sqlite3 +- dyaml + - tinyendian +- imageformats #+BEGIN_SRC json :tangle ../dub.json +{ + "authors": [ + "Ralph Amissah" + ], + "copyright": "Copyright © 2015 - 2020 Ralph Amissah", + "name": "spine", + "version": "<>", + "description": "a sisu like document parser", + "homepage": "http://sisudoc.org", + "license": "AGPL-3.0+", + "targetPath": "./bin", + "sourcePaths": [ "./src/doc_reform" ], + "stringImportPaths": [ "./views" ], + "buildRequirements": [ "allowWarnings" ], + "targetType": "executable", + "platforms": [ "posix" ], + "buildTypes": { + "dmd": { + "dflags": [ "-J=views", "-I=src/doc_reform" ], + "buildOptions": [ "verbose", "inline" ], + "buildRequirements": [ "allowWarnings" ] + }, + "ldc": { + "dflags": [ "-O2", "-J=views", "-I=src/doc_reform" ], + "buildOptions": [ "verbose", "optimize", "inline" ], + "buildRequirements": [ "allowWarnings" ] + } + }, + "dependencies": { + "spine:d2sqlite3": "*", + "spine:imageformats": "*", + "spine:dyaml": "*" + }, + "subPackages": [ + { + "name": "d2sqlite3", + "description": "A thin wrapper around SQLite 3", + "homepage": "https://github.com/dlang-community/d2sqlite3", + "authors": [ "Nicolas Sicard", "Other contributors: see Github repo" ], + "copyright": "Copyright 2011-18 Nicolas Sicard", + "license": "BSL-1.0", + "sourcePaths": [ "./src/ext_depends/d2sqlite3/source" ], + "configurations": [ + { + "name": "with-lib", + "targetType": "library", + "systemDependencies": "SQLite version >= 3.8.7", + "libs": [ "sqlite3" ], + "excludedSourceFiles": [ "source/tests.d" ] + } + ] + }, + { + "name": "imageformats", + "description": "Decoders for PNG, TGA, BMP, JPEG and encoders for PNG, TGA, BMP.", + "authors": [ "Tero Hänninen" ], + "license": "BSL-1.0", + "sourcePaths": [ "./src/ext_depends/imageformats/imageformats" ] + }, + { + "name": "dyaml", + "description": "YAML parser and emitter", + "authors": [ + "Ferdinand Majerech", + "Cameron \"Herringway\" Ross" + ], + "license": "BSL-1.0", + "homepage": "https://github.com/dlang-community/D-YAML", + "copyright": "Copyright © 2011-2018, Ferdinand Majerech", + "sourcePaths": [ + "./src/ext_depends/D-YAML/source/dyaml", + "./src/ext_depends/D-YAML/source/tinyendian" + ], + "importPaths": [ + "./src/ext_depends/D-YAML/source/dyaml", + "./src/ext_depends/D-YAML/source/tinyendian" + ], + "preGenerateCommands": [ + "rm -rf ./src/ext_depends/D-YAML/examples", + "rm -rf ./src/ext_depends/D-YAML/testsuite" + ] + } + ], + "configurations": [ + { + "name": "default", + "targetName": "spine" + }, + { + "name": "ldc", + "targetName": "spine-ldc" + }, + { + "name": "dmd", + "targetName": "spine-dmd" + } + ], + "subConfigurations": { + "d2sqlite3": "with-lib" + } +} +#+END_SRC + +*** git (interim) + +#+BEGIN_SRC json +{ + "authors": [ + "Ralph Amissah" + ], + "copyright": "Copyright © 2015 - 2020 Ralph Amissah", + "name": "spine", + "version": "<>", + "description": "a sisu like document parser", + "homepage": "http://sisudoc.org", + "license": "AGPL-3.0+", + "targetPath": "./bin", + "sourcePaths": [ "./src/doc_reform" ], + "stringImportPaths": [ "./views" ], + "buildRequirements": [ "allowWarnings" ], + "targetType": "executable", + "platforms": [ "posix" ], + "buildTypes": { + "dmd": { + "dflags": [ "-J=views", "-I=src/doc_reform" ], + "buildOptions": [ "verbose", "inline" ], + "buildRequirements": [ "allowWarnings" ] + }, + "ldc": { + "dflags": [ "-O2", "-J=views", "-I=src/doc_reform" ], + "buildOptions": [ "verbose", "optimize", "inline" ], + "buildRequirements": [ "allowWarnings" ] + } + }, + "dependencies": { + "spine:d2sqlite3": "*", + "spine:imageformats": "*", + "spine:dyaml": "*" + }, + "subPackages": [ + { + "name": "d2sqlite3", + "description": "A thin wrapper around SQLite 3", + "homepage": "https://github.com/dlang-community/d2sqlite3", + "authors": [ "Nicolas Sicard", "Other contributors: see Github repo" ], + "copyright": "Copyright 2011-18 Nicolas Sicard", + "license": "BSL-1.0", + "sourcePaths": [ "./src/ext_depends/d2sqlite3/source" ], + "configurations": [ + { + "name": "with-lib", + "targetType": "library", + "systemDependencies": "SQLite version >= 3.8.7", + "libs": [ "sqlite3" ], + "excludedSourceFiles": [ "source/tests.d" ] + } + ] + }, + { + "name": "imageformats", + "description": "Decoders for PNG, TGA, BMP, JPEG and encoders for PNG, TGA, BMP.", + "authors": [ "Tero Hänninen" ], + "license": "BSL-1.0", + "sourcePaths": [ "./src/ext_depends/imageformats/imageformats" ] + }, + { + "name": "dyaml", + "description": "YAML parser and emitter", + "authors": [ + "Ferdinand Majerech", + "Cameron \"Herringway\" Ross" + ], + "license": "BSL-1.0", + "homepage": "https://github.com/dlang-community/D-YAML", + "copyright": "Copyright © 2011-2018, Ferdinand Majerech", + "sourcePaths": [ "./src/ext_depends/D-YAML/source/dyaml" ], + "importPaths": [ + "./src/ext_depends/D-YAML/source/dyaml", + "./src/ext_depends/tinyendian/source" + ], + "dependencies": { + "tinyendian" : "~>0.2.0" + }, + "preGenerateCommands": [ + "rm -rf ./src/ext_depends/D-YAML/examples", + "rm -rf ./src/ext_depends/D-YAML/testsuite" + ] + }, + { + "name": "tinyendian", + "description": "Lightweight endianness handling library", + "authors": [ "Ferdinand Majerech" ], + "license": "Boost 1.0", + "copyright": "Copyright © 2014, Ferdinand Majerech", + "homepage": "https://github.com/kiith-sa/tinyendian", + "importPaths": [ "./src/ext_depends/tinyendian/source" ] + } + ], + "configurations": [ + { + "name": "default", + "targetName": "spine" + }, + { + "name": "ldc", + "targetName": "spine-ldc" + }, + { + "name": "dmd", + "targetName": "spine-dmd" + } + ], + "subConfigurations": { + "d2sqlite3": "with-lib" + } +} +#+END_SRC + +*** git fetched remote external dependencies (used previously) + +#+BEGIN_SRC json { "authors": [ "Ralph Amissah" @@ -1887,6 +2175,35 @@ nix develop nix flake update --recreate-lock-file #+BEGIN_SRC nix :tangle ../flake.nix +{ + description = "a sisu like document parser"; + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "/nixpkgs-ra/nixpkgs/.gitworktree/ra/nixpkgs"; + dub2nix-src = { + url = "github:lionello/dub2nix"; + flake = false; + }; + }; + outputs = { self, dub2nix-src, nixpkgs, flake-utils }: + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + in { + packages.x86_64-linux.spine = pkgs.stdenv.mkDerivation { + name = "spine"; + inherit self; + src = self; + shell = ./shell.nix; + installPhase = '' + install -m755 spine $out/bin/spine + ''; + }; + defaultPackage.x86_64-linux = self.packages.x86_64-linux.spine; + }; +} +#+END_SRC + +#+BEGIN_SRC nix { description = "a sisu like document parser"; inputs = { @@ -2435,7 +2752,7 @@ in { #+NAME: nix_dub2nix_with_pkgs #+BEGIN_SRC nix let - <> + <> in with pkgs; [ <> @@ -2443,8 +2760,17 @@ with pkgs; [ #+END_SRC *** get dub2nix +**** source local + +#+NAME: nix_shell_dub2nix_srcLocalPreFetched +#+BEGIN_SRC nix +dub2nix-src = ./src/build_depends/dub2nix/.; +dub2nix = (import dub2nix-src) { inherit pkgs; }; +#+END_SRC + +**** source remote (github) -#+NAME: nix_shell_dub2nix +#+NAME: nix_shell_dub2nix_srcRemoteGitHub #+BEGIN_SRC nix dub2nix-src = fetchTarball { url = "https://github.com/lionello/dub2nix/archive/master.tar.gz"; -- cgit v1.2.3