Skip to content

Commit

Permalink
nix expressions: update to work with no CFILES target
Browse files Browse the repository at this point in the history
  • Loading branch information
shlevy committed Apr 22, 2015
1 parent 5cc83f6 commit 4c8908d
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 24 deletions.
10 changes: 6 additions & 4 deletions nix/build.nix
@@ -1,9 +1,11 @@
{
stdenv, gmp, tarball, version
# author: Shea Levy (sheaATshealevyDOTcom)
{ stdenv
, gmp
, tarball
, version
}:

stdenv.mkDerivation
rec {
stdenv.mkDerivation {
name = "ATS2-Postiats-${version}";
src = tarball;
buildInputs = [ gmp ];
Expand Down
11 changes: 8 additions & 3 deletions nix/default.nix
@@ -1,7 +1,12 @@
# author: Shea Levy (sheaATshealevyDOTcom)
let
pkgs = import <nixpkgs> {};
version = builtins.readFile ./VERSION;

version = builtins.head (builtins.match "([^\n]*)\n?" (
builtins.readFile ../VERSION
));
in rec {
tarball = pkgs.callPackage ./nix/tarball.nix { inherit version; };
build = pkgs.callPackage ./nix/build.nix { inherit tarball version; };
tarball = pkgs.callPackage ./tarball.nix { inherit version; };

build = pkgs.callPackage ./build.nix { inherit tarball version; };
}
2 changes: 2 additions & 0 deletions nix/shell.nix
@@ -0,0 +1,2 @@
# author: Shea Levy (sheaATshealevyDOTcom)
(import ./default.nix).tarball
43 changes: 26 additions & 17 deletions nix/tarball.nix
@@ -1,35 +1,44 @@
{
stdenv, ats, autoconf, automake, version
# author: Shea Levy (sheaATshealevyDOTcom)
{ stdenv
, ats
, gmp
, autoconf
, automake
, version
}:

stdenv.mkDerivation
rec {
stdenv.mkDerivation rec {
name = "ATS2-Postiats-${version}.tgz";

buildInputs = [ autoconf automake ];
buildInputs = [ autoconf automake gmp ];

src = builtins.filterSource (path: type: (toString path) != (toString ./.git)) ./.;
src = builtins.filterSource (path: type:
(toString path) != (toString ../.git)
) ../.;

ATSHOME = "${ats}/lib/ats-anairiats-${ats.version}";

ATSHOMERELOC = "ATS-${ats.version}";

configurePhase = ''
patchShebangs doc/DISTRIB/ATS-Postiats/autogen.sh
export PATSHOME=$PWD
make -f codegen/Makefile_atslib
patchShebangs doc/DISTRIB/ATS-Postiats/autogen.sh
export PATSHOME=$PWD
make -f codegen/Makefile_atslib
'';

buildPhase = ''
make -C src all
make -C src CBOOT
make -C src/CBOOT/prelude
make -C src/CBOOT/libc
make -C src/CBOOT/libats
make -C doc/DISTRIB atspackaging
make -C doc/DISTRIB atspacktarzvcf
make -C src all
make -C src CBOOT
make -C src/CBOOT/prelude
make -C src/CBOOT/libc
make -C src/CBOOT/libats
make -C doc/DISTRIB atspackaging
make -C doc/DISTRIB atspacktarzvcf
'';

installPhase = ''
mv doc/DISTRIB/${name} $out
mv doc/DISTRIB/${name} $out
'';

shellHook = "export PATSHOME=$PWD";
}
1 change: 1 addition & 0 deletions shell.nix

0 comments on commit 4c8908d

Please sign in to comment.