diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5b2d462 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.sconsign.dblite diff --git a/.nix/derivation.nix b/.nix/derivation.nix index 40d5eb2..17057ed 100644 --- a/.nix/derivation.nix +++ b/.nix/derivation.nix @@ -1,15 +1,16 @@ { pkgs -, stdenvNoCC -, python3 +, buildPythonPackage +, scons }: -stdenvNoCC.mkDerivation { +buildPythonPackage { pname = "kel_project_template"; version = "0.0.1"; src = ../.; nativeBuildInputs = [ + scons ]; buildInputs = [ diff --git a/SConstruct b/SConstruct new file mode 100755 index 0000000..275de79 --- /dev/null +++ b/SConstruct @@ -0,0 +1,22 @@ +#!/usr/bin/env scons + +import os; + + +def isAbsolutePath(key, dirname, env): + assert os.path.isabs(dirname), "%r must have absolute path syntax" % (key,); + +env_vars = Variables(args=ARGUMENTS); + +env_vars.Add('prefix', + default='/usr/local', + validator=isAbsolutePath +); + +env = Environment(ENV=os.environ, variables=env_vars); + + + +Export('env'); + +SConscript('src/SConscript'); diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..b369f19 --- /dev/null +++ b/default.nix @@ -0,0 +1,3 @@ +{ pkgs ? import {} }: + +pkgs.callPackage ./.nix/derivation.nix {} diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..82ce641 --- /dev/null +++ b/setup.py @@ -0,0 +1,11 @@ +# setup.py +from distutils.core import setup + + +setup( + name='cppSconsTemplate', + version='0.0.0', + scripts=['cppSconsInit.py',], +); + + diff --git a/shell.nix b/shell.nix index 4f29931..5446b19 100644 --- a/shell.nix +++ b/shell.nix @@ -4,6 +4,7 @@ with import {}; pkgs.mkShellNoCC { name = "kel_project_template"; nativeBuildInputs = [ + scons ]; buildInputs = [ diff --git a/src/SConscript b/src/SConscript new file mode 100644 index 0000000..b26ed8a --- /dev/null +++ b/src/SConscript @@ -0,0 +1,15 @@ +#!/usr/bin/env false + +import os; +import os.path; +import glob; + + +Import('env'); + +dir_path = Dir('.').abspath; +env.scripts = sorted(glob.glob(dir_path + "/*.py")); + +env.Install('$prefix/bin/', [env.scripts]); + +env.Alias('install', '$prefix'); diff --git a/src/keldu-project-template-setup b/src/keldu-project-template-setup.py similarity index 100% rename from src/keldu-project-template-setup rename to src/keldu-project-template-setup.py