Created
December 16, 2019 23:24
-
-
Save manveru/ebe3b669fdec44f0d9b9c6f04d4986f2 to your computer and use it in GitHub Desktop.
static compilation with crystal
This file contains hidden or 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
{ lib, crystal, nix-prefetch-git, makeStaticLibraries, stdenv, glibc, pcre | |
, libyaml, boehmgc, libevent }: | |
let | |
staticStdenv = makeStaticLibraries stdenv; | |
staticGlibc = glibc.static; | |
staticPcre = pcre.override { stdenv = staticStdenv; }; | |
staticLibyaml = libyaml.override { stdenv = staticStdenv; }; | |
staticBoehmgc = | |
boehmgc.override { stdenv = staticStdenv // { isLinux = false; }; }; | |
staticLibevent = libevent.override { stdenv = staticStdenv; }; | |
in crystal.buildCrystalPackage { | |
pname = "crystal2nix"; | |
version = "unstable-2018-07-31"; | |
nixPrefetchGit = "${lib.getBin nix-prefetch-git}/bin/nix-prefetch-git"; | |
unpackPhase = "substituteAll ${./crystal2nix.cr} crystal2nix.cr"; | |
buildInputs = | |
[ staticGlibc staticPcre staticLibyaml staticBoehmgc staticLibevent ]; | |
crystalBinaries.crystal2nix = { | |
src = "crystal2nix.cr"; | |
options = [ "--release" "--static" "--no-debug" ]; | |
}; | |
meta = with lib; { | |
description = "Utility to convert Crystal's shard.lock files to a Nix file"; | |
license = licenses.mit; | |
maintainers = [ maintainers.manveru ]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment