From 06525e28aadefe622e8182cd2477e7f004bb34c7 Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 23 Mar 2025 19:10:22 -0700 Subject: [PATCH] add: all files --- build.nix | 49 +++++++++++++++++++++++++++++++++++++++++-------- shell.nix | 24 ++++++++++++++++++++++++ 2 files changed, 65 insertions(+), 8 deletions(-) create mode 100644 shell.nix diff --git a/build.nix b/build.nix index 5622a30..79cf03a 100644 --- a/build.nix +++ b/build.nix @@ -1,34 +1,67 @@ -{ stdenv, fetchgit, pkgs }: +{ stdenv, fetchgit, pkgs, lib }: +let + fs = lib.fileset; +in stdenv.mkDerivation { pname = "yottadb"; version = "1.0.0"; - src = fetchgit { + /*src = fetchgit { url = "https://gitlab.com/YottaDB/DB/YDB.git"; rev = "refs/tags/r2.00"; hash = "sha256-npdULo1GrawrmnlucTXKCs9LU0X/+WD5RICKXVDcX5E="; deepClone = true; leaveDotGit = true; - }; + };*/ + src = fs.toSource { + root = /home/charles/p3/YDB; + fileset = /home/charles/p3/YDB; + }; buildInputs = with pkgs; [ cmake pkg-config - icu + icu73 git + zlib + libelf + binutils + libxcrypt + readline + tcsh + curl + file + binutils + ncurses + glibc + libgcc ]; + /* buildPhase = '' export HOME=$(pwd) - ls -la ../.git echo $(pwd) pushd /build/YDB/ - git --no-pager tag --list + git config --global user.email "you@example.com" + git config --global user.name "Your Name" git checkout -b tmp + touch a_file + git add a_file + git commit -am 'a_file makes index' popd make -j12 ''; + */ + buildPhase = '' + export HOME=$(pwd) + echo $(pwd) + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nix/store/wsyiyjdqqjsvrq42h13dl0cmqdbbb26i-icu4c-73.2/lib/ + make -j12 + ''; installPhase = '' - mkdir -p $out/bin - cp hello $out/bin/ + tmpdir=$(mktemp -d) + make install DESTDIR=$tmpdir + echo "installed to $tmpdir" + cd $tmpdir/nix/store/*/yottadb_r201/ + ./ydbinstall --utf8 --installdir=$out ''; } \ No newline at end of file diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..9872145 --- /dev/null +++ b/shell.nix @@ -0,0 +1,24 @@ +let + + nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05"; + + pkgs = import nixpkgs { config = {}; overlays = []; }; + + build = pkgs.callPackage ./build.nix { }; + +in + + +pkgs.mkShellNoCC { + + packages = with pkgs; [ + + cowsay + + lolcat + + build + + ]; + +} \ No newline at end of file