diff --git a/pkgs/applications/science/misc/golly/default.nix b/pkgs/applications/science/misc/golly/default.nix new file mode 100644 index 000000000000..ac37655d53b2 --- /dev/null +++ b/pkgs/applications/science/misc/golly/default.nix @@ -0,0 +1,48 @@ +x@{builderDefsPackage, + wxGTK, perl, python, zlib + , ...}: +builderDefsPackage +(a : +let + s = import ./src-for-default.nix; + helperArgNames = ["builderDefsPackage"] ++ + []; + buildInputs = map (n: builtins.getAttr n x) + (builtins.attrNames (builtins.removeAttrs x helperArgNames)); +in +rec { + src = a.fetchUrlFromSrcInfo s; + + inherit (s) name; + inherit buildInputs; + + /* doConfigure should be removed if not needed */ + phaseNames = ["setVars" "doMake" "doDeploy"]; + setVars = a.noDepEntry '' + export NIX_LDFLAGS="$NIX_LDFLAGS -lperl -L$(echo "${perl}"/lib/perl5/5*/*/CORE)" + pythonLib="$(echo "${python}"/lib/libpython*.so)" + pythonLib="''${pythonLib##*/lib}" + pythonLib="''${pythonLib%%.so}" + export NIX_LDFLAGS="$NIX_LDFLAGS -l$pythonLib" + echo "Flags: $NIX_LDFLAGS" + ''; + goSrcDir = ''cd */''; + makeFlags = [ + "-f makefile-gtk" + ]; + doDeploy = a.fullDepEntry '' + cat < ${./make-install.make} >> makefile-gtk + make -f makefile-gtk out="$out" install + '' ["minInit" "doMake" "defEnsureDir"]; + + meta = { + description = "Cellular automata simulation program"; + maintainers = with a.lib.maintainers; + [ + raskin + ]; + platforms = with a.lib.platforms; + linux; + }; +}) x + diff --git a/pkgs/applications/science/misc/golly/make-install.make b/pkgs/applications/science/misc/golly/make-install.make new file mode 100644 index 000000000000..1d082e2b6cec --- /dev/null +++ b/pkgs/applications/science/misc/golly/make-install.make @@ -0,0 +1,9 @@ + +install_file = echo "\#! /bin/sh" > "$(out)/bin/$(binfile)"; echo "$(out)/share/golly/$(binfile)" >> "$(out)/bin/$(binfile)"; chmod a+x "$(out)/bin/$(binfile)"; + +install: + mkdir -p "$(out)/share/golly" + mkdir -p "$(out)/bin" + cp -r $(BINFILES) $(SHAREDFILES) "$(out)/share/golly" + $(foreach binfile,$(BINFILES),$(install_file)) + diff --git a/pkgs/applications/science/misc/golly/src-for-default.nix b/pkgs/applications/science/misc/golly/src-for-default.nix new file mode 100644 index 000000000000..f60df2da3152 --- /dev/null +++ b/pkgs/applications/science/misc/golly/src-for-default.nix @@ -0,0 +1,9 @@ +rec { + version="2.1-src"; + name="golly-2.1-src"; + hash="0m9sz0b7pwsxpgvscdvab2q8qnncr337gg3anzgzw83z5zyn3rdz"; + url="http://downloads.sourceforge.net/project/golly/golly/golly-2.1/golly-2.1-src.tar.gz"; + advertisedUrl="http://downloads.sourceforge.net/project/golly/golly/golly-2.1/golly-2.1-src.tar.gz"; + + +} diff --git a/pkgs/applications/science/misc/golly/src-info-for-default.nix b/pkgs/applications/science/misc/golly/src-info-for-default.nix new file mode 100644 index 000000000000..c3bbb262a6f5 --- /dev/null +++ b/pkgs/applications/science/misc/golly/src-info-for-default.nix @@ -0,0 +1,4 @@ +{ + downloadPage = "http://sourceforge.net/projects/golly/files/"; + method="fetchSF"; +} diff --git a/pkgs/build-support/builder-defs/template-auto-callable.nix b/pkgs/build-support/builder-defs/template-auto-callable.nix new file mode 100644 index 000000000000..4801e4253028 --- /dev/null +++ b/pkgs/build-support/builder-defs/template-auto-callable.nix @@ -0,0 +1,32 @@ +x@{builderDefsPackage + (abort "Specify dependencies") + , ...}: +builderDefsPackage +(a : +let + s = import ./src-for-default.nix; + helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ + [(abort "Specify helper argument names")]; + buildInputs = map (n: builtins.getAttr n x) + (builtins.attrNames (builtins.removeAttrs x helperArgNames)); +in +rec { + src = a.fetchUrlFromSrcInfo s; + + inherit (s) name; + inherit buildInputs; + + /* doConfigure should be removed if not needed */ + phaseNames = ["doConfigure" "doMakeInstall"]; + + meta = { + description = "${abort ''Specify description''}"; + maintainers = with a.lib.maintainers; + [ + (abort "Specify maintainers") + ]; + platforms = with a.lib.platforms; + (abort "Specify platforms"); + }; +}) x + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 32825537ccc2..a316c8b528a6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9583,6 +9583,11 @@ let ### SCIENCE / MISC + golly = import ../applications/science/misc/golly { + inherit builderDefsPackage wxGTK perl zlib + python; + }; + simgrid = import ../applications/science/misc/simgrid { inherit fetchurl cmake ruby; stdenv = stdenv2;