19 re2c = stdenv.mkDerivation rec {
22 sourceRoot = "${src.name}/re2c";
23 src = fetchFromGitHub {
27 sha256 = "0grx7nl9fwcn880v5ssjljhcb9c5p2a6xpwil7zxpmv0rwnr3yqi";
29 nativeBuildInputs = [ autoreconfHook ];
31 patchShebangs run_tests.sh
35 py-yajl = python27.pkgs.buildPythonPackage rec {
36 pname = "oil-pyyajl-unstable";
37 version = "2022-09-01";
38 src = fetchFromGitHub {
41 rev = "72686b0e2e9d13d3ce5fefe47ecd607c540c90a3";
42 hash = "sha256-H3GKN0Pq1VFD5+SWxm8CXUVO7zAyj/ngKVmDaG/aRT4=";
43 fetchSubmodules = true;
46 # Fixes several incompatible function pointer conversions, which are errors in clang 16.
47 ./0014-clang_incompatible_function_pointer_conversions.patch
49 # just for submodule IIRC
50 nativeBuildInputs = [ git ];
54 Upstream isn't interested in packaging this as a library
55 (or accepting all of the patches we need to do so).
56 This creates one without disturbing upstream too much.
58 oildev = python27.pkgs.buildPythonPackage rec {
59 pname = "oildev-unstable";
60 version = "2021-07-14";
62 src = fetchFromGitHub {
65 # rev == present HEAD of release/0.14.0
66 rev = "3d0427e222f7e42ae7be90c706d7fde555efca2e";
67 hash = "sha256-XMoNkBEEmD6AwNSu1uSh3OcWLfy4/ADtRckn/Pj2cP4=";
70 It's not critical to drop most of these; the primary target is
71 the vendored fork of Python-2.7.13, which is ~ 55M and over 3200
72 files, dozens of which get interpreter script patches in fixup.
74 Note: -f is necessary to keep it from being a pain to update
75 hash on rev updates. Command will fail w/o and not print hash.
78 rm -rf $out/{Python-2.7.13,metrics,py-yajl,rfc,gold,web,testdata,services,demo,devtools}
82 # patch to support a python package, pass tests on macOS, drop deps, etc.
83 patchSrc = fetchFromGitHub {
85 repo = "nix-py-dev-oil";
87 hash = "sha256-47+986+SohdtoNzTYAgF2vPPWgakyg0VCmR+MgxMzTk=";
90 "${patchSrc}/0001-add_setup_py.patch"
91 "${patchSrc}/0002-add_MANIFEST_in.patch"
92 "${patchSrc}/0004-disable-internal-py-yajl-for-nix-built.patch"
93 "${patchSrc}/0006-disable_failing_libc_tests.patch"
94 "${patchSrc}/0007-namespace_via_init.patch"
95 "${patchSrc}/0009-avoid_nix_arch64_darwin_toolchain_bug.patch"
96 "${patchSrc}/0010-disable-line-input.patch"
97 "${patchSrc}/0011-disable-fanos.patch"
98 "${patchSrc}/0012-disable-doc-cmark.patch"
99 "${patchSrc}/0013-fix-pyverify.patch"
106 nativeBuildInputs = [ re2c file makeWrapper ];
108 propagatedBuildInputs = [ six typing py-yajl ];
117 patchShebangs asdl build core doctools frontend pyext oil_lang
118 substituteInPlace pyext/fastlex.c --replace '_gen/frontend' '../_gen/frontend'
119 substituteInPlace core/main_loop.py --replace 'import fanos' '# import fanos'
120 rm cpp/stdlib.h # keep modules from finding the wrong stdlib?
121 # work around hard parse failure documented in oilshell/oil#1468
122 substituteInPlace osh/cmd_parse.py --replace 'elif self.c_id == Id.Op_LParen' 'elif False'
125 # See earlier note on glibcLocales TODO: verify needed?
126 LOCALE_ARCHIVE = lib.optionalString (stdenv.buildPlatform.libc == "glibc") "${glibcLocales}/lib/locale/locale-archive";
128 # not exhaustive; sample what resholve uses as a sanity check
129 pythonImportsCheck = [
135 "oil._devbuild.gen.id_kind_asdl"
136 "oil._devbuild.gen.syntax_asdl"
141 license = with lib.licenses; [
142 psfl # Includes a portion of the python interpreter and standard library
143 asl20 # Licence for Oil itself