-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`nix/static` is a plain `nixpkgs` setup, and almost builds a static version of the binary, if it were not for nh2/static-haskell-nix#14 `nix/` is using the tooling at https://github.com/input-output-hk/iohk-nix as advised by @angerman, but it currenty fails to download or build `/nix/store/j6m77ilz08bsdhs8cba9i0mhs4lw0vak-ghc-8.4.4.drv` because some patches do not apply. Or something.
- Loading branch information
Showing
12 changed files
with
485 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ mkDerivation, array, base, base64-bytestring, binary, bytestring | ||
, containers, errors, filepath, HTF, mtl, network-uri, parsec | ||
, random, stdenv, text, vector, zlib, fetchgit | ||
}: | ||
mkDerivation { | ||
pname = "HPDF"; | ||
version = "1.4.10"; | ||
src = fetchgit { | ||
url = "https://github.com/nomeata/HPDF"; | ||
rev = "1062cf0378c6bff384380101821e6744d41d0484"; | ||
sha256 = "0jjam8s0sl9abgd1a9l6d0ilmzp0l34kvw24548m10r3fg7jc6kd"; | ||
}; | ||
isLibrary = true; | ||
isExecutable = false; | ||
enableSeparateDataOutput = true; | ||
libraryHaskellDepends = [ | ||
array base base64-bytestring binary bytestring containers errors | ||
filepath mtl network-uri parsec random text vector zlib | ||
]; | ||
executableHaskellDepends = [ | ||
base filepath network-uri random text vector | ||
]; | ||
testHaskellDepends = [ base HTF ]; | ||
homepage = "http://www.alpheccar.org"; | ||
description = "Generation of PDF documents"; | ||
license = stdenv.lib.licenses.bsd3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
static ? false, | ||
windows ? false | ||
}: | ||
|
||
let mypkgs = new: old: rec { | ||
HPDF = new.callPackage ./HPDF.nix { }; | ||
tttool = new.callPackage ./project.nix {inherit static; }; | ||
}; in | ||
|
||
let | ||
config = { | ||
packageOverrides = pkgs: { | ||
haskellPackages = pkgs.haskellPackages.override { overrides = mypkgs; }; | ||
haskell = pkgs.haskell // { | ||
packages = pkgs.haskell.packages // { | ||
ghc843 = pkgs.haskell.packages.ghc843.override { overrides = mypkgs; }; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
pkgs = import ./nixpkgs { inherit config; }; | ||
|
||
in | ||
if windows | ||
then pkgs.pkgsCross.mingw32.haskellPackages.tttool | ||
else if static | ||
then pkgs.pkgsMusl.haskell.packages.ghc843.tttool | ||
else pkgs.haskellPackages.tttool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
let | ||
fetchFromGitHub = if (builtins ? "fetchTarball") | ||
then { owner, repo, rev, sha256 }: builtins.fetchTarball { | ||
inherit sha256; | ||
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; | ||
} | ||
else (import <nixpkgs> {}).fetchFromGitHub; | ||
in import (fetchFromGitHub (builtins.fromJSON (builtins.readFile ./github.json))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"owner": "NixOS", | ||
"repo": "nixpkgs", | ||
"rev": "2c07921cff84dfb0b9e0f6c2d10ee2bfee6a85ac", | ||
"sha256": "1sxh54zxqy54vrak203qci4128z9mxnzfr5bb5pl6xdrdkcdpqrn" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,48 @@ | ||
{ mkDerivation, array, base, base64-bytestring, binary, bytestring | ||
, containers, errors, filepath, HTF, mtl, network-uri, parsec | ||
, random, stdenv, text, vector, zlib, fetchgit | ||
}: | ||
mkDerivation { | ||
pname = "HPDF"; | ||
version = "1.4.10"; | ||
src = fetchgit { | ||
url = "https://github.com/nomeata/HPDF"; | ||
rev = "1062cf0378c6bff384380101821e6744d41d0484"; | ||
sha256 = "0jjam8s0sl9abgd1a9l6d0ilmzp0l34kvw24548m10r3fg7jc6kd"; | ||
}; | ||
isLibrary = true; | ||
isExecutable = false; | ||
enableSeparateDataOutput = true; | ||
libraryHaskellDepends = [ | ||
array base base64-bytestring binary bytestring containers errors | ||
filepath mtl network-uri parsec random text vector zlib | ||
]; | ||
executableHaskellDepends = [ | ||
base filepath network-uri random text vector | ||
]; | ||
testHaskellDepends = [ base HTF ]; | ||
homepage = "http://www.alpheccar.org"; | ||
description = "Generation of PDF documents"; | ||
license = stdenv.lib.licenses.bsd3; | ||
} | ||
{ system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }: | ||
|
||
let | ||
src = pkgs.fetchgit { | ||
url = "https://github.com/nomeata/HPDF"; | ||
rev = "1062cf0378c6bff384380101821e6744d41d0484"; | ||
sha256 = "0jjam8s0sl9abgd1a9l6d0ilmzp0l34kvw24548m10r3fg7jc6kd"; | ||
}; | ||
in | ||
|
||
{ | ||
flags = {}; | ||
package = { | ||
specVersion = "1.10"; | ||
identifier = { name = "HPDF"; version = "1.4.10"; }; | ||
license = "BSD-3-Clause"; | ||
copyright = "Copyright (c) 2007-2016, alpheccar.org"; | ||
maintainer = "misc@NOSPAMalpheccar.org"; | ||
author = ""; | ||
homepage = "http://www.alpheccar.org"; | ||
url = ""; | ||
synopsis = "Generation of PDF documents"; | ||
description = "A PDF library with support for several pages, page transitions, outlines, annotations, compression, colors, shapes, patterns, jpegs, fonts, typesetting ... Have a look at the \"Graphics.PDF.Documentation\" module to see how to use it. Or, download the package and look at the test.hs file in the Test folder. That file is giving an example of each feature."; | ||
buildType = "Simple"; | ||
}; | ||
components = { | ||
"library" = { | ||
depends = [ | ||
(hsPkgs.base) | ||
(hsPkgs.containers) | ||
(hsPkgs.random) | ||
(hsPkgs.bytestring) | ||
(hsPkgs.array) | ||
(hsPkgs.zlib) | ||
(hsPkgs.binary) | ||
(hsPkgs.mtl) | ||
(hsPkgs.vector) | ||
(hsPkgs.errors) | ||
(hsPkgs.base64-bytestring) | ||
]; | ||
}; | ||
tests = { | ||
"HPDF-Tests" = { | ||
depends = [ (hsPkgs.base) (hsPkgs.HTF) (hsPkgs.HPDF) ]; | ||
}; | ||
}; | ||
}; | ||
} // rec { inherit src; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,51 @@ | ||
let | ||
config = { | ||
packageOverrides = pkgs: rec { | ||
haskellPackages = pkgs.haskellPackages.override { | ||
overrides = haskellPackagesNew: haskellPackagesOld: rec { | ||
HPDF = haskellPackagesNew.callPackage ./HPDF.nix { }; | ||
tttool = haskellPackagesNew.callPackage ./project.nix { }; | ||
}; | ||
}; | ||
}; | ||
}; | ||
localLib = import ./lib.nix; | ||
in | ||
{ ... }@args: | ||
localLib.nix-tools.default-nix ./pkgs.nix args | ||
|
||
pkgs = import ./nixpkgs { inherit config; }; | ||
|
||
in | ||
pkgs.haskellPackages.tttool | ||
# { pkgs ? import ./nixpkgs {} | ||
# }: | ||
# let | ||
# overrideWith = override: default: | ||
# let | ||
# try = builtins.tryEval (builtins.findFile builtins.nixPath override); | ||
# in if try.success then | ||
# builtins.trace "using search host <${override}>" try.value | ||
# else | ||
# default; | ||
# in | ||
# | ||
# let | ||
# haskellLib = pkgs.fetchFromGitHub { | ||
# owner = "input-output-hk"; | ||
# repo = "haskell.nix"; | ||
# rev = "3c78fdaede42abe88936a55ecffbadf533cb3d28"; | ||
# sha256 = "06rmib2hza6s5gvx52dqw905pc4rmcwxj7xyafk21nbbh76l5rmw"; | ||
# name = "haskell-lib-source"; | ||
# }; | ||
# haskell = import (overrideWith "haskell" haskellLib) { inherit pkgs; }; | ||
# in | ||
# | ||
# let | ||
# my-pkgs = import ./pkgs.nix; | ||
# | ||
# pkgSet = haskell.mkPkgSet { | ||
# pkg-def = my-pkgs.pkg-def; | ||
# pkg-def-overlays = [ | ||
# # this overlay will provide additional packages | ||
# # ontop of the package set. E.g. extra-deps | ||
# # for stack packages. or local packages for | ||
# # cabal.projects | ||
# my-pkgs.overlay | ||
# ]; | ||
# modules = [ | ||
# # specific package overrides would go here | ||
# # example: | ||
# # packages.cbors.patches = [ ./one.patch ]; | ||
# # packages.cbors.flags.optimize-gmp = false; | ||
# ]; | ||
# }; | ||
# | ||
# in pkgSet.config.hsPkgs // { _config = pkgSet.config; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"url": "https://github.com/input-output-hk/iohk-nix", | ||
"rev": "c92f0119ef5814b0ed1f445c2fdcf8894e326294", | ||
"sha256": "05r90x6x3yp1nb66rkc4n0i8q15c634rrdsr2zvb118s3sdcmmrm", | ||
"fetchSubmodules": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
let | ||
# iohk-nix can be overridden for debugging purposes by setting | ||
# NIX_PATH=iohk_nix=/path/to/iohk-nix | ||
iohkNix = import ( | ||
let try = builtins.tryEval <iohk_nix>; | ||
in if try.success | ||
then builtins.trace "using host <iohk_nix>" try.value | ||
else | ||
let | ||
spec = builtins.fromJSON (builtins.readFile ./iohk-nix.json); | ||
in builtins.fetchTarball { | ||
url = "${spec.url}/archive/${spec.rev}.tar.gz"; | ||
inherit (spec) sha256; | ||
}) {}; | ||
|
||
pkgs = iohkNix.pkgs; | ||
lib = pkgs.lib; | ||
in lib // { inherit iohkNix pkgs; inherit (iohkNix) nix-tools; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# let plan = import ./plan.nix; in | ||
# { pkg-def = plan; | ||
# overlay = | ||
# { tttool = ./tttool.nix; | ||
# HPDF = ./HPDF2.nix; | ||
# }; | ||
# } | ||
|
||
{ pkgs ? import <nixpkgs> {} | ||
, haskell | ||
, ... | ||
}: | ||
let | ||
|
||
# Build the packageset with module support. | ||
# We can essentially override anything in the modules | ||
# section. | ||
# | ||
# packages.cbors.patches = [ ./one.patch ]; | ||
# packages.cbors.flags.optimize-gmp = false; | ||
# | ||
pkgSet = haskell.mkPkgSet { | ||
inherit pkgs; | ||
pkg-def = import ./plan.nix; | ||
pkg-def-overlays = [ | ||
{ tttool = ./tttool.nix; | ||
HPDF = ./HPDF.nix; | ||
}]; | ||
modules = [ ]; | ||
}; | ||
in | ||
pkgSet.config.hsPkgs // { _config = pkgSet.config; } |
Oops, something went wrong.