Leverage deps.sh

This commit is contained in:
Nettika 2026-02-16 15:53:59 -08:00
parent cda034b29e
commit 061cb5fc1f
No known key found for this signature in database
GPG key ID: C357EE70D5027BCC
5 changed files with 184 additions and 216 deletions

View file

@ -7,8 +7,6 @@
pkg-config,
ninja,
git,
re2c,
cmark,
which,
time,
readline,
@ -17,33 +15,23 @@
libffi,
}:
let
stdenv.mkDerivation (finalAttrs: {
pname = "oils-for-unix";
version = "0.37.0";
src = fetchFromGitHub {
owner = "oils-for-unix";
repo = "oils";
rev = "release/${version}";
rev = "release/${finalAttrs.version}";
hash = "sha256-d2i2P8ZiGb+FYzZIzs0pY2gIRQGGuenLbxrGhafVxVc=";
};
wedges = callPackage ./wedges.nix { };
in
stdenv.mkDerivation (finalAttrs: {
pname = "oils-for-unix";
inherit version src;
nativeBuildInputs = [
pkg-config
ninja
git
re2c
cmark
which
time
wedges.python2Wedge
wedges.python3Wedge
];
buildInputs = [
@ -64,28 +52,18 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace doctools/cmark.py \
--replace-quiet "raise AssertionError('bin/cmark not found')" \
"cmark_path = '${cmark}/bin/cmark'"
"cmark_path = '${finalAttrs.passthru.wedge.cmark}/bin/cmark'"
'';
configurePhase = ''
runHook preConfigure
./configure \
--datarootdir=$out \
--with-readline \
--readline=${wedges.readline-all}
runHook postConfigure
'';
configureFlags = [
"--datarootdir=${placeholder "out"}"
"--with-readline"
"--readline=${finalAttrs.passthru.wedge.readline-all}"
];
buildPhase = ''
runHook preBuild
export PATH="${wedges.python2Wedge}/bin:${wedges.python3Wedge}/bin:$PATH"
export PATH="${wedges.mypyWedge}/bin:$PATH"
export PYTHONPATH="${wedges.mypyWedge}/lib/python3.10/site-packages:.:vendor/"
export LD_LIBRARY_PATH="${wedges.python2Wedge}/lib:${wedges.python3Wedge}/lib:''${LD_LIBRARY_PATH:-}"
build/py.sh configure-for-dev
build/stamp.sh write-git-commit
build/py.sh py-source
@ -108,7 +86,23 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstall
'';
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=incompatible-function-pointer-types";
env = {
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=incompatible-function-pointer-types";
PYTHONPATH = "${finalAttrs.passthru.wedge.mypy}:${finalAttrs.passthru.wedge.py3-libs}/lib/python3.10/site-packages:.:vendor/";
LD_LIBRARY_PATH = "${finalAttrs.passthru.wedge.python2}/lib:${finalAttrs.passthru.wedge.python3}/lib";
};
preBuild = ''
export PATH="${
lib.makeBinPath [
finalAttrs.passthru.wedge.python2
finalAttrs.passthru.wedge.python3
finalAttrs.passthru.wedge.re2c
finalAttrs.passthru.wedge.cmark
finalAttrs.passthru.wedge.py3-libs
]
}:$PATH"
'';
meta = {
description = "Oils is our upgrade path from bash to a better language and runtime";
@ -119,7 +113,7 @@ stdenv.mkDerivation (finalAttrs: {
};
passthru = {
inherit wedges;
wedge = callPackage ./wedge.nix { oilsSrc = finalAttrs.src; };
withSrc = newSrc: finalAttrs.finalPackage.overrideAttrs { src = newSrc; };
}
@ -128,7 +122,7 @@ stdenv.mkDerivation (finalAttrs: {
mkShell =
shellName:
symlinkJoin {
name = "oils-for-unix-${shellName}-${version}";
name = "oils-for-unix-${shellName}-${finalAttrs.version}";
paths = [ finalAttrs.finalPackage ];
passthru.shellPath = "/bin/${shellName}";
meta = finalAttrs.meta // {