diff options
Diffstat (limited to 'org/spine_build_scaffold.org')
-rw-r--r-- | org/spine_build_scaffold.org | 330 |
1 files changed, 328 insertions, 2 deletions
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 @@ <<make_version_tag>> <<make_changelog>> <<make_project_zip_archive>> +<<make_get_project_dependencies_github>> <<make_dub_upgrade>> <<make_compile_0_compiler_default>> <<make_compile_1_compiler_all>> @@ -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,6 +1120,12 @@ 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 { @@ -1090,6 +1157,227 @@ gitsnapshot: distclean tangle } }, "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": "<<version_spine>>", + "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" + ], + "copyright": "Copyright © 2015 - 2020 Ralph Amissah", + "name": "spine", + "version": "<<version_spine>>", + "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": { "d2sqlite3": "~><<version_d2sqlite3>>", "imageformats": "~><<version_imageformats>>", "dyaml": "~><<version_dyaml>>", @@ -1892,6 +2180,35 @@ nix flake update --recreate-lock-file 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 = { + flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "/nixpkgs-ra/nixpkgs/.gitworktree/ra/nixpkgs"; d2sqlite3 = { url = "github:dlang-community/d2sqlite3"; flake = false; @@ -2435,7 +2752,7 @@ in { #+NAME: nix_dub2nix_with_pkgs #+BEGIN_SRC nix let - <<nix_shell_dub2nix>> + <<nix_shell_dub2nix_srcLocalPreFetched>> in with pkgs; [ <<nix_shell_with_pkgs_list>> @@ -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"; |