@@ -0,0 +1,34 @@
1+{ stdenv, fetchFromGitHub, premake4, bootil }:
2+
3+stdenv.mkDerivation rec {
4+ name = "gmad-unstable-2015-04-16";
5+
6+ meta = {
7+ description = "Garry's Mod Addon Creator and Extractor";
8+ homepage = https://github.com/garrynewman/gmad;
9+ license = stdenv.lib.licenses.unfree;
10+ maintainers = [ stdenv.lib.maintainers.abigailbuccaneer ];
11+ platforms = stdenv.lib.platforms.all;
12+ };
13+
14+ src = fetchFromGitHub {
15+ owner = "garrynewman";
16+ repo = "gmad";
17+ rev = "377f3458bf1ecb8a1a2217c2194773e3c2a2dea0";
18+ sha256="0myi9njr100gxhxk1vrzr2sbij5kxl959sq0riiqgg01div338g0";
19+ };
20+
21+ buildInputs = [ premake4 bootil ];
22+
23+ targetName =
24+ if stdenv.isLinux then "gmad_linux"
25+ else if stdenv.isDarwin then "gmad_osx"
26+ else "gmad";
27+
28+ configurePhase = "premake4 --bootil_lib=${bootil}/lib --bootil_inc=${bootil}/include gmake";
29+
30+ installPhase = ''
31+ mkdir -p $out/bin
32+ cp ${targetName} $out/bin/gmad
33+ '';
34+}