18 Upstream isn't interested in packaging this as a library
19 (or accepting all of the patches we need to do so).
20 This creates one without disturbing upstream too much.
22 oildev = python27.pkgs.buildPythonPackage rec {
23 pname = "oildev-unstable";
24 version = "2024-02-26";
26 src = fetchFromGitHub {
29 # rev == present HEAD of release/0.20.0
30 rev = "f730c79e2dcde4bc08e85a718951cfa42102bd01";
31 hash = "sha256-HBj3Izh1gD63EzbgZ/9If5vihR5L2HhnyCyMah6rMg4=";
34 It's not critical to drop most of these; the primary target is
35 the vendored fork of Python-2.7.13, which is ~ 55M and over 3200
36 files, dozens of which get interpreter script patches in fixup.
38 Note: -f is necessary to keep it from being a pain to update
39 hash on rev updates. Command will fail w/o and not print hash.
42 rm -rf $out/{Python-2.7.13,metrics,py-yajl,rfc,gold,web,testdata,services,demo}
46 # patch to support a python package, pass tests on macOS, drop deps, etc.
47 patchSrc = fetchFromGitHub {
49 repo = "nix-py-dev-oil";
51 hash = "sha256-qoA54rnzAdnFZ3k4kRzQWEdgtEjraCT5+NFw8AWnRDk=";
55 "${patchSrc}/0001-add_setup_py.patch"
56 "${patchSrc}/0002-add_MANIFEST_in.patch"
57 "${patchSrc}/0006-disable_failing_libc_tests.patch"
58 "${patchSrc}/0007-namespace_via_init.patch"
59 "${patchSrc}/0009-avoid_nix_arch64_darwin_toolchain_bug.patch"
60 "${patchSrc}/0010-disable-line-input.patch"
61 "${patchSrc}/0011-disable-fanos.patch"
62 "${patchSrc}/0012-disable-doc-cmark.patch"
63 "${patchSrc}/0013-fix-pyverify.patch"
64 "${patchSrc}/0015-fix-compiled-extension-import-paths.patch"
77 propagatedBuildInputs = [
89 patchShebangs asdl build core doctools frontend pyext oil_lang ysh
90 rm cpp/stdlib.h # keep modules from finding the wrong stdlib?
91 # work around hard parse failure documented in oilshell/oil#1468
92 substituteInPlace osh/cmd_parse.py --replace 'elif self.c_id == Id.Op_LParen' 'elif False'
95 # See earlier note on glibcLocales TODO: verify needed?
96 LOCALE_ARCHIVE = lib.optionalString (
97 stdenv.buildPlatform.libc == "glibc"
98 ) "${glibcLocales}/lib/locale/locale-archive";
100 # not exhaustive; sample what resholve uses as a sanity check
101 pythonImportsCheck = [
107 "oil._devbuild.gen.id_kind_asdl"
108 "oil._devbuild.gen.syntax_asdl"
114 license = with lib.licenses; [
115 psfl # Includes a portion of the python interpreter and standard library
116 asl20 # Licence for Oil itself