-
-
Save crinklywrappr/a84ed4a7b61f8f5861d96824409c4008 to your computer and use it in GitHub Desktop.
graphviz nix build
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
pkgs: attrs: | |
with pkgs; | |
let defaultAttrs = { | |
builder = "${bash}/bin/bash"; | |
args = [ ./builder.sh ]; | |
setup = ./setup.sh; | |
baseInputs = [gnutar gzip gnumake gcc binutils-unwrapped coreutils gawk gnused gnugrep]; | |
buildInputs = []; | |
system = builtins.currentSystem; | |
}; | |
in | |
derivation (defaultAttrs // attrs) |
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
set -e | |
source $setup | |
genericBuild |
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
let | |
pkgs = import <nixpkgs> {}; | |
mkDerivation = import ./autotools.nix pkgs; | |
in mkDerivation { | |
name = "graphviz"; | |
src = ./graphviz-2.38.0.tar.gz; | |
} |
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
function join_by { local IFS="$1"; shift; echo "$*"; } | |
unset PATH | |
PATH="" | |
for p in $baseInputs $buildInputs; do | |
export PATH=$(join_by ":" $PATH "$p/bin"); | |
done | |
function unpackPhase() { | |
tar -xzf $src | |
for d in *; do | |
if [ -d "$d" ]; then | |
cd "$d" | |
break | |
fi | |
done | |
} | |
function configurePhase() { | |
./configure --prefix=$out | |
} | |
function buildPhase() { | |
make | |
} | |
function installPhase() { | |
make install | |
} | |
function fixupPhase() { | |
find $out -type f -exec patchelf --shrink-rpath '{}' \; -exec strip '{}' \; 2>/dev/null | |
} | |
function genericBuild() { | |
unpackPhase | |
configurePhase | |
buildPhase | |
installPhase | |
fixupPhase | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment