aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--default.nix9
-rw-r--r--minion/default.nix37
-rw-r--r--path-of-building/default.nix50
3 files changed, 59 insertions, 37 deletions
diff --git a/default.nix b/default.nix
index 2b83c02..19481c7 100644
--- a/default.nix
+++ b/default.nix
@@ -1,12 +1,19 @@
let nixpkgs = import <nixpkgs> {}; in
-{ callPackageWith ? nixpkgs.lib.callPackageWith
+{ makeOverridable ? nixpkgs.lib.makeOverridable
}:
let
magpkgs = rec {
+
+ callPackageWith = pkgs: fn: args:
+ (import fn) (pkgs // args);
+
callPackage = callPackageWith (nixpkgs // magpkgs);
+ stdenv = (callPackage ./stdenv.nix {}) // nixpkgs.stdenv;
+ fetch = callPackage ./fetch.nix {};
+
path-of-building = callPackage ./path-of-building {};
minion = callPackage ./minion {};
diff --git a/minion/default.nix b/minion/default.nix
index 03c3454..b72e036 100644
--- a/minion/default.nix
+++ b/minion/default.nix
@@ -1,24 +1,35 @@
{ stdenv
-, fetchurl
-
+, unzip
+, coreutils
+, fetch
, ...
}:
-stdenv.mkDerivation rec {
+stdenv.mkDerivations rec {
pname = "minion";
- version = "1.8";
- src = fetchurl {
- url = https://blogs.cs.st-andrews.ac.uk/constraintmodelling/files/2015/06/minion-1.8-linux.tar_1.gz;
- sha256 = "04d07mc5kffzfl3q56180kcxaixsaph9vdzcl3salpn2h9qjsnq3";
- };
+ variations = [
+ {
+ version = "1.8";
+ src = fetch.tar {
+ url = https://blogs.cs.st-andrews.ac.uk/constraintmodelling/files/2015/06/minion-1.8-linux.tar_1.gz;
+ sha256 = "1346fcssic7hcsy0v4l95ng5iqqlzmm1g8d7p3g944rwzs70g7zp";
+ };
+ }
- unpackCmd = ''
- tar -xf $curSrc
- '';
+ {
+ version = "2";
+ src = fetch.zip {
+ url = https://github.com/conjure-cp/conjure/releases/download/v2.3.0/conjure-v2.3.0-linux-solvers.zip;
+ sha256 = "09ajj7zbb4rk9srk3q9gmfkvaymwsd8ai3ddkkinp8y8z018abk0";
+ };
+ }
+ ];
+
+ PATH = "${coreutils}/bin";
- installPhase = ''
+ install = ''
mkdir -p $out/bin
- cp ./bin/minion $out/bin/minion
+ cp $src\/*/minion $out/bin/minion
'';
}
diff --git a/path-of-building/default.nix b/path-of-building/default.nix
index a0dbe11..10fb7bd 100644
--- a/path-of-building/default.nix
+++ b/path-of-building/default.nix
@@ -10,39 +10,43 @@ let nixpkgs = import <nixpkgs> {}; in
let
pob-src = stdenv.mkDerivation {
name = "path-of-building-community-data";
+ # src = fetchurl {
+ # url = https://github.com/PathOfBuildingCommunity/PathOfBuilding/releases/download/v2.7.0/PathOfBuildingCommunity-Portable-2.7.0.zip;
+ # sha256 = "0ybw5f07h676hcdimhdbvacj53ky9lr47vvinya4sj7plkkq49ii";
+ # };
src = fetchurl {
- url = https://github.com/PathOfBuildingCommunity/PathOfBuilding/releases/download/v2.7.0/PathOfBuildingCommunity-Portable-2.7.0.zip;
- sha256 = "0ybw5f07h676hcdimhdbvacj53ky9lr47vvinya4sj7plkkq49ii";
- };
- dontUnpack = true;
- nativeBuildInputs = [
- unzip
- ];
- installPhase = ''
+ url = https://github.com/PathOfBuildingCommunity/PathOfBuilding/releases/download/v2.9.0/PathOfBuildingCommunity-Portable-2.9.0.zip;
+ sha256 = "0129zbz5dl5j0gk979n9k395773z74ighsd30b2fb1ympcjnyn87";
+ };
+ dontUnpack = true;
+ nativeBuildInputs = [
+ unzip
+ ];
+ installPhase = ''
unzip $src -d $out
- '';
- };
+ '';
+ };
in stdenv.mkDerivation rec {
- pname = "path-of-building-community";
- version = "2.7.0";
+ pname = "path-of-building-community";
+ version = "2.7.0";
- pob_script = writeTextFile {
- name = "pob-script";
- executable = true;
+ pob_script = writeTextFile {
+ name = "pob-script";
+ executable = true;
- text = ''
+ text = ''
#!/bin/sh
${wine}/bin/wine "${pob-src}/Path of Building.exe"
- '';
- };
+ '';
+ };
- dontUnpack = true;
+ dontUnpack = true;
- src = pob_script;
+ src = pob_script;
- installPhase = ''
+ installPhase = ''
mkdir -p $out/bin
cp $src $out/bin/pob
- '';
- }
+ '';
+}