From 46aa9361d6ce1374708b9c403a5a51d7e9aa9370 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Tue, 24 Mar 2015 18:53:10 +0000 Subject: tolua++ (toluapp): add version 1.0.92 --- pkgs/development/tools/toluapp/default.nix | 33 ++++++++++++++++++++ .../toluapp/environ-and-linux-is-kinda-posix.patch | 36 ++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 +++ 3 files changed, 73 insertions(+) create mode 100644 pkgs/development/tools/toluapp/default.nix create mode 100644 pkgs/development/tools/toluapp/environ-and-linux-is-kinda-posix.patch diff --git a/pkgs/development/tools/toluapp/default.nix b/pkgs/development/tools/toluapp/default.nix new file mode 100644 index 00000000000..5edc57e2f81 --- /dev/null +++ b/pkgs/development/tools/toluapp/default.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchFromGitHub, scons, lua }: + +stdenv.mkDerivation rec { + version = "1.0.92"; + name = "toluapp-${version}"; + + src = fetchFromGitHub { + owner = "eddieringle"; + repo = "toluapp"; + rev = "b1e680dc486c17128a3c21f89db1693ff06c02b1"; + sha256 = "1d1a9bll9825dg4mz71vwykvfd3s5zi2yvzbfsvlr3qz1l3zqfwb"; + }; + + buildInputs = [ lua scons ]; + + patches = [ ./environ-and-linux-is-kinda-posix.patch ]; + + preConfigure = '' + substituteInPlace config_posix.py \ + --replace /usr/local $out + ''; + + NIX_CFLAGS_COMPILE = "-fPIC"; + + buildPhase = ''scons''; + + installPhase = ''scons install''; + + meta = { + licence = stdenv.lib.licenses.mit; + }; + +} diff --git a/pkgs/development/tools/toluapp/environ-and-linux-is-kinda-posix.patch b/pkgs/development/tools/toluapp/environ-and-linux-is-kinda-posix.patch new file mode 100644 index 00000000000..6743b25cb8a --- /dev/null +++ b/pkgs/development/tools/toluapp/environ-and-linux-is-kinda-posix.patch @@ -0,0 +1,36 @@ +As it turns out, scons doesn't inherit environment variables by +default. Debugging this was very pleasant. -- oxij + +diff --git a/SConstruct b/SConstruct +index 5c1e774..66aa4c8 100644 +--- a/SConstruct ++++ b/SConstruct +@@ -5,13 +5,11 @@ tools = ['default'] + if os.name == 'nt': + tools = ['mingw'] + +-env = Environment(tools = tools) ++env = Environment(tools = tools, ENV = os.environ) + + options_file = None +-if sys.platform == 'linux2': +- options_file = "linux" + +-elif 'msvc' in env['TOOLS']: ++if 'msvc' in env['TOOLS']: + options_file = "msvc" + else: + options_file = "posix" +diff --git a/config_posix.py b/config_posix.py +index 2bb696c..eb4eb9b 100644 +--- a/config_posix.py ++++ b/config_posix.py +@@ -16,7 +16,7 @@ CCFLAGS = ['-O2', '-ansi', '-Wall'] + prefix = '/usr/local' + + # libraries +-LIBS = ['lua', 'lualib', 'm'] ++LIBS = ['lua', 'liblua', 'm'] + + + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index eb83bcc8996..e5899d392c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4482,6 +4482,10 @@ let luarocks = luaPackages.luarocks; + toluapp = callPackage ../development/tools/toluapp { + lua = lua5_1; # doesn't work with any other :( + }; + ### END OF LUA lush2 = callPackage ../development/interpreters/lush {}; -- cgit 1.4.1