moving to typical python project setup

master
Claudius Holeksa 2023-02-19 22:30:28 +01:00
parent 9468de17d1
commit f6ad4c4ab9
8 changed files with 57 additions and 3 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.sconsign.dblite

View File

@ -1,15 +1,16 @@
{ pkgs
, stdenvNoCC
, python3
, buildPythonPackage
, scons
}:
stdenvNoCC.mkDerivation {
buildPythonPackage {
pname = "kel_project_template";
version = "0.0.1";
src = ../.;
nativeBuildInputs = [
scons
];
buildInputs = [

22
SConstruct Executable file
View File

@ -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');

3
default.nix Normal file
View File

@ -0,0 +1,3 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.callPackage ./.nix/derivation.nix {}

11
setup.py Normal file
View File

@ -0,0 +1,11 @@
# setup.py
from distutils.core import setup
setup(
name='cppSconsTemplate',
version='0.0.0',
scripts=['cppSconsInit.py',],
);

View File

@ -4,6 +4,7 @@ with import <nixpkgs> {};
pkgs.mkShellNoCC {
name = "kel_project_template";
nativeBuildInputs = [
scons
];
buildInputs = [

15
src/SConscript Normal file
View File

@ -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');